예제 #1
0
 /**
  * Initialize the content element
  * @param object
  */
 public function __construct($objElement)
 {
     parent::__construct($objElement);
     if (TL_MODE == 'FE') {
         // Load Isotope javascript and css
         $GLOBALS['TL_JAVASCRIPT'][] = \Haste\Util\Debug::uncompressedFile('system/modules/isotope/assets/js/isotope.min.js');
         $GLOBALS['TL_CSS'][] = \Haste\Util\Debug::uncompressedFile('system/modules/isotope/assets/css/isotope.min.css');
     }
 }
예제 #2
0
 /**
  * Initialize the content element
  * @param object
  */
 public function __construct($objElement)
 {
     parent::__construct($objElement);
     // Load Isotope JavaScript and style sheet
     if (TL_MODE == 'FE') {
         $version = RepositoryVersion::encode(Isotope::VERSION);
         $GLOBALS['TL_JAVASCRIPT'][] = Debug::uncompressedFile('system/modules/isotope/assets/js/isotope.min.js|static|' . $version);
         $GLOBALS['TL_CSS'][] = Debug::uncompressedFile('system/modules/isotope/assets/css/isotope.min.css|screen|static|' . $version);
     }
 }
예제 #3
0
파일: Callback.php 프로젝트: Aziz-JH/core
 /**
  * Generate the order details view when editing an order
  * @param   object
  * @param   string
  * @return  string
  */
 public function generateOrderDetails($dc)
 {
     $objOrder = \Database::getInstance()->execute("SELECT * FROM tl_iso_product_collection WHERE id=" . $dc->id);
     if (!$objOrder->numRows) {
         \Controller::redirect('contao/main.php?act=error');
     }
     $GLOBALS['TL_CSS'][] = \Haste\Util\Debug::uncompressedFile('system/modules/isotope/assets/css/print.min.css|print');
     // Generate a regular order details module
     \Input::setGet('uid', $objOrder->uniqid);
     $objModule = new \Isotope\Module\OrderDetails(\Database::getInstance()->execute("SELECT * FROM tl_module WHERE type='iso_orderdetails'"));
     return Haste::getInstance()->call('replaceInsertTags', $objModule->generate(true));
 }
예제 #4
0
파일: Callback.php 프로젝트: rpquadrat/core
 /**
  * Generate the order details view when editing an order
  *
  * @param object $dc
  *
  * @return string
  */
 public function generateOrderDetails($dc)
 {
     $objOrder = Order::findByPk($dc->id);
     if ($objOrder === null) {
         return '';
     }
     $GLOBALS['TL_CSS'][] = Debug::uncompressedFile('system/modules/isotope/assets/css/print.min.css|print');
     // Try to find a order details module or create a dummy FE module model
     if (($objModuleModel = \ModuleModel::findOneBy('type', 'iso_orderdetails')) === null) {
         $objModuleModel = new \ModuleModel();
         $objModuleModel->type = 'iso_orderdetails';
         $objModuleModel->iso_collectionTpl = 'iso_collection_default';
     }
     // Generate a regular order details module
     \Input::setGet('uid', $objOrder->uniqid);
     $objModule = new OrderDetails($objModuleModel);
     return Haste::getInstance()->call('replaceInsertTags', $objModule->generate(true));
 }
예제 #5
0
파일: Module.php 프로젝트: Aziz-JH/core
 /**
  * Load libraries and scripts
  * @param object
  * @param string
  * @return void
  */
 public function __construct($objModule, $strColumn = 'main')
 {
     parent::__construct($objModule, $strColumn);
     Isotope::initialize();
     if (TL_MODE == 'FE') {
         // Load Isotope javascript and css
         $GLOBALS['TL_JAVASCRIPT'][] = \Haste\Util\Debug::uncompressedFile('system/modules/isotope/assets/js/isotope.min.js');
         $GLOBALS['TL_CSS'][] = \Haste\Util\Debug::uncompressedFile('system/modules/isotope/assets/css/isotope.min.css');
         // Disable caching for pages with certain modules (eg. Cart)
         if ($this->blnDisableCache) {
             try {
                 global $objPage;
                 $objPage->cache = 0;
             } catch (\Exception $e) {
             }
         }
     }
 }
