当前位置: 首页>>代码示例>>PHP>>正文


PHP Language::getLanguages方法代码示例

本文整理汇总了PHP中Language::getLanguages方法的典型用法代码示例。如果您正苦于以下问题:PHP Language::getLanguages方法的具体用法?PHP Language::getLanguages怎么用?PHP Language::getLanguages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Language的用法示例。


在下文中一共展示了Language::getLanguages方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: migrate_block_info_to_cms_block

function migrate_block_info_to_cms_block()
{
    //get ids cms of block information
    $id_blockinfos = Db::getInstance()->getValue('SELECT id_module FROM  `' . _DB_PREFIX_ . 'module` WHERE name = \'blockinfos\'');
    //get ids cms of block information
    $ids_cms = Db::getInstance()->ExecuteS('SELECT * FROM  `' . _DB_PREFIX_ . 'block_cms` WHERE `id_block` = ' . (int) $id_blockinfos);
    //check if block info is installed and active
    if (sizeof($ids_cms)) {
        //install module blockcms
        if (Module::getInstanceByName('blockcms')->install()) {
            //add new block in new cms block
            Db::getInstance()->Execute('INSERT INTO `' . _DB_PREFIX_ . 'cms_block` (`id_cms_category`, `name`, `location`, `position`) VALUES( 1, \'\', 0, 0)');
            $id_block = Db::getInstance()->Insert_ID();
            $languages = Language::getLanguages(false);
            foreach ($languages as $language) {
                Db::getInstance()->Execute('INSERT INTO `' . _DB_PREFIX_ . 'cms_block_lang` (`id_cms_block`, `id_lang`, `name`) VALUES (' . (int) $id_block . ', ' . (int) $language['id_lang'] . ', \'Information\')');
            }
            //save ids cms of block information in new module cms bloc
            foreach ($ids_cms as $id_cms) {
                Db::getInstance()->Execute('INSERT INTO `' . _DB_PREFIX_ . 'cms_block_page` (`id_cms_block`, `id_cms`, `is_category`) VALUES (' . (int) $id_block . ', ' . (int) $id_cms['id_cms'] . ', 0)');
            }
        } else {
            return true;
        }
    } else {
        return true;
    }
}
开发者ID:priyankajsr19,项目名称:indusdiva2,代码行数:28,代码来源:migrate_block_info_to_cms_block.php

示例2: add_order_state

