static function setAdminMenuImages()
 {
     global $database, $path;
     $id = DMInstallHelper::getComponentId();
     if (version_compare(JVERSION, "1.6.0", "lt")) {
         // Main menu
         $database->setQuery("UPDATE #__components SET admin_menu_img = '" . $path . "dm_component_16.png' WHERE id=" . $id);
         $database->query();
         // Submenus
         $submenus = array();
         $submenus[] = array('image' => 'class:module', 'title' => 'Books');
         $submenus[] = array('image' => 'class:dm_credits', 'title' => 'Categories');
         $submenus[] = array('image' => 'class:move', 'title' => 'Lend Requests');
         $submenus[] = array('image' => 'class:download', 'title' => 'Import/Export');
         $submenus[] = array('image' => 'class:config', 'title' => 'Settings Frontend');
         $submenus[] = array('image' => 'class:config', 'title' => 'Settings Backend');
         $submenus[] = array('image' => 'class:info', 'title' => 'About');
         foreach ($submenus as $submenu) {
             $database->setQuery("UPDATE #__components SET admin_menu_img = '" . $submenu['image'] . "' WHERE parent={$id} AND name = '" . $submenu['title'] . "';");
             $database->query();
         }
     } else {
         if (version_compare(JVERSION, "1.6.0", "ge") && version_compare(JVERSION, "3.5.0", "lt")) {
             $parent_id = DMInstallHelper::getParentId();
             // Main menu
             $database->setQuery("UPDATE #__menu SET img = 'class:dm_component' WHERE title='Book Library' and level=1 and parent_id=1 and component_id={$id}");
             $database->query();
             // Submenus
             $submenus = array();
             $submenus[] = array('img' => 'class:dm_component', 'title' => 'Book Library', 'alias' => 'Book Library');
             $submenus[] = array('img' => 'class:module', 'title' => 'Books', 'alias' => 'Books');
             $submenus[] = array('img' => 'class:dm_credits', 'title' => 'Categories', 'alias' => 'Categories');
             $submenus[] = array('img' => 'class:move', 'title' => 'Lend Requests', 'alias' => 'Lend Requests');
             $submenus[] = array('img' => 'class:writemess', 'title' => 'Language Manager', 'alias' => 'Language Manager');
             $submenus[] = array('img' => 'class:download', 'title' => 'Import/Export', 'alias' => 'Import/Export');
             $submenus[] = array('img' => 'class:config', 'title' => 'Settings Frontend', 'alias' => 'Settings Frontend');
             $submenus[] = array('img' => 'class:config', 'title' => 'Settings Backend', 'alias' => 'Settings Backend');
             $submenus[] = array('img' => 'class:info', 'title' => 'About', 'alias' => 'About');
             foreach ($submenus as $submenu) {
                 $database->setQuery("UPDATE #__menu SET img = '" . $submenu['img'] . "' WHERE component_id={$id} AND parent_id = '" . $parent_id . "' and level=2  AND title = '" . $submenu['title'] . "';");
                 $database->query();
                 $database->setQuery("UPDATE #__menu SET alias = '" . $submenu['alias'] . "'" . "\n WHERE component_id={$id} AND title = '" . $submenu['title'] . "';");
                 $database->query();
             }
         } else {
             echo "Sanity test. Error version check!";
             exit;
         }
     }
 }
예제 #2
0
 function setAdminMenuImages()
 {
     global $database;
     $id = DMInstallHelper::getComponentId();
     // Main mennu
     $database->setQuery("UPDATE #__components SET admin_menu_img = '" . _DM_INSTALLER_ICONPATH . "dm_documents_16.png' WHERE id={$id}");
     $database->query();
     // Submenus
     $submenus = array();
     $submenus[] = array('image' => _DM_INSTALLER_ICONPATH . 'dm_cpanel_16.png', 'name' => 'Home');
     $submenus[] = array('image' => _DM_INSTALLER_ICONPATH . 'dm_files_16.png', 'name' => 'Files');
     $submenus[] = array('image' => _DM_INSTALLER_ICONPATH . 'dm_documents_16.png', 'name' => 'Documents');
     $submenus[] = array('image' => _DM_INSTALLER_ICONPATH . 'dm_categories_16.png', 'name' => 'Categories');
     $submenus[] = array('image' => _DM_INSTALLER_ICONPATH . 'dm_groups_16.png', 'name' => 'Groups');
     $submenus[] = array('image' => _DM_INSTALLER_ICONPATH . 'dm_licenses_16.png', 'name' => 'Licenses');
     $submenus[] = array('image' => _DM_INSTALLER_ICONPATH . 'dm_stats_16.png', 'name' => 'Statistics');
     $submenus[] = array('image' => _DM_INSTALLER_ICONPATH . 'dm_logs_16.png', 'name' => 'Download Logs');
     $submenus[] = array('image' => _DM_INSTALLER_ICONPATH . 'dm_config_16.png', 'name' => 'Configuration');
     $submenus[] = array('image' => _DM_INSTALLER_ICONPATH . 'dm_templates_16.png', 'name' => 'Themes');
     foreach ($submenus as $submenu) {
         $database->setQuery("UPDATE #__components SET admin_menu_img = '" . $submenu['image'] . "'" . "\n WHERE parent={$id} AND name = '" . $submenu['name'] . "';");
         $database->query();
     }
 }