Example #1
0
 public function init()
 {
     $this->links = array();
     $this->widget_types = array();
     $this->module_name = "widget";
     $this->module_position = 16;
     $this->version = 2.1;
     //2.1 - initial release
     if ($this->can_i('view', 'Widgets') && module_widget::is_plugin_enabled()) {
         // only display if a customer has been created.
         if (isset($_REQUEST['customer_id']) && $_REQUEST['customer_id'] && $_REQUEST['customer_id'] != 'new') {
             // how many widgets?
             $widgets = $this->get_widgets(array('customer_id' => $_REQUEST['customer_id']));
             $name = 'Widgets';
             if (count($widgets)) {
                 $name .= " <span class='menu_label'>" . count($widgets) . "</span> ";
             }
             $this->links[] = array("name" => $name, "p" => "widget_admin", 'args' => array('widget_id' => false), 'holder_module' => 'customer', 'holder_module_page' => 'customer_admin_open', 'menu_include_parent' => 0, 'icon_name' => 'globe');
         }
         $this->links[] = array("name" => 'Widgets', "p" => "widget_admin", 'args' => array('widget_id' => false), 'icon_name' => 'globe');
     }
 }