Changeset 13205
- Timestamp:
- 11/21/08 16:35:58 (5 years ago)
- Files:
-
- plugins/sfDynamicCMSPlugin/branches/1.0/README (modified) (3 diffs)
- plugins/sfDynamicCMSPlugin/branches/1.0/lib/helper/sfDynamicCMSHelper.php (modified) (1 diff)
- plugins/sfDynamicCMSPlugin/branches/1.0/lib/model/propel/PropelsfDynamicCmsMenu.php (modified) (1 diff)
- plugins/sfDynamicCMSPlugin/branches/1.0/lib/model/propel/PropelsfDynamicCmsMenuPeer.php (modified) (1 diff)
- plugins/sfDynamicCMSPlugin/branches/1.0/lib/model/propel/PropelsfDynamicCmsNode.php (modified) (14 diffs)
- plugins/sfDynamicCMSPlugin/branches/1.0/lib/model/propel/PropelsfDynamicCmsNodePeer.php (modified) (8 diffs)
- plugins/sfDynamicCMSPlugin/branches/1.0/lib/model/propel12/Propel12sfDynamicCmsNode.php (modified) (1 diff)
- plugins/sfDynamicCMSPlugin/branches/1.0/lib/model/propel12/Propel12sfDynamicCmsNodePeer.php (modified) (1 diff)
- plugins/sfDynamicCMSPlugin/branches/1.0/lib/model/propel13/Propel13sfDynamicCmsNode.php (modified) (1 diff)
- plugins/sfDynamicCMSPlugin/branches/1.0/lib/sfDynamicCMS.php (modified) (5 diffs)
- plugins/sfDynamicCMSPlugin/branches/1.0/lib/sfDynamicCMSAdminAction.php (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/lib/sfDynamicCMSFilter.class.php (modified) (1 diff)
- plugins/sfDynamicCMSPlugin/branches/1.0/lib/sfDynamicCMSTools.class.php (modified) (4 diffs)
- plugins/sfDynamicCMSPlugin/branches/1.0/modules/sfDynamicCMS/action (deleted)
- plugins/sfDynamicCMSPlugin/branches/1.0/modules/sfDynamicCMS/i18n (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/modules/sfDynamicCMS/i18n/sfDynamicCMS.fr.xml (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/modules/sfDynamicCMS/lib/BasesfDynamicCMSComponents.class.php (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/modules/sfDynamicCMS/templates/_toolbar.php (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/modules/sfDynamicCMSAdmin/actions/components.class.php (modified) (1 diff)
- plugins/sfDynamicCMSPlugin/branches/1.0/modules/sfDynamicCMSAdmin/i18n/sfDynamicCMS.fr.xml (modified) (2 diffs)
- plugins/sfDynamicCMSPlugin/branches/1.0/modules/sfDynamicCMSAdmin/lib/BasesfDynamicCMSAdminActions.class.php (modified) (22 diffs)
- plugins/sfDynamicCMSPlugin/branches/1.0/modules/sfDynamicCMSAdmin/templates/_menu.php (modified) (3 diffs)
- plugins/sfDynamicCMSPlugin/branches/1.0/modules/sfDynamicCMSAdmin/templates/_menuNav.php (modified) (2 diffs)
- plugins/sfDynamicCMSPlugin/branches/1.0/modules/sfDynamicCMSAdmin/templates/_sidebar.php (modified) (2 diffs)
- plugins/sfDynamicCMSPlugin/branches/1.0/modules/sfDynamicCMSAdmin/templates/_sidebarNav.php (modified) (2 diffs)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/css/sfDynamicCMS.css (modified) (2 diffs)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/css/toolbar.css (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16 (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/application.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/application_add.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/application_delete.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/application_edit.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/application_error.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/application_key.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/application_lightning.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/application_link.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/application_wrench.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/layout.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/layout_edit.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/logo-dcms-bird.gif (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/menu.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_add.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_attach.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_code.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_copy.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_delete.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_edit.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_error.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_find.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_gear.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_go.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_green.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_key.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_lightning.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_link.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_paintbrush.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_paste.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_red.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_refresh.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_route.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_save.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_white.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_white_add.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_white_camera.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_white_cd.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_white_code.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_white_code_red.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_white_copy.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_white_database.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_white_delete.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_white_dvd.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_white_edit.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_white_error.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_white_find.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_white_gear.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_white_get.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_white_go.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_white_horizontal.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_white_key.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_white_lightning.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_white_link.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_white_magnify.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_white_medal.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_white_paint.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_white_paintbrush.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_white_php.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_white_picture.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_white_powerpoint.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_white_put.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_white_stack.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_white_star.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_white_text.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_white_text_width.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_white_width.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_white_world.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_white_wrench.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_white_zip.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/page_world.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/route.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/routing.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/icons16/tab.png (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/logo-dcms.gif (added)
- plugins/sfDynamicCMSPlugin/branches/1.0/web/images/logo-dcms32.gif (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/sfDynamicCMSPlugin/branches/1.0/README
r13148 r13205 600 600 --------- 601 601 602 ### Trunk | 0.3.3. 9Pre-release ###602 ### Trunk | 0.3.3.10 Pre-release ### 603 603 604 604 * sylvio : a lot of refactor and bugfixes … … 612 612 * sylvio : make plugin compatible with Symfony 1.1 (thanks to disturbedHR) 613 613 * sylvio : make plugin compatible with Symfony 1.2 & propel 1.3 (required propel 1.3 compatible version of sfPropelActAsNestedSetBehaviorPlugin : included in data folder of the plugin) 614 * sylvio : refactor routing (fix bug with homepage using default routing), add the helper "link_to_homepage" 614 * sylvio : refactor routing (fix bug with homepage using default routing), add the helper "link_to_homepage" 615 * sylvio : improve & refactor admin interface 616 * sylvio : little toolbar component for frontend to access node admin actions 615 617 616 618 > __This version must use sfPropelSlotBehavior release 0.1.12__ … … 621 623 * rebuild model (symfony propel-build-model) and clear cache 622 624 * call http://mydomain.tld/backend_dev.php/sfDynamicCMSAdmin/upgrade (you can call upgrade process several time without incidence) 623 624 * '@sfDynamicCMS_homepage' & '@sfDynamicCMS_culture_homepage' routing rules are deprecated, don't use them, use helpers or uri625 625 626 626 ### 2008-06-13 | 0.3.2 Alpha ### plugins/sfDynamicCMSPlugin/branches/1.0/lib/helper/sfDynamicCMSHelper.php
r13148 r13205 277 277 else return ''; 278 278 } 279 280 281 282 function url_for_dcms_admin($internal_uri = '',$app = null) 283 { 284 if(!$app) $app=sfConfig::get('sf_app'); 285 $environment=(SF_ENVIRONMENT=='prod') ? "" : "_".SF_ENVIRONMENT; 286 $protocole=(sfContext::getInstance()->getRequest()->isSecure()) ? "https" : "http"; 287 return $protocole."://".$_SERVER["SERVER_NAME"].'/'.strtolower($app).$environment. ".php/".$internal_uri; 288 } 289 290 function link_to_dcms_admin($name = '', $internal_uri = '', $options = array(), $app = null) 291 { 292 return link_to($name, url_for_dcms_admin($internal_uri,$app), $options); 293 } plugins/sfDynamicCMSPlugin/branches/1.0/lib/model/propel/PropelsfDynamicCmsMenu.php
r13069 r13205 8 8 if(!$c) $c=new Criteria(); 9 9 $c->addAscendingOrderByColumn(SfDynamicCmsNodePeer::TREE_LEFT); 10 if( in_array('sfDynamicCMS', sfConfig::get('sf_enabled_modules')) &&sfDynamicCMS::getInstance()->hasIndex('node_id'))10 if(sfDynamicCMS::getInstance()->hasIndex('node_id')) 11 11 { 12 12 $all_nodes=sfDynamicCmsNodePeer::getAll(); plugins/sfDynamicCMSPlugin/branches/1.0/lib/model/propel/PropelsfDynamicCmsMenuPeer.php
r13069 r13205 15 15 public static function retrieveByName($name, $nav, Criteria $c = null) 16 16 { 17 if( in_array('sfDynamicCMS', sfConfig::get('sf_enabled_modules')) &&sfDynamicCMS::getInstance()->hasIndex('menu_name'))17 if(sfDynamicCMS::getInstance()->hasIndex('menu_name')) 18 18 { 19 19 return sfDynamicCMS::getInstance()->getFromIndex('menu_name',$name); plugins/sfDynamicCMSPlugin/branches/1.0/lib/model/propel/PropelsfDynamicCmsNode.php
r13069 r13205 51 51 } 52 52 53 public function deleteNode($con = null )53 public function deleteNode($con = null, $delete_page = false) 54 54 { 55 55 if($delete_page && $this->getSfDynamicCmsPage()) $this->getSfDynamicCmsPage()->delete(); … … 131 131 public function retrieveFirstChild() 132 132 { 133 if( in_array('sfDynamicCMS', sfConfig::get('sf_enabled_modules')) &&sfDynamicCMS::getInstance()->hasIndex())133 if(sfDynamicCMS::getInstance()->hasIndex()) 134 134 { 135 135 $children=$this->getChildren(); … … 145 145 public function retrieveLastChild() 146 146 { 147 if( in_array('sfDynamicCMS', sfConfig::get('sf_enabled_modules')) &&sfDynamicCMS::getInstance()->hasIndex())147 if(sfDynamicCMS::getInstance()->hasIndex()) 148 148 { 149 149 $children=$this->getChildren(); … … 159 159 public function retrievePrevSibling() 160 160 { 161 if( in_array('sfDynamicCMS', sfConfig::get('sf_enabled_modules')) &&sfDynamicCMS::getInstance()->hasIndex())161 if(sfDynamicCMS::getInstance()->hasIndex()) 162 162 { 163 163 $parent=$this->getParent(); … … 186 186 public function retrieveNextSibling() 187 187 { 188 if( in_array('sfDynamicCMS', sfConfig::get('sf_enabled_modules')) &&sfDynamicCMS::getInstance()->hasIndex())188 if(sfDynamicCMS::getInstance()->hasIndex()) 189 189 { 190 190 $parent=$this->getParent(); … … 213 213 public function getParent($peer_method = 'retrieveByPk') 214 214 { 215 if( in_array('sfDynamicCMS', sfConfig::get('sf_enabled_modules')) &&sfDynamicCMS::getInstance()->hasIndex() && $peer_method=='retrieveByPk')215 if(sfDynamicCMS::getInstance()->hasIndex() && $peer_method=='retrieveByPk') 216 216 { 217 217 if($this->aSfDynamicCmsNodeRelatedByTreeParent!==false) $node=$this; … … 227 227 public function retrieveParent($peer_method = 'doSelectOne') 228 228 { 229 if( in_array('sfDynamicCMS', sfConfig::get('sf_enabled_modules')) &&sfDynamicCMS::getInstance()->hasIndex() && $peer_method=='doSelectOne')229 if(sfDynamicCMS::getInstance()->hasIndex() && $peer_method=='doSelectOne') 230 230 { 231 231 if($this->aSfDynamicCmsNodeRelatedByTreeParent!==false) $node=$this; … … 241 241 public function getPathWithThis() 242 242 { 243 if( in_array('sfDynamicCMS', sfConfig::get('sf_enabled_modules')) &&sfDynamicCMS::getInstance()->hasIndex())243 if(sfDynamicCMS::getInstance()->hasIndex()) 244 244 { 245 245 if($this->aSfDynamicCmsNodeRelatedByTreeParent!==false) $node=$this; … … 264 264 public function getPath() 265 265 { 266 if( in_array('sfDynamicCMS', sfConfig::get('sf_enabled_modules')) &&sfDynamicCMS::getInstance()->hasIndex())267 { 268 if($this->aSfDynamicCmsNodeRelatedByTreeParent!==false) $node=$this; 266 if(sfDynamicCMS::getInstance()->hasIndex()) 267 { 268 if($this->aSfDynamicCmsNodeRelatedByTreeParent!==false) $node=$this; 269 269 else $node=SfDynamicCmsNodePeer::retrieveByPK($this->getId()); 270 270 if($node->aSfDynamicCmsNodeRelatedByTreeParent!==null) return $node->retrieveParent()->getPathWithThis(); … … 275 275 return parent::__call('getPath',array()); 276 276 } 277 } 277 } 278 278 279 279 public function retrieveSiblings($peer_method = 'doSelect') 280 280 { 281 if( in_array('sfDynamicCMS', sfConfig::get('sf_enabled_modules')) &&sfDynamicCMS::getInstance()->hasIndex() && $peer_method=='doSelect')281 if(sfDynamicCMS::getInstance()->hasIndex() && $peer_method=='doSelect') 282 282 { 283 283 $parent=$this->getParent(); … … 304 304 public function getChildren($peer_method='doSelect') 305 305 { 306 if( in_array('sfDynamicCMS', sfConfig::get('sf_enabled_modules')) &&sfDynamicCMS::getInstance()->hasIndex() && ( $peer_method=='doSelect' || $peer_method=='doSelectVisible' || $peer_method=='doSelectPublished') )306 if(sfDynamicCMS::getInstance()->hasIndex() && ( $peer_method=='doSelect' || $peer_method=='doSelectVisible' || $peer_method=='doSelectPublished') ) 307 307 { 308 308 if($this->children_index!==false) $node=$this; … … 331 331 public function getDescendants($peer_method='doSelect') 332 332 { 333 334 if(in_array('sfDynamicCMS', sfConfig::get('sf_enabled_modules')) && sfDynamicCMS::getInstance()->hasIndex() && ($peer_method=='doSelect' || $peer_method=='doSelectPublished')) 333 if(sfDynamicCMS::getInstance()->hasIndex() && ($peer_method=='doSelect' || $peer_method=='doSelectPublished')) 335 334 { 336 335 $descendants=array(); 337 336 if($this->hasChildren()) 338 337 { 339 /*$c=$this->getChildren();340 foreach($c as $n) echo "- $n</br>";341 die("<br/>getDescendants ($peer_method) of ".$this);*/342 338 $children=$this->getChildren($peer_method); 343 339 if(is_array($children)) … … 348 344 { 349 345 $descendants[]=$child; 350 $descendants+=$child->getDescendants(); 351 //for ($l=0;$l<=$child->getLevel();$l++) echo '-';echo " $child<br/>"; 346 foreach($child->getDescendants() as $descendant) 347 { 348 $descendants[]=$descendant; 349 } 352 350 } 353 351 } … … 360 358 $sfPropelActAsNestedSetBehavior= new sfPropelActAsNestedSetBehavior(); 361 359 return $sfPropelActAsNestedSetBehavior->getDescendants($this,$peer_method); 362 //return parent::__call('getDescendants',array($peer_method));363 360 } 364 361 } plugins/sfDynamicCMSPlugin/branches/1.0/lib/model/propel/PropelsfDynamicCmsNodePeer.php
r13069 r13205 24 24 public static function doSelectVisible(Criteria $criteria=null, $con = null) 25 25 { 26 if( in_array('sfDynamicCMS', sfConfig::get('sf_enabled_modules')) &&sfDynamicCMS::getInstance()->hasIndex('node_id'))26 if(sfDynamicCMS::getInstance()->hasIndex('node_id')) 27 27 { 28 28 $all_nodes=SfDynamicCmsNodePeer::getAll(); … … 38 38 public static function doSelectPublished(Criteria $criteria=null, $con = null) 39 39 { 40 if( in_array('sfDynamicCMS', sfConfig::get('sf_enabled_modules')) &&sfDynamicCMS::getInstance()->hasIndex('node_id'))40 if(sfDynamicCMS::getInstance()->hasIndex('node_id')) 41 41 { 42 42 $all_nodes=SfDynamicCmsNodePeer::getAll(); … … 161 161 public static function retrieveByAbsoluteUrl($absolute_url, $nav = null, $con=null) 162 162 { 163 if( in_array('sfDynamicCMS', sfConfig::get('sf_enabled_modules')) &&sfDynamicCMS::getInstance()->hasIndex('absolute_url'))163 if(sfDynamicCMS::getInstance()->hasIndex('absolute_url')) 164 164 { 165 165 return sfDynamicCMS::getInstance()->getFromIndex('absolute_url',$absolute_url); … … 174 174 public static function retrieveByRouteName($route_name, $nav = null, $con=null) 175 175 { 176 if( in_array('sfDynamicCMS', sfConfig::get('sf_enabled_modules')) &&sfDynamicCMS::getInstance()->hasIndex('route_name'))176 if(sfDynamicCMS::getInstance()->hasIndex('route_name')) 177 177 { 178 178 return sfDynamicCMS::getInstance()->getFromIndex('route_name',$route_name); … … 187 187 public static function retrieveNodeByPK($id, $con=null) 188 188 { 189 if( in_array('sfDynamicCMS', sfConfig::get('sf_enabled_modules')) &&sfDynamicCMS::getInstance()->hasIndex('node_id'))189 if(sfDynamicCMS::getInstance()->hasIndex('node_id')) 190 190 { 191 191 return sfDynamicCMS::getInstance()->getFromIndex('node_id',$id); … … 207 207 foreach ($root_node->getDescendants() as $child) 208 208 { 209 $options[$child->getId()]=''; 210 for ($i=0;$i<$child->getLevel();$i++) $options[$child->getId()].='- '; 211 $options[$child->getId()].=$child->getTitle(); 209 $option=''; 210 for ($i=0;$i<$child->getLevel();$i++) $option.='- '; 211 $option.=$child->getTitle(); 212 $options[(string) $child->getId()]=$option; 212 213 } 213 214 } … … 246 247 public static function getAll($nav=null,$peer_method='doSelect') 247 248 { 248 if( in_array('sfDynamicCMS', sfConfig::get('sf_enabled_modules')) && sfDynamicCMS::getInstance()->hasIndex('node_id'))249 if(sfDynamicCMS::getInstance()->hasIndex('node_id')) //$nav->hasIndex('node_id') 249 250 { 250 251 return sfDynamicCMS::getInstance()->getFromIndex('node_id'); … … 269 270 } 270 271 } 272 //echo 'no index'; 271 273 return $nodes; 272 274 } plugins/sfDynamicCMSPlugin/branches/1.0/lib/model/propel12/Propel12sfDynamicCmsNode.php
r13069 r13205 9 9 } 10 10 11 public function delete($con = null )11 public function delete($con = null, $delete_page = false) 12 12 { 13 $this-> saveNode($con);13 $this->deleteNode($con, $delete_page); 14 14 } 15 15 } plugins/sfDynamicCMSPlugin/branches/1.0/lib/model/propel12/Propel12sfDynamicCmsNodePeer.php
r13069 r13205 28 28 $obj1 = new $cls(); 29 29 $obj1->hydrate($rs); 30 31 $omClass = SfDynamicCmsPagePeer::getOMClass(); 32 33 $cls = Propel::import($omClass); 34 $obj2 = new $cls(); 35 $obj2->hydrate($rs, $startcol); 36 37 $newObject = true; 38 foreach($results as $temp_obj1) 30 31 if($rs->getInt($startcol)) 39 32 { 40 $temp_obj2 = $temp_obj1->getSfDynamicCmsPage(); 41 if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) 42 { 43 $newObject = false; 44 $temp_obj2->addSfDynamicCmsNode($obj1); 45 break; 46 } 33 $omClass = SfDynamicCmsPagePeer::getOMClass(); 34 35 $cls = Propel::import($omClass); 36 $obj2 = new $cls(); 37 $obj2->hydrate($rs, $startcol); 38 39 $newObject = true; 40 foreach($results as $temp_obj1) 41 { 42 if($temp_obj1->getPageId()>0) 43 { 44 $temp_obj2 = $temp_obj1->getSfDynamicCmsPage(); 45 if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) 46 { 47 $newObject = false; 48 $temp_obj2->addSfDynamicCmsNode($obj1); 49 break; 50 } 51 } 52 } 53 if ($newObject) 54 { 55 $obj2->initSfDynamicCmsNodes(); 56 $obj2->addSfDynamicCmsNode($obj1); 57 } 47 58 } 48 if ($newObject)59 else 49 60 { 50 $obj2->initSfDynamicCmsNodes(); 51 $obj2->addSfDynamicCmsNode($obj1); 61 $obj1->setPageId(null); 52 62 } 53 63 $results[] = $obj1; plugins/sfDynamicCMSPlugin/branches/1.0/lib/model/propel13/Propel13sfDynamicCmsNode.php
r13069 r13205 9 9 } 10 10 11 public function delete(PropelPDO $con = null )11 public function delete(PropelPDO $con = null, $delete_page = false) 12 12 { 13 $this-> saveNode($con);13 $this->deleteNode($con,$delete_page); 14 14 } 15 15 } plugins/sfDynamicCMSPlugin/branches/1.0/lib/sfDynamicCMS.php
r13148 r13205 19 19 protected $current_node = null; 20 20 21 protected $current_page = null; 22 21 23 protected $node_path = null; 22 24 … … 52 54 } 53 55 54 public function makeIndex() 55 { 56 if(!$this->getCurrentNav()->hasIndex()) 57 { 58 $this->getCurrentNav()->makeNodeIndex(); 59 $this->getCurrentNav()->makeMenuIndex(); 60 if(sfConfig::get('app_sfDynamicCMS_index',true)==='session') sfContext::getInstance()->getUser()->setAttribute('current_nav',serialize($this->current_nav)); 56 public function makeIndex($nav = null) 57 { 58 if($nav === null) 59 { 60 $nav = $this->getCurrentNav(); 61 } 62 if(!$nav->hasIndex()) 63 { 64 $nav->makeNodeIndex(); 65 $nav->makeMenuIndex(); 66 if(sfConfig::get('app_sfDynamicCMS_index',true)==='session') 67 { 68 sfContext::getInstance()->getUser()->setAttribute('current_nav',serialize($nav)); 69 } 61 70 sfContext::getInstance()->getLogger()->info('sfDynamicCMS index done'); 62 71 } … … 65 74 public function hasIndex($index_name='node_index') 66 75 { 67 return $this->getCurrentNav()->hasIndex($index_name); 76 if(isset($this->current_nav) && $this->current_nav) 77 { 78 return $this->current_nav->hasIndex($index_name); 79 } 80 else 81 { 82 return false; 83 } 68 84 } 69 85 … … 82 98 $this->current_node=$node; 83 99 } 100 101 public function setCurrentPage($page) 102 { 103 $this->current_page=$page; 104 } 84 105 85 106 public function getCurrentNav() 86 107 { 87 if (isset($this->current_nav) && $this->current_nav) return $this->current_nav; 108 if (isset($this->current_nav) && $this->current_nav) 109 { 110 return $this->current_nav; 111 } 88 112 else 89 113 { … … 174 198 } 175 199 200 public function getCurrentPage() 201 { 202 if($this->current_page===null) 203 { 204 if($this->getCurrentNode() && $this->getCurrentNode()->getPageId()>0) 205 { 206 $this->current_page = $this->getCurrentNode()->getSfDynamicCMSPage(); 207 } 208 else 209 { 210 $this->current_page = false; 211 } 212 } 213 return $this->current_page; 214 } 215 216 public function getPermittedActions($actions = null) 217 { 218 if($actions===null) 219 { 220 $actions = sfDynamicCMSTools::getSfDynamicCMSAdminActions(); 221 } 222 $permitted_actions=array(); 223 224 foreach($actions as $action) 225 { 226 if(is_string($action)) $admin_action = sfDynamicCMSTools::getSfDynamicCMSAdminAction($action); 227 else $admin_action = $action; 228 229 if( ($this->getCurrentNav()->isNew() && !$admin_action->isNavRequired()) || ( !$this->getCurrentNav()->isNew() && $this->getCurrentNav()->userHasCredentials($admin_action->getCredentials()))) 230 { 231 if( ($this->getCurrentNode()->isNew() && !$admin_action->isNodeRequired()) || (!$this->getCurrentNode()->isNew() && $this->getCurrentNode()->userHasCredentials($admin_action->getCredentials()))) 232 { 233 if($this->getCurrentPage() || (!$this->getCurrentPage() && !$admin_action->isPageRequired())) 234 { 235 $permitted_actions[$admin_action->getName()]=$admin_action; 236 } 237 } 238 } 239 } 240 return $permitted_actions; 241 } 176 242 177 243 } plugins/sfDynamicCMSPlugin/branches/1.0/lib/sfDynamicCMSFilter.class.php
r9441 r13205 22 22 if ($this->isFirstCall()) 23 23 { 24 if(sfDynamicCMSTools::useIndex()) sfDynamicCMS::getInstance()->makeIndex(); 24 if(sfDynamicCMSTools::useIndex()) 25 { 26 sfDynamicCMS::getInstance()->makeIndex(); 27 } 25 28 } 26 29 $filterChain->execute(); plugins/sfDynamicCMSPlugin/branches/1.0/lib/sfDynamicCMSTools.class.php
r13148 r13205 5 5 6 6 protected static $version = '0.3.3'; 7 8 protected static $admin_actions = null; 7 9 8 10 public static function isMultiLingual() … … 173 175 } 174 176 177 public static function getSfDynamicCMSAdminActions() 178 { 179 if(self::$admin_actions===null) 180 { 181 $admin_actions = array(); 182 $admin_actions[]=new sfDynamicCMSAdminAction('editNode', "Edit element settings",'Settings', 'page_white_wrench.png',array('delete_node','delete_node','move_node','select_node_status','edit_node_menu','manage_node_pages'),true,true,false); 183 $admin_actions[]=new sfDynamicCMSAdminAction('editPageSettings', "Edit page settings", 'Page settings', 'page_gear.png',array('select_page_template','edit_page_meta'),true,true,true); 184 $admin_actions[]=new sfDynamicCMSAdminAction('editPageContent', "Edit page content", 'Content', 'page_edit.png',array('edit_page_content'),true,true,true); 185 $admin_actions[]=new sfDynamicCMSAdminAction('editRoute', "Manage element routing", 'Routing', 'page_route.png',array('edit_node_url','manage_node_routing'),true,true,false); 186 $admin_actions[]=new sfDynamicCMSAdminAction('editPermissions', "Manage element permissions", 'Permissions', 'page_white_key.png',array('manage_node_access_permissions','manage_node_admin_permissions'),true,true,false); 187 $admin_actions[]=new sfDynamicCMSAdminAction('createNode', 'Add a new element', 'New element', 'page_white_add.png',array('create_node'),true,true,false); 188 $admin_actions[]=new sfDynamicCMSAdminAction('deleteNode', "Delete element", 'Delete', 'page_white_delete.png',array('delete_node'),true,true,false); 189 $admin_actions[]=new sfDynamicCMSAdminAction('editNav', "Edit version settings", 'Settings', 'application_wrench.png',array('manage_nav','manage_nav_settings'),true,false,false); 190 $admin_actions[]=new sfDynamicCMSAdminAction('manageTemplates', "Manage page templates", 'Page templates', 'layout.png',array('manage_nav_templates'),true,false,false); 191 $admin_actions[]=new sfDynamicCMSAdminAction('managePages', "Manage pages", 'Pages', 'page_white_stack.png',array('manage_nav_pages'),true,false,false); 192 $admin_actions[]=new sfDynamicCMSAdminAction('manageMenus', "Manage menus", 'Menus', 'menu.png',array('manage_nav_menus'),true,false,false); 193 $admin_actions[]=new sfDynamicCMSAdminAction('editMenu', "Edit menu", 'Edit', false,array('manage_nav_menus'),true,false,false); 194 $admin_actions[]=new sfDynamicCMSAdminAction('deleteMenu', "Delete menu", 'Delete', false,array('manage_nav_menus'),true,false,false); 195 $admin_actions[]=new sfDynamicCMSAdminAction('managePermissions', "Manage global permissions", 'Permissions', 'application_key.png',array('manage_nav_permissions'),true,false,false); 196 $admin_actions[]=new sfDynamicCMSAdminAction('createNav', "Add a new version",'new version', false,array('manage_nav'), 'application_add.png',false,false,false); 197 $admin_actions[]=new sfDynamicCMSAdminAction('deleteNav', "Delete version", 'Delete', false,array('manage_nav'), 'application_delete.png',true,false,false); 198 self::$admin_actions = $admin_actions; 199 } 200 return self::$admin_actions; 201 } 202 203 public static function getSfDynamicCMSAdminAction($name) 204 { 205 $admin_actions=self::getSfDynamicCMSAdminActions(); 206 foreach($admin_actions as $admin_action) 207 { 208 if($admin_action->getName()==$name) return $admin_action; 209 } 210 return null; 211 } 212 175 213 /********************************* SLOT & TEMPLATES *******************************/ 176 214 … … 376 414 return (file_exists($template_file)); 377 415 } 378 416 379 417 /******************************** PLUGIN *******************************/ 380 418 … … 649 687 } 650 688 689 651 690 } plugins/sfDynamicCMSPlugin/branches/1.0/modules/sfDynamicCMSAdmin/actions/components.class.php
r9441 r13205 10 10 public function executeSidebar() 11 11 { 12 if (isset($this->current_nav) && $this->current_nav) $this->current_nav=sfDynamicCMS::getInstance()->getCurrentNav(); 13 $this->nodes= SfDynamicCmsNodePeer::getAll($this->current_nav); 12 14 $this->nav_options=SfDynamicCmsNavPeer::getOptions(); 13 if (isset($this->current_nav) && $this->current_nav) $this->root_node=SfDynamicCmsNodePeer::getRootNode($this->current_nav->getId());14 $this->nodes= SfDynamicCmsNodePeer::getAll($this->current_nav);15 15 } 16 16 plugins/sfDynamicCMSPlugin/branches/1.0/modules/sfDynamicCMSAdmin/i18n/sfDynamicCMS.fr.xml
r13069 r13205 12 12 </trans-unit> 13 13 <trans-unit> 14 <source>open page</source> 15 <target>Ouvrir la page</target> 16 </trans-unit> 17 <trans-unit> 14 18 <source>delete</source> 15 19 <target>Supprimer</target> … … 348 352 </trans-unit> 349 353 <trans-unit> 354 <source>Manage version</source> 355 <target>Gérer la version</target> 356 </trans-unit> 357 <trans-unit> 358 <source>Manage content</source> 359 <target>Gérer le contenu</target> 360 </trans-unit> 361 <trans-unit> 362 <source>Add a new version</source> 363 <target>Ajouter une version</target> 364 </trans-unit> 365 <trans-unit> 366 <source>Page templates</source> 367 <target>Modèles de pages</target> 368 </trans-unit> 369 <trans-unit> 370 <source>Culture</source> 371 <target>Langue</target> 372 </trans-unit> 373 <trans-unit> 374 <source>Page templates of</source> 375 <target>Modèles de page de</target> 376 </trans-unit> 377 <trans-unit> 378 <source>Slots (separeted with coma)</source> 379 <target>Slots (séparés par des virgules)</target> 380 </trans-unit> 381 <trans-unit> 382 <source>Template Title</source> 383 <target>Titre du template</target> 384 </trans-unit> 385 <trans-unit> 386 <source>Template name</source> 387 <target>Nom du template</target> 388 </trans-unit> 389 <trans-unit> 390 <source>Current absolute URL</source> 391 <target>URL absolue actuelle</target> 392 </trans-unit> 393 <trans-unit> 394 <source>URL</source> 395 <target>URL</target> 396 </trans-unit> 397 <trans-unit> 398 <source>Template title</source> 399 <target>Titre du template</target> 400 </trans-unit> 401 <trans-unit> 402 <source>There are some errors that prevent the form to validate</source> 403 <target>Des erreurs empèchent d'enregistrer les modifications.</target> 404 </trans-unit> 405 <trans-unit> 406 <source>Page title</source> 407 <target>Titre de la page</target> 408 </trans-unit> 409 <trans-unit> 410 <source>updated at</source> 411 <target>mise à jour le</target> 412 </trans-unit> 413 <trans-unit> 414 <source>created at</source> 415 <target>créé le</target> 416 </trans-unit> 417 <trans-unit> 418 <source>Usage</source> 419 <target>Utilisation</target> 420 </trans-unit> 421 <trans-unit> 422 <source>Actions</source> 423 <target>Actions</target> 424 </trans-unit> 425 <trans-unit> 426 <source>Pages of</source> 427 <target>Pages de</target> 428 </trans-unit> 429 <trans-unit> 430 <source>Are you sure to delete this page ?</source> 431 <target>Etes-vous sûr de vouloir supprimer cette page ?</target> 432 </trans-unit> 433 <trans-unit> 434 <source>Duplicate content of</source> 435 <target>Dupliquer le contenu</target> 436 </trans-unit> 437 <trans-unit> 438 <source>Menus of</source> 439 <target>Menus de</target> 440 </trans-unit> 441 <trans-unit> 442 <source>Edit menu</source> 443 <target>Edition du menu</target> 444 </trans-unit> 445 <trans-unit> 446 <source>Levels start from 0 (home node level)</source> 447 <target>Les niveaux commencent à 0 (niveau de l'accueil)</target> 448 </trans-unit> 449 <trans-unit> 450 <source>Create new menu</source> 451 <target>Création d'un nouveau menu</target> 452 </trans-unit> 453 <trans-unit> 454 <source>Level</source> 455 <target>Niveau</target> 456 </trans-unit> 457 <trans-unit> 458 <source>Menu title</source> 459 <target>Titre du menu</target> 460 </trans-unit> 461 <trans-unit> 462 <source>Menu name</source> 463 <target>Nom du menu</target> 464 </trans-unit> 465 <trans-unit> 466 <source>Menu level</source> 467 <target>Niveau du menu</target> 468 </trans-unit> 469 <trans-unit> 470 <source>The title of the menu is required</source> 471 <target>Le titre du menu est requis</target> 472 </trans-unit> 473 <trans-unit> 474 <source>The name of the menu is required</source> 475 <target>Le nom du menu est requis</target> 476 </trans-unit> 477 <trans-unit> 478 <source>Add a menu</source> 479 <target>Ajouter un menu</target> 480 </trans-unit> 481 <trans-unit> 482 <source>Manage permissions of</source> 483 <target>Gérer les permissions de</target> 484 </trans-unit> 485 <trans-unit> 486 <source>Save and apply for all children</source> 487 <target>Enregistrer et appliquer à tous les fils</target> 488 </trans-unit> 489 <trans-unit> 490 <source>Access permissions</source> 491 <target>Permission d'accès</target> 492 </trans-unit> 493 <trans-unit> 494 <source>Editing permissions</source> 495 <target>Permission d'édition</target> 496 </trans-unit> 497 <trans-unit> 498 <source>Advanced Administration permissions</source> 499 <target>Permissions d'administration avancées</target> 500 </trans-unit> 501 <trans-unit> 502 <source>Administration permissions</source> 503 <target>Permissions d'administration</target> 504 </trans-unit> 505 <trans-unit> 506 <source>Developpement permissions</source> 507 <target>Permissions de développement</target> 508 </trans-unit> 509 <trans-unit> 510 <source>Access to page</source> 511 <target>Accès à la page</target> 512 </trans-unit> 513 <trans-unit> 514 <source>Visible in menu</source> 515 <target>Visible dans le menu</target> 516 </trans-unit> 517 <trans-unit> 518 <source>Move element</source> 519 <target>Déplacer l'élément</target> 520 </trans-unit> 521 <trans-unit> 522 <source>Delete element</source> 523 <target>Supprimer l'élément</target> 524 </trans-unit> 525 <trans-unit> 526 <source>Edit menu</source> 527 <target>Edition du menu</target> 528 </trans-unit> 529 <trans-unit> 530 <source>Edit status</source> 531 <target>Modification de l'état de l'élément</target> 532 </trans-unit> 533 <trans-unit> 534 <source>Manage pages</source> 535 <target>Gestion des pages</target> 536 </trans-unit> 537 <trans-unit> 538 <source>Select page template</source> 539 <target>Sélection du modèle de page</target> 540 </trans-unit> 541 <trans-unit> 542 <source>Edit page meta</source> 543 <target>Edition des métas</target> 544 </trans-unit> 545 <trans-unit> 546 <source>Edit page content</source> 547 <target>Edition du contenu</target> 548 </trans-unit> 549 <trans-unit> 550 <source>Manage access permission</source> 551 <target>Gestion des permissions d'accès</target> 552 </trans-unit> 553 <trans-unit> 554 <source>Edit URL</source> 555 <target>Edition de l'URL</target> 556 </trans-unit> 557 <trans-unit> 558 <source>Manage routing</source> 559 <target>Gestion du routage</target> 560 </trans-unit> 561 <trans-unit> 562 <source>Manage admin permission</source> 563 <target>Gestion des permissions d'admin</target> 564 </trans-unit> 565 <trans-unit> 566 <source>Edit page's content</source> 567 <target>Edition du contenu des pages</target> 568 </trans-unit> 569 <trans-unit> 570 <source>Edit page's meta</source> 571 <target>Edition des métas des pages</target> 572 </trans-unit> 573 <trans-unit> 574 <source>Select page's template</source> 575 <target>Sélection des modèles de pages</target> 576 </trans-unit> 577 <trans-unit> 578 <source>Edit node's menu</source> 579 <target>Edition des menu des éléments</target> 580 </trans-unit> 581 <trans-unit> 582 <source>Edit node's status</source> 583 <target>Modification des status des éléments</target> 584 </trans-unit> 585 <trans-unit> 586 <source>Manage node's pages</source> 587 <target>Gestion des pages des éléments</target> 588 </trans-unit> 589 <trans-unit> 590 <source>Manage node's access permissions</source> 591 <target>Gestion des permission d'accès</target> 592 </trans-unit> 593 <trans-unit> 594 <source>Move nodes</source> 595 <target>Déplacement des éléments</target> 596 </trans-unit> 597 <trans-unit> 598 <source>Delete nodes</source> 599 <target>Suppression des éléments</target> 600 </trans-unit> 601 <trans-unit> 602 <source>Create nodes</source> 603 <target>Création d'un élément</target> 604 </trans-unit> 605 <trans-unit> 606 <source>Manage node's administration permissions</source> 607 <target>Gestion des permission d'administration des éléments</target> 608 </trans-unit> 609 <trans-unit> 610 <source>Edit node's URL</source> 611 <target>Edition des URL</target> 612 </trans-unit> 613 <trans-unit> 614 <source>Manage node's routing</source> 615 <target>Gestion du routage</target> 616 </trans-unit> 617 <trans-unit> 618 <source>Manage version's settings</source> 619 <target>Gestion des paramètres de la versions</target> 620 </trans-unit> 621 <trans-unit> 622 <source>Manage page templates</source> 623 <target>Gestion des modèles de pages</target> 624 </trans-unit> 625 <trans-unit> 626 <source>Manage pages</source> 627 <target>Gestion des pages</target> 628 </trans-unit> 629 <trans-unit> 630 <source>Manage menus</source> 631 <target>Gestion des menus</target> 632 </trans-unit> 633 <trans-unit> 634 <source>Manage version's permissions</source> 635 <target>Gestion des permissions de la version</target> 636 </trans-unit> 637 <trans-unit> 638 <source>Global permissions</source> 639 <target>Permissions générales</target> 640 </trans-unit> 641 <trans-unit> 642 <source>Open page in new window</source> 643 <target>Ouvrir la page dans une nouvelle fenêtre</target> 644 </trans-unit> 645 <trans-unit> 646 <source>Close sfDynamicCMS toolbar</source> 647 <target>Fermer la barre d'outils sfDynamicCMS</target> 648 </trans-unit> 649 <trans-unit> 650 <source>Edit element settings</source> 651 <target>Configuration de l'élément</target> 652 </trans-unit> 653 <trans-unit> 654 <source>Edit page settings</source> 655 <target>Configuration de la page</target> 656 </trans-unit> 657 <trans-unit> 658 <source>Edit page content</source> 659 <target>Editer le contenu de la page</target> 660 </trans-unit> 661 <trans-unit> 662 <source>Manage element routing</source> 663 <target>Gérer le routage</target> 664 </trans-unit> 665 <trans-unit> 666 <source>Manage element permissions</source> 667 <target>Gérer les permissions</target> 668 </trans-unit> 669 <trans-unit> 350 670 <source>Manage versions</source> 351 671 <target>Gérer les versions</target> 352 672 </trans-unit> 353 673 <trans-unit> 354 <source>Manage content</source> 355 <target>Gérer le contenu</target> 356 </trans-unit> 357 <trans-unit> 358 <source>Add a new version</source> 359 <target>Ajouter une version</target> 360 </trans-unit> 361 <trans-unit> 362 <source>Page templates</source> 363 <target>Modèles de pages</target> 364 </trans-unit> 365 <trans-unit> 366 <source>Culture</source> 367 <target>Langue</target> 368 </trans-unit> 369 <trans-unit> 370 <source>Page templates of</source> 371 <target>Modèles de page de</target> 372 </trans-unit> 373 <trans-unit> 374 <source>Slots (separeted with coma)</source> 375 <target>Slots (séparés par des virgules)</target> 376 </trans-unit> 377 <trans-unit> 378 <source>Template Title</source> 379 <target>Titre du template</target> 380 </trans-unit> 381 <trans-unit> 382 <source>Template name</source> 383 <target>Nom du template</target> 384 </trans-unit> 385 <trans-unit> 386 <source>Current absolute URL</source> 387 <target>URL absolue actuelle</target> 388 </trans-unit> 389 <trans-unit> 390 <source>URL</source> 391 <target>URL</target> 392 </trans-unit> 393 <trans-unit> 394 <source>Template title</source> 395 <target>Titre du template</target> 396 </trans-unit> 397 <trans-unit> 398 <source>There are some errors that prevent the form to validate</source> 399 <target>Des erreurs empèchent d'enregistrer les modifications.</target> 400 </trans-unit> 401 <trans-unit> 402 <source>Page title</source> 403 <target>Titre de la page</target> 404 </trans-unit> 405 <trans-unit> 406 <source>updated at</source> 407 <target>mise à jour le</target> 408 </trans-unit> 409 <trans-unit> 410 <source>created at</source> 411 <target>créé le</target> 412 </trans-unit> 413 <trans-unit> 414 <source>Usage</source> 415 <target>Utilisation</target> 416 </trans-unit> 417 <trans-unit> 418 <source>Actions</source> 419 <target>Actions</target> 420 </trans-unit> 421 <trans-unit> 422 <source>Pages of</source> 423 <target>Pages de</target> 424 </trans-unit> 425 <trans-unit> 426 <source>Are you sure to delete this page ?</source> 427 <target>Etes-vous sûr de vouloir supprimer cette page ?</target> 428 </trans-unit> 429 <trans-unit> 430 <source>Duplicate content of</source> 431 <target>Dupliquer le contenu</target> 432 </trans-unit> 433 <trans-unit> 434 <source>Menus of</source> 435 <target>Menus de</target> 436 </trans-unit> 437 <trans-unit> 438 <source>Edit menu</source> 439 <target>Edition du menu</target> 440 </trans-unit> 441 <trans-unit> 442 <source>Levels start from 0 (home node level)</source> 443 <target>Les niveaux commencent à 0 (niveau de l'accueil)</target> 444 </trans-unit> 445 <trans-unit> 446 <source>Create new menu</source> 447 <target>Création d'un nouveau menu</target> 448 </trans-unit> 449 <trans-unit> 450 <source>Level</source> 451 <target>Niveau</target> 452 </trans-unit> 453 <trans-unit> 454 <source>Menu title</source> 455 <target>Titre du menu</target> 456 </trans-unit> 457 <trans-unit> 458 <source>Menu name</source> 459 <target>Nom du menu</target> 460 </trans-unit> 461 <trans-unit> 462 <source>Menu level</source> 463 <target>Niveau du menu</target> 464 </trans-unit> 465 <trans-unit> 466 <source>The title of the menu is required</source> 467 <target>Le titre du menu est requis</target> 468 </trans-unit> 469 <trans-unit> 470 <source>The name of the menu is required</source> 471 <target>Le nom du menu est requis</target> 472 </trans-unit> 473 <trans-unit> 474 <source>Add a menu</source> 475 <target>Ajouter un menu</target> 476 </trans-unit> 477 <trans-unit> 478 <source>Manage permissions of</source> 479 <target>Gérer les permissions de</target> 480 </trans-unit> 481 <trans-unit> 482 <source>Save and apply for all children</source> 483 <target>Enregistrer et appliquer à tous les fils</target> 484 </trans-unit> 485 <trans-unit> 486 <source>Access permissions</source> 487 <target>Permission d'accès</target> 488 </trans-unit> 489 <trans-unit> 490 <source>Editing permissions</source> 491 <target>Permission d'édition</target> 492 </trans-unit> 493 <trans-unit> 494 <source>Advanced Administration permissions</source> 495 <target>Permissions d'administration avancées</target> 496 </trans-unit> 497 <trans-unit> 498 <source>Administration permissions</source> 499 <target>Permissions d'administration</target> 500 </trans-unit> 501 <trans-unit> 502 <source>Developpement permissions</source> 503 <target>Permissions de développement</target> 504 </trans-unit> 505 <trans-unit> 506 <source>Access to page</source> 507 <target>Accès à la page</target> 508 </trans-unit> 509 <trans-unit> 510 <source>Visible in menu</source> 511 <target>Visible dans le menu</target> 512 </trans-unit> 513 <trans-unit> 514 <source>Move element</source> 515 <target>Déplacer l'élément</target> 516 </trans-unit> 517 <trans-unit> 518 <source>Delete element</source> 519 <target>Supprimer l'élément</target> 520 </trans-unit> 521 <trans-unit> 522 <source>Edit menu</source> 523 <target>Edition du menu</target> 524 </trans-unit> 525 <trans-unit> 526 <source>Edit status</source> 527 <target>Modification de l'état de l'élément</target> 528 </trans-unit> 529 <trans-unit> 530 <source>Manage pages</source> 531 <target>Gestion des pages</target> 532 </trans-unit> 533 <trans-unit> 534 <source>Select page template</source> 535 <target>Sélection du modèle de page</target> 536 </trans-unit> 537 <trans-unit> 538 <source>Edit page meta</source> 539 <target>Edition des métas</target> 540 </trans-unit> 541 <trans-unit> 542 <source>Edit page content</source> 543 <target>Edition du contenu</target> 544 </trans-unit> 545 <trans-unit> 546 <source>Manage access permission</source> 547 <target>Gestion des permissions d'accès</target> 548 </trans-unit> 549 <trans-unit> 550 <source>Edit URL</source> 551 <target>Edition de l'URL</target> 552 </trans-unit> 553 <trans-unit> 554 <source>Manage routing</source> 555 <target>Gestion du routage</target> 556 </trans-unit> 557 <trans-unit> 558 <source>Manage admin permission</source> 559 <target>Gestion des permissions d'admin</target> 560 </trans-unit> 561 <trans-unit> 562 <source>Edit page's content</source> 563 <target>Edition du contenu des pages</target> 564 </trans-unit> 565 <trans-unit> 566 <source>Edit page's meta</source> 567 <target>Edition des métas des pages</target> 568 </trans-unit> 569 <trans-unit> 570 <source>Select page's template</source> 571 <target>Sélection des modèles de pages</target> 572 </trans-unit> 573 <trans-unit> 574 <source>Edit node's menu</source> 575 <target>Edition des menu des éléments</target> 576 </trans-unit> 577 <trans-unit> 578 <source>Edit node's status</source> 579 <target>Modification des status des éléments</target> 580 </trans-unit> 581 <trans-unit> 582 <source>Manage node's pages</source> 583 <target>Gestion des pages des éléments</target> 584 </trans-unit> 585 <trans-unit> 586 <source>Manage node's access permissions</source> 587 <target>Gestion des permission d'accès</target> 588 </trans-unit> 589 <trans-unit> 590 <source>Move nodes</source> 591 <target>Déplacement des éléments</target> 592 </trans-unit> 593 <trans-unit> 594 <source>Delete nodes</source> 595 <target>Suppression des éléments</target> 596 </trans-unit> 597 <trans-unit> 598 <source>Create nodes</source> 599 <target>Création d'un élément</target> 600 </trans-unit> 601 <trans-unit> 602 <source>Manage node's administration permissions</source> 603 <target>Gestion des permission d'administration</target> 604 </trans-unit> 605 <trans-unit> 606 <source>Edit node's URL</source> 607 <target>Edition des URL</target> 608 </trans-unit> 609 <trans-unit> 610 <source>Manage node's routing</source> 611 <target>Gestion du routage</target> 612 </trans-unit> 613 <trans-unit> 614 <source>Manage version's settings</source> 615 <target>Gestion des paramètres des versions</target> 616 </trans-unit> 617 <trans-unit> 618 <source>Manage version's templates</source> 619 <target>Gestion des modèles de pages</target> 620 </trans-unit> 621 <trans-unit> 622 <source>Manage version's pages</source> 623 <target>Gestion des pages</target> 624 </trans-unit> 625 <trans-unit> 626 <source>Manage version's menus</source> 627 <target>Gestion des menus</target> 628 </trans-unit> 629 <trans-unit> 630 <source>Manage version's permissions</source> 631 <target>Gestion des permissions globales</target> 632 </trans-unit> 633 <trans-unit> 634 <source>Global permissions</source> 635 <target>Permissions générales</target> 636 </trans-unit> 637 <trans-unit> 638 <source>Open page in new window</source> 639 <target>Ouvrir la page dans une nouvelle fenêtre</target> 640 </trans-unit> 641 <trans-unit> 642 <source></source> 643 <target></target> 644 </trans-unit> 645 <trans-unit> 646 <source></source> 647 <target></target> 648 </trans-unit> 649 <trans-unit> 650 <source></source> 651 <target></target> 652 </trans-unit> 653 <trans-unit> 654 <source></source> 655 <target></target> 656 </trans-unit> 657 <trans-unit> 658 <source></source> 659 <target></target> 660 </trans-unit> 661 <trans-unit> 662 <source></source> 663 <target></target> 664 </trans-unit> 665 <trans-unit> 666 <source></source> 667 <target></target> 668 </trans-unit> 669 <trans-unit> 670 <source></source> 671 <target></target> 674 <source>Element has been created successfully</source> 675 <target>L'élément a été ajouté</target> 672 676 </trans-unit> 673 677 <trans-unit> plugins/sfDynamicCMSPlugin/branches/1.0/modules/sfDynamicCMSAdmin/lib/BasesfDynamicCMSAdminActions.class.php
r13148 r13205 26 26 'manage_nav_permissions', 27 27 ); 28 29 protected $actions_permissions = array(30 'editNode' => array('delete_node','delete_node','move_node','select_node_status','edit_node_menu','manage_node_pages'),31 'editPageSettings' => array('select_page_template','edit_page_meta'),32 'editPageContent' => array('edit_page_content'),33 'editRoute' => array('edit_node_url','manage_node_routing'),34 'editPermissions' => array('manage_node_access_permissions','manage_node_admin_permissions'),35 'createNode' => array('create_node'),36 'deleteNode' => array('delete_node'),37 'editNav' => array('manage_nav','manage_nav_settings'),38 'manageTemplates' => array('manage_nav_templates'),39 'managePages' => array('manage_nav_pages'),40 'manageMenus' => array('manage_nav_menus'),41 'editMenu' => array('manage_nav_menus'),42 'deleteMenu' => array('manage_nav_menus'),43 'managePermissions' => array('manage_nav_permissions'),44 'createNav' => array('manage_nav'),45 'deleteNav' => array('manage_nav'),46 );47 28 48 29 public function BasesfDynamicCMSAdminActions($context = null, $moduleName = null, $actionName = null) … … 71 52 } 72 53 73 sfConfig::set('app_sfDynamicCMS_index',false);54 //sfConfig::set('app_sfDynamicCMS_index',false); 74 55 $this->current_nav=$this->getNav(); 75 56 $this->validated_permissions=$this->getValidatedPermissions(); 76 $this->permitted_actions= $this->getPermittedActions();57 $this->permitted_actions=sfDynamicCMS::getInstance()->getPermittedActions(); 77 58 } 78 59 } … … 106 87 107 88 $last_action=$this->getUser()->getAttribute('last_action'); 108 if(in_array($last_action,$this->permitted_actions)) $action=$last_action; 89 if(isset($this->permitted_actions[$last_action])) 90 { 91 $action=$last_action; 92 } 109 93 else 110 94 { … … 112 96 foreach($default_actions as $default_action) 113 97 { 114 if(i n_array($default_action,$this->permitted_actions))98 if(isset($this->permitted_actions[$default_action])) 115 99 { 116 100 $action=$default_action; … … 127 111 $this->checkActionCredential('editPageContent'); 128 112 129 if($this->getPage()) $this->template_slots=$this->getPage()->getTemplateSlots('sfDynamicCMS'); 130 131 if ($this->getRequest()->getMethod() == sfRequest::POST && !$this->getRequest()->hasErrors()) 132 { 133 $this->getPage()->updateSlotsFromRequest($this->getRequest(), $this->getNav()->getCulture(),'sfDynamicCMS', true); 134 $this->clearCache('templates'); 135 $this->setFlash('notice', 'Your modifications have been saved'); 136 return $this->redirect(sfContext::getInstance()->getModuleName().'/editPageContent?node_id='.$this->getNode()->getId()); 113 if($this->getPage()) 114 { 115 $this->template_slots=$this->getPage()->getTemplateSlots('sfDynamicCMS'); 116 117 if ($this->getRequest()->getMethod() == sfRequest::POST && !$this->getRequest()->hasErrors()) 118 { 119 $this->getPage()->updateSlotsFromRequest($this->getRequest(), $this->getNav()->getCulture(),'sfDynamicCMS', true); 120 $this->clearCache('templates'); 121 $this->setFlash('notice', 'Your modifications have been saved'); 122 return $this->redirect(sfContext::getInstance()->getModuleName().'/editPageContent?node_id='.$this->getNode()->getId()); 123 } 124 } 125 else 126 { 127 $this->redirect(sfContext::getInstance()->getModuleName().'/index?node_id='.$this->getNode()->getId()); 137 128 } 138 129 } … … 141 132 { 142 133 $this->checkActionCredential('editPageSettings'); 143 $this->getPage(); 144 $this->getNav(); 145 $this->templates_options=sfDynamicCMSTools::getTemplatesOptionsForSelect($this->getNav()); 146 if ($this->getRequest()->getMethod() == sfRequest::POST && !$this->getRequest()->hasErrors()) 147 { 148 $this->savePage(); 149 $this->clearCache('templates'); 150 $this->setFlash('notice', 'Your modifications have been saved'); 151 return $this->redirect(sfContext::getInstance()->getModuleName().'/editPageSettings?node_id='.$this->getNode()->getId()); 134 if($this->getPage()) 135 { 136 $this->getNav(); 137 $this->templates_options=sfDynamicCMSTools::getTemplatesOptionsForSelect($this->getNav()); 138 if ($this->getRequest()->getMethod() == sfRequest::POST && !$this->getRequest()->hasErrors()) 139 { 140 $this->savePage(); 141 $this->clearCache('templates'); 142 $this->setFlash('notice', 'Your modifications have been saved'); 143 return $this->redirect(sfContext::getInstance()->getModuleName().'/editPageSettings?node_id='.$this->getNode()->getId()); 144 } 145 } 146 else 147 { 148 $this->redirect(sfContext::getInstance()->getModuleName().'/index?node_id='.$this->getNode()->getId()); 152 149 } 153 150 } … … 156 153 { 157 154 $this->preExecute(); 158 $this->execute EditNode();155 $this->executeCreateNode(); 159 156 return sfView::SUCCESS; 160 157 } … … 198 195 if ($node_rel->isRoot() && ($this->getRequestParameter('node[position_rel]')=='after' || $this->getRequestParameter('node[position_rel]')=='before')) $this->getRequest()->setError('node{position_rel}',__("This element can't be put in place like this", null, 'sfDynamicCMS')); 199 196 } 200 return $this->getRequest()->hasErrors();197 return !$this->getRequest()->hasErrors(); 201 198 } 202 199 else return true; … … 216 213 $this->getRequest()->setError('menu{title}',__('The title of the menu is required', null, 'sfDynamicCMS')); 217 214 } 218 return $this->getRequest()->hasErrors();215 return !$this->getRequest()->hasErrors(); 219 216 } 220 217 else return true; … … 256 253 sfDynamicCMSTools::generateRoutes($this->getNav()->getApplication()); 257 254 $this->clearCache(); 258 $this->setFlash('notice', ' Node has been created');255 $this->setFlash('notice', 'Element has been created successfully'); 259 256 if ($this->getRequestParameter('save_and_add')) return $this->redirect(sfContext::getInstance()->getModuleName().'/createNode?node_id='.$this->getNode()->getId()); 260 257 else return $this->redirect(sfContext::getInstance()->getModuleName().'/editNode?node_id='.$this->getNode()->getId()); … … 390 387 { 391 388 $this->preExecute(); 392 if($this->getRequestParameter('menu_id')) $this->menu=SfDynamicCmsMenuPeer::retrieveByPK($this->getRequestParameter('menu_id')); 389 if($this->getRequestParameter('menu_id')) 390 { 391 $this->menu=SfDynamicCmsMenuPeer::retrieveByPK($this->getRequestParameter('menu_id')); 392 } 393 393 else $this->menu=new SfDynamicCmsMenu(); 394 394 $this->updateMenuFromRequest(); … … 400 400 $this->checkActionCredential('editMenu'); 401 401 $this->getNav(); 402 $this->clearCache(); 403 if($this->getRequestParameter('menu_id')) $this->menu=SfDynamicCmsMenuPeer::retrieveByPK($this->getRequestParameter('menu_id')); 402 if($this->getRequestParameter('menu_id')) 403 { 404 $this->menu=SfDynamicCmsMenuPeer::retrieveByPK($this->getRequestParameter('menu_id')); 405 } 404 406 else $this->menu=new SfDynamicCmsMenu(); 405 407 if ($this->getRequest()->getMethod() == sfRequest::POST && !$this->getRequest()->hasErrors()) … … 407 409 $this->updateMenuFromRequest(); 408 410 $this->menu->save(); 411 $this->clearCache(); 409 412 $this->setFlash('notice', 'Your modifications have been saved'); 410 413 if ($this->getRequestParameter('save_and_add')) return $this->redirect(sfContext::getInstance()->getModuleName().'/editMenu?nav_id='.$this->getNav()->getId()); … … 473 476 $this->permissions_groups['Developpement permissions']['manage_node_admin_permissions']="Manage node's administration permissions"; 474 477 $this->permissions_groups['Developpement permissions']['manage_node_routing']="Manage node's routing"; 475 $this->permissions_groups['Developpement permissions']['manage_nav']="Manage version s";478 $this->permissions_groups['Developpement permissions']['manage_nav']="Manage version"; 476 479 $this->permissions_groups['Developpement permissions']['manage_nav_settings']="Manage version's settings"; 477 $this->permissions_groups['Developpement permissions']['manage_nav_templates']="Manage version'stemplates";478 $this->permissions_groups['Developpement permissions']['manage_nav_pages']="Manage version'spages";479 $this->permissions_groups['Developpement permissions']['manage_nav_menus']="Manage version'smenus";480 $this->permissions_groups['Developpement permissions']['manage_nav_templates']="Manage page templates"; 481 $this->permissions_groups['Developpement permissions']['manage_nav_pages']="Manage pages"; 482 $this->permissions_groups['Developpement permissions']['manage_nav_menus']="Manage menus"; 480 483 $this->permissions_groups['Developpement permissions']['manage_nav_permissions']="Manage version's permissions"; 481 484 … … 644 647 $this->current_node->setPermissions($permissions); 645 648 } 646 647 649 } 648 650 … … 668 670 elseif ($this->getRequestParameter('node_id')) 669 671 { 670 $ this->setNav($this->getNode()->getSfDynamicCmsNav());671 }672 672 $node = SfDynamicCmsNodePeer::retrieveByPk($this->getRequestParameter('node_id')); 673 $this->setNav($node->getSfDynamicCmsNav()); 674 } 673 675 else 674 676 { … … 683 685 $this->current_nav=$nav; 684 686 sfDynamicCMS::getInstance()->setCurrentNav($nav); 687 /* 688 //experimental: use node index 689 if(sfDynamicCMSTools::useIndex() && !$nav->isNew()) 690 { 691 sfDynamicCMS::getInstance()->makeIndex($nav); 692 } 693 */ 685 694 } 686 695 … … 706 715 if ($this->getNav()) 707 716 { 708 if ( $this->getNav()->getRootNode())717 if (!$this->getNav()->isNew() && $this->getNav()->getRootNode()) 709 718 { 710 719 $this->setNode($this->getNav()->getRootNode()); … … 729 738 { 730 739 $this->current_node=$node; 740 sfDynamicCMS::getInstance()->setCurrentNode($node); 731 741 } 732 742 … … 753 763 protected function checkActionCredential($action, $mode='forward_index') 754 764 { 755 if(!$this->permitted_actions) $this->permitted_actions= $this->getPermittedActions();765 if(!$this->permitted_actions) $this->permitted_actions=sfDynamicCMS::getInstance()->getPermittedActions(); 756 766 //print_r($this->permitted_actions); die(); 757 767 … … 761 771 } 762 772 763 if(!i n_array($action,$this->permitted_actions))773 if(!isset($this->permitted_actions[$action])) 764 774 { 765 775 switch($mode) … … 803 813 $this->debugMessage('Validated permissions : '.implode(', ',$validated_permissions)); 804 814 return $validated_permissions; 805 }806 807 protected function getPermittedActions()808 {809 $permitted_actions=array();810 foreach($this->actions_permissions as $action => $permissions)811 {812 if($this->getNav() && $this->getNav()->userHasCredentials($permissions))813 {814 if($this->getNode())815 {816 if($this->getNode()->userHasCredentials($permissions))817 {818 $permitted_actions[]=$action;819 }820 }821 else822 {823 $permitted_actions[]=$action;824 }825 }826 }827 828 if(!$this->getNode() || $this->getNode()->isNew())829 {830 //unset($permitted_actions[array_search('editNode',$permitted_actions)]);831 unset($permitted_actions[array_search('deleteNode',$permitted_actions)]);832 unset($permitted_actions[array_search('editRoute',$permitted_actions)]);833 unset($permitted_actions[array_search('editPermissions',$permitted_actions)]);834 }835 if(!$this->getPage())836 {837 unset($permitted_actions[array_search('editPageSettings',$permitted_actions)]);838 unset($permitted_actions[array_search('editPageContent',$permitted_actions)]);839 }840 $this->debugMessage('Permitted actions : '.implode(', ',$permitted_actions));841 return $permitted_actions;842 815 } 843 816 plugins/sfDynamicCMSPlugin/branches/1.0/modules/sfDynamicCMSAdmin/templates/_menu.php
r12494 r13205 1 1 <?php 2 $actions_pool = array( 'editNode', 'editPageSettings', 'editPageContent', 'editRoute', 'editPermissions'); 3 $actions = sfDynamicCMS::getInstance()->getPermittedActions($actions_pool); 2 4 3 $tab_actions=array( 'editNode' => 'Settings', 4 'editPageSettings' => 'Page settings', 5 'editPageContent' => 'Content', 6 'editRoute' => 'Routing', 7 'editPermissions' => 'Permissions', 8 ); 9 10 foreach($tab_actions as $tab_action => $tab_name) 5 if(count($actions)) 11 6 { 12 if(!in_array($tab_action,$permitted_actions))13 {14 unset($tab_actions[$tab_action]);15 }16 }17 18 if(count($tab_actions))19 {20 $current_action = sfContext::getInstance()->getActionName();21 7 if ($current_node && $current_node->getId()) $node_id=$current_node->getId(); 22 8 else $node_id=0; … … 25 11 <ul> 26 12 <?php 27 foreach($ tab_actions as $tab_action => $tab_name)13 foreach($actions as $action_name => $action) 28 14 { 29 if ($current_action==$tab_action) $class='menu_element-sel'; else $class='menu_element'; 30 echo '<li>'.link_to(__($tab_name,null,'sfDynamicCMS'),sfContext::getInstance()->getModuleName().'/'.$tab_action.'?node_id='.$node_id,array('class'=>$class)).'</li>'; 15 if ($action->isCurrentAction()) $class='menu_element-sel'; else $class='menu_element'; 16 echo '<li>'; 17 echo link_to(image_tag($action->getIcon()).__($action->getShortTitle(),null,'sfDynamicCMS'),sfContext::getInstance()->getModuleName().'/'.$action->getActionName().'?node_id='.$node_id,array('class'=>$class)); 18 echo '</li>'; 31 19 } 32 20 if($current_node->getPageId()) … … 34 22 ?> 35 23 <li> 36 <?php echo '<a class="menu_element" href="'.$current_node->getAbsoluteUrl(true,true).'" target="_blank" title="'.__("Open page in new window", null, 'sfDynamicCMS').'">'.image_tag('/sfDynamicCMSPlugin/images/ page_white_magnify.png',array('alt'=>__("Open page in new window", null, 'sfDynamicCMS'))).'</a>'; ?>24 <?php echo '<a class="menu_element" href="'.$current_node->getAbsoluteUrl(true,true).'" target="_blank" title="'.__("Open page in new window", null, 'sfDynamicCMS').'">'.image_tag('/sfDynamicCMSPlugin/images/icons16/page_white_magnify.png',array('alt'=>__("Open page in new window", null, 'sfDynamicCMS'))).__('open page',null,'sfDynamicCMS').'</a>'; ?> 37 25 </li> 38 26 <?php } ?> plugins/sfDynamicCMSPlugin/branches/1.0/modules/sfDynamicCMSAdmin/templates/_menuNav.php
r13004 r13205 1 1 <?php 2 $tab_actions=array( 'editNav' => 'Settings'); 3 if ($current_nav && !$current_nav->isNew()) 2 $actions_pool=array( 'editNav', 'managePages', 'manageMenus', 'manageTemplates', 'managePermissions'); 3 $actions = sfDynamicCMS::getInstance()->getPermittedActions($actions_pool); 4 5 if(count($actions)) 4 6 { 5 $tab_actions+=array('managePages' => 'Pages',6 'manageMenus' => 'Menus',7 'manageTemplates' => 'Page templates',8 'managePermissions' => 'Permissions',9 );10 }11 12 foreach($tab_actions as $tab_action => $tab_name)13 {14 if(!in_array($tab_action,$permitted_actions))15 {16 unset($tab_actions[$tab_action]);17 }18 }19 20 if(count($tab_actions))21 {22 $current_action = sfContext::getInstance()->getActionName();23 7 if ($current_nav && $current_nav->getId()) $nav_id=$current_nav->getId(); 24 8 else $nav_id=0; … … 27 11 <ul> 28 12 <?php 29 foreach($ tab_actions as $tab_action => $tab_name)13 foreach($actions as $action_name => $action) 30 14 { 31 if ($current_action==$tab_action) $class='menu_element-sel'; else $class='menu_element'; 32 echo '<li>'.link_to(__($tab_name,null,'sfDynamicCMS'),sfContext::getInstance()->getModuleName().'/'.$tab_action.'?nav_id='.$nav_id,array('class'=>$class)).'</li>'; 15 if ($action->isCurrentAction()) $class='menu_element-sel'; else $class='menu_element'; 16 echo '<li>'; 17 echo link_to(image_tag($action->getIcon()).__($action->getShortTitle(),null,'sfDynamicCMS'),sfContext::getInstance()->getModuleName().'/'.$action->getActionName().'?nav_id='.$nav_id,array('class'=>$class)); 18 echo '</li>'; 33 19 } 34 20 ?> plugins/sfDynamicCMSPlugin/branches/1.0/modules/sfDynamicCMSAdmin/templates/_sidebar.php
r13148 r13205 2 2 use_helper('Object','Javascript','sfDynamicCMS'); 3 3 $sf_context->getResponse()->addJavascript('/sfDynamicCMSPlugin/js/expand_menu.js'); 4 4 if (isset($permitted_actions['editNav'])) 5 { ?> 6 <div style="margin:5px 0;"><?php echo button_to(__('Manage versions', null, 'sfDynamicCMS'), sfContext::getInstance()->getModuleName().'/editNav?nav_id='.$current_nav->getId(), array ( 7 'style' => 'padding: 3px 2px 3px 20px;background: #FFFFCC url(/sfDynamicCMSPlugin/images/icons16/application_edit.png) no-repeat 5px 2px;cursor: hand; cursor: pointer;', 8 )) ?></div><hr/> 9 <?php 10 } 5 11 if ($current_nav) 6 12 { … … 9 15 echo submit_tag('OK', array('style' => 'margin-left: 5px;padding: 3px 2px 3px 20px;background: #FFFFCC url(/sf/sf_admin/images/ok.png) no-repeat 5px 2px;')); 10 16 echo '</form>'; 11 if (in_array('editNav',$permitted_actions))12 {13 echo link_to(__("Manage versions", null, 'sfDynamicCMS'),sfContext::getInstance()->getModuleName().'/editNav?nav_id='.$current_nav->getId());14 }15 17 ?> 16 18 <div id="node-list"> 17 19 <?php 18 if (i n_array('createNode',$permitted_actions))20 if (isset($permitted_actions['createNode'])) 19 21 { ?> 20 22 <div style="margin:5px 0;"><?php echo button_to(__('Add a new element', null, 'sfDynamicCMS'), sfContext::getInstance()->getModuleName().'/createNode?nav_id='.$current_nav->getId().'&node_id=new&rel_node_id='.$current_node->getId(), array ( 21 'style' => 'padding: 3px 2px 3px 20px;background: #FFFFCC url(/sf /sf_admin/images/add.png) no-repeat 5px 2px;cursor: hand; cursor: pointer;',23 'style' => 'padding: 3px 2px 3px 20px;background: #FFFFCC url(/sfDynamicCMSPlugin/images/icons16/page_white_add.png) no-repeat 5px 2px;cursor: hand; cursor: pointer;', 22 24 )) ?></div> 23 25 <?php } plugins/sfDynamicCMSPlugin/branches/1.0/modules/sfDynamicCMSAdmin/templates/_sidebarNav.php
r12313 r13205 1 1 <?php if($sf_user->hasCredential(sfConfig::get('app_sfDynamicCMS_dev_credentials'))) { ?> 2 <div style="margin-top:5px;"><?php echo button_to(__('Add a new version', null, 'sfDynamicCMS'), sfContext::getInstance()->getModuleName().'/createNav', array ( 3 'style' => 'padding: 3px 2px 3px 20px;background: #FFFFCC url(/sf/sf_admin/images/add.png) no-repeat 5px 2px;cursor: hand; cursor: pointer;', 2 <div style="text-align:center"> 3 <a href="http://www.symfony-project.org/plugins/sfDynamicCMSPlugin" target="_blank"> 4 <?php echo image_tag('/sfDynamicCMSPlugin/images/logo-dcms.gif',array('alt'=>'sfDynamicCMS','style'=>'border: 1px solid #e0e0e0')); ?> 5 </a> 6 <p style="letter-spacing:1px;color:#b87341"><?php echo 'sfDynamicCMS v.'.sfDynamicCMSTools::getSfDynamicCMSVersion(); ?> 7 </p> 8 </div> 9 <div style="margin-top:10px;"><?php echo button_to(__('Add a new version', null, 'sfDynamicCMS'), sfContext::getInstance()->getModuleName().'/createNav', array ( 10 'style' => 'padding: 3px 2px 3px 20px;background: #FFFFCC url(/sfDynamicCMSPlugin/images/icons16/application_add.png) no-repeat 5px 2px;cursor: hand; cursor: pointer;', 4 11 )) ?></div> 5 12 <hr /> … … 14 21 ?> 15 22 </ul> 16 <?php if($sf_user->hasCredential(sfConfig::get('app_sfDynamicCMS_dev_credentials'))) { ?>17 <p style="position:absolute;bottom:0;">18 <?php19 echo 'sfDynamicCMS v.'.sfDynamicCMSTools::getSfDynamicCMSVersion();20 ?>21 </p>22 <?php } ?>plugins/sfDynamicCMSPlugin/branches/1.0/web/css/sfDynamicCMS.css
r13069 r13205 202 202 font-weight: normal; 203 203 font-size: 12px; 204 line-height: 16px;205 204 text-transform: lowercase; 206 205 border: 1px solid #999999; … … 209 208 color: #666666; 210 209 background-color: #F0F0F0; 210 line-height: 16px; 211 211 height: 16px; 212 padding: 2px 8px; 213 } 212 padding: 1px 8px 3px 8px; 213 } 214 215 div#sfdynamiccms_menu img { 216 vertical-align: middle; 217 margin-right: 5px; 218 } 214 219 215 220 div#sfdynamiccms_menu a.menu_element-sel {