예제 #6
0
 /**
  * Load libraries and scripts
  *
  * @param \ModuleModel $objModule
  * @param string $strColumn
  */
 public function __construct($objModule, $strColumn = 'main')
 {
     parent::__construct($objModule, $strColumn);
     if ($this->iso_list_where != '') {
         $this->iso_list_where = Haste::getInstance()->call('replaceInsertTags', $this->iso_list_where);
     }
     $this->iso_buttons = deserialize($this->iso_buttons);
     if (!is_array($this->iso_buttons)) {
         $this->iso_buttons = array();
     }
     Isotope::initialize();
     // Load Isotope JavaScript and style sheet
     if (TL_MODE == 'FE') {
         $version = RepositoryVersion::encode(Isotope::VERSION);
         $GLOBALS['TL_JAVASCRIPT'][] = Debug::uncompressedFile('system/modules/isotope/assets/js/isotope.min.js|static|' . $version);
         $GLOBALS['TL_CSS'][] = Debug::uncompressedFile('system/modules/isotope/assets/css/isotope.min.css|screen|static|' . $version);
         // Disable caching for pages with certain modules (eg. Cart)
         if ($this->blnDisableCache) {
             global $objPage;
             $objPage->cache = 0;
         }
     }
 }
예제 #7
0
파일: config.php 프로젝트: Aziz-JH/core
 * Copyright (C) 2009-2014 terminal42 gmbh & Isotope eCommerce Workgroup
 *
 * @package    Isotope
 * @link       http://isotopeecommerce.org
 * @license    http://opensource.org/licenses/lgpl-3.0.html
 */
/**
 * Backend modules
 */
if (!is_array($GLOBALS['BE_MOD']['isotope'])) {
    array_insert($GLOBALS['BE_MOD'], 1, array('isotope' => array()));
}
array_insert($GLOBALS['BE_MOD']['isotope'], 0, array('iso_products' => array('tables' => array(\Isotope\Model\Product::getTable(), \Isotope\Model\Group::getTable(), \Isotope\Model\ProductCategory::getTable(), \Isotope\Model\Download::getTable(), \Isotope\Model\RelatedProduct::getTable(), \Isotope\Model\ProductPrice::getTable(), 'tl_iso_product_pricetier'), 'icon' => 'system/modules/isotope/assets/images/store-open.png', 'javascript' => \Haste\Util\Debug::uncompressedFile('system/modules/isotope/assets/js/backend.min.js'), 'generate' => array('Isotope\\Backend\\Product\\VariantGenerator', 'generate'), 'import' => array('Isotope\\Backend\\Product\\AssetImport', 'generate')), 'iso_orders' => array('tables' => array(\Isotope\Model\ProductCollection::getTable(), \Isotope\Model\ProductCollectionItem::getTable(), \Isotope\Model\ProductCollectionSurcharge::getTable(), \Isotope\Model\ProductCollectionDownload::getTable(), \Isotope\Model\Address::getTable()), 'icon' => 'system/modules/isotope/assets/images/shopping-basket.png', 'javascript' => \Haste\Util\Debug::uncompressedFile('system/modules/isotope/assets/js/backend.min.js'), 'print_document' => array('Isotope\\Backend\\ProductCollection\\Callback', 'printDocument'), 'payment' => array('Isotope\\Backend\\ProductCollection\\Callback', 'paymentInterface'), 'shipping' => array('Isotope\\Backend\\ProductCollection\\Callback', 'shippingInterface')), 'iso_setup' => array('callback' => 'Isotope\\BackendModule\\Setup', 'tables' => array(), 'icon' => 'system/modules/isotope/assets/images/application-monitor.png', 'javascript' => \Haste\Util\Debug::uncompressedFile('system/modules/isotope/assets/js/backend.min.js'))));
$GLOBALS['BE_MOD']['accounts']['member']['tables'][] = \Isotope\Model\Address::getTable();
if (TL_MODE == 'BE') {
    $GLOBALS['TL_CSS'][] = \Haste\Util\Debug::uncompressedFile('system/modules/isotope/assets/css/backend.min.css');
}
/**
 * Isotope Modules
 */
