Changeset 2949
- Timestamp:
- 07/23/08 18:46:32 (1 month ago)
- Files:
-
- trunk/project/modules/devel/cms3/heading/classes/headingelementinformationservices.class.php (modified) (1 diff)
- trunk/project/modules/devel/cms3/heading/classes/headingelementtype.class.php (modified) (2 diffs)
- trunk/project/modules/devel/cms3/heading/classes/headingservices.class.php (modified) (3 diffs)
- trunk/project/modules/devel/cms3/heading/tests/heading_headingelementinformationtest.class.php (modified) (1 diff)
- trunk/project/modules/devel/cms3/heading/tests/heading_headingelementtype.class.php (modified) (1 diff)
- trunk/project/modules/devel/cms3/heading/tests/heading_headingportletsxmlparse.class.php (modified) (1 diff)
- trunk/project/modules/devel/cms3/heading/tests/heading_headingservicestest.class.php (modified) (2 diffs)
- trunk/project/modules/devel/cms3/portal/classes/portletservices.class.php (modified) (2 diffs)
- trunk/project/modules/devel/cms3/portal/tests/portal_portletsxmlparse.class.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/project/modules/devel/cms3/heading/classes/headingelementinformationservices.class.php
r2945 r2949 159 159 ->orderby (array('version_hei', 'DESC')) 160 160 ->setLimit (0, 1); 161 if ( count ($results = _dao('headingelementinformation')->findBy ($parameters)) <= 1){161 if (!$results = _dao('headingelementinformation')->findBy ($parameters)) { 162 162 throw new CopixException ('Element inexistant '.$pPublicId); 163 163 } trunk/project/modules/devel/cms3/heading/classes/headingelementtype.class.php
r2942 r2949 10 10 class HeadingElementType { 11 11 12 staticpublic function getList() {12 public function getList() { 13 13 CopixClassesFactory::fileInclude ('heading|headingparameterservices'); 14 $config = CopixConfig::instance();15 $config->force_compile = true;16 14 $xml = CopixModule::getParsedModuleInformation ( 17 15 "headingList_ParameterGroups", … … 27 25 * @return string libellé 28 26 */ 29 staticpublic function getCaption ($id) {27 public function getCaption ($id) { 30 28 $arData = self::getList($id); 31 29 return $arData[$id]; trunk/project/modules/devel/cms3/heading/classes/headingservices.class.php
r2945 r2949 59 59 ->setLimit (0, 1); 60 60 $results = _dao('heading')->findBy ($parameters); 61 if ($results[0]->parent_id_head !== null) { 62 $record = _dao('heading')->get ($results[0]->parent_id_head); 61 if ($results[0]->public_id_hei !== null) { 62 $record = _dao('heading')->get ($results[0]->public_id_hei); 63 if ($record === false) { 64 break; 65 } 63 66 $path[] = $record->public_id_hei; 64 67 $public_id = $record->public_id_hei; … … 66 69 break; 67 70 } 68 } while ($results[0]->p arent_id_head);69 return $path;71 } while ($results[0]->public_id_hei); 72 //return $path; 70 73 } 71 74 … … 84 87 do { 85 88 $results = _dao('heading')->get ($id_head); 86 if ( $results->parent_id_head !== null) {87 $path[] = $results->p arent_id_head;88 $id_head = $results->p arent_id_head;89 if (isset($results->public_id_hei)) { 90 $path[] = $results->public_id_hei; 91 $id_head = $results->public_id_hei; 89 92 } else { 90 93 break; 91 94 } 92 } while ($results->p arent_id_head);95 } while ($results->public_id_hei); 93 96 return $path; 94 97 } trunk/project/modules/devel/cms3/heading/tests/heading_headingelementinformationtest.class.php
r2936 r2949 24 24 25 25 public function testgetNextVersion () { 26 CopixClassesFactory::fileInclude('heading|headingelementinformationservices'); 27 $this->assertTrue(HeadingElementInformationServices::getNextVersion(1) == 4); 26 $this->assertTrue(_class('heading|HeadingElementInformationServices')->getNextVersion(37) === 1); 28 27 } 29 28 trunk/project/modules/devel/cms3/heading/tests/heading_headingelementtype.class.php
r2914 r2949 10 10 class heading_headingelementtype extends CopixTest { 11 11 public function testParsingType () { 12 CopixClassesFactory::fileInclude('heading|HeadingElementType'); 13 $this->assertTrue(HeadingElementType::getCaption('media') === 'salut'); 12 $this->assertTrue(_class('heading|HeadingElementType')->getCaption('media') === 'salut'); 14 13 } 15 14 16 15 public function testArrayType () { 17 CopixClassesFactory::fileInclude('heading|HeadingElementType');18 16 $arData = array (); 19 17 $arData['media'] = 'salut'; 20 18 $arData['image'] = 'bonjour'; 21 $this->assertTrue( HeadingElementType::getList() == $arData);19 $this->assertTrue(_class('heading|HeadingElementType')->getList() == $arData); 22 20 } 23 21 } trunk/project/modules/devel/cms3/heading/tests/heading_headingportletsxmlparse.class.php
r2936 r2949 9 9 */ 10 10 class heading_headingportletsxmlparse extends CopixTest { 11 public function testParsingType () {12 CopixClassesFactory::fileInclude('heading|headingservices');13 $this->assertTrue(HeadingServices::getZoneId('media') === 'salut');14 }15 11 16 12 public function testArrayType () { 17 CopixClassesFactory::fileInclude('head');18 13 $arData = array (); 19 $arData[' diaporama'] = 'libelle sans i18n';20 $arData[' document'] = 'cheminI18N';21 $this->assertTrue( HeadingElementType::getList() == $arData);14 $arData['media'] = 'salut'; 15 $arData['image'] = 'bonjour'; 16 $this->assertTrue(_class('heading|HeadingElementType')->getList() == $arData); 22 17 } 23 18 } trunk/project/modules/devel/cms3/heading/tests/heading_headingservicestest.class.php
r2942 r2949 14 14 */ 15 15 public function testGetPathFromId () { 16 CopixClassesFactory::fileInclude('heading|headingservices'); 17 $this->assertTrue(HeadingServices::getPathFromId (8) !== null); 16 $this->assertTrue(_class('heading|headingservices')->getPathFromId (8) !== null); 18 17 } 19 18 … … 22 21 * 23 22 */ 24 public function testGetPathFromPublicId () { 25 CopixClassesFactory::fileInclude('heading|headingservices'); 26 $this->assertTrue(HeadingServices::getPathFromPublicId (85) !== null); 23 public function testGetPathFromPublicId () { 24 $this->assertTrue(!_class('heading|headingservices')->getPathFromPublicId (5)); 27 25 } 28 26 } trunk/project/modules/devel/cms3/portal/classes/portletservices.class.php
r2941 r2949 8 8 * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public Licence, see LICENCE file 9 9 */ 10 class portletservices {10 class PortletServices { 11 11 12 12 /** … … 29 29 public function getList () { 30 30 CopixClassesFactory::fileInclude ('portal|portalparameterservices'); 31 $config = CopixConfig::instance();32 $config->force_compile = true;33 31 $xml = CopixModule::getParsedModuleInformation ( 34 32 "portallist_ParameterGroups", trunk/project/modules/devel/cms3/portal/tests/portal_portletsxmlparse.class.php
r2919 r2949 14 14 public function testParsingPortlet () { 15 15 CopixClassesFactory::fileInclude('portal|portletservices'); 16 $this->assertTrue( PortletServices::getZoneId('diaporama') === 'libelle sans i18n');16 $this->assertTrue(_class('portal|portletservices')->getZoneId('diaporama') === 'libelle sans i18n'); 17 17 } 18 18
