Exemple #1
0
    /**
     * Generate product filter buttons and return them as HTML
     * @return string
     */
    public static function generateFilterButtons()
    {
        if (\Input::get('id') > 0) {
            return '';
        }
        $session = \Session::getInstance()->getData();
        $intPage = $session['filter']['tl_iso_product']['iso_page'];
        $blnGroups = true;
        // Check permission
        if (!\BackendUser::getInstance()->isAdmin) {
            $groups = deserialize(\BackendUser::getInstance()->iso_groups);
            if (!is_array($groups) || empty($groups)) {
                $blnGroups = false;
            }
            // Allow to manage groups
            if (is_array(\BackendUser::getInstance()->iso_groupp) && !empty(\BackendUser::getInstance()->iso_groupp)) {
                $blnGroups = true;
            }
        }
        return '
<div class="tl_filter iso_filter tl_subpanel">
' . ($blnGroups ? '<input type="button" id="groupFilter" class="tl_submit' . (\Session::getInstance()->get('iso_products_gid') ? ' active' : '') . '" onclick="Backend.getScrollOffset();Isotope.openModalGroupSelector({\'width\':765,\'title\':\'' . specialchars($GLOBALS['TL_LANG']['tl_iso_product']['product_groups'][0]) . '\',\'url\':\'system/modules/isotope/group.php?do=' . \Input::get('do') . '&amp;table=' . \Isotope\Model\Group::getTable() . '&amp;field=gid&amp;value=' . \Session::getInstance()->get('iso_products_gid') . '\',\'action\':\'filterGroups\'});return false" value="' . specialchars($GLOBALS['TL_LANG']['MSC']['filterByGroups']) . '">' : '') . '
<input type="button" id="pageFilter" class="tl_submit' . ($intPage > 0 ? ' active' : '') . '" onclick="Backend.getScrollOffset();Isotope.openModalPageSelector({\'width\':765,\'title\':\'' . specialchars($GLOBALS['TL_LANG']['MOD']['page'][0]) . '\',\'url\':\'contao/page.php?do=' . \Input::get('do') . '&amp;table=tl_iso_product_category&amp;field=page_id&amp;value=' . $intPage . '\',\'action\':\'filterPages\'});return false" value="' . specialchars($GLOBALS['TL_LANG']['MSC']['filterByPages']) . '">
</div>';
    }
Exemple #2
0
    /**
     * List all records of a particular table
     * @return string
     */
    public function showAll()
    {
        $return = '';
        $this->limit = '';
        $this->bid = 'tl_buttons';
        // Clean up old tl_undo and tl_log entries
        if ($this->strTable == 'tl_undo' && strlen($GLOBALS['TL_CONFIG']['undoPeriod'])) {
            $this->Database->prepare("DELETE FROM tl_undo WHERE tstamp<?")->execute(intval(time() - $GLOBALS['TL_CONFIG']['undoPeriod']));
        } elseif ($this->strTable == 'tl_log' && strlen($GLOBALS['TL_CONFIG']['logPeriod'])) {
            $this->Database->prepare("DELETE FROM tl_log WHERE tstamp<?")->execute(intval(time() - $GLOBALS['TL_CONFIG']['logPeriod']));
        }
        $this->reviseTable();
        // Add to clipboard
        if (\Input::get('act') == 'paste') {
            $arrClipboard = $this->Session->get('CLIPBOARD');
            $arrClipboard[$this->strTable] = array('id' => \Input::get('id'), 'childs' => \Input::get('childs'), 'mode' => \Input::get('mode'));
            $this->Session->set('CLIPBOARD', $arrClipboard);
            // Perform a redirect (this is the CURRENT_ID fix)
            \Controller::redirect('contao/main.php?do=' . \Input::get('do') . (\Input::get('pid') ? '&id=' . \Input::get('pid') : '') . '&rt=' . \Input::get('rt') . '&ref=' . \Input::get('ref'));
        }
        // Do not show the language records
        $this->procedure[] = "language=''";
        // Display products filtered by group
        if (!$this->intId && $this->intGroupId > 0) {
            $this->procedure[] = "gid IN(" . implode(',', array_map('intval', \Database::getInstance()->getChildRecords(array($this->intGroupId), \Isotope\Model\Group::getTable(), false, array($this->intGroupId)))) . ")";
        }
        // Custom filter
        if (is_array($GLOBALS['TL_DCA'][$this->strTable]['list']['sorting']['filter']) && !empty($GLOBALS['TL_DCA'][$this->strTable]['list']['sorting']['filter'])) {
            foreach ($GLOBALS['TL_DCA'][$this->strTable]['list']['sorting']['filter'] as $filter) {
                $this->procedure[] = $filter[0];
                $this->values[] = $filter[1];
            }
        }
        $return .= $this->panel();
        $return .= CURRENT_ID && (\Input::get('pid') === null || \Input::get('pid') != '' && intval(\Input::get('pid')) != 0) ? $this->parentView() : $this->listView();
        // Add another panel at the end of the page
        if (strpos($GLOBALS['TL_DCA'][$this->strTable]['list']['sorting']['panelLayout'], 'limit') !== false && ($strLimit = $this->limitMenu(true)) != false) {
            $return .= '

<form action="' . ampersand(\Environment::get('request'), true) . '" class="tl_form" method="post">
<div class="tl_formbody">
<input type="hidden" name="FORM_SUBMIT" value="tl_filters_limit">
<input type="hidden" name="REQUEST_TOKEN" value="' . REQUEST_TOKEN . '">

<div class="tl_panel_bottom">

<div class="tl_submit_panel tl_subpanel">
<input type="image" name="btfilter" id="btfilter" src="' . TL_FILES_URL . 'system/themes/' . \Backend::getTheme() . '/images/reload.gif" class="tl_img_submit" title="' . specialchars($GLOBALS['TL_LANG']['MSC']['applyTitle']) . '" alt="' . specialchars($GLOBALS['TL_LANG']['MSC']['apply']) . '">
</div>' . $strLimit . '

<div class="clear"></div>

</div>

</div>
</form>
';
        }
        // Store the current IDs
        $session = $this->Session->getData();
        $session['CURRENT']['IDS'] = $this->current;
        $this->Session->setData($session);
        return $return;
    }
