Changeset 479af905 in github
- Timestamp:
- Mar 7, 2012 5:07:57 AM (15 months ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.8
- Children:
- c388257
- Parents:
- 2f88b17
- Location:
- program/include
- Files:
-
- 2 edited
-
rcube_plugin.php (modified) (9 diffs)
-
rcube_plugin_api.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
program/include/rcube_plugin.php
r7fe3811 r479af905 82 82 $this->urlbase = $api->url . $this->ID . '/'; 83 83 } 84 84 85 85 /** 86 86 * Initialization method, needs to be implemented by the plugin itself … … 118 118 return false; 119 119 } 120 120 121 121 return true; 122 122 } … … 132 132 $this->api->register_hook($hook, $callback); 133 133 } 134 134 135 /** 136 * Unregister a callback function for a specific (server-side) hook. 137 * 138 * @param string $hook Hook name 139 * @param mixed $callback Callback function as string or array with object reference and method name 140 */ 141 public function remove_hook($hook, $callback) 142 { 143 $this->api->unregister_hook($hook, $callback); 144 } 145 135 146 /** 136 147 * Load localized texts from the plugins dir … … 142 153 { 143 154 $domain = $this->ID; 144 155 145 156 $lang = $_SESSION['language']; 146 157 $locdir = slashify(realpath(slashify($this->home) . $dir)); … … 168 179 $rcmail = rcmail::get_instance(); 169 180 $rcmail->load_language($lang, $add); 170 181 171 182 // add labels to client 172 183 if ($add2client) { … … 176 187 } 177 188 } 178 189 179 190 /** 180 191 * Wrapper for rcmail::gettext() adding the plugin ID as domain … … 246 257 $this->api->include_stylesheet($this->resource_url($fn)); 247 258 } 248 259 249 260 /** 250 261 * Append a button to a certain container … … 261 272 if ($p[$key]) 262 273 $p[$key] = $this->api->url . $this->resource_url($p[$key]); 263 274 264 275 $this->api->add_content($this->api->output->button($p), $container); 265 276 } 266 277 } 267 278 268 279 /** 269 280 * Generate an absolute URL to the given resource within the current … … 316 327 } 317 328 318 319 329 } 320 -
program/include/rcube_plugin_api.php
rb3ad480 r479af905 231 231 } 232 232 233 /** 234 * Allow a plugin object to unregister a callback. 235 * 236 * @param string $hook Hook name 237 * @param mixed $callback String with global function name or array($obj, 'methodname') 238 */ 239 public function unregister_hook($hook, $callback) 240 { 241 $callback_id = array_search($callback, $this->handlers[$hook]); 242 if ($callback_id !== false) { 243 unset($this->handlers[$hook][$callback_id]); 244 } 245 } 246 233 247 234 248 /**
Note: See TracChangeset
for help on using the changeset viewer.
