Example #1
0
/**
 * Initialize plugin
 */
function plugin_init_rackview()
{
    global $PLUGIN_HOOKS;
    Plugin::registerClass("PluginRackviewRack", array("addtabon" => rackview_get_supported_types()));
    $PLUGIN_HOOKS['change_profile']['rackview'] = 'plugin_change_profile_rackview';
    $PLUGIN_HOOKS['add_css']['rackview'] = array("css/cssTableGenerator.css", "css/rackview.css");
    $PLUGIN_HOOKS['item_purge']['rackview'] = array();
    foreach (rackview_get_supported_types() as $type) {
        $PLUGIN_HOOKS['item_purge']['rackview'][$type] = 'plugin_item_purge_rackview';
    }
    $PLUGIN_HOOKS['add_javascript']['rackview'] = 'js/rackview.js';
    if (Session::getLoginUserID()) {
        if (plugin_rackview_haveRight('rack', 'r')) {
            $PLUGIN_HOOKS['menu_entry']['rackview'] = 'index.php';
            $PLUGIN_HOOKS['submenu_entry']['rackview']['search'] = 'index.php';
            $PLUGIN_HOOKS['submenu_entry']['rackview']['summary'] = 'front/rackSummary.php';
        }
        if (plugin_rackview_haveRight('rack', 'w')) {
            $PLUGIN_HOOKS['submenu_entry']['rackview']['add'] = 'front/rack.form.php?new=1';
        }
    }
    $PLUGIN_HOOKS['use_massive_action']['rackview'] = 1;
    $PLUGIN_HOOKS['csrf_compliant']['rackview'] = true;
}
Example #2
0
-------------------------------------------------------------------------

LICENSE

This file is part of GLPI.

GLPI is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

GLPI is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with GLPI; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
--------------------------------------------------------------------------
*/
// ----------------------------------------------------------------------
// Original Author of file: Dennis Plöger <*****@*****.**>
// Purpose of file: Rack data display
// ----------------------------------------------------------------------
$NEEDED_ITEMS = array('search');
include '../../../inc/includes.php';
plugin_rackview_haveRight('rack', "r");
Html::header($LANG['plugin_rackview']['title'], 'plugins', 'rackview');
Search::show('PluginRackviewRack');
Html::footer();
Example #3
0
 function getTabNameForItem($item)
 {
     global $LANG;
     if (in_array($item->getType(), rackview_get_supported_types())) {
         if (!$item->getId()) {
             // Don't react on new objects
             return false;
         }
         if (!plugin_rackview_haveRight('object', 'r')) {
             // Security check
             return false;
         }
         return array(1 => $LANG['plugin_rackview']['title']);
     }
     return false;
 }