Exemple #3
0
$GLOBALS['NOTIFICATION_CENTER']['NOTIFICATION_TYPE']['isotope']['iso_order_status_change']['email_subject'] =& $GLOBALS['NOTIFICATION_CENTER']['NOTIFICATION_TYPE']['isotope']['iso_order_status_change']['email_text'];
$GLOBALS['NOTIFICATION_CENTER']['NOTIFICATION_TYPE']['isotope']['iso_order_status_change']['email_html'] =& $GLOBALS['NOTIFICATION_CENTER']['NOTIFICATION_TYPE']['isotope']['iso_order_status_change']['email_text'];
$GLOBALS['NOTIFICATION_CENTER']['NOTIFICATION_TYPE']['isotope']['iso_order_status_change']['email_replyTo'] =& $GLOBALS['NOTIFICATION_CENTER']['NOTIFICATION_TYPE']['isotope']['iso_order_status_change']['recipients'];
$GLOBALS['NOTIFICATION_CENTER']['NOTIFICATION_TYPE']['isotope']['iso_order_status_change']['email_recipient_cc'] =& $GLOBALS['NOTIFICATION_CENTER']['NOTIFICATION_TYPE']['isotope']['iso_order_status_change']['recipients'];
$GLOBALS['NOTIFICATION_CENTER']['NOTIFICATION_TYPE']['isotope']['iso_order_status_change']['email_recipient_bcc'] =& $GLOBALS['NOTIFICATION_CENTER']['NOTIFICATION_TYPE']['isotope']['iso_order_status_change']['recipients'];
/**
 * Models
 */
