예제 #1
0
 public function loadPageResponsiveScript($_module)
 {
     global $lC_Vqmod;
     if (file_exists('includes/applications/' . $_module . '/js/responsive.js.php')) {
         include $lC_Vqmod->modCheck('includes/applications/' . $_module . '/js/responsive.js.php');
     } else {
         if (lC_Addons_Admin::hasAdminModulePageResponsiveScript($_module)) {
             include $lC_Vqmod->modCheck(lC_Addons_Admin::getAdminModulePageResponsiveScriptPath($_module));
         }
     }
     return true;
 }
 public function uninstall($class)
 {
     global $lC_Vqmod;
     $result = array();
     if (file_exists('includes/modules/product_attributes/' . $class . '.php')) {
         include $lC_Vqmod->modCheck('includes/modules/product_attributes/' . $class . '.php');
         if (class_exists('lC_ProductAttributes_' . $class)) {
             $module = 'lC_ProductAttributes_' . $class;
             $module = new $module();
             if ($module->removeModule($module->getID(), $module->getCode())) {
             } else {
                 $result['rpcStatus'] = -1;
             }
         }
     } else {
         $result = lC_Addons_Admin::uninstallAdminAddonsProductAttributesModule($class);
     }
     lC_Cache::clear('addons');
     lC_Cache::clear('vqmoda');
     return $result;
 }
예제 #3
0
 public static function getProductAttributeModules($section = '')
 {
     global $lC_Database, $lC_Language, $_module;
     $aInfo = new lC_ObjectInfo(lC_Products_Admin::get($_GET[$_module]));
     $attributes = $aInfo->get('attributes');
     $attributes2 = $aInfo->get('attributes2');
     $output = '';
     $Qattributes = $lC_Database->query('select id, code from :table_templates_boxes where modules_group = :modules_group order by code desc');
     $Qattributes->bindTable(':table_templates_boxes');
     $Qattributes->bindValue(':modules_group', 'product_attributes');
     $Qattributes->execute();
     while ($Qattributes->next()) {
         $module = basename($Qattributes->value('code'));
         if (!class_exists('lC_ProductAttributes_' . $module)) {
             if (file_exists(DIR_FS_ADMIN . 'includes/modules/product_attributes/' . $module . '.php')) {
                 include DIR_FS_ADMIN . 'includes/modules/product_attributes/' . $module . '.php';
             } else {
                 if (lC_Addons_Admin::hasAdminAddonsProductAttributesModule($module)) {
                     include lC_Addons_Admin::getAdminAddonsProductAttributesModulePath($module);
                 }
             }
         }
         if (class_exists('lC_ProductAttributes_' . $module)) {
             $module = 'lC_ProductAttributes_' . $module;
             $module = new $module();
             if ($module->getSection() == $section) {
                 if (file_exists(DIR_FS_ADMIN . 'includes/languages/' . $lC_Language->getCode() . '/modules/product_attributes/' . $module->getCode() . '.php')) {
                     $lC_Language->loadIniFile('/modules/product_attributes/' . $module->getCode() . '.php');
                 } else {
                     lC_Addons_Admin::loadAdminAddonsProductAttributesDefinitions($module->getCode());
                 }
                 // added for value2 support
                 $value2 = isset($attributes2[$Qattributes->valueInt('id')]) && $attributes2[$Qattributes->valueInt('id')] != null ? $attributes2[$Qattributes->valueInt('id')] : '';
                 $output .= '<div class="new-row-mobile six-columns six-columns-tablet twelve-columns-mobile no-margin-bottom">
                     <div class="twelve-columns strong mid-margin-bottom">
                       <span>' . $lC_Language->get('product_attributes_' . $module->getCode() . '_title') . '</span>' . lc_show_info_bubble($lC_Language->get('info_bubble_attributes_' . $module->getCode() . '_text'), null, 'info-spot on-left grey float-right mid-margin-bottom') . '
                     </div>
                     <div class="twelve-columns product-module-content margin-bottom">
                       ' . $module->setFunction(isset($attributes[$Qattributes->valueInt('id')]) ? $attributes[$Qattributes->valueInt('id')] : null, $value2) . '
                     </div>
                   </div>';
             }
         }
     }
     return $output;
 }
