示例#1
0
 /**
  * Called after any type of action
  *
  * @param     string              $route      Which action is happening (install|uninstall|discover_install)
  * @param     jadapterinstance    $adapter    The object responsible for running this script
  *
  * @return    boolean                         True on success
  */
 public function postflight($route, JAdapterInstance $adapter)
 {
     if (strtolower($route) == 'install') {
         $element = $adapter->get('element');
         // Restore assets from backup
         PFInstallerHelper::restoreAssets($element);
         // Make the admin component menu item a child of com_projectfork
         PFInstallerHelper::setComponentMenuItem($element);
         // Create a menu item in the projectfork site menu
         $com = JComponentHelper::getComponent($element);
         $eid = is_object($com) && isset($com->id) ? $com->id : 0;
         if ($eid) {
             $item = array();
             $item['title'] = 'Time Tracking';
             $item['alias'] = 'timetracking';
             $item['link'] = 'index.php?option=' . $element . '&view=timesheet';
             $item['component_id'] = $eid;
             PFInstallerHelper::addMenuItem($item);
         }
     }
     if (strtolower($route) == 'update') {
         $element = $adapter->get('element');
         // Make the admin component menu item a child of com_projectfork
         PFInstallerHelper::setComponentMenuItem($element);
     }
     return true;
 }
示例#2
0
 /**
  * Called after any type of action
  *
  * @param     string              $route      Which action is happening (install|uninstall|discover_install)
  * @param     jadapterinstance    $adapter    The object responsible for running this script
  *
  * @return    boolean                         True on success
  */
 public function postflight($route, JAdapterInstance $adapter)
 {
     if (strtolower($route) == 'install') {
         $element = $adapter->get('element');
         // Restore assets from backup
         PFInstallerHelper::restoreAssets($element);
         // Make the admin component menu item a child of com_projectfork
         PFInstallerHelper::setComponentMenuItem($element);
     }
     if (strtolower($route) == 'update') {
         $element = $adapter->get('element');
         // Make the admin component menu item a child of com_projectfork
         PFInstallerHelper::setComponentMenuItem($element);
     }
     return true;
 }
示例#3
0
文件: script.php 项目: MrJookie/pm
 /**
  * Called after any type of action
  *
  * @param     string              $route      Which action is happening (install|uninstall|discover_install)
  * @param     jadapterinstance    $adapter    The object responsible for running this script
  *
  * @return    boolean                         True on success
  */
 public function postflight($route, JAdapterInstance $adapter)
 {
     if (strtolower($route) == 'install') {
         $element = $adapter->get('element');
         // Restore assets from backup
         PFInstallerHelper::restoreAssets($element);
         // Make the admin component menu item a child of com_projectfork
         PFInstallerHelper::setComponentMenuItem($element);
         // Create a menu item in the projectfork site menu
         $com = JComponentHelper::getComponent($element);
         $eid = is_object($com) && isset($com->id) ? $com->id : 0;
         if ($eid) {
             $item = array();
             $item['title'] = 'Designs';
             $item['alias'] = 'designs';
             $item['link'] = 'index.php?option=' . $element . '&view=designs';
             $item['component_id'] = $eid;
             PFInstallerHelper::addMenuItem($item);
         }
     }
     if (strtolower($route) == 'update') {
         $element = $adapter->get('element');
         // Make the admin component menu item a child of com_projectfork
         PFInstallerHelper::setComponentMenuItem($element);
         // Delete duplicate top-level admin menu entry if it exists
         $db = JFactory::getDbo();
         $query = $db->getQuery(true);
         $query->select('id')->from('#__menu')->where('level = 1')->where('menutype = ' . $db->quote('main'))->where('link = "index.php?option=' . $element . '&view=designs"');
         $db->setQuery($query);
         $item_id = (int) $db->loadResult();
         if ($item_id) {
             $menu = JTable::getInstance('menu');
             $menu->delete($item_id);
         }
     }
     if (in_array(strtolower($route), array('install', 'update'))) {
         $this->installPlugins($adapter);
     }
     return true;
 }