$GLOBALS['TL_MODELS'][\Isotope\Model\Address::getTable()] = 'Isotope\\Model\\Address';
$GLOBALS['TL_MODELS'][\Isotope\Model\Attribute::getTable()] = 'Isotope\\Model\\Attribute';
$GLOBALS['TL_MODELS'][\Isotope\Model\BasePrice::getTable()] = 'Isotope\\Model\\BasePrice';
$GLOBALS['TL_MODELS'][\Isotope\Model\Config::getTable()] = 'Isotope\\Model\\Config';
$GLOBALS['TL_MODELS'][\Isotope\Model\Document::getTable()] = 'Isotope\\Model\\Document';
$GLOBALS['TL_MODELS'][\Isotope\Model\Download::getTable()] = 'Isotope\\Model\\Download';
$GLOBALS['TL_MODELS'][\Isotope\Model\Gallery::getTable()] = 'Isotope\\Model\\Gallery';
$GLOBALS['TL_MODELS'][\Isotope\Model\Group::getTable()] = 'Isotope\\Model\\Group';
$GLOBALS['TL_MODELS'][\Isotope\Model\Label::getTable()] = 'Isotope\\Model\\Label';
$GLOBALS['TL_MODELS'][\Isotope\Model\OrderStatus::getTable()] = 'Isotope\\Model\\OrderStatus';
$GLOBALS['TL_MODELS'][\Isotope\Model\Payment::getTable()] = 'Isotope\\Model\\Payment';
$GLOBALS['TL_MODELS'][\Isotope\Model\Product::getTable()] = 'Isotope\\Model\\Product';
$GLOBALS['TL_MODELS'][\Isotope\Model\ProductCategory::getTable()] = 'Isotope\\Model\\ProductCategory';
$GLOBALS['TL_MODELS'][\Isotope\Model\ProductCollection::getTable()] = 'Isotope\\Model\\ProductCollection';
$GLOBALS['TL_MODELS'][\Isotope\Model\ProductCollectionDownload::getTable()] = 'Isotope\\Model\\ProductCollectionDownload';
$GLOBALS['TL_MODELS'][\Isotope\Model\ProductCollectionItem::getTable()] = 'Isotope\\Model\\ProductCollectionItem';
$GLOBALS['TL_MODELS'][\Isotope\Model\ProductCollectionSurcharge::getTable()] = 'Isotope\\Model\\ProductCollectionSurcharge';
$GLOBALS['TL_MODELS'][\Isotope\Model\ProductPrice::getTable()] = 'Isotope\\Model\\ProductPrice';
$GLOBALS['TL_MODELS'][\Isotope\Model\ProductCache::getTable()] = 'Isotope\\Model\\ProductCache';
$GLOBALS['TL_MODELS'][\Isotope\Model\ProductType::getTable()] = 'Isotope\\Model\\ProductType';
$GLOBALS['TL_MODELS'][\Isotope\Model\RelatedCategory::getTable()] = 'Isotope\\Model\\RelatedCategory';
$GLOBALS['TL_MODELS'][\Isotope\Model\RelatedProduct::getTable()] = 'Isotope\\Model\\RelatedProduct';
$GLOBALS['TL_MODELS'][\Isotope\Model\RequestCache::getTable()] = 'Isotope\\Model\\RequestCache';
 /**
  * Returns an array of all allowed product IDs and variant IDs for the current backend user
  * @return array|bool
  */
 public static function getAllowedIds()
 {
     $objUser = \BackendUser::getInstance();
     if ($objUser->isAdmin) {
         $arrProducts = true;
     } else {
         $arrNewRecords = $_SESSION['BE_DATA']['new_records']['tl_iso_product'];
         $arrProductTypes = $objUser->iso_product_types;
         $arrGroups = array();
         // Return false if there are no product types
         if (!is_array($arrProductTypes) || empty($arrProductTypes)) {
             return false;
         }
         // Find the user groups
         if (is_array($objUser->iso_groups) && count($objUser->iso_groups) > 0) {
             $arrGroups = array_merge($arrGroups, $objUser->iso_groups, \Database::getInstance()->getChildRecords($objUser->iso_groups, Group::getTable()));
             if (in_array('rootPaste', $objUser->iso_groupp)) {
                 $arrGroups[] = 0;
             }
         }
         $objProducts = \Database::getInstance()->execute("\n                SELECT id FROM tl_iso_product\n                WHERE pid=0\n                    AND language=''\n                    " . (empty($arrGroups) ? '' : "AND gid IN (" . implode(',', $arrGroups) . ")") . "\n                    AND (\n                        type IN (" . implode(',', $arrProductTypes) . ")" . (is_array($arrNewRecords) && !empty($arrNewRecords) ? " OR id IN (" . implode(',', $arrNewRecords) . ")" : '') . ")\n            ");
         if ($objProducts->numRows == 0) {
             return array();
         }
         $arrProducts = $objProducts->fetchEach('id');
         $arrProducts = array_merge($arrProducts, \Database::getInstance()->getChildRecords($arrProducts, 'tl_iso_product'));
     }
     // HOOK: allow extensions to define allowed products
     if (isset($GLOBALS['ISO_HOOKS']['getAllowedProductIds']) && is_array($GLOBALS['ISO_HOOKS']['getAllowedProductIds'])) {
         foreach ($GLOBALS['ISO_HOOKS']['getAllowedProductIds'] as $callback) {
             $objCallback = \System::importStatic($callback[0]);
             $arrAllowed = $objCallback->{$callback}[1]();
             if ($arrAllowed === false) {
                 return false;
             } elseif (is_array($arrAllowed)) {
                 if ($arrProducts === true) {
                     $arrProducts = $arrAllowed;
                 } else {
                     $arrProducts = array_intersect($arrProducts, $arrAllowed);
                 }
             }
         }
     }
     // If all product are allowed, we don't need to filter
     if ($arrProducts === true || count($arrProducts) == Product::countAll()) {
         return true;
     }
     return $arrProducts;
 }
<?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
 */
\System::loadLanguageFile(\Isotope\Model\ProductType::getTable());
/**
 * Table tl_iso_product
 */