예제 #4
0
  </div>
    
  <?php 
if ($lC_Template->hasPageWrapper()) {
    ?>
    <!-- Button to open/hide menu -->
    <a href="#" id="open-menu" class="open-menu-margin"><span>Menu</span></a>

    <!-- Button to open/hide shortcuts -->
    <a href="#" id="open-shortcuts"><span class="icon-thumbs"></span></a>
    <?php 
}
// load the main content
if ($lC_Template->isAuthorized($lC_Template->getModule())) {
    if (lC_Addons_Admin::hasAdminPage($lC_Template->getModule(), $lC_Template->getPageContentsFilename())) {
        require $lC_Vqmod->modCheck(lC_Addons_Admin::getAdminPage($lC_Template->getModule(), $lC_Template->getPageContentsFilename()));
    } else {
        require $lC_Vqmod->modCheck('includes/applications/' . $lC_Template->getModule() . '/pages/' . $lC_Template->getPageContentsFilename());
    }
} else {
    // not authorized to view
    require $lC_Vqmod->modCheck(DIR_FS_ADMIN . 'includes/applications/error_pages/pages/main.php');
}
if ($lC_Template->hasPageWrapper()) {
    ?>
    <!-- Side tabs shortcuts -->
    <ul id="shortcuts" role="complementary" class="children-tooltip tooltip-right" style="z-index:2;">
      <li id="sc-dashboard" class="current"><a href="./index.php" class="shortcut-dashboard" title="<?php 
    echo $lC_Language->get('icon_dashboard');
    ?>
"><?php 
예제 #5
0
 public function hasAccess($module = null)
 {
     if (empty($module)) {
         $module = $this->_module;
     }
     if ($_SESSION['moduleType'] == 'addon') {
         return lC_Addons_Admin::hasAccess($module);
     } else {
         return !@file_exists('includes/modules/access/' . $module . '.php') || @array_key_exists($module, $_SESSION['admin']['access']) || (int) $_SESSION['admin']['access'][$module] >= 1;
     }
 }
예제 #6
0
  @version    $Id: index.php v1.0 2013-08-08 datazen $
*/
require 'includes/application_top.php';
require_once $lC_Vqmod->modCheck('includes/classes/template.php');
$_SESSION['module'] = 'index';
$_SESSION['moduleType'] = 'core';
if (!empty($_GET)) {
    $first_array = array_slice($_GET, 0, 1);
    $_module = lc_sanitize_string(basename(key($first_array)));
    if (file_exists('includes/applications/' . $_module . '/' . $_module . '.php')) {
        $_SESSION['module'] = $_module;
        $_SESSION['moduleType'] = 'core';
    } else {
        if (lC_Addons_Admin::hasAdminModule($_module)) {
            $_SESSION['module'] = $_module;
            $_SESSION['moduleType'] = 'addon';
        }
    }
}
if ($_SESSION['moduleType'] == 'addon') {
    $lC_Language->loadIniFile(lC_Addons_Admin::getAdminLanguageDefinitionsPath($_SESSION['module']), null, null, true);
    require $lC_Vqmod->modCheck(lC_Addons_Admin::getAdminModule($_SESSION['module']));
} else {
    $lC_Language->loadIniFile($_SESSION['module'] . '.php');
    require $lC_Vqmod->modCheck('includes/applications/' . $_SESSION['module'] . '/' . $_SESSION['module'] . '.php');
}
$lC_Template = lC_Template_Admin::setup($_SESSION['module']);
$lC_Template->set('default');
define(DIR_WS_TEMPLATE_IMAGES, HTTPS_SERVER . DIR_WS_HTTPS_CATALOG . DIR_WS_ADMIN . 'templates/default/images/');
require $lC_Vqmod->modCheck('templates/default.php');
require $lC_Vqmod->modCheck('includes/application_bottom.php');
예제 #7
0
 private static function _init()
 {
     global $lC_Vqmod, $lC_Language, $lC_Database;
     $lC_DirectoryListing = new lC_DirectoryListing(DIR_FS_CATALOG . 'addons');
     $lC_DirectoryListing->setRecursive(true);
     $lC_DirectoryListing->setIncludeDirectories(false);
     $lC_DirectoryListing->setCheckExtension('php');
     $lC_DirectoryListing->setStats(true);
     $enabled = '';
     foreach ($lC_DirectoryListing->getFiles() as $addon) {
         $ao = utility::cleanArr($addon);
         if ($ao['name'] != 'controller.php') {
             continue;
         }
         $nameArr = explode('/', $ao['path']);
         $class = $nameArr[count($nameArr) - 2];
         if (file_exists($ao['path'])) {
             include_once $lC_Vqmod->modCheck($ao['path']);
             $aoData = new $class();
             if ($aoData->isAutoInstall()) {
                 if (defined('ADDONS_' . strtoupper($aoData->getAddonType()) . '_' . strtoupper($class) . '_STATUS')) {
                     $isInstalled = $aoData->isInstalled();
                     $isEnabled = $aoData->isEnabled();
                 } else {
                     if (class_exists('lC_Store_Admin')) {
                     } else {
                         include_once $lC_Vqmod->modCheck('includes/applications/store/classes/store.php');
                     }
                     lC_Store_Admin::install($class);
                     $isInstalled = true;
                     $isEnabled = true;
                 }
             } else {
                 $isInstalled = $aoData->isInstalled();
                 $isEnabled = $aoData->isEnabled();
             }
             // language definitions
             if (file_exists(DIR_FS_CATALOG . 'addons/' . $class . '/languages/' . $lC_Language->getCode() . '.xml')) {
                 $lC_Language->injectAddonDefinitions(DIR_FS_CATALOG . 'addons/' . $class . '/languages/' . $lC_Language->getCode() . '.xml', $lC_Language->getCode());
             }
             $_SESSION['lC_Addons_Admin_data'][$class] = array('type' => $aoData->getAddonType(), 'title' => strpos($aoData->getAddonTitle(), '_') > 0 ? $lC_Language->get($aoData->getAddonTitle()) : $aoData->getAddonTitle(), 'description' => strpos($aoData->getAddonDescription(), '_') > 0 ? $lC_Language->get($aoData->getAddonDescription()) : $aoData->getAddonDescription(), 'rating' => $aoData->getAddonRating(), 'author' => $aoData->getAddonAuthor(), 'authorWWW' => $aoData->getAddonAuthorWWW(), 'thumbnail' => $aoData->getAddonThumbnail(), 'version' => $aoData->getAddonVersion(), 'compatibility' => $aoData->getCompatibility(), 'installed' => $isInstalled, 'mobile' => $aoData->isMobileEnabled(), 'auto_install' => $aoData->isAutoInstall(), 'enabled' => $isEnabled);
             if ($isEnabled) {
                 $enabled .= $addon['path'] . ';';
             }
             if ($aoData->isAutoInstall() === true) {
                 self::_autoInstall($class);
             }
         }
     }
     if ($enabled != '') {
         $enabled = substr($enabled, 0, -1);
     }
     if (!file_exists(DIR_FS_WORK . 'cache/addons.cache')) {
         file_put_contents(DIR_FS_WORK . 'cache/addons.cache', serialize($enabled));
     }
     self::$_data = $_SESSION['lC_Addons_Admin_data'];
     // cleanup
     $Qchk = $lC_Database->query("select * from :table_templates_boxes where modules_group LIKE '%|%'");
     $Qchk->bindTable(':table_templates_boxes', TABLE_TEMPLATES_BOXES);
     $Qchk->execute();
     while ($Qchk->next()) {
         $parts = explode('|', $Qchk->value('modules_group'));
         $type = $parts[0];
         $addon = $parts[1];
         if (!file_exists(DIR_FS_CATALOG . 'addons/' . $addon . '/controller.php')) {
             $Qdel = $lC_Database->query('delete from :table_templates_boxes where modules_group = :modules_group');
             $Qdel->bindTable(':table_templates_boxes', TABLE_TEMPLATES_BOXES);
             $Qdel->bindValue(':modules_group', $Qchk->value('modules_group'));
             $Qdel->execute();
         }
     }
     $Qchk->freeResult();
 }