Beispiel #1
0
    /**
     * @return array List of items to display.
     */
    public function getSections()
    {
        $pages = $this->_getPages();
        $termsPages = $pages;
        $termsPages[0] = __('None', 'jigoshop');
        return array(array('title' => __('Cron jobs', 'jigoshop'), 'id' => 'cron', 'fields' => array(array('name' => '[automatic_complete]', 'title' => __('Complete processing orders', 'jigoshop'), 'description' => __("Change all 'Processing' orders older than one month to 'Completed'", 'jigoshop'), 'tip' => __("For orders that have been completed but the status is still set to 'processing'.  This will move them to a 'completed' status without sending an email out to all the customers.", 'jigoshop'), 'type' => 'checkbox', 'checked' => $this->settings['automatic_complete'], 'classes' => array('switch-medium')), array('name' => '[automatic_reset]', 'title' => __('Reset pending orders', 'jigoshop'), 'description' => __("Change all 'Pending' orders older than one month to 'On Hold'", 'jigoshop'), 'tip' => __("For customers that have not completed the Checkout process or haven't paid for an order after a period of time, this will reset the Order to On Hold allowing the Shop owner to take action.  WARNING: For the first use on an existing Shop this setting <em>can</em> generate a <strong>lot</strong> of email!", 'jigoshop'), 'type' => 'checkbox', 'checked' => $this->settings['automatic_reset'], 'classes' => array('switch-medium')))), array('title' => __('Integration', 'jigoshop'), 'id' => 'integration', 'fields' => array(array('name' => '[integration][google_analytics]', 'title' => __('Google Analytics ID', 'jigoshop'), 'description' => __('Log into your Google Analytics account to find your ID. e.g. <code>UA-XXXXXXX-X</code>', 'jigoshop'), 'type' => 'text', 'value' => $this->settings['integration']['google_analytics']))), array('title' => __('Products list', 'jigoshop'), 'id' => 'products_list', 'fields' => array(array('name' => '[products_list][variations_sku_stock]', 'title' => __('Show variation\'s SKU and stock', 'jigoshop'), 'description' => __("Show all variation's SKU and stock on admin products list page.", 'jigoshop'), 'type' => 'checkbox', 'checked' => $this->settings['products_list']['variations_sku_stock'], 'classes' => array('switch-medium')))), array('title' => __('Others', 'jigoshop'), 'id' => 'others', 'fields' => array(array('name' => '[cache]', 'title' => __('Caching mechanism', 'jigoshop'), 'description' => __('Decides which mechanism for caching is used on the page.', 'jigoshop'), 'type' => 'select', 'value' => $this->settings['cache'], 'options' => $this->caches), array('name' => '[session]', 'title' => __('Session mechanism', 'jigoshop'), 'description' => __('Decides which mechanism for session is used on the page.', 'jigoshop'), 'type' => 'select', 'value' => $this->settings['session'], 'options' => $this->sessionTypes), array('name' => '[ignore_meta_queries]', 'title' => __('Ignore meta queries on product list', 'jigoshop'), 'description' => __('Ignores products\' visibility to enhance the loading time.
Warning : This will result in showing "out of stock" products on the catalog page, as well as making all products visible in the catalog and search pages.', 'jigoshop'), 'type' => 'checkbox', 'checked' => $this->settings['ignore_meta_queries'], 'classes' => array('switch-medium')), array('name' => '[install_emails]', 'title' => __('Create default emails', 'jigoshop'), 'description' => __('Creates default emails for Jigoshop email system.', 'jigoshop'), 'type' => 'user_defined', 'display' => function () {
            Render::output('admin/settings/create_emails', array());
        }))), array('title' => __('API', 'jigoshop'), 'id' => 'api', 'description' => __('API DESC', 'jigoshop'), 'fields' => array(array('name' => '[api][keys]', 'title' => __('Keys', 'jigoshop'), 'type' => 'user_defined', 'value' => $this->settings['api']['keys'], 'description' => __('Logged users don\'t need to use api keys, guest can see products and manage their carts', 'jigoshop'), 'display' => function ($field) {
            Render::output('admin/settings/api_keys', array('name' => $field['name'], 'values' => $field['value'], 'description' => $field['description'], 'availablePermissions' => Permission::getPermisions()));
        }))), array('title' => __('Pages', 'jigoshop'), 'id' => 'pages', 'description' => __('This section allows you to change content source page for each part of Jigoshop. It will not change the main behaviour though.', 'jigoshop'), 'fields' => array(array('name' => '[pages][shop]', 'title' => __('Shop page', 'jigoshop'), 'type' => 'select', 'value' => $this->settings['pages']['shop'], 'options' => $pages), array('name' => '[pages][cart]', 'title' => __('Cart page', 'jigoshop'), 'type' => 'select', 'value' => $this->settings['pages']['cart'], 'options' => $pages), array('name' => '[pages][checkout]', 'title' => __('Checkout page', 'jigoshop'), 'type' => 'select', 'value' => $this->settings['pages']['checkout'], 'options' => $pages), array('name' => '[pages][checkout_thank_you]', 'title' => __('Thanks page', 'jigoshop'), 'type' => 'select', 'value' => $this->settings['pages']['checkout_thank_you'], 'options' => $pages), array('name' => '[pages][account]', 'title' => __('My account page', 'jigoshop'), 'type' => 'select', 'value' => $this->settings['pages']['account'], 'options' => $pages), array('name' => '[pages][terms]', 'title' => __('Terms page', 'jigoshop'), 'type' => 'select', 'value' => $this->settings['pages']['terms'], 'options' => $termsPages))));
    }
Beispiel #2
0
 /**
  * @return string[]
  */
 private function getKeyPermissions()
 {
     $keyData = $this->getCurrentKeyData();
     return !empty($keyData) && !empty($keyData['permissions']) ? $keyData['permissions'] : array_keys(Permission::getPermisions());
 }