$GLOBALS['TL_DCA']['tl_iso_product'] = array('config' => array('label' => &$GLOBALS['TL_LANG']['MOD']['iso_products'][0], 'dataContainer' => 'ProductData', 'enableVersioning' => true, 'switchToEdit' => true, 'ctable' => array(\Isotope\Model\Download::getTable(), \Isotope\Model\ProductCategory::getTable(), \Isotope\Model\ProductPrice::getTable(), \Isotope\Model\AttributeOption::getTable()), 'onload_callback' => array(array('Isotope\\Backend\\Product\\DcaManager', 'load'), array('Isotope\\Backend\\Product\\Permission', 'check'), array('Isotope\\Backend\\Product\\Panel', 'applyAdvancedFilters'), array('Isotope\\Backend\\Product\\XmlSitemap', 'generate')), 'oncreate_callback' => array(array('Isotope\\Backend\\Product\\DcaManager', 'updateNewRecord')), 'oncopy_callback' => array(array('Isotope\\Backend\\Product\\Category', 'updateSorting'), array('Isotope\\Backend\\Product\\DcaManager', 'updateDateAdded')), 'onsubmit_callback' => array(array('Isotope\\Backend', 'truncateProductCache'), array('Isotope\\Backend\\Product\\XmlSitemap', 'scheduleUpdate')), 'onversion_callback' => array(array('Isotope\\Backend\\Product\\Category', 'createVersion')), 'onrestore_callback' => array(array('Isotope\\Backend\\Product\\Category', 'restoreVersion')), 'sql' => array('keys' => array('id' => 'primary', 'gid' => 'index', 'pid,language' => 'index', 'language,published,start,stop,pid' => 'index', 'start' => 'index'))), 'select' => array('buttons_callback' => array(array('Isotope\\Backend\\Product\\Button', 'forSelect'))), 'list' => array('sorting' => array('mode' => 2, 'fields' => array('name'), 'headerFields' => array('name', 'sku', 'price', 'published'), 'flag' => 1, 'panelLayout' => 'iso_buttons,iso_filter;filter;sort,iso_sorting,search,limit', 'icon' => 'system/modules/isotope/assets/images/store-open.png', 'paste_button_callback' => array('Isotope\\Backend\\Product\\PasteButton', 'generate'), 'panel_callback' => array('iso_buttons' => array('Isotope\\Backend\\Product\\Panel', 'generateFilterButtons'), 'iso_filter' => array('Isotope\\Backend\\Product\\Panel', 'generateAdvancedFilters'), 'iso_sorting' => array('Isotope\\Backend\\Product\\Panel', 'generateSortingIcon'))), 'label' => array('fields' => array('images', 'name', 'sku', 'price'), 'showColumns' => true, 'label_callback' => array('Isotope\\Backend\\Product\\Label', 'generate')), 'global_operations' => array('generate' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product']['generate'], 'href' => 'key=generate', 'icon' => 'new.gif'), 'groups' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product']['product_groups'], 'href' => 'table=' . \Isotope\Model\Group::getTable(), 'icon' => 'system/modules/isotope/assets/images/folders.png', 'attributes' => 'onclick="Backend.getScrollOffset();"', 'button_callback' => array('Isotope\\Backend\\Product\\Button', 'forGroups')), 'import' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product']['import'], 'href' => 'key=import', 'icon' => 'system/modules/isotope/assets/images/image--plus.png', 'attributes' => 'onclick="Backend.getScrollOffset();"'), 'all' => array('label' => &$GLOBALS['TL_LANG']['MSC']['all'], 'href' => 'act=select', 'class' => 'header_edit_all', 'attributes' => 'onclick="Backend.getScrollOffset();"')), 'operations' => array('edit' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product']['edit'], 'href' => 'act=edit', 'icon' => 'edit.gif'), 'copy' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product']['copy'], 'href' => 'act=copy&amp;childs=1', 'icon' => 'copy.gif', 'button_callback' => array('Isotope\\Backend\\Product\\Button', 'forCopy')), 'cut' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product']['cut'], 'href' => 'act=cut', 'icon' => 'cut.gif', 'button_callback' => array('Isotope\\Backend\\Product\\Button', 'forCut')), 'delete' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product']['delete'], 'href' => 'act=delete', 'icon' => 'delete.gif', 'attributes' => 'onclick="if (!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\')) return false; Backend.getScrollOffset();"', 'button_callback' => array('Isotope\\Backend\\Product\\Button', 'forDelete')), 'toggle' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product']['toggle'], 'icon' => 'visible.gif', 'attributes' => 'onclick="Backend.getScrollOffset(); return AjaxRequest.toggleVisibility(this, %s);"', 'button_callback' => array('Isotope\\Backend\\Product\\Button', 'forVisibilityToggle')), 'show' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product']['show'], 'href' => 'act=show', 'icon' => 'show.gif'), 'break' => array('button_callback' => function () {
    return '<br>';
}), 'variants' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product']['variants'], 'href' => '', 'icon' => 'system/modules/isotope/assets/images/table--pencil.png', 'button_callback' => array('Isotope\\Backend\\Product\\Button', 'forVariants')), 'related' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product']['related'], 'href' => 'table=' . \Isotope\Model\RelatedProduct::getTable(), 'icon' => 'system/modules/isotope/assets/images/sitemap.png', 'button_callback' => array('Isotope\\Backend\\Product\\Button', 'forRelated')), 'downloads' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product']['downloads'], 'href' => 'table=' . \Isotope\Model\Download::getTable(), 'icon' => 'system/modules/isotope/assets/images/paper-clip.png', 'button_callback' => array('Isotope\\Backend\\Product\\Button', 'forDownloads')), 'group' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product']['group'], 'href' => 'act=cut', 'icon' => 'system/modules/isotope/assets/images/folder-network.png', 'button_callback' => array('Isotope\\Backend\\Product\\Button', 'forGroup')))), 'palettes' => array('__selector__' => array('type', 'protected'), 'default' => '{general_legend},type'), 'subpalettes' => array('protected' => 'groups'), 'fields' => array('id' => array('attributes' => array('systemColumn' => true), 'sql' => "int(10) unsigned NOT NULL auto_increment"), 'pid' => array('eval' => array('submitOnChange' => true), 'attributes' => array('systemColumn' => true), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'gid' => array('foreignKey' => \Isotope\Model\Group::getTable() . '.name', 'eval' => array('doNotShow' => true), 'attributes' => array('systemColumn' => true, 'inherit' => true), 'sql' => "int(10) unsigned NOT NULL default '0'", 'relation' => array('type' => 'hasOne', 'load' => 'lazy')), 'tstamp' => array('attributes' => array('systemColumn' => true), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'language' => array('eval' => array('doNotShow' => true), 'attributes' => array('systemColumn' => true, 'inherit' => true), 'sql' => "varchar(5) NOT NULL default ''"), 'dateAdded' => array('label' => &$GLOBALS['TL_LANG']['MSC']['dateAdded'], 'eval' => array('rgxp' => 'datim', 'doNotCopy' => true), 'attributes' => array('fe_sorting' => true, 'systemColumn' => true), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'type' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product']['type'], 'exclude' => true, 'filter' => true, 'inputType' => 'select', 'options_callback' => array('Isotope\\Backend\\ProductType\\Callback', 'getOptions'), 'foreignKey' => \Isotope\Model\ProductType::getTable() . '.name', 'eval' => array('mandatory' => true, 'submitOnChange' => true, 'includeBlankOption' => true, 'tl_class' => 'clr', 'helpwizard' => true), 'attributes' => array('legend' => 'general_legend', 'fixed' => true, 'inherit' => true, 'systemColumn' => true), 'sql' => "int(10) unsigned NOT NULL default '0'", 'relation' => array('type' => 'hasOne', 'load' => 'lazy'), 'explanation' => 'tl_iso_product.type'), 'pages' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product']['pages'], 'exclude' => true, 'inputType' => 'pageTree', 'foreignKey' => 'tl_page.title', 'eval' => array('doNotSaveEmpty' => true, 'multiple' => true, 'fieldType' => 'checkbox', 'orderField' => 'orderPages', 'tl_class' => 'clr hide_sort_hint'), 'relation' => array('type' => 'hasMany', 'load' => 'lazy'), 'attributes' => array('legend' => 'general_legend', 'fixed' => true, 'inherit' => true, 'systemColumn' => true), 'load_callback' => array(array('Isotope\\Backend\\Product\\Category', 'load')), 'save_callback' => array(array('Isotope\\Backend\\Product\\Category', 'save'))), 'orderPages' => array('eval' => array('doNotShow' => true), 'attributes' => array('systemColumn' => true, 'inherit' => true), 'sql' => "text NULL"), 'inherit' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product']['inherit'], 'exclude' => true, 'inputType' => 'inheritCheckbox', 'eval' => array('multiple' => true), 'attributes' => array('systemColumn' => true), 'sql' => "blob NULL"), 'alias' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product']['alias'], 'exclude' => true, 'search' => true, 'sorting' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'alnum', 'doNotCopy' => true, 'spaceToUnderscore' => true, 'maxlength' => 128, 'tl_class' => 'w50'), 'attributes' => array('legend' => 'general_legend', 'fixed' => true, 'inherit' => true), 'sql' => "varchar(128) NOT NULL default ''", 'save_callback' => array(array('Isotope\\Backend\\Product\\Alias', 'save'))), 'sku' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product']['sku'], 'exclude' => true, 'search' => true, 'sorting' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 128, 'unique' => true, 'tl_class' => 'w50'), 'attributes' => array('legend' => 'general_legend', 'fe_sorting' => true, 'fe_search' => true), 'sql' => "varchar(128) NOT NULL default ''"), 'name' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product']['name'], 'exclude' => true, 'search' => true, 'sorting' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'tl_class' => 'clr long'), 'attributes' => array('legend' => 'general_legend', 'multilingual' => true, 'fixed' => true, 'fe_sorting' => true, 'fe_search' => true), 'sql' => "varchar(255) NOT NULL default ''"), 'teaser' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product']['teaser'], 'exclude' => true, 'search' => true, 'inputType' => 'textarea', 'eval' => array('style' => 'height:80px', 'tl_class' => 'clr'), 'attributes' => array('legend' => 'general_legend', 'multilingual' => true), 'sql' => "text NULL"), 'description' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product']['description'], 'exclude' => true, 'search' => true, 'inputType' => 'textarea', 'eval' => array('mandatory' => true, 'rte' => 'tinyMCE', 'tl_class' => 'clr'), 'attributes' => array('legend' => 'general_legend', 'multilingual' => true, 'fe_search' => true), 'sql' => "text NULL"), 'meta_title' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product']['meta_title'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'clr long'), 'attributes' => array('legend' => 'meta_legend', 'multilingual' => true), 'sql' => "varchar(255) NOT NULL default ''"), 'meta_description' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product']['meta_description'], 'exclude' => true, 'search' => true, 'inputType' => 'textarea', 'eval' => array('style' => 'height:60px', 'tl_class' => 'clr'), 'attributes' => array('legend' => 'meta_legend', 'multilingual' => true), 'sql' => "text NULL"), 'meta_keywords' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product']['meta_keywords'], 'exclude' => true, 'search' => true, 'inputType' => 'textarea', 'eval' => array('style' => 'height:40px', 'tl_class' => 'clr'), 'attributes' => array('legend' => 'meta_legend', 'multilingual' => true), 'sql' => "text NULL"), 'price' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product']['price'], 'exclude' => true, 'inputType' => 'timePeriod', 'foreignKey' => \Isotope\Model\TaxClass::getTable() . '.name', 'eval' => array('mandatory' => true, 'maxlength' => 13, 'rgxp' => 'price', 'includeBlankOption' => true, 'blankOptionLabel' => &$GLOBALS['TL_LANG']['MSC']['taxFree'], 'doNotSaveEmpty' => true, 'tl_class' => 'w50'), 'attributes' => array('legend' => 'pricing_legend', 'fe_sorting' => true, 'dynamic' => true, 'systemColumn' => true, 'type' => '\\Isotope\\Model\\Attribute\\Price'), 'load_callback' => array(array('\\Isotope\\Backend\\Product\\Price', 'load')), 'save_callback' => array(array('\\Isotope\\Backend\\Product\\Price', 'save'))), 'prices' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product']['prices'], 'inputType' => 'dcaWizard', 'foreignTable' => \Isotope\Model\ProductPrice::getTable(), 'attributes' => array('systemColumn' => true), 'eval' => array('listCallback' => array('Isotope\\Backend\\ProductPrice\\Callback', 'generateWizardList'), 'applyButtonLabel' => &$GLOBALS['TL_LANG']['tl_iso_product']['prices']['apply_and_close'], 'tl_class' => 'clr')), 'price_tiers' => array('attributes' => array('type' => '\\Isotope\\Model\\Attribute\\PriceTiers'), 'tableformat' => array('min' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product']['price_tiers']['min'], 'format' => &$GLOBALS['TL_LANG']['tl_iso_product']['price_tiers']['min_format']), 'price' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product']['price_tiers']['price'], 'rgxp' => 'price'), 'tax_class' => array('doNotShow' => true))), 'baseprice' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product']['baseprice'], 'exclude' => true, 'inputType' => 'timePeriod', 'foreignKey' => 'tl_iso_baseprice.name', 'eval' => array('includeBlankOption' => true, 'tl_class' => 'w50'), 'attributes' => array('type' => '\\Isotope\\Model\\Attribute\\BasePrice', 'legend' => 'pricing_legend'), 'sql' => "varchar(255) NOT NULL default ''"), 'shipping_weight' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product']['shipping_weight'], 'exclude' => true, 'inputType' => 'timePeriod', 'default' => array('', 'kg'), 'options' => array('mg', 'g', 'kg', 't', 'ct', 'oz', 'lb', 'st', 'grain'), 'reference' => &$GLOBALS['TL_LANG']['WGT'], 'eval' => array('rgxp' => 'digit', 'tl_class' => 'w50', 'helpwizard' => true), 'attributes' => array('legend' => 'shipping_legend'), 'sql' => "varchar(255) NOT NULL default ''"), 'shipping_exempt' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product']['shipping_exempt'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50'), 'attributes' => array('legend' => 'shipping_legend', 'systemColumn' => true), 'sql' => "char(1) NOT NULL default ''"), 'images' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product']['images'], 'exclude' => true, 'inputType' => 'mediaManager', 'explanation' => 'mediaManager', 'eval' => array('extensions' => 'jpeg,jpg,png,gif', 'helpwizard' => true, 'tl_class' => 'clr'), 'attributes' => array('legend' => 'media_legend', 'fixed' => true, 'multilingual' => true, 'dynamic' => true, 'systemColumn' => true, 'fetch_fallback' => true), 'sql' => "blob NULL"), 'protected' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product']['protected'], 'exclude' => true, 'filter' => true, 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => true, 'tl_class' => 'clr'), 'attributes' => array('legend' => 'expert_legend', 'systemColumn' => true), 'sql' => "char(1) NOT NULL default ''"), 'groups' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product']['groups'], 'exclude' => true, 'filter' => true, 'inputType' => 'checkbox', 'foreignKey' => 'tl_member_group.name', 'eval' => array('mandatory' => true, 'multiple' => true, 'systemColumn' => true), 'sql' => "blob NULL", 'relation' => array('type' => 'hasMany', 'load' => 'lazy')), 'guests' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product']['guests'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50'), 'attributes' => array('legend' => 'expert_legend', 'systemColumn' => true), 'sql' => "char(1) NOT NULL default ''"), 'cssID' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product']['cssID'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('multiple' => true, 'size' => 2, 'tl_class' => 'w50'), 'attributes' => array('legend' => 'expert_legend'), 'sql' => "varchar(255) NOT NULL default ''"), 'published' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product']['published'], 'exclude' => true, 'filter' => true, 'inputType' => 'checkbox', 'eval' => array('doNotCopy' => true, 'tl_class' => 'clr'), 'attributes' => array('legend' => 'publish_legend', 'fixed' => true, 'variant_fixed' => true, 'systemColumn' => true), 'sql' => "char(1) NOT NULL default ''", 'save_callback' => array(array('Isotope\\Backend', 'truncateProductCache'))), 'start' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product']['start'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'date', 'datepicker' => true, 'tl_class' => 'w50 wizard'), 'attributes' => array('legend' => 'publish_legend', 'fixed' => true, 'variant_fixed' => true, 'systemColumn' => true), 'sql' => "varchar(10) NOT NULL default ''"), 'stop' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product']['stop'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'date', 'datepicker' => true, 'tl_class' => 'w50 wizard'), 'attributes' => array('legend' => 'publish_legend', 'fixed' => true, 'variant_fixed' => true, 'systemColumn' => true), 'sql' => "varchar(10) NOT NULL default ''"), 'variantFields' => array('label' => &$GLOBALS['TL_LANG'][\Isotope\Model\ProductType::getTable()]['variant_attributes']), 'source' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product']['source'], 'eval' => array('mandatory' => true, 'required' => true, 'fieldType' => 'radio'))));
/**
 * Adjust the data configuration array in variants view
 */