function add_order_state($conf_name, $name, $invoice, $send_email, $color, $unremovable, $logable, $delivery, $template = null)
{
    $name_lang = array();
    $template_lang = array();
    foreach (explode('|', $name) as $item) {
        $temp = explode(':', $item);
        $name_lang[$temp[0]] = $temp[1];
    }
    if ($template) {
        foreach (explode('|', $template) as $item) {
            $temp = explode(':', $item);
            $template_lang[$temp[0]] = $temp[1];
        }
    }
    Db::getInstance()->Execute('
		INSERT INTO `' . _DB_PREFIX_ . 'order_state` (`invoice`, `send_email`, `color`, `unremovable`, `logable`, `delivery`) 
		VALUES (' . (int) $invoice . ', ' . (int) $send_email . ', \'' . pSQL($color) . '\', ' . (int) $unremovable . ', ' . (int) $logable . ', ' . (int) $delivery . ')');
    $id_order_state = Db::getInstance()->getValue('
		SELECT MAX(`id_order_state`)
		FROM `' . _DB_PREFIX_ . 'order_state`
	');
    foreach (Language::getLanguages() as $lang) {
        Db::getInstance()->Execute('
		INSERT IGNORE INTO `' . _DB_PREFIX_ . 'order_state_lang` (`id_lang`, `id_order_state`, `name`, `template`) 
		VALUES (' . (int) $lang['id_lang'] . ', ' . (int) $id_order_state . ', \'' . pSQL(isset($name_lang[$lang['iso_code']]) ? $name_lang[$lang['iso_code']] : $name_lang['en']) . '\', \'' . pSQL(isset($template_lang[$lang['iso_code']]) ? $template_lang[$lang['iso_code']] : (isset($template_lang['en']) ? $template_lang['en'] : '')) . '\')
		');
    }
    Configuration::updateValue($conf_name, $id_order_state);
}
开发者ID:srikanthash09,项目名称:codetestdatld,代码行数:29,代码来源:add_order_state.php

示例3: __construct

 public function __construct()
 {
     $this->bootstrap = true;
     $this->context = Context::getContext();
     $this->table = 'customer_thread';
     $this->className = 'CustomerThread';
     $this->lang = false;
     $contact_array = array();
     $contacts = Contact::getContacts($this->context->language->id);
     foreach ($contacts as $contact) {
         $contact_array[$contact['id_contact']] = $contact['name'];
     }
     $language_array = array();
     $languages = Language::getLanguages();
     foreach ($languages as $language) {
         $language_array[$language['id_lang']] = $language['name'];
     }
     $icon_array = array('open' => array('class' => 'icon-circle text-success', 'alt' => $this->l('Open')), 'closed' => array('class' => 'icon-circle text-danger', 'alt' => $this->l('Closed')), 'pending1' => array('class' => 'icon-circle text-warning', 'alt' => $this->l('Pending 1')), 'pending2' => array('class' => 'icon-circle text-warning', 'alt' => $this->l('Pending 2')));
     $status_array = array();
     foreach ($icon_array as $k => $v) {
         $status_array[$k] = $v['alt'];
     }
     $this->fields_list = array('id_customer_thread' => array('title' => $this->l('ID'), 'align' => 'center', 'class' => 'fixed-width-xs'), 'customer' => array('title' => $this->l('Customer'), 'filter_key' => 'customer', 'tmpTableFilter' => true), 'email' => array('title' => $this->l('Email'), 'filter_key' => 'a!email'), 'contact' => array('title' => $this->l('Type'), 'type' => 'select', 'list' => $contact_array, 'filter_key' => 'cl!id_contact', 'filter_type' => 'int'), 'language' => array('title' => $this->l('Language'), 'type' => 'select', 'list' => $language_array, 'filter_key' => 'l!id_lang', 'filter_type' => 'int'), 'status' => array('title' => $this->l('Status'), 'type' => 'select', 'list' => $status_array, 'icon' => $icon_array, 'align' => 'center', 'filter_key' => 'a!status', 'filter_type' => 'string'), 'employee' => array('title' => $this->l('Employee'), 'filter_key' => 'employee', 'tmpTableFilter' => true), 'messages' => array('title' => $this->l('Messages'), 'filter_key' => 'messages', 'tmpTableFilter' => true, 'maxlength' => 40), 'date_upd' => array('title' => $this->l('Last message'), 'havingFilter' => true, 'type' => 'datetime'));
     $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'), 'icon' => 'icon-trash'));
     $this->shopLinkType = 'shop';
     $this->fields_options = array('contact' => array('title' => $this->l('Contact options'), 'fields' => array('PS_CUSTOMER_SERVICE_FILE_UPLOAD' => array('title' => $this->l('Allow file uploading'), 'hint' => $this->l('Allow customers to upload files using the contact page.'), 'type' => 'bool'), 'PS_CUSTOMER_SERVICE_SIGNATURE' => array('title' => $this->l('Default message'), 'hint' => $this->l('Please fill out the message fields that appear by default when you answer a thread on the customer service page.'), 'type' => 'textareaLang', 'lang' => true)), 'submit' => array('title' => $this->l('Save'))), 'general' => array('title' => $this->l('Customer service options'), 'fields' => array('PS_SAV_IMAP_URL' => array('title' => $this->l('IMAP URL'), 'hint' => $this->l('URL for your IMAP server (ie.: mail.server.com).'), 'type' => 'text'), 'PS_SAV_IMAP_PORT' => array('title' => $this->l('IMAP port'), 'hint' => $this->l('Port to use to connect to your IMAP server.'), 'type' => 'text', 'defaultValue' => 143), 'PS_SAV_IMAP_USER' => array('title' => $this->l('IMAP user'), 'hint' => $this->l('User to use to connect to your IMAP server.'), 'type' => 'text'), 'PS_SAV_IMAP_PWD' => array('title' => $this->l('IMAP password'), 'hint' => $this->l('Password to use to connect your IMAP server.'), 'type' => 'text'), 'PS_SAV_IMAP_DELETE_MSG' => array('title' => $this->l('Delete messages'), 'hint' => $this->l('Delete messages after synchronization. If you do not enable this option, the synchronization will take more time.'), 'type' => 'bool'), 'PS_SAV_IMAP_CREATE_THREADS' => array('title' => $this->l('Create new threads'), 'hint' => $this->l('Create new threads for unrecognized emails.'), 'type' => 'bool'), 'PS_SAV_IMAP_OPT_NORSH' => array('title' => $this->l('IMAP options') . ' (/norsh)', 'type' => 'bool', 'hint' => $this->l('Do not use RSH or SSH to establish a preauthenticated IMAP sessions.')), 'PS_SAV_IMAP_OPT_SSL' => array('title' => $this->l('IMAP options') . ' (/ssl)', 'type' => 'bool', 'hint' => $this->l('Use the Secure Socket Layer (TLS/SSL) to encrypt the session.')), 'PS_SAV_IMAP_OPT_VALIDATE-CERT' => array('title' => $this->l('IMAP options') . ' (/validate-cert)', 'type' => 'bool', 'hint' => $this->l('Validate certificates from the TLS/SSL server.')), 'PS_SAV_IMAP_OPT_NOVALIDATE-CERT' => array('title' => $this->l('IMAP options') . ' (/novalidate-cert)', 'type' => 'bool', 'hint' => $this->l('Do not validate certificates from the TLS/SSL server. This is only needed if a server uses self-signed certificates.')), 'PS_SAV_IMAP_OPT_TLS' => array('title' => $this->l('IMAP options') . ' (/tls)', 'type' => 'bool', 'hint' => $this->l('Force use of start-TLS to encrypt the session, and reject connection to servers that do not support it.')), 'PS_SAV_IMAP_OPT_NOTLS' => array('title' => $this->l('IMAP options') . ' (/notls)', 'type' => 'bool', 'hint' => $this->l('Do not use start-TLS to encrypt the session, even with servers that support it.'))), 'submit' => array('title' => $this->l('Save'))));
     parent::__construct();
 }
开发者ID:zangles,项目名称:lennyba,代码行数:28,代码来源:AdminCustomerThreadsController.php

示例4: __construct

 /**
  * Initialise the object variables
  *
  */
 public function __construct($oContext = false)
 {
     if (is_object($oContext) && get_class($oContext) == 'Context') {
         $this->oContext = $oContext;
     }
     $aLanguages = Language::getLanguages(false);
     foreach ($this->aConfs as $var => $aConf) {
         $aParams = array(0 => $aConf['name'], 1 => false, 2 => false, 3 => false);
         if ($this->oContext) {
             if ((int) $aConf['multishopgroup']) {
                 $aParams[2] = (int) $this->oContext->shop->id_shop_group;
             }
             if ((int) $aConf['multishop']) {
                 $aParams[3] = (int) $this->oContext->shop->id;
             }
         }
         switch ($aConf['type']) {
             case 'int':
                 $this->{$var} = (int) call_user_func_array(array('Configuration', 'get'), $aParams);
                 break;
             default:
                 if ($this->oContext && (int) $aConf['multilang']) {
                     // Set the multilingual configurations
                     foreach ($aLanguages as $aLanguage) {
                         $aParams[1] = (int) $aLanguage['id_lang'];
                         $this->{$var}[(int) $aLanguage['id_lang']] = pSQL(call_user_func_array(array('Configuration', 'get'), $aParams));
                     }
                 } else {
                     $this->{$var} = pSQL(call_user_func_array(array('Configuration', 'get'), $aParams));
                 }
                 break;
         }
     }
 }
开发者ID:juniorhq88,项目名称:PrestaShop-modules,代码行数:38,代码来源:PrediggoConfig.php

示例5: add_new_tab

function add_new_tab($className, $name, $id_parent)
{
    $array = array();
    foreach (explode('|', $name) as $item) {
        $temp = explode(':', $item);
        $array[$temp[0]] = $temp[1];
    }
    if (!(int) Db::getInstance()->getValue('SELECT count(id_tab) FROM `' . _DB_PREFIX_ . 'tab` WHERE `class_name` = \'' . pSQL($className) . '\' ')) {
        Db::getInstance()->Execute('INSERT INTO `' . _DB_PREFIX_ . 'tab` (`id_parent`, `class_name`, `module`, `position`) VALUES (' . (int) $id_parent . ', \'' . pSQL($className) . '\', \'\', 
									(SELECT MAX(t.position)+ 1 FROM `' . _DB_PREFIX_ . 'tab` t WHERE t.id_parent = ' . (int) $id_parent . '))');
    }
    foreach (Language::getLanguages() as $lang) {
        Db::getInstance()->Execute('
		INSERT IGNORE INTO `' . _DB_PREFIX_ . 'tab_lang` (`id_lang`, `id_tab`, `name`) 
		VALUES (' . (int) $lang['id_lang'] . ', (
				SELECT `id_tab`
				FROM `' . _DB_PREFIX_ . 'tab`
				WHERE `class_name` = \'' . pSQL($className) . '\' LIMIT 0,1
			), \'' . pSQL(isset($array[$lang['iso_code']]) ? $array[$lang['iso_code']] : $array['en']) . '\')
		');
    }
    Db::getInstance()->Execute('INSERT IGNORE INTO `' . _DB_PREFIX_ . 'access` (`id_profile`, `id_tab`, `view`, `add`, `edit`, `delete`) 
								(SELECT `id_profile`, (
								SELECT `id_tab`
								FROM `' . _DB_PREFIX_ . 'tab`
								WHERE `class_name` = \'' . pSQL($className) . '\' LIMIT 0,1
								), 1, 1, 1, 1 FROM `' . _DB_PREFIX_ . 'profile` )');
}
开发者ID:priyankajsr19,项目名称:indusdiva2,代码行数:28,代码来源:add_new_tab.php

示例6: getTranslationsFieldsChild

 public function getTranslationsFieldsChild()
 {
     parent::validateFieldsLang();
     $fieldsArray = array('meta_title', 'meta_description', 'meta_keywords', 'link_rewrite');
     $fields = array();
     $languages = Language::getLanguages(false);
     $defaultLanguage = (int) Configuration::get('PS_LANG_DEFAULT');
     foreach ($languages as $language) {
         $fields[$language['id_lang']]['id_lang'] = (int) $language['id_lang'];
         $fields[$language['id_lang']][$this->identifier] = (int) $this->id;
         $fields[$language['id_lang']]['content'] = isset($this->content[$language['id_lang']]) ? pSQL($this->content[$language['id_lang']], true) : '';
         foreach ($fieldsArray as $field) {
             if (!Validate::isTableOrIdentifier($field)) {
                 die(Tools::displayError());
             }
             if (isset($this->{$field}[$language['id_lang']]) and !empty($this->{$field}[$language['id_lang']])) {
                 $fields[$language['id_lang']][$field] = pSQL($this->{$field}[$language['id_lang']]);
             } elseif (in_array($field, $this->fieldsRequiredLang)) {
                 $fields[$language['id_lang']][$field] = pSQL($this->{$field}[$defaultLanguage]);
             } else {
                 $fields[$language['id_lang']][$field] = '';
             }
         }
     }
     return $fields;
 }
开发者ID:nicolasjeol,项目名称:hec-ecommerce,代码行数:26,代码来源:CMS.php

示例7: install

 public function install()
 {
     Configuration::updateValue('PS_DASHGOALS_CURRENT_YEAR', date('Y'));
     for ($month = '01'; $month <= 12; $month = sprintf('%02d', $month + 1)) {
         $key = Tools::strtoupper('dashgoals_traffic_' . $month . '_' . date('Y'));
         if (!ConfigurationKPI::get($key)) {
             ConfigurationKPI::updateValue($key, 600);
         }
         $key = Tools::strtoupper('dashgoals_conversion_' . $month . '_' . date('Y'));
         if (!ConfigurationKPI::get($key)) {
             ConfigurationKPI::updateValue($key, 2);
         }
         $key = Tools::strtoupper('dashgoals_avg_cart_value_' . $month . '_' . date('Y'));
         if (!ConfigurationKPI::get($key)) {
             ConfigurationKPI::updateValue($key, 80);
         }
     }
     // Prepare tab
     $tab = new Tab();
     $tab->active = 1;
     $tab->class_name = 'AdminDashgoals';
     $tab->name = array();
     foreach (Language::getLanguages(true) as $lang) {
         $tab->name[$lang['id_lang']] = 'Dashgoals';
     }
     $tab->id_parent = -1;
     $tab->module = $this->name;
     return $tab->add() && parent::install() && $this->registerHook('dashboardZoneTwo') && $this->registerHook('dashboardData') && $this->registerHook('actionAdminControllerSetMedia');
 }
开发者ID:informaticapb,项目名称:Prestashop,代码行数:29,代码来源:dashgoals.php

示例8: createtdDefaultData

 public static function createtdDefaultData()
 {
     $context = Context::getContext();
     $id_shop = $context->shop->id;
     $psbaseurl = _PS_BASE_URL_ . __PS_BASE_URI__;
     $modlink = _PS_BASE_URL_ . __PS_BASE_URI__ . 'blog';
     $sql = Db::getInstance()->Execute('
         INSERT INTO `' . _DB_PREFIX_ . 'tdmegamenu`(`id_tdmegamenu`,`menu_type`,`order`,`parent`,`custome_type`,`id_shop`) 
         VALUES(1,"LNK1",1,0,"cus_url",' . $id_shop . ')');
     $sql = Db::getInstance()->Execute('
         INSERT INTO `' . _DB_PREFIX_ . 'tdmegamenu`(`id_tdmegamenu`,`menu_type`,`order`,`parent`,`custome_type`,`id_shop`) 
         VALUES(2,"LNK2",2,0,"cus_url",' . $id_shop . ')');
     $languages = Language::getLanguages(false);
     for ($i = 1; $i <= 2; $i++) {
         if ($i == 1) {
             $title = "Home";
             $links = $psbaseurl;
         } elseif ($i == 2) {
             $title = "Blog";
             $links = $modlink;
         }
         foreach ($languages as $language) {
             $sql .= Db::getInstance()->Execute('
             INSERT INTO `' . _DB_PREFIX_ . 'tdmegal`(`id_tdmegamenu`,`id_lang`,`menu_title`,`menu_link`,`description`) 
             VALUES(' . (int) $i . ', ' . (int) $language['id_lang'] . ', "' . $title . '","' . $links . '", "")');
         }
     }
     return true;
 }
开发者ID:reshman,项目名称:swkart-presta,代码行数:29,代码来源:tdmegamenuModel.php

示例9: copyFromPost

 /**
  * @param object &$object Object
  * @param string $table Object table
  * @ DONE
  */
 protected function copyFromPost(&$object, $table, $post = array())
 {
     /* Classical fields */
     foreach ($post as $key => $value) {
         if (key_exists($key, $object) && $key != 'id_' . $table) {
             /* Do not take care of password field if empty */
             if ($key == 'passwd' && Tools::getValue('id_' . $table) && empty($value)) {
                 continue;
             }
             if ($key == 'passwd' && !empty($value)) {
                 /* Automatically encrypt password in MD5 */
                 $value = Tools::encrypt($value);
             }
             $object->{$key} = $value;
         }
     }
     /* Multilingual fields */
     $rules = call_user_func(array(get_class($object), 'getValidationRules'), get_class($object));
     if (count($rules['validateLang'])) {
         $languages = Language::getLanguages(false);
         foreach ($languages as $language) {
             foreach (array_keys($rules['validateLang']) as $field) {
                 $field_name = $field . '_' . (int) $language['id_lang'];
                 $value = Tools::getValue($field_name);
                 if (isset($value)) {
                     # validate module
                     $object->{$field}[(int) $language['id_lang']] = $value;
                 }
             }
         }
     }
 }
开发者ID:ahmedonee,项目名称:morinella,代码行数:37,代码来源:blog.php

示例10: renderConfigurationForm

 public function renderConfigurationForm()
 {
     $lang = new Language((int) Configuration::get('PS_LANG_DEFAULT'));
     $langs = Language::getLanguages();
     $id_shop = (int) $this->context->shop->id;
     foreach ($langs as $key => $language) {
         $options[] = array('id_option' => $language['id_lang'], 'name' => $language['name']);
     }
     $cats = $this->getCategories($lang->id, true, $id_shop);
     $categories[] = array('id_option' => 99999, 'name' => 'All');
     foreach ($cats as $key => $cat) {
         $categories[] = array('id_option' => $cat['id_category'], 'name' => $cat['name']);
     }
     $inputs = array(array('type' => 'select', 'label' => $this->l('Language'), 'desc' => $this->l('Choose a language you wish to export'), 'name' => 'export_language', 'class' => 't', 'options' => array('query' => $options, 'id' => 'id_option', 'name' => 'name')), array('type' => 'text', 'label' => $this->l('Delimiter'), 'name' => 'export_delimiter', 'value' => ',', 'desc' => $this->l('The character to separate the fields')), array('type' => 'radio', 'label' => $this->l('Export active products?'), 'name' => 'export_active', 'values' => array(array('id' => 'active_off', 'value' => 0, 'label' => 'no, export all products.'), array('id' => 'active_on', 'value' => 1, 'label' => 'yes, export only active products')), 'is_bool' => true), array('type' => 'select', 'label' => $this->l('Product Category'), 'desc' => $this->l('Choose a product category you wish to export'), 'name' => 'export_category', 'class' => 't', 'options' => array('query' => $categories, 'id' => 'id_option', 'name' => 'name')));
     $fields_form = array('form' => array('legend' => array('title' => $this->l('Export Options'), 'icon' => 'icon-cogs'), 'input' => $inputs, 'submit' => array('title' => $this->l('Export'))));
     $helper = new HelperForm();
     $helper->show_toolbar = false;
     $helper->default_form_language = $lang->id;
     $helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') ? Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') : 0;
     $this->fields_form = array();
     $helper->identifier = $this->identifier;
     $helper->submit_action = 'submitExport';
     $helper->currentIndex = self::$currentIndex;
     $helper->token = Tools::getAdminTokenLite('AdminExportProducts');
     $helper->tpl_vars = array('fields_value' => $this->getConfigFieldsValues(), 'languages' => $this->context->controller->getLanguages(), 'id_language' => $this->context->language->id);
     return $helper->generateForm(array($fields_form));
 }
开发者ID:KaipiYann,项目名称:exportproducts,代码行数:27,代码来源:AdminExportProducts.php

示例11: install

 public function install()
 {
     // Install SQL
     include dirname(__FILE__) . '/sql/install.php';
     foreach ($sql as $s) {
         if (!Db::getInstance()->execute($s)) {
             return false;
         }
     }
     // Install Tabs
     if (!(int) Tab::getIdFromClassName('AdminPosMenu')) {
         $parent_tab = new Tab();
         // Need a foreach for the language
         $parent_tab->name[$this->context->language->id] = $this->l('PosExtentions');
         $parent_tab->class_name = 'AdminPosMenu';
         $parent_tab->id_parent = 0;
         // Home tab
         $parent_tab->module = $this->name;
         $parent_tab->add();
     }
     $tab = new Tab();
     // Need a foreach for the language
     foreach (Language::getLanguages() as $language) {
         $tab->name[$language['id_lang']] = $this->l('Manage Static Footer');
     }
     $tab->class_name = 'AdminPosstaticfooter';
     $tab->id_parent = (int) Tab::getIdFromClassName('AdminPosMenu');
     $tab->module = $this->name;
     $tab->add();
     // Set some defaults
     return parent::install() && $this->registerHook('footer') && $this->_installHookCustomer() && $this->registerHook('blockFooter1') && $this->registerHook('blockFooter2') && $this->registerHook('blockFooter3') && $this->registerHook('displayBackOfficeHeader');
 }
开发者ID:OaSiis,项目名称:LDDP,代码行数:32,代码来源:posstaticfooter.php

示例12: install

 public function install()
 {
     if (!parent::install() || !Configuration::updateValue('eicmslinks_admin_path', 0)) {
         return false;
     }
     //Copie des dossier de l'editeur tinyMce
     $this->copyDir(dirname(__FILE__) . '/tiny_mce/', dirname(__FILE__) . '/../../js/tiny_mce/plugins/');
     //Copie de l'override du formulaire cms de l'admin (Normalement devrait fonctionner via prestashop)
     $this->copyDir(dirname(__FILE__) . '/override/controllers/admin/templates/', dirname(__FILE__) . '/../../override/controllers/admin/templates/');
     //Création d'une tab prestashop ( nécessaire pour le controller back office )
     $tab = new Tab();
     $tab->class_name = 'wysiwyg';
     //On va la ranger dans "Préférences comme les pages cms y sont insérée
     $id_parent = Tab::getIdFromClassName('AdminParentPreferences');
     $tab->id_parent = $id_parent;
     $tab->module = $this->name;
     $languages = Language::getLanguages();
     foreach ($languages as $lang) {
         $tab->name[$lang['id_lang']] = 'EiCmsLinks';
     }
     try {
         $tab->save();
     } catch (Exception $e) {
         echo $e->getMessage();
         return false;
     }
     //Spécifique 1.5 ( on renomme le fichier de surcharge avec le bon nom car ils ne sont pas compatibles entre les versions )
     if (_PS_VERSION_ < '1.6') {
         rename(dirname(__FILE__) . '/../../override/controllers/admin/templates/cms/helpers/form/form.tpl', dirname(__FILE__) . '/../../override/controllers/admin/templates/cms/helpers/form/form16.tpl');
         rename(dirname(__FILE__) . '/../../override/controllers/admin/templates/cms/helpers/form/form15.tpl', dirname(__FILE__) . '/../../override/controllers/admin/templates/cms/helpers/form/form.tpl');
     }
     return true;
 }
开发者ID:nenes25,项目名称:prestashop_eicmslinks,代码行数:33,代码来源:eicmslinks.php

示例13: init

 public function init()
 {
     ${"GLOBALS"}["pcwndnxzm"] = "isoTinyMCE";
     parent::init();
     ${"GLOBALS"}["akprgggjmj"] = "languages";
     ${"GLOBALS"}["tbvspw"] = "deflang";
     ${"GLOBALS"}["vhicmlpg"] = "custom_labels";
     ${${"GLOBALS"}["tbvspw"]} = new Language(self::$cookie->id_lang);
     $tmulinwrlntj = "str_custom_multi_lang_fields";
     ${"GLOBALS"}["ktemnns"] = "custom_multi_lang_fields";
     ${${"GLOBALS"}["gdwbgebyw"]} = file_exists(_PS_ROOT_DIR_ . "/js/tiny_mce/langs/" . $deflang->iso_code . ".js") ? $deflang->iso_code : "en";
     ${${"GLOBALS"}["iffkuw"]} = str_replace("\\", "\\\\", dirname($_SERVER["PHP_SELF"]));
     ${${"GLOBALS"}["akprgggjmj"]} = Language::getLanguages(false);
     ${"GLOBALS"}["aecuqgnp"] = "custom_multi_lang_fields";
     ${${"GLOBALS"}["ijwyqrvm"]} = new AgileMultipleSeller();
     ${${"GLOBALS"}["iqpxuil"]} = Configuration::getMultiple($sellermodule->getCustomFields());
     ${${"GLOBALS"}["vhicmlpg"]} = $sellermodule->getCustomLabels(":");
     ${"GLOBALS"}["ppyvhso"] = "custom_labels";
     ${${"GLOBALS"}["aecuqgnp"]} = SellerInfo::getCustomMultiLanguageFields();
     ${$tmulinwrlntj} = "";
     ${"GLOBALS"}["wsahmoa"] = "isoTinyMCE";
     foreach (${${"GLOBALS"}["ktemnns"]} as ${${"GLOBALS"}["jbuucd"]}) {
         ${"GLOBALS"}["krcvdjennfj"] = "custom_multi_lang_field";
         ${${"GLOBALS"}["lkuqcxcngl"]} .= "&curren;" . ${${"GLOBALS"}["krcvdjennfj"]};
     }
     self::$smarty->assign(array("seller_tab_id" => 2, "ad" => ${${"GLOBALS"}["iffkuw"]}, "isoTinyMCE" => ${${"GLOBALS"}["pcwndnxzm"]}, "theme_css_dir" => _THEME_CSS_DIR_, "languages" => ${${"GLOBALS"}["tgpizrhrpccv"]}, "current_id_lang" => self::$cookie->id_lang, "conf" => ${${"GLOBALS"}["iqpxuil"]}, "custom_labels" => ${${"GLOBALS"}["ppyvhso"]}, "str_custom_multi_lang_fields" => ${${"GLOBALS"}["lkuqcxcngl"]}, "shop_url_mode" => (int) Configuration::get("ASP_SHOP_URL_MODE"), "iso_code" => ${${"GLOBALS"}["wsahmoa"]}));
 }
开发者ID:ecssjapan,项目名称:guiding-you-afteropen,代码行数:27,代码来源:sellerbusiness.php

示例14: saveBlog

 public function saveBlog()
 {
     // Validate
     $this->validateBlog();
     $languages = Language::getLanguages(0);
     // insert new data
     $title = Tools::getValue('title');
     $link_rewrite = Tools::str2url($title);
     $short_description = Tools::getValue('short_description');
     $content = Tools::getValue('content');
     // Insert into smart_blog_post table
     $query_blog = "INSERT INTO " . _DB_PREFIX_ . "smart_blog_post (`id_author`, `id_category`, `position`, `active`, `available`, `created`, `post_type`, `comment_status`,`viewed`, `is_featured`)\n\t\t\t\t  VALUES ('" . $this->context->controller->seller->id . "', 1, 0, 1, 1, '" . date('Y-m-d H:i:s') . "', 0, 1,0,0)";
     Db::getInstance()->execute($query_blog);
     $last_id = Db::getInstance()->Insert_ID();
     // insert into smart_blog_post_lang table
     $insert_data = array();
     foreach ($languages as $key => $value) {
         $id_lang = $value['id_lang'];
         $insert_data[] = '(' . $last_id . ', ' . $id_lang . ', "' . pSQL($title) . '", "' . pSQL($short_description) . '", "' . pSQL($short_description) . '", "' . pSQL($content) . '", "' . pSQL($link_rewrite) . '")';
     }
     $flat_data = implode(",", $insert_data);
     $query_blog_lang = "INSERT INTO " . _DB_PREFIX_ . "smart_blog_post_lang (`id_smart_blog_post`, `id_lang`, `meta_title`, `meta_description`, `short_description`, `content`, `link_rewrite`) VALUES \n\t\t" . $flat_data;
     Db::getInstance()->execute($query_blog_lang);
     // insert into smart_blog_post_shop
     $blog_shop = "INSERT INTO " . _DB_PREFIX_ . "smart_blog_post_shop (`id_smart_blog_post`,`id_shop`) VALUES(" . $last_id . ",1)";
     Db::getInstance()->execute($blog_shop);
     return $last_id;
     // die('<pre>'.print_r($query, true));
 }
开发者ID:sho5kubota,项目名称:guidingyou2,代码行数:29,代码来源:smartform.php

示例15: renderForm

 public function renderForm()
 {
     if (Context::getContext()->shop->getContext() != Shop::CONTEXT_SHOP && Shop::isFeatureActive()) {
         $this->errors[] = $this->l('You have to select a shop before creating new orders.');
     }
     $id_cart = (int) Tools::getValue('id_cart');
     $cart = new Cart((int) $id_cart);
     if ($id_cart && !Validate::isLoadedObject($cart)) {
         $this->errors[] = $this->l('This cart does not exists');
     }
     if ($id_cart && Validate::isLoadedObject($cart) && !$cart->id_customer) {
         $this->errors[] = $this->l('The cart must have a customer');
     }
     if (count($this->errors)) {
         return false;
     }
     parent::renderForm();
     unset($this->toolbar_btn['save']);
     $this->addJqueryPlugin(array('autocomplete', 'fancybox', 'typewatch'));
     $defaults_order_state = array('cheque' => (int) Configuration::get('PS_OS_CHEQUE'), 'bankwire' => (int) Configuration::get('PS_OS_BANKWIRE'), 'cashondelivery' => Configuration::get('PS_OS_COD_VALIDATION') ? (int) Configuration::get('PS_OS_COD_VALIDATION') : (int) Configuration::get('PS_OS_PREPARATION'), 'other' => (int) Configuration::get('PS_OS_PAYMENT'));
     $payment_modules = array();
     foreach (PaymentModule::getInstalledPaymentModules() as $p_module) {
         $payment_modules[] = Module::getInstanceById((int) $p_module['id_module']);
     }
     $this->context->smarty->assign(array('recyclable_pack' => (int) Configuration::get('PS_RECYCLABLE_PACK'), 'gift_wrapping' => (int) Configuration::get('PS_GIFT_WRAPPING'), 'cart' => $cart, 'currencies' => Currency::getCurrenciesByIdShop(Context::getContext()->shop->id), 'langs' => Language::getLanguages(true, Context::getContext()->shop->id), 'payment_modules' => $payment_modules, 'order_states' => OrderState::getOrderStates((int) Context::getContext()->language->id), 'defaults_order_state' => $defaults_order_state, 'show_toolbar' => $this->show_toolbar, 'toolbar_btn' => $this->toolbar_btn, 'toolbar_scroll' => $this->toolbar_scroll, 'PS_CATALOG_MODE' => Configuration::get('PS_CATALOG_MODE'), 'title' => array($this->l('Orders'), $this->l('Create order'))));
     $this->content .= $this->createTemplate('form.tpl')->fetch();
 }
开发者ID:paolobattistella,项目名称:aphro,代码行数:27,代码来源:AdminAphOrdersController.php


注:本文中的Language::getLanguages方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。