$GLOBALS['ISO_MOD'] = array('product' => array('producttypes' => array('tables' => array(\Isotope\Model\ProductType::getTable()), 'icon' => 'system/modules/isotope/assets/images/setup-producttypes.png'), 'attributes' => array('tables' => array(\Isotope\Model\Attribute::getTable()), 'icon' => 'system/modules/isotope/assets/images/setup-attributes.png'), 'related_categories' => array('tables' => array(\Isotope\Model\RelatedCategory::getTable()), 'icon' => 'system/modules/isotope/assets/images/setup-related_categories.png'), 'baseprice' => array('tables' => array(\Isotope\Model\BasePrice::getTable()), 'icon' => 'system/modules/isotope/assets/images/setup-baseprice.png')), 'checkout' => array('payment' => array('tables' => array(\Isotope\Model\Payment::getTable()), 'icon' => 'system/modules/isotope/assets/images/setup-payment.png'), 'shipping' => array('tables' => array(\Isotope\Model\Shipping::getTable()), 'icon' => 'system/modules/isotope/assets/images/setup-shipping.png'), 'tax_class' => array('tables' => array(\Isotope\Model\TaxClass::getTable()), 'icon' => 'system/modules/isotope/assets/images/setup-tax_class.png'), 'tax_rate' => array('tables' => array(\Isotope\Model\TaxRate::getTable()), 'icon' => 'system/modules/isotope/assets/images/setup-tax_rate.png')), 'config' => array('configs' => array('tables' => array(\Isotope\Model\Config::getTable()), 'icon' => 'system/modules/isotope/assets/images/setup-config.png'), 'orderstatus' => array('tables' => array(\Isotope\Model\OrderStatus::getTable()), 'icon' => 'system/modules/isotope/assets/images/setup-orderstatus.png'), 'notifications' => array('icon' => 'system/modules/isotope/assets/images/setup-notifications.png', 'redirect' => 'contao/main.php?do=nc_notifications'), 'documents' => array('tables' => array(\Isotope\Model\Document::getTable()), 'icon' => 'system/modules/isotope/assets/images/setup-documents.png'), 'gallery' => array('tables' => array(\Isotope\Model\Gallery::getTable()), 'icon' => 'system/modules/isotope/assets/images/setup-gallery.png')), 'miscellaneous:hide' => array('labels' => array('tables' => array(\Isotope\Model\Label::getTable()), 'icon' => 'system/modules/isotope/assets/images/setup-labels.png')));
// Enable tables in iso_setup
if ($_GET['do'] == 'iso_setup') {
    foreach ($GLOBALS['ISO_MOD'] as $strGroup => $arrModules) {
        foreach ($arrModules as $strModule => $arrConfig) {
            if (is_array($arrConfig['tables'])) {
                $GLOBALS['BE_MOD']['isotope']['iso_setup']['tables'] = array_merge($GLOBALS['BE_MOD']['isotope']['iso_setup']['tables'], $arrConfig['tables']);
            }
        }
    }
}
예제 #8
0
파일: config.php 프로젝트: Aziz-JH/core
<?php

/**
 * Isotope eCommerce for Contao Open Source CMS
 *
 * Copyright (C) 2009-2014 terminal42 gmbh & Isotope eCommerce Workgroup
 *
 * @package    Isotope
 * @link       http://isotopeecommerce.org
 * @license    http://opensource.org/licenses/lgpl-3.0.html
 */