if (\Input::get('id')) {
    $GLOBALS['TL_LANG']['tl_iso_product']['new'] = $GLOBALS['TL_LANG']['tl_iso_product']['new_variant'];
    $GLOBALS['TL_DCA']['tl_iso_product']['config']['switchToEdit'] = false;
    unset($GLOBALS['TL_DCA']['tl_iso_product']['list']['global_operations']['import']);
    unset($GLOBALS['TL_DCA']['tl_iso_product']['list']['global_operations']['groups']);
} else {
    unset($GLOBALS['TL_DCA']['tl_iso_product']['list']['global_operations']['generate']);
}
<?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
 */
$this->loadLanguageFile(\Isotope\Model\Group::getTable());
$this->loadDataContainer(\UserModel::getTable());
/**
 * Extend a tl_user_group palette
 */
$GLOBALS['TL_DCA']['tl_user_group']['palettes']['default'] = str_replace(',iso_modules,', ',iso_modules,iso_reports,', $GLOBALS['TL_DCA']['tl_user_group']['palettes']['default']);
/**
 * Add fields to tl_user_group
 */
$GLOBALS['TL_DCA']['tl_user_group']['fields']['iso_reports'] = array('label' => &$GLOBALS['TL_LANG']['tl_user']['iso_reports'], 'exclude' => true, 'inputType' => 'checkbox', 'options_callback' => array('tl_iso_reports', 'getReports'), 'eval' => array('multiple' => true, 'tl_class' => 'w50 w50h'));
 /**
  * Adjust the product groups manager view
  *
  * @param \Template $objTemplate
  */
 public function adjustGroupsManager($objTemplate)
 {
     if (\Input::get('popup') && \Input::get('do') == 'iso_products' && \Input::get('table') == Group::getTable() && $objTemplate->getName() == 'be_main') {
         $objTemplate->managerHref = ampersand($this->Session->get('groupPickerRef'));
         $objTemplate->manager = $GLOBALS['TL_LANG']['MSC']['groupPickerHome'];
     }
 }
