Exemple #1
0
 /**
  * Module constructor
  *
  * @param vivvo_site 	$site_manager
  * @param array 		$params
  * @param template		$parent_template
  * @param bool 			$cache
  * @param bool			$output
  */
 public function __construct($site_manager, $params, $parent_template = NULL, $cache = true, $output = true)
 {
     if (self::$hooks === false) {
         self::$hooks = array();
         $hooks = $site_manager->get_configuration()->get_configuration_property_list('ui_hooks');
         foreach ($hooks as $name => $hook) {
             if (!isset(self::$hooks[$hook_name = $hook['hook']])) {
                 self::$hooks[$hook_name] = array();
             }
             if (is_array($hook_params = @unserialize($hook['params']))) {
                 $handler = false;
                 if (is_array($handler = @unserialize($hook['handler'])) and !empty($handler['file']) and !empty($handler['function'])) {
                     $handler['loaded'] = false;
                     if (empty($handler['params'])) {
                         $handler['params'] = array();
                     }
                 } else {
                     $handler = false;
                 }
             }
             $hook = array('name' => $name, 'params' => $hook_params);
             if ($handler) {
                 $hook['handler'] = $handler;
             }
             self::$hooks[$hook_name][] = $hook;
         }
     }
     $this->module($site_manager, $params, $parent_template, $cache, $output);
 }
Exemple #2
0
 /**
  * Uninstall Plugin
  *
  * @param vivvo_site 	$site_manager
  * @param integer		$step
  */
 function uninstall(&$site_manager, $step = 1)
 {
     $template = $site_manager->get_template();
     $template->assign('PLUGIN_ROOT', $this->get_root_dir());
     $template->assign('PLUG_IN_HREF', $this->plugin_name);
     $content_template = new template(null, $template);
     if ($step == 2) {
         $content_template->set_template_file(VIVVO_FS_INSTALL_ROOT . VIVVO_FS_ADMIN_DIR . 'templates/plugins/uninstall/step_2.xml');
     } else {
         $content_template->set_template_file(VIVVO_FS_INSTALL_ROOT . VIVVO_FS_ADMIN_DIR . 'templates/plugins/uninstall/step_1.xml');
     }
     $template->assign('content', $content_template->get_output());
     $template->assign('step', strval($step));
     $search_template = new template(null, $template);
     $search_template->set_template_file(VIVVO_FS_INSTALL_ROOT . VIVVO_FS_ADMIN_DIR . 'templates/plugins/uninstall/tabs.xml');
     $template->assign('left', $search_template->get_output());
 }