Changeset 4665
- Timestamp:
- 07/18/07 18:04:25 (6 years ago)
- Files:
-
- plugins/sfSimpleCMSPlugin/README (modified) (3 diffs)
- plugins/sfSimpleCMSPlugin/lib/helper/sfSimpleCMSBasicSlotTypesHelper.php (modified) (4 diffs)
- plugins/sfSimpleCMSPlugin/package.xml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/sfSimpleCMSPlugin/README
r4663 r4665 125 125 RichText: Rich text 126 126 Php: PHP code 127 Modular: List of components 127 128 }}} 128 129 … … 182 183 * Refactor the `sfSimpleCMS` action code to make it DRYier (use mixins?) 183 184 * Add a validator for the slug 184 * Ability to use a list of components as the value of a slot185 185 * Better integration with sfGuard 186 186 * Search engine … … 191 191 === Trunk === 192 192 193 === 2007-07-18 | 0.6.2 Beta === 194 195 * francois: Added the ability to use a list of components as the value of a slot 193 196 * francois: Fixed problem with encoded placeholder on certain configurations 194 197 * francois: Fixed problem when using SQLite in sfSimpleCMSAdmin module plugins/sfSimpleCMSPlugin/lib/helper/sfSimpleCMSBasicSlotTypesHelper.php
r4660 r4665 1 1 <?php 2 2 3 /** 4 * Returns the value of a simple text slot. To be used by the sfSimpleCMSHelper. 5 * The slot must contain text, and is fimply formatted in HTML 6 * By transforming carriage returns into <br/> and URLs into hyperlinks. 7 * Example: 8 * <code> 9 * // If the slot value is 10 * Hello, world. 11 * My address is http://www.example.com 12 * // Then the helper will return 13 * Hello, world.<br /> 14 * My address is <a href='http://www.example.com'>http://www.example.com</a> 15 * </code> 16 * 17 * @param string $page the page object 18 * @param string $slot slot name 19 * @return slot value 20 */ 3 21 function getTextSlotValue($page, $slot) 4 22 { … … 12 30 } 13 31 32 /** 33 * Returns the value of a rich text slot. To be used by the sfSimpleCMSHelper. 34 * The slot must contain valid HTML code. 35 * Example: 36 * <code> 37 * // If the slot value is 38 * Hello, <b>world</b>! 39 * // Then the helper will return 40 * Hello, <b>world</b>! 41 * </code> 42 * 43 * @param string $page the page object 44 * @param string $slot slot name 45 * @return slot value 46 */ 14 47 function getRichTextSlotValue($page, $slot) 15 48 { … … 30 63 } 31 64 65 /** 66 * Returns the value of a PHP slot. To be used by the sfSimpleCMSHelper. 67 * The slot must contain valid HTML with embedded PHP tags 68 * Example: 69 * <code> 70 * // If the slot value is 71 * Hello, <?php echo 'world' ?>! 72 * // Then the helper will return 73 * Hello, world! 74 * </code> 75 * 76 * @param string $page the page object 77 * @param string $slot slot name 78 * @return slot value 79 */ 32 80 function getPHPSlotValue($page, $slot) 33 81 { … … 41 89 return textarea_tag('slot_content', $page->getByName($slot), 'size=80x10 id=edit_textarea'. $slot .' style=width:100% class=code'); 42 90 } 91 92 /** 93 * Returns the value of a modular slot. To be used by the sfSimpleCMSHelper. 94 * The slot must contain a valid list of components in YAML format 95 * Example: 96 * <code> 97 * // If the slot value is 98 * mycomponent: 99 * component: mymodule/myaction 100 * foo: bar 101 * // Then the helper will return the result of a call to 102 * get_component('mymodule', 'myaction', array('foo' => 'bar')); 103 * </code> 104 * 105 * @param string $page the page object 106 * @param string $slot slot name 107 * @return slot value 108 */ 109 function getModularSlotValue($page, $slot) 110 { 111 sfLoader::loadHelpers(array('Partial')); 112 $components = sfYaml::load($page->getByName($slot)); 113 $res = ''; 114 foreach($components as $name => $params) 115 { 116 list($module, $action) = split('/', $params['component']); 117 unset($params['component']); 118 $res .= get_component($module, $action, $params); 119 } 120 121 return $res; 122 } 123 124 function getModularSlotEditor($page, $slot) 125 { 126 return textarea_tag('slot_content', $page->getByName($slot), 'size=80x10 id=edit_textarea'. $slot .' style=width:100% class=modular'); 127 } plugins/sfSimpleCMSPlugin/package.xml
r4652 r4665 26 26 <date>2007-07-18</date> 27 27 <version> 28 <release>0.6. 1</release>28 <release>0.6.2</release> 29 29 <api>0.6.0</api> 30 30 </version>