Changeset 3399
- Timestamp:
- 02/23/11 11:39:59 (15 months ago)
- Location:
- plugins/apostrophePlugin/branches/contribute/rande/1.5
- Files:
-
- 3 added
- 5 modified
-
CHANGES (added)
-
config/doctrine/schema.yml (modified) (1 diff)
-
config/routing.yml.sample (modified) (1 diff)
-
lib/form/BaseaPageSettingsForm.class.php (modified) (1 diff)
-
lib/route (added)
-
lib/route/aCmsRoute.class.php (added)
-
lib/toolkit/BaseaTools.class.php (modified) (2 diffs)
-
modules/a/templates/settingsSuccess.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
plugins/apostrophePlugin/branches/contribute/rande/1.5/config/doctrine/schema.yml
r3288 r3399 73 73 engine: 74 74 type: string(255) 75 76 # a code is use to reference a page inside the code, ie code=term_and_condition 77 # we don't need to know the url to generate the url 78 code: 79 type: varchar(32) # use to reference the page 80 81 # the related action will be handled by a symfony action class but we need the page 82 # in the menu 83 skip_on_url_match: 84 type: boolean 85 default: false 86 75 87 indexes: 76 88 slugindex: -
plugins/apostrophePlugin/branches/contribute/rande/1.5/config/routing.yml.sample
r4 r3399 1 1 # Special case for the home page 2 2 3 homepage: 4 url: / 5 param: { module: a, action: show, slug: / } 6 7 # The non-CMS actions of your project, and the admin actions of the CMS 8 a_action: 9 url: /cms/:module/:action 10 11 # Must be the LAST rule 3 # Must be the FIRST rule 12 4 a_page: 13 5 url: /:slug 6 class: aCmsRoute 7 options: {type: object, model: aPage} 14 8 param: { module: a, action: show } 15 9 requirements: { slug: .* } 16 10 11 12 # default rules 13 homepage: 14 url: / 15 param: { module: a, action: show, slug: / } 16 17 a_action: 18 url: /cms/:module/:action -
plugins/apostrophePlugin/branches/contribute/rande/1.5/lib/form/BaseaPageSettingsForm.class.php
r3273 r3399 180 180 ))); 181 181 } 182 183 // This option allows to have an apostrophe url linked to a symfony action 184 $this->setWidget('skip_on_url_match', new sfWidgetFormChoice(array( 185 'expanded' => true, 186 'choices' => array(false => "No", true => "Yes"), 187 'default' => false 188 ))); 182 189 183 190 // Tags -
plugins/apostrophePlugin/branches/contribute/rande/1.5/lib/toolkit/BaseaTools.class.php
r3320 r3399 33 33 aNavigation::simulateNewRequest(); 34 34 } 35 36 /** 37 * retrieve a page with the provided slug (create the page if the related slug does not exist) 38 * 39 * inside a symfony template file, you can define a hybrid page and use it in an area 40 * 41 * <?php $page = aTools::getHybridPage('Poll/showPollCategory/'.$poll_category->id) ?> 42 * 43 * <?php a_area('body', array( 'slug' => $page->getSlug(), 'allowed_types' => array('aText') ); ?> 44 * 45 * @param string $slug the slug related to hybrid page 46 */ 47 static public function getHybridPage($slug) 48 { 49 aTools::globalSetup(array('slug' => 'hybrid_'.$slug)); 50 51 return aTools::getCurrentPage(); 52 } 35 53 36 54 static public function cultureOrDefault($culture = false) … … 76 94 // and not get tripped up by the default routing rule which could 77 95 // match first if we wrote a/show 78 $routed_url = sfContext::getInstance()->getController()->genUrl('@a_page?slug=-PLACEHOLDER-', $absolute); 79 $routed_url = str_replace('-PLACEHOLDER-', $slug, $routed_url); 96 $routed_url = sfContext::getInstance()->getController()->genUrl('@a_page?slug='.$slug, $absolute); 97 98 // thomas : not require anymore 99 // $routed_url = str_replace('-PLACEHOLDER-', $slug, $routed_url); 100 80 101 // We tend to get double slashes because slugs begin with slashes 81 102 // and the routing engine wants to helpfully add one too. Fix that, -
plugins/apostrophePlugin/branches/contribute/rande/1.5/modules/a/templates/settingsSuccess.php
r3254 r3399 79 79 </div> 80 80 </div> 81 82 <div class="a-form-row"> 83 <h4><label><?php echo __('Hybrid Page', null, 'apostrophe') ?></label></h4> 84 <div class="<?php echo $stem ?>-hybrid-page"> 85 <?php echo $form['skip_on_url_match'] ?> 86 </div> 87 </div> 81 88 </div> 82 89