Exemple #8
0
 /**
  * Manage act=select buttons
  *
  * @param array $arrButtons
  *
  * @return array
  */
 public function forSelect($arrButtons)
 {
     if (\Input::get('act') == 'select' && !\Input::get('id')) {
         unset($arrButtons['copy']);
         unset($arrButtons['cut']);
         array_insert($arrButtons, 0, array('group' => '<input type="submit" name="group" id="group" class="tl_submit" value="' . specialchars($GLOBALS['TL_LANG']['tl_iso_product']['groupSelected']) . '">'));
         $GLOBALS['TL_MOOTOOLS'][] = "\n<script>\nwindow.addEvent('domready', function() {\n    document.id('group').addEvents({\n        'click': function(e) {\n            e.preventDefault();\n            Isotope.openModalGroupSelector({\n                'width':    765,\n                'title':    '" . specialchars($GLOBALS['TL_LANG']['tl_iso_product']['product_groups'][0]) . "',\n                'url':      'system/modules/isotope/group.php?do=" . \Input::get('do') . "&amp;table=" . Group::getTable() . "&amp;field=gid&amp;value=" . \Session::getInstance()->get('iso_products_gid') . "',\n                'action':   'moveProducts',\n                'trigger':  \$(this)\n            });\n        },\n        'closeModal': function() {\n            var form = \$('tl_select'),\n            hidden = new Element('input', { type:'hidden', name:'cut' }).inject(form.getElement('.tl_formbody'), 'top');\n            form.submit();\n        }\n    });\n});\n</script>";
     }
     return $arrButtons;
 }
