Changeset 2965
- Timestamp:
- 07/25/08 10:52:53 (1 month ago)
- Files:
-
- trunk/project/modules/devel/cms3/heading/classes/headingelementinformationservices.class.php (modified) (10 diffs)
- trunk/project/modules/devel/cms3/heading/tests/heading_headingelementinformationtest.class.php (modified) (11 diffs)
- trunk/project/modules/devel/cms3/heading/tests/heading_headingelementtype.class.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/project/modules/devel/cms3/heading/classes/headingelementinformationservices.class.php
r2961 r2965 101 101 ->addCondition ('type_hei', '=', $id['type_hei']); 102 102 103 $results = _dao('headingelementinformation')->findBy ($parameters); 103 $results = _dao('headingelementinformation')->findBy ($parameters); 104 104 if ($results[0]->theme_id_hei !== null) { 105 105 return array ('theme' => $results[0]->theme_id_hei, 'providedBy' => $results[0]->public_id_hei); … … 146 146 $results = _dao('headingelementinformation')->findBy ($parameters); 147 147 if ($results[0]->base_url_hei !== null) { 148 return array (' theme' => $results[0]->base_url_hei, 'providedBy' => $results[0]->public_id_hei);148 return array ('baseUrl' => $results[0]->base_url_hei, 'providedBy' => $results[0]->public_id_hei); 149 149 } else { 150 150 $id = $this->getId ($results[0]->parent_heading_public_id_hei); … … 160 160 * @return array ['baseUrl']=>l'url de base ['providedBy']=>publicId de la rubrique qui fourni l'élément 161 161 */ 162 public function getBaseUrlById ($pIdHelt, $pTypeHe lt){162 public function getBaseUrlById ($pIdHelt, $pTypeHei) { 163 163 do { 164 164 $parameters = _daoSp ()->addCondition ('id_helt', '=', $pIdHelt) … … 167 167 $results = _dao('headingelementinformation')->findBy ($parameters); 168 168 if ($results[0]->base_url_hei !== null) { 169 return array (' theme' => $results[0]->base_url_hei, 'providedBy' => $results[0]->public_id_hei);169 return array ('baseUrl' => $results[0]->base_url_hei, 'providedBy' => $results[0]->public_id_hei); 170 170 } else { 171 171 $id = $this->getId ($results[0]->parent_heading_public_id_hei); … … 188 188 $results = _dao('headingelementinformation')->findBy ($parameters); 189 189 if ($results[0]->public_id_root_menu_hei !== null) { 190 return array (' theme' => $results[0]->public_id_root_menu_hei, 'providedBy' => $results[0]->public_id_hei);190 return array ('rootMenu' => $results[0]->public_id_root_menu_hei, 'providedBy' => $results[0]->public_id_hei); 191 191 } else { 192 192 $id = $this->getId ($results[0]->parent_heading_public_id_hei); … … 202 202 * @return array ['rootMenu']=>le menu de base ['providedBy']=>publicId de la rubrique qui fourni l'élément 203 203 */ 204 public function getRootMenuById ($pIdHelt, $pTypeHe lt){204 public function getRootMenuById ($pIdHelt, $pTypeHei){ 205 205 do { 206 206 $parameters = _daoSp ()->addCondition ('id_helt', '=', $pIdHelt) … … 209 209 $results = _dao('headingelementinformation')->findBy ($parameters); 210 210 if ($results[0]->public_id_root_menu_hei !== null) { 211 return array (' theme' => $results[0]->public_id_root_menu_hei, 'providedBy' => $results[0]->public_id_hei);211 return array ('rootMenu' => $results[0]->public_id_root_menu_hei, 'providedBy' => $results[0]->public_id_hei); 212 212 } else { 213 213 $id = $this->getId ($results[0]->parent_heading_public_id_hei); … … 230 230 $results = _dao('headingelementinformation')->findBy ($parameters); 231 231 if ($results[0]->public_id_contextual_menu_hei !== null) { 232 return array (' theme' => $results[0]->public_id_contextual_menu_hei, 'providedBy' => $results[0]->public_id_hei);232 return array ('contextualMenu' => $results[0]->public_id_contextual_menu_hei, 'providedBy' => $results[0]->public_id_hei); 233 233 } else { 234 234 $id = $this->getId ($results[0]->parent_heading_public_id_hei); … … 245 245 * @todo vérifier le retour 246 246 */ 247 public function getContextualMenuById ($pIdHelt, $pTypeHe lt) {247 public function getContextualMenuById ($pIdHelt, $pTypeHei) { 248 248 $publicId = $this->getPublicId ($pIdHelt, $pTypeHelt); 249 249 $parameters = _daoSp ()->addCondition ('public_id_hei', '=', $pPublicId); … … 280 280 */ 281 281 public function hasChild ($pPublicId){ 282 $parameters = _daoSp ()->addCondition ('parent_heading_public_id ', '=', $pPublicId);282 $parameters = _daoSp ()->addCondition ('parent_heading_public_id_hei', '=', $pPublicId); 283 283 $results = _dao('headingelementinformation')->findBy ($parameters); 284 return count ($results ) == 0;284 return count ($results[0]) == 0; 285 285 } 286 286 trunk/project/modules/devel/cms3/heading/tests/heading_headingelementinformationtest.class.php
r2962 r2965 80 80 * 81 81 */ 82 public function testDeleteById () { 82 /* public function testDeleteById () { 83 $this->testCreationArbo (); 83 84 $this->assertTrue (_class('heading|HeadingElementInformationServices')->deleteById(15, true) !== false); 84 $this->testCreationArbo();85 85 } 86 86 … … 89 89 * 90 90 */ 91 public function testDeleteByPublicId () {92 $this->testCreationArbo ();91 /* public function testDeleteByPublicId () { 92 $this->testCreationArbo (); 93 93 $this->assertTrue (_class('heading|HeadingElementInformationServices')->deleteByPublicId (16, true) !== false); 94 94 } … … 99 99 */ 100 100 public function testHasChild() { 101 $this->assertTrue(_class('heading|HeadingElementInformationServices')->hasChild ( 17, 'heading') == true);101 $this->assertTrue(_class('heading|HeadingElementInformationServices')->hasChild (28) == true); 102 102 } 103 103 … … 107 107 */ 108 108 public function testHasChildById () { 109 $this->assertTrue(_class('heading|HeadingElementInformationServices')->hasChildById ( 31, 'heading') == true);109 $this->assertTrue(_class('heading|HeadingElementInformationServices')->hasChildById (28, 'heading') == true); 110 110 } 111 111 … … 115 115 */ 116 116 public function testGetTheme () { 117 $arData = array ('theme' => 0, 'providedBy' => 6);118 if (_class('heading|HeadingElementInformationServices')->getTheme ( 15) == $arData) {119 $this->assertTrue(_class('heading|HeadingElementInformationServices')->getTheme ( 6) == $arData);117 $arData = array ('theme' => 5, 'providedBy' => 27); 118 if (_class('heading|HeadingElementInformationServices')->getTheme (27) == $arData) { 119 $this->assertTrue(_class('heading|HeadingElementInformationServices')->getTheme (27) == $arData); 120 120 } 121 121 } … … 126 126 */ 127 127 public function testGetThemeById () { 128 $this->assertTrue(_class('heading|HeadingElementInformationServices')->getThemeById (2) !== false); 128 $arData = array ('theme' => 5, 'providedBy' => 27); 129 $this->assertTrue(_class('heading|HeadingElementInformationServices')->getThemeById (27, 'heading') !== $arData); 129 130 } 130 131 … … 134 135 */ 135 136 public function testGetBaseUrl () { 136 $this->assertTrue (_class('heading|HeadingElementInformationServices')->getBaseUrl (4) == null); 137 $arData = array ('baseUrl' => 'http://www.test.com', 'providedBy' => 27); 138 $this->assertTrue (_class('heading|HeadingElementInformationServices')->getBaseUrl (27) == $arData); 137 139 } 138 140 … … 142 144 */ 143 145 public function testGetBaseUrlById () { 144 $this->assertTrue (_class('heading|HeadingElementInformationServices')->getBaseUrlById (4) == null); 146 $arData = array ('baseUrl' => 'http://www.test.com', 'providedBy' => 27); 147 $this->assertTrue (_class('heading|HeadingElementInformationServices')->getBaseUrlById (28, 'heading') == $arData); 145 148 } 146 149 … … 150 153 */ 151 154 public function testGetRootMenu () { 152 $this->assertTrue (_class('heading|HeadingElementInformationServices')->getRootMenu (4) == null); 155 $arData = array ('rootMenu' => 8, 'providedBy' => 27); 156 $this->assertTrue (_class('heading|HeadingElementInformationServices')->getRootMenu (27) == $arData); 153 157 } 154 158 … … 158 162 */ 159 163 public function testGetRootMenuById () { 160 $this->assertTrue (_class('heading|HeadingElementInformationServices')->getRootMenuById (4) == null); 164 $arData = array ('rootMenu' => 8, 'providedBy' => 27); 165 $this->assertTrue (_class('heading|HeadingElementInformationServices')->getRootMenuById (28, 'heading') == $arData); 161 166 } 162 167 … … 166 171 */ 167 172 public function testGetContextualMenu () { 168 $this->asserttrue (_class('heading|HeadingElementInformationServices')->getRootMenuById (4) == null); 173 $arData = array ('contextualMenu' => 7, 'providedBy' => 27); 174 $this->asserttrue (_class('heading|HeadingElementInformationServices')->getContextualMenu (27) == $arData); 169 175 } 170 176 trunk/project/modules/devel/cms3/heading/tests/heading_headingelementtype.class.php
r2949 r2965 19 19 $this->assertTrue(_class('heading|HeadingElementType')->getList() == $arData); 20 20 } 21 21 22 } 22 23 ?>
