Changeset 2305 in subversion
- Timestamp:
- Feb 21, 2009 1:09:38 PM (4 years ago)
- Location:
- branches/devel-api/program/include
- Files:
-
- 2 edited
-
rcube_plugin.php (modified) (1 diff)
-
rcube_plugin_api.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/devel-api/program/include/rcube_plugin.php
r2289 r2305 152 152 $this->api->include_stylesheet($this->ressource_url($fn)); 153 153 } 154 155 /** 156 * Append a button to a certain container 157 * 158 * @param array Hash array with named parameters (as used in skin templates) 159 * @param string Container name where the buttons should be added to 160 * @see rcube_remplate::button() 161 */ 162 public function add_button($p, $container) 163 { 164 if ($this->api->output->type == 'html') { 165 // fix relative paths 166 foreach (array('imagepas', 'imageact', 'imagesel') as $key) 167 if ($p[$key]) 168 $p[$key] = $this->api->url . $this->ressource_url($p[$key]); 169 170 $this->api->add_content($this->api->output->button($p), $container); 171 } 172 } 154 173 155 174 /** -
branches/devel-api/program/include/rcube_plugin_api.php
r2289 r2305 31 31 public $dir; 32 32 public $url = 'plugins/'; 33 public $output; 33 34 34 35 private $handlers = array(); … … 37 38 private $actionmap = array(); 38 39 private $objectsmap = array(); 39 private $ output;40 private $template_contents = array(); 40 41 41 42 … … 103 104 } 104 105 106 // register an internal hook 107 $this->register_hook('template_container', array($this, 'template_container_hook')); 108 105 109 // maybe also register a shudown function which triggers shutdown functions of all plugin objects 106 110 } … … 223 227 224 228 /** 225 * Include a plugin stylesheet in the current HTML page229 * Include a plugin stylesheet in the current HTML page 226 230 */ 227 231 public function include_stylesheet($fn) … … 233 237 } 234 238 239 /** 240 * Save the given HTML content to be added to a template container 241 */ 242 public function add_content($html, $container) 243 { 244 console($html, $container); 245 $this->template_contents[$container] .= $html . "\n"; 246 } 247 248 /** 249 * Callback for template_container hooks 250 */ 251 private function template_container_hook($attrib) 252 { 253 $container = $attrib['name']; 254 return array('content' => $this->template_contents[$container]); 255 } 235 256 236 257 /**
Note: See TracChangeset
for help on using the changeset viewer.