/**
 * Backend modules
 */
array_insert($GLOBALS['BE_MOD']['isotope'], 2, array('iso_rules' => array('tables' => array(\Isotope\Model\Rule::getTable()), 'javascript' => \Haste\Util\Debug::uncompressedFile('system/modules/isotope/assets/js/backend.min.js'), 'icon' => 'system/modules/isotope_rules/assets/auction-hammer-gavel.png')));
/**
 * Models
 */
$GLOBALS['TL_MODELS'][\Isotope\Model\Rule::getTable()] = 'Isotope\\Model\\Rule';
/**
 * Checkout Steps
 * @todo this will no longer work
 */
array_insert($GLOBALS['ISO_CHECKOUT_STEPS']['review'], 0, array(array('Isotope\\Rules', 'cleanRuleUsages')));
/**
 * Product collection surcharge
 */
\Isotope\Model\ProductCollectionSurcharge::registerModelType('rule', 'Isotope\\Model\\ProductCollectionSurcharge\\Rule');
/**
 * Hooks
 */
예제 #9
0
 /**
  * Instantiate widget and initialize uploader
  */
 public function __construct($arrAttributes = false)
 {
     parent::__construct($arrAttributes);
     $GLOBALS['TL_JAVASCRIPT']['fineuploader'] = \Haste\Util\Debug::uncompressedFile('system/modules/isotope/assets/plugins/fineuploader/fineuploader-4.0.1.min.js');
 }
예제 #10
0
   /**
    * Generate the widget and return it as string
    * @return string
    */
   public function generate()
   {
       $GLOBALS['TL_JAVASCRIPT'][] = \Haste\Util\Debug::uncompressedFile('system/modules/isotope/assets/js/backend.min.js');
       // Open the tree if there is an error
       if ($this->hasErrors()) {
           $this->required = true;
       }
       // Store the keyword
       if (\Input::post('FORM_SUBMIT') == 'item_selector') {
           $this->Session->set('product_group_selector_search', \Input::post('keyword'));
           $this->reload();
       }
       $tree = '';
       $this->getPathNodes();
       $for = $this->Session->get('product_group_selector_search');
       $arrIds = array();
       // Search for a specific group
       if ($for != '') {
           // The keyword must not start with a wildcard (see #4910)
           if (strncmp($for, '*', 1) === 0) {
               $for = substr($for, 1);
           }
           $objRoot = \Database::getInstance()->prepare("SELECT id FROM tl_iso_group WHERE CAST(name AS CHAR) REGEXP ?")->execute($for);
           if ($objRoot->numRows > 0) {
               // Respect existing limitations
               if (is_array($GLOBALS['TL_DCA'][$this->strTable]['fields'][$this->strField]['rootNodes'])) {
                   $arrRoot = array();
                   while ($objRoot->next()) {
                       // Predefined node set (see #3563)
                       if (count(array_intersect($GLOBALS['TL_DCA'][$this->strTable]['fields'][$this->strField]['rootNodes'], \Database::getInstance()->getParentRecords($objRoot->id, 'tl_iso_group'))) > 0) {
                           $arrRoot[] = $objRoot->id;
                       }
                   }
                   $arrIds = $arrRoot;
               } elseif ($this->User->isAdmin) {
                   // Show all pages to admins
                   $arrIds = $objRoot->fetchEach('id');
               } else {
                   $arrRoot = array();
                   while ($objRoot->next()) {
                       // Show only mounted groups to regular users
                       if (count(array_intersect($this->User->iso_groups, $this->Database->getParentRecords($objRoot->id, 'tl_iso_group'))) > 0) {
                           $arrRoot[] = $objRoot->id;
                       }
                   }
                   $arrIds = $arrRoot;
               }
           }
           // Build the tree
           foreach ($arrIds as $id) {
               $tree .= $this->renderGrouptree($id, -20, true);
           }
       } else {
           if (is_array($GLOBALS['TL_DCA'][$this->strTable]['fields'][$this->strField]['rootNodes'])) {
               // Predefined node set (see contao/core#3563)
               foreach ($this->eliminateNestedPages($GLOBALS['TL_DCA'][$this->strTable]['fields'][$this->strField]['rootNodes'], $this->strTable) as $node) {
                   $tree .= $this->renderGrouptree($node, -20);
               }
           } elseif ($this->User->isAdmin) {
               // Show all groups to admins
               $objGroup = \Database::getInstance()->execute("SELECT id FROM tl_iso_group WHERE pid=0 ORDER BY sorting");
               while ($objGroup->next()) {
                   $tree .= $this->renderGrouptree($objGroup->id, -20);
               }
           } else {
               // Show only mounted groups to regular users
               foreach ($this->eliminateNestedPages($this->User->iso_groups, 'tl_iso_group') as $node) {
                   $tree .= $this->renderGrouptree($node, -20);
               }
           }
       }
       // Select all checkboxes
       if ($GLOBALS['TL_DCA'][$this->strTable]['fields'][$this->strField]['eval']['fieldType'] == 'checkbox') {
           $strReset = "\n" . '    <li class="tl_folder"><div class="tl_left">&nbsp;</div> <div class="tl_right"><label for="check_all_' . $this->strId . '" class="tl_change_selected">' . $GLOBALS['TL_LANG']['MSC']['selectAll'] . '</label> <input type="checkbox" id="check_all_' . $this->strId . '" class="tl_tree_checkbox" value="" onclick="Backend.toggleCheckboxGroup(this,\'' . $this->strName . '\')"></div><div style="clear:both"></div></li>';
       } else {
           $strReset = "\n" . '    <li class="tl_folder"><div class="tl_left">&nbsp;</div> <div class="tl_right"><label for="reset_' . $this->strId . '" class="tl_change_selected">' . $GLOBALS['TL_LANG']['MSC']['resetSelected'] . '</label> <input type="radio" name="' . $this->strName . '" id="reset_' . $this->strName . '" class="tl_tree_radio" value="" onfocus="Backend.getScrollOffset()"></div><div style="clear:both"></div></li>';
       }
       // Return the tree
       return '<ul class="tl_listing tree_view picker_selector' . ($this->strClass != '' ? ' ' . $this->strClass : '') . '" id="' . $this->strId . '">
   <li class="tl_folder_top"><div class="tl_left">' . \Image::getHtml($GLOBALS['TL_DCA'][$this->strTable]['list']['sorting']['icon']) . ' ' . $GLOBALS['TL_LANG']['tl_iso_group']['label'] . '</div> <div class="tl_right">&nbsp;</div><div style="clear:both"></div></li><li class="parent" id="' . $this->strId . '_parent"><ul>' . $tree . $strReset . '
 </ul></li></ul>';
   }
예제 #11
0
 /**
  * Modifies the DCA.
  *
  * @param string $table
  */
 public function modifyDca($table)
 {
     if (TL_MODE !== 'BE' || !isset($GLOBALS['TL_DCA'][$table]['list']['operations']) || !is_array($GLOBALS['TL_DCA'][$table]['list']['operations'])) {
         return;
     }
     foreach ($GLOBALS['TL_DCA'][$table]['list']['operations'] as $name => $settings) {
         if (!isset($settings['haste_ajax_operation'])) {
             continue;
         }
         $operation =& $GLOBALS['TL_DCA'][$table]['list']['operations'][$name];
         // Add the JavaScript
         $GLOBALS['TL_JAVASCRIPT'][] = Debug::uncompressedFile('system/modules/haste/assets/haste.min.js') . '|static';
         // Add default button callback to display the correct initial state
         // but only add it if not already present
         if (!isset($settings['button_callback'])) {
             $operation['button_callback'] = $this->getDefaultButtonCallback($name, $table, $settings['haste_ajax_operation']);
             // Make sure an icon is set to prevent DC_Table errors
             // (set to '' as the button_callback will return the correct icon)
             $operation['icon'] = '';
             // Add the onclick attribute
             $this->addOnClickAttribute($operation);
         }
     }
 }
예제 #12
0
파일: config.php 프로젝트: error08/core
<?php

/**
 * Isotope eCommerce for Contao Open Source CMS
 *
 * Copyright (C) 2009-2014 terminal42 gmbh & Isotope eCommerce Workgroup
 *
 * @package    Isotope
 * @link       http://isotopeecommerce.org
 * @license    http://opensource.org/licenses/lgpl-3.0.html
 */
/**
 * Backend modules
 */
array_insert($GLOBALS['BE_MOD']['isotope'], 2, array('reports' => array('callback' => 'Isotope\\BackendModule\\Reports', 'icon' => 'system/modules/isotope_reports/assets/icon.png', 'stylesheet' => \Haste\Util\Debug::uncompressedFile('system/modules/isotope_reports/assets/reports.min.css'), 'modules' => array('sales' => array('sales_total' => array('callback' => 'Isotope\\Report\\SalesTotal', 'label' => &$GLOBALS['TL_LANG']['ISO_REPORT']['sales_total'], 'icon' => 'system/modules/isotope_reports/assets/sales_total.png', 'panels' => array(array('getSelectStopPanel', 'getSelectStartPanel', 'getSelectPeriodPanel'), array('getSortingPanel', 'getFilterByConfigPanel', 'getStatusPanel'))), 'sales_product' => array('callback' => 'Isotope\\Report\\SalesProduct', 'label' => &$GLOBALS['TL_LANG']['ISO_REPORT']['sales_product'], 'icon' => 'system/modules/isotope_reports/assets/sales_product.png', 'panels' => array(array('getSelectFromPanel', 'getSelectColumnsPanel', 'getSelectPeriodPanel', 'getSelectVariantsPanel'), array('getSortingPanel', 'getStatusPanel')))), 'member' => array('members_total' => array('callback' => 'Isotope\\Report\\MembersTotal', 'label' => &$GLOBALS['TL_LANG']['ISO_REPORT']['members_total'], 'icon' => 'system/modules/isotope_reports/assets/members_total.png', 'class' => 'disabled'), 'members_registration' => array('callback' => 'Isotope\\Report\\MembersRegistration', 'label' => &$GLOBALS['TL_LANG']['ISO_REPORT']['members_registration'], 'icon' => 'system/modules/isotope_reports/assets/members_registration.png', 'class' => 'disabled'), 'members_guests' => array('callback' => 'Isotope\\Report\\MembersGuests', 'label' => &$GLOBALS['TL_LANG']['ISO_REPORT']['members_guests'], 'icon' => 'system/modules/isotope_reports/assets/members_guests.png', 'panels' => array(array('getSelectStopPanel', 'getSelectStartPanel', 'getSelectPeriodPanel'), array('getSortingPanel', 'getFilterByConfigPanel', 'getStatusPanel')))), 'rules' => array('rules_usage' => array('callback' => 'Isotope\\Report\\RulesUsage', 'label' => &$GLOBALS['TL_LANG']['ISO_REPORT']['rules_usage'], 'icon' => 'system/modules/isotope_reports/assets/rules_usage.png', 'class' => 'disabled'), 'rules_coupons' => array('callback' => 'Isotope\\Report\\RulesCoupons', 'label' => &$GLOBALS['TL_LANG']['ISO_REPORT']['rules_coupons'], 'icon' => 'system/modules/isotope_reports/assets/rules_coupons.png', 'class' => 'disabled')), 'custom' => array()))));
/**
 * Permissions are access settings for user and groups (fields in tl_user and tl_user_group)
 */
$GLOBALS['TL_PERMISSIONS'][] = 'iso_reports';