Posted By

brainwaves on 07/15/10


Tagged

textmate sidebar dynamic load widgets


Versions (?)

loadWidget


 / Published in: PHP
 

  1. function loadWidget($name, $order='', $side='right', $param=''){
  2. global $a, $widgetOrder, $widgets;
  3. switch ($name) {
  4. default:
  5. $functionName=$widgets[$name]['function'];
  6. if(!$param) $param=$widgets[$name]['param'];
  7. $a[$name]=$functionName($param);
  8. break;
  9. }
  10.  
  11. if($order) $widgetOrder[$side][$order]=$name;
  12. else $widgetOrder[$side][]=$name;
  13. }

Report this snippet  

You need to login to post a comment.