<?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
 */
\System::loadLanguageFile(\Isotope\Model\Group::getTable());
/**
 * Extend tl_user palettes
 */
$GLOBALS['TL_DCA']['tl_user']['palettes']['extend'] = str_replace('{account_legend}', '{isotope_legend},iso_modules,iso_product_types,iso_product_typep,iso_payment_modules,iso_payment_modulep,iso_shipping_modules,iso_shipping_modulep,iso_tax_classes,iso_tax_classp,iso_tax_rates,iso_tax_ratep,iso_configs,iso_configp,iso_groups,iso_groupp;{account_legend}', $GLOBALS['TL_DCA']['tl_user']['palettes']['extend']);
$GLOBALS['TL_DCA']['tl_user']['palettes']['custom'] = str_replace('{account_legend}', '{isotope_legend},iso_modules,iso_product_types,iso_product_typep,iso_payment_modules,iso_payment_modulep,iso_shipping_modules,iso_shipping_modulep,iso_tax_classes,iso_tax_classp,iso_tax_rates,iso_tax_ratep,iso_configs,iso_configp,iso_groups,iso_groupp;{account_legend}', $GLOBALS['TL_DCA']['tl_user']['palettes']['custom']);
/**
 * Add fields to tl_user
 */
$GLOBALS['TL_DCA']['tl_user']['fields']['iso_modules'] = array('label' => &$GLOBALS['TL_LANG']['tl_user']['iso_modules'], 'exclude' => true, 'filter' => true, 'inputType' => 'checkbox', 'options_callback' => array('Isotope\\Backend', 'getIsotopeModules'), 'reference' => &$GLOBALS['TL_LANG']['IMD'], 'eval' => array('multiple' => true, 'helpwizard' => true, 'tl_class' => 'clr w50 w50h'), 'sql' => 'blob NULL');
$GLOBALS['TL_DCA']['tl_user']['fields']['iso_product_types'] = array('label' => &$GLOBALS['TL_LANG']['tl_user']['iso_product_types'], 'exclude' => true, 'inputType' => 'checkbox', 'foreignKey' => \Isotope\Model\ProductType::getTable() . '.name', 'eval' => array('multiple' => true, 'helpwizard' => true, 'tl_class' => 'clr w50 w50h'), 'sql' => 'blob NULL');
$GLOBALS['TL_DCA']['tl_user']['fields']['iso_product_typep'] = array('label' => &$GLOBALS['TL_LANG']['tl_user']['iso_product_typep'], 'exclude' => true, 'inputType' => 'checkbox', 'options' => array('create', 'delete'), 'reference' => &$GLOBALS['TL_LANG']['MSC'], 'eval' => array('multiple' => true, 'tl_class' => 'w50 w50h'), 'sql' => 'blob NULL');
$GLOBALS['TL_DCA']['tl_user']['fields']['iso_payment_modules'] = array('label' => &$GLOBALS['TL_LANG']['tl_user']['iso_payment_modules'], 'exclude' => true, 'inputType' => 'checkbox', 'foreignKey' => \Isotope\Model\Payment::getTable() . '.name', 'eval' => array('multiple' => true, 'tl_class' => 'clr w50 w50h'), 'sql' => 'blob NULL');
$GLOBALS['TL_DCA']['tl_user']['fields']['iso_payment_modulep'] = array('label' => &$GLOBALS['TL_LANG']['tl_user']['iso_payment_modulep'], 'exclude' => true, 'inputType' => 'checkbox', 'options' => array('create', 'delete'), 'reference' => &$GLOBALS['TL_LANG']['MSC'], 'eval' => array('multiple' => true, 'tl_class' => 'w50 w50h'), 'sql' => 'blob NULL');
$GLOBALS['TL_DCA']['tl_user']['fields']['iso_shipping_modules'] = array('label' => &$GLOBALS['TL_LANG']['tl_user']['iso_shipping_modules'], 'exclude' => true, 'inputType' => 'checkbox', 'foreignKey' => \Isotope\Model\Shipping::getTable() . '.name', 'eval' => array('multiple' => true, 'tl_class' => 'clr w50 w50h'), 'sql' => 'blob NULL');
$GLOBALS['TL_DCA']['tl_user']['fields']['iso_shipping_modulep'] = array('label' => &$GLOBALS['TL_LANG']['tl_user']['iso_shipping_modulep'], 'exclude' => true, 'inputType' => 'checkbox', 'options' => array('create', 'delete'), 'reference' => &$GLOBALS['TL_LANG']['MSC'], 'eval' => array('multiple' => true, 'tl_class' => 'w50 w50h'), 'sql' => 'blob NULL');
$GLOBALS['TL_DCA']['tl_user']['fields']['iso_tax_classes'] = array('label' => &$GLOBALS['TL_LANG']['tl_user']['iso_tax_classes'], 'exclude' => true, 'inputType' => 'checkbox', 'foreignKey' => \Isotope\Model\TaxClass::getTable() . '.name', 'eval' => array('multiple' => true, 'tl_class' => 'clr w50 w50h'), 'sql' => 'blob NULL');
$GLOBALS['TL_DCA']['tl_user']['fields']['iso_tax_classp'] = array('label' => &$GLOBALS['TL_LANG']['tl_user']['iso_tax_classp'], 'exclude' => true, 'inputType' => 'checkbox', 'options' => array('create', 'delete'), 'reference' => &$GLOBALS['TL_LANG']['MSC'], 'eval' => array('multiple' => true, 'tl_class' => 'w50 w50h'), 'sql' => 'blob NULL');
$GLOBALS['TL_DCA']['tl_user']['fields']['iso_tax_rates'] = array('label' => &$GLOBALS['TL_LANG']['tl_user']['iso_tax_rates'], 'exclude' => true, 'inputType' => 'checkbox', 'foreignKey' => \Isotope\Model\TaxRate::getTable() . '.name', 'eval' => array('multiple' => true, 'tl_class' => 'clr w50 w50h'), 'sql' => 'blob NULL');
$GLOBALS['TL_DCA']['tl_user']['fields']['iso_tax_ratep'] = array('label' => &$GLOBALS['TL_LANG']['tl_user']['iso_tax_ratep'], 'exclude' => true, 'inputType' => 'checkbox', 'options' => array('create', 'delete'), 'reference' => &$GLOBALS['TL_LANG']['MSC'], 'eval' => array('multiple' => true, 'tl_class' => 'w50 w50h'), 'sql' => 'blob NULL');