public function renderForm()
 {
     $fields_form = array('form' => array('legend' => array('title' => $this->l('Homepage categories'), 'icon' => ''), 'input' => array(array('type' => 'cat_choice', 'label' => '', 'name' => 'cats')), 'submit' => array('name' => 'submitBlockhomecats', 'title' => $this->l('Save'))));
     $lang = $this->context->language;
     if ($selectedCats = Configuration::get('MOD_BLOCKHOMECATS_CATS')) {
         $selectedCats = explode(',', $selectedCats);
         foreach ($selectedCats as $index => $id_category) {
             $selectedCats[$index] = new Category($id_category, $this->context->language->id);
         }
     } else {
         $selectedCats = null;
     }
     $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;
     $helper->module = $this;
     $helper->identifier = 'id_blocklink';
     $helper->submit_action = 'submit';
     $helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false) . '&configure=' . $this->name . '&tab_module=' . $this->tab . '&module_name=' . $this->name;
     $helper->token = Tools::getAdminTokenLite('AdminModules');
     $helper->fields_value = array('text' => 'text');
     $categories = Category::getNestedCategories(2, $this->context->language->id, false);
     $helper->tpl_vars = array('allCats' => $this->getAllCats(current($categories)), 'selectedCats' => $selectedCats);
     return $helper->generateForm(array($fields_form));
 }
 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));
 }
Example #3
0
 public function displayFormSettings()
 {
     $veykuwqwjkus = "currency";
     ${"GLOBALS"}["tthknplj"] = "currencies";
     $lfapjegsknsa = "currency_list";
     $this->context->controller->addCSS($this->_path . "css/agilepaypal.css", "all");
     ${${"GLOBALS"}["teujyh"]} = array();
     array_push(${$lfapjegsknsa}, array("id" => 0, "name" => $this->l('Please choose')));
     $tfcoqgvrd = "helper";
     ${${"GLOBALS"}["sajaoqav"]} = Currency::getCurrencies(false, false);
     foreach (${${"GLOBALS"}["tthknplj"]} as ${$veykuwqwjkus}) {
         $unlqgrxvnkrh = "currency";
         array_push(${${"GLOBALS"}["teujyh"]}, array("id" => ${${"GLOBALS"}["duxtnwtj"]}["id_currency"], "name" => ${$unlqgrxvnkrh}["name"]));
     }
     ${${"GLOBALS"}["ogzmjfmjkidg"]} = array("form" => array("legend" => array("title" => $this->l('Settings'), "image" => $this->_path . "logo.gif"), "input" => array(array("type" => "text", "label" => $this->l('PayPal business e-mail'), "class" => "width10", "name" => "business", "size" => 33), array("type" => "select", "label" => $this->l('Paypal Account Currency'), "name" => "paypal_currency", "options" => array("query" => ${${"GLOBALS"}["teujyh"]}, "id" => "id", "name" => "name"), "desc" => $this->l('Please select the your Paypal Account Currency.')), array("type" => "radio", "label" => $this->l('Sandbox mode (Test)'), "name" => "sandbox", "values" => array(array("id" => "sandbox_yes", "value" => 1, "label" => $this->l('Yes')), array("id" => "sandbox_no", "value" => 0, "label" => $this->l('No')))), array("type" => "radio", "label" => $this->l('Mutiple Sellers Mode'), "name" => "support_sellers", "hint" => $this->l('If you have installed the Agile Multiple Seller module'), "form_group_class" => Module::isInstalled("agilemultipleseller") ? "" : "hidden", "values" => array(array("id" => "support_sellers_yes", "value" => 1, "label" => $this->l('Yes')), array("id" => "support_sellers_no", "value" => 0, "label" => $this->l('No'))), "desc" => array($this->l('All settings are the same for all sellers, except the Paypal account information which is managed in the Agile Multiple Seller module'))), array("type" => "htmlhr", "name" => "section1", "values" => array()), array("type" => "text", "label" => $this->l('Banner image URL'), "class" => "width10", "name" => "header", "size" => 82, "desc" => $this->l('The image should be hosted on a secured server in order to avoid security warnings. Size should be limited to 750x90px.')), array("type" => "htmlhr", "name" => "section2", "values" => array()), array("type" => "agile_radio_checkbox", "label" => $this->l('Express Checkout Enabled'), "name" => "express_enabled", "values" => array(array("id" => "express_enabled_yes", "value" => 1, "label" => $this->l('Yes'), "onclick" => "showitem('.express_enabled_yes')", "checkbox_list" => array("class" => "express_enabled_yes agile-radio-checkbox", "query" => array(array("id" => "hidecountry", "val" => 1, "name" => $this->l('Hide Countries') . "<font color=red>&nbsp;--&nbsp;" . $this->l('If your store ships to one country only.') . "</font>"), array("id" => "hidecarrier", "val" => 1, "name" => $this->l('Hide Carriers') . "<font color=red>&nbsp;--&nbsp;" . $this->l('If your store has one carrier, or no carrier') . "</font>"), array("id" => "hideterms", "val" => 1, "name" => $this->l('Hide Terms and Conditions') . "&nbsp;&nbsp;" . $this->l('Hide Terms and Conditions') . "&nbsp;--&nbsp;" . $this->l('If your want to hide the "Terms & Conditions" agreement checkbox at the express checkout screen'))), "id" => "id", "name" => "name")), array("id" => "express_enabled_no", "value" => 0, "label" => $this->l('No'), "onclick" => "hideitem('.express_enabled_yes')"))), array("type" => "htmlhr", "name" => "section3", "values" => array()), array("type" => "radio", "label" => $this->l('Force "Checkout" goes though summary page'), "name" => "force_summary", "values" => array(array("id" => "force_summary_yes", "value" => 1, "label" => $this->l('Yes')), array("id" => "force_summary_no", "value" => 0, "label" => $this->l('No'))), "desc" => $this->l('There are two buttons (Cart and Checkout) in the cart block. The "Checkout" button will bypass the order summary page, so the user will not be able to choose Express Checkout. Selecting "Yes" will force Checkout to go though the order summary page')), array("type" => "htmlhr", "name" => "section4", "values" => array()), array("type" => "agile_radio_checkbox", "label" => $this->l('Enable Recurring Payment'), "name" => "recurringpayment", "hint" => $this->l('Determine whether allow customers to subcribe for automatic, periodic payments, such as membership payments, etc.'), "values" => array(array("id" => "recurringpayment_yes", "value" => 1, "label" => $this->l('Yes'), "p" => $this->l('This will allow customers to subcribe for automatic, periodic payments, such as membership payments, etc.'), "onclick" => "showitem('.recurringpayment_yes')", "checkbox_list" => array("class" => "recurringpayment_yes agile-radio-checkbox", "query" => array(array("id" => "recurringdaily", "val" => 1, "name" => $this->l('Daily')), array("id" => "recurringweekly", "val" => 1, "name" => $this->l('Weekly')), array("id" => "recurringmonthly", "val" => 1, "name" => $this->l('Mobthly')), array("id" => "recurringyearly", "val" => 1, "name" => $this->l('Yearly'))), "id" => "id", "name" => "name")), array("id" => "recurringpayment_no", "value" => 0, "label" => $this->l('No'), "onclick" => "hideitem('.recurringpayment_yes')"))), array("type" => "htmlhr", "name" => "section5", "values" => array()), array("type" => "agile_text_addon", "label" => $this->l('Paypal Micropayment Account(Optional)'), "class" => "width10", "name" => "business2", "hint" => $this->l('Please leave this field empty if you are not using it'), "size" => 33, "addon_text" => $this->l('Max Amount:'), "addon_name" => "micro_amount", "addon_id" => "micro_amount", "size_addon" => 10, "desc" => array($this->l('What is Paypal Micropayment Account?'), $this->l('PayPal offers support for Micropayments to merchants for US to US, GB to GB, AU to AU, and EU to EU transactions for Business and Premier accounts. This feature is offered at a special rate of 5% + $0.05 per transaction. ') . "<a href=\"https://www.paypalobjects.com/IntegrationCenter/ic_micropayments.html\" target=\"_blank\" style=\"color:Blue\">" . $this->l('See here for detail') . "</a>")), array("type" => "agile_radio_checkbox", "label" => $this->l('Membership Integrattion'), "name" => "am_integrated", "hint" => $this->l(' Integrated with membership module'), "form_group_class" => Module::isInstalled("agilemembership") ? "" : "hidden", "values" => array(array("id" => "am_integrated_yes", "value" => 1, "label" => $this->l('Yes'), "onclick" => "showitem('.am_integrated_yes')", "checkbox_list" => array("class" => "am_integrated_yes agile-radio-checkbox", "query" => array(array("id" => "am_show_choice", "val" => 1, "name" => $this->l('Allow customer to choose repeating times')), array("id" => "am_mix_product", "val" => 1, "name" => $this->l('Prevent Membership and other product mix in the shopping cart')), array("id" => "subscribe_only", "val" => 1, "name" => $this->l('Make this module for membership payment only'))), "id" => "id", "name" => "name")), array("id" => "am_integrated_no", "value" => 0, "label" => $this->l('No'), "onclick" => "hideitem('.am_integrated_yes')")))), "submit" => array("title" => $this->l('Update settings'))));
     $fjxhbnyyanl = "lang";
     ${$tfcoqgvrd} = new HelperForm();
     $helper->show_toolbar = false;
     $helper->table = $this->name;
     ${$fjxhbnyyanl} = new Language((int) Configuration::get("PS_LANG_DEFAULT"));
     $helper->default_form_language = $lang->id;
     $helper->module = $this;
     $helper->allow_employee_form_lang = Configuration::get("PS_BO_ALLOW_EMPLOYEE_FORM_LANG") ? Configuration::get("PS_BO_ALLOW_EMPLOYEE_FORM_LANG") : 0;
     $helper->identifier = $this->identifier;
     $helper->submit_action = "submitPaypal";
     $helper->currentIndex = $this->context->link->getAdminLink("AdminModules", false) . "&configure=" . $this->name . "&tab_module=" . $this->tab . "&module_name=" . $this->name;
     $helper->token = Tools::getAdminTokenLite("AdminModules");
     $helper->tpl_vars = array("fields_value" => $this->getConfigFieldsValues(), "languages" => $this->context->controller->getLanguages(), "id_language" => $this->context->language->id);
     $this->_html .= $helper->generateForm(array(${${"GLOBALS"}["ogzmjfmjkidg"]}));
     $this->context->controller->addCSS($this->_path . "css/agilepaypal.css", "all");
     $this->context->controller->addJS($this->_path . "js/agilepaypal.js");
 }
 public function displayForm()
 {
     // Get default language
     $default_lang = (int) Configuration::get('PS_LANG_DEFAULT');
     // Init Fields form array
     $fields_form[0]['form'] = array('legend' => array('title' => $this->l('Ustawienia Integracyjne')), 'input' => array(array('type' => 'text', 'label' => $this->l('Hash sklepu w Shopconnector'), 'name' => 'SHOPCONNECTORMODULE_HASH', 'size' => 20, 'required' => true)), 'submit' => array('title' => $this->l('Save'), 'class' => 'button'));
     $helper = new HelperForm();
     if (!extension_loaded('mcrypt')) {
         echo '<div style="padding: 20px; text-align: center; background-color: yellow; font-weight: bold;">Do poprawnego działania wtyczki ShopConnector wymagane jest zainstalowanie rozszerzenia PHP mcrypt.</div>';
     }
     // Module, token and currentIndex
     $helper->module = $this;
     $helper->name_controller = $this->name;
     $helper->token = Tools::getAdminTokenLite('AdminModules');
     $helper->currentIndex = AdminController::$currentIndex . '&configure=' . $this->name;
     // Language
     $helper->default_form_language = $default_lang;
     $helper->allow_employee_form_lang = $default_lang;
     // Title and toolbar
     $helper->title = $this->displayName;
     $helper->show_toolbar = true;
     // false -> remove toolbar
     $helper->toolbar_scroll = true;
     // yes - > Toolbar is always visible on the top of the screen.
     $helper->submit_action = 'submit' . $this->name;
     $helper->toolbar_btn = array('save' => array('desc' => $this->l('Save'), 'href' => AdminController::$currentIndex . '&configure=' . $this->name . '&save' . $this->name . '&token=' . Tools::getAdminTokenLite('AdminModules')), 'back' => array('href' => AdminController::$currentIndex . '&token=' . Tools::getAdminTokenLite('AdminModules'), 'desc' => $this->l('Back to list')));
     // Load current value
     $helper->fields_value['SHOPCONNECTORMODULE_HASH'] = Configuration::get('SHOPCONNECTORMODULE_HASH');
     return $helper->generateForm($fields_form);
 }
Example #5
0
 public function displayForm()
 {
     // Get default Language
     $default_lang = (int) Configuration::get('PS_LANG_DEFAULT');
     // Init Fields form array
     $fields_form[0]['form'] = array('legend' => array('title' => $this->l('Product Update')), 'input' => array(array('type' => 'text', 'label' => $this->l('List'), 'name' => 'PRODUCTUPDATE_LIST', 'size' => 20, 'required' => true)), 'submit' => array('title' => $this->l('Update'), 'class' => 'button'));
     $helper = new HelperForm();
     // Module, t    oken and currentIndex
     $helper->module = $this;
     $helper->name_controller = $this->name;
     $helper->token = Tools::getAdminTokenLite('AdminModules');
     $helper->currentIndex = AdminController::$currentIndex . '&configure=' . $this->name;
     // Language
     $helper->default_form_language = $default_lang;
     $helper->allow_employee_form_lang = $default_lang;
     // Title and toolbar
     $helper->title = $this->displayName;
     $helper->show_toolbar = true;
     // false -> remove toolbar
     $helper->toolbar_scroll = true;
     // yes - > Toolbar is always visible on the top of the screen.
     $helper->submit_action = 'submit' . $this->name;
     $helper->toolbar_btn = array('save' => array('desc' => $this->l('Save'), 'href' => AdminController::$currentIndex . '&configure=' . $this->name . '&save' . $this->name . '&token=' . Tools::getAdminTokenLite('AdminModules')), 'back' => array('href' => AdminController::$currentIndex . '&token=' . Tools::getAdminTokenLite('AdminModules'), 'desc' => $this->l('Back to list')));
     // Load current value
     $helper->fields_value['PRODUCTUPDATE_LIST'] = Configuration::get('PRODUCTUPDATE_LIST');
     return $helper->generateForm($fields_form);
 }
 public function __construct()
 {
     $this->name = 'adminmarketingestep5';
     $this->bootstrap = true;
     $this->module = 'expressmailing';
     $this->context = Context::getContext();
     $this->lang = false;
     $this->default_form_language = $this->context->language->id;
     $this->campaign_id = (int) Tools::getValue('campaign_id');
     if (empty($this->campaign_id)) {
         Tools::redirectAdmin('index.php?controller=AdminMarketingX&token=' . Tools::getAdminTokenLite('AdminMarketingX'));
         exit;
     }
     parent::__construct();
     $this->session_api = new SessionApi();
     // On regarde si le compte est toujours en activité
     // --------------------------------------------------------------------------------
     if ($this->session_api->connectFromCredentials('email')) {
         // Si le compte est toujours en activité :
         // 1/ on crée une liste de diffusion pour le mailing actuel
         // 2/ on update le message HTML
         // 3/ puis on passe à l'étape 6
         // -------------------------------------------
         if ($this->updateApiListMessage()) {
             Tools::redirectAdmin('index.php?controller=AdminMarketingEStep6&campaign_id=' . $this->campaign_id . '&token=' . Tools::getAdminTokenLite('AdminMarketingEStep6'));
             exit;
         }
     }
 }
 public function __construct()
 {
     $id_seller_home = AgileSellerManager::get_current_logged_seller_home_category_id();
     $id_category = intval(Tools::getValue('id_category'));
     $id_parent = intval(Tools::getValue('id_parent'));
     if ($id_seller_home > 0) {
         $url2sellerhome = "./index.php?controller=AdminCategories&id_category=" . $id_seller_home . "&viewcategory&token=" . Tools::getAdminTokenLite("AdminCategories");
         if ($id_category == 0 && $id_parent == 0) {
             Tools::redirectAdmin($url2sellerhome);
         }
         if ($id_category > 0 && $id_category != $id_seller_home && !AgileHelper::isSuccessor($id_seller_home, $id_category)) {
             Tools::redirectAdmin($url2sellerhome);
         }
         if ($id_parent > 0 && $id_parent != $id_seller_home && !AgileHelper::isSuccessor($id_seller_home, $id_category)) {
             Tools::redirectAdmin($url2sellerhome);
         }
     }
     parent::__construct();
     if (Module::isInstalled('agilemultipleseller')) {
         $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?')));
         if (!$this->is_seller) {
             $this->bulk_actions['assignto'] = array('text' => $this->l('Assign to seller'), 'confirm' => $this->l('Assign selected items to the seller?'));
         }
     }
     if (Module::isInstalled('agilemultipleseller')) {
         $this->agilemultipleseller_list_override();
     }
 }
 public function __construct()
 {
     $this->name = 'adminmarketingsstep7';
     $this->bootstrap = true;
     $this->module = 'expressmailing';
     $this->context = Context::getContext();
     $this->lang = false;
     $this->default_form_language = $this->context->language->id;
     $this->campaign_id = (int) Tools::getValue('campaign_id');
     if (empty($this->campaign_id)) {
         Tools::redirectAdmin('index.php?controller=AdminMarketingX&token=' . Tools::getAdminTokenLite('AdminMarketingX'));
         exit;
     }
     parent::__construct();
     // API initialization
     // ------------------
     include _PS_MODULE_DIR_ . $this->module->name . '/controllers/admin/session_api.php';
     $this->session_api = new SessionApi();
     // Checking the session
     // --------------------
     if (!$this->session_api->connectFromCredentials('sms')) {
         Tools::redirectAdmin('index.php?controller=AdminMarketingSStep4&token=' . Tools::getAdminTokenLite('AdminMarketingSStep4'));
         exit;
     }
     // Enfin, on retrouve les éléments depuis la base de données + de l'API
     // --------------------------------------------------------------------
     $this->getFieldsValues();
 }
 public function __construct()
 {
     $this->name = 'adminmarketingestep8';
     $this->bootstrap = true;
     $this->module = 'expressmailing';
     $this->context = Context::getContext();
     $this->lang = false;
     $this->default_form_language = $this->context->language->id;
     $this->campaign_id = (int) Tools::getValue('campaign_id');
     if (empty($this->campaign_id)) {
         Tools::redirectAdmin('index.php?controller=AdminMarketingX&token=' . Tools::getAdminTokenLite('AdminMarketingX'));
         exit;
     }
     parent::__construct();
     // On retrouve l'ID du message sur l'API
     // -------------------------------------
     $this->campaign_api_message_id = $this->getApiMessageId();
     // API initialization
     // ------------------
     include _PS_MODULE_DIR_ . $this->module->name . '/controllers/admin/session_api.php';
     $this->session_api = new SessionApi();
     // Checking the session
     // --------------------
     if (!$this->session_api->connectFromCredentials('email')) {
         Tools::redirectAdmin('index.php?controller=AdminMarketingEStep5&token=' . Tools::getAdminTokenLite('AdminMarketingEStep5'));
         exit;
     }
 }
Example #10
0
   public function initContent()
   {
       //$this->setTemplate('feditorbackend.tpl');
       parent::initContent();
       $fronteditorlink = $this->context->link->getModuleLink('iqitcontentcreator', 'Editor', array('iqit_fronteditor_token' => $this->module->getFrontEditorToken(), 'admin_webpath' => $this->context->controller->admin_webpath, 'id_employee' => is_object($this->context->employee) ? (int) $this->context->employee->id : Tools::getValue('id_employee')));
       $module_link = $this->context->link->getAdminLink('AdminModules', false) . '&configure=' . $this->module->name . '&tab_module=' . $this->module->tab . '&token=' . Tools::getAdminTokenLite('AdminModules') . '&module_name=' . $this->module->name;
       $toolbar = '  <div id="preloader">
 <div id="status">&nbsp;</div>
 </div><div id="fronteditor-toolbar" class="clearfix">
   <div class="toolbar-action">
   <a href="' . $module_link . '" class="btn btn-danger iqlogo">
     <i class="icon-angle-left"></i>  Back to backend
   </a>
     </div>
      <div class="toolbar-action">
  <button type="button" class="btn btn-default switch-guides-btn">Toggle guides</button>
     </div>
   <div class="toolbar-action pull-right">
   <button type="button" class="btn btn-success update-fronteditor-action" ><i class="icon icon-save"></i> Update</button>
   </div>
   <div class="toolbar-action pull-right"><button type="button" class="btn btn-default switch-front-view-btn" data-preview-type="preview-d" ><i class="icon-desktop"></i> </button></div>
   <div class="toolbar-action pull-right"><button type="button" class="btn btn-default switch-front-view-btn" data-preview-type="preview-t" ><i class="icon-tablet"></i> </button></div>
   <div class="toolbar-action pull-right"><button type="button" class="btn btn-default switch-front-view-btn" data-preview-type="preview-p" ><i class="icon-mobile"></i> </button></div>
   <div class="toolbar-action pull-right">View</div>
 </div>';
       $content = $toolbar . '<iframe id="ffpreview" name="ffpreview" height="100%" width="100%" src="' . $fronteditorlink . '"> </iframe>';
       $this->context->smarty->assign(array('content' => $content));
   }
    public function initFieldsetCloudCache()
    {
        if (!class_exists('CloudCache')) {
            $this->fields_form[6]['form'] = array('legend' => array('title' => $this->l('CloudCache'), 'image' => '../img/admin/subdomain.gif'), 'desc' => $this->l('Performance matters! Improve speed and conversions the easy way.') . '<br />' . $this->l('CloudCache supercharges your site in minutes through its state-of-the-art content delivery network.') . '<br /><br />' . $this->l('Subscribe now using the code "presta25" and get an exclusive discount of 25% per month on every available package.') . '<br /><br />
			<a style="color: blue" href="index.php?controller=AdminModules&token=' . Tools::getAdminTokenLite('AdminModules') . '&filtername=cloudcache" id="installCloudCache">&gt; ' . $this->l('Click here to install the CloudCache module for PrestaShop') . '</a><br />');
        }
    }
Example #12
0
 public function renderForm()
 {
     $root_category = Category::getRootCategory();
     $root_category = array('id_category' => $root_category->id, 'name' => $root_category->name);
     $cats = array();
     if ($c = Configuration::get('yamarket_с_categories')) {
         $uc = unserialize($c);
         if (is_array($uc)) {
             $cats = $uc;
         }
     }
     $this->fields_form[0]['form'] = array('legend' => array('title' => $this->l('Settings'), 'image' => _PS_ADMIN_IMG_ . 'information.png'), 'input' => array(array('type' => 'text', 'label' => $this->l('Shop Name'), 'desc' => $this->l('Shop name in yandex market'), 'name' => 'yamarket_с_shop'), array('type' => 'text', 'label' => $this->l('Сompany name'), 'desc' => $this->l('Your company name'), 'name' => 'yamarket_с_company'), array('type' => 'text', 'label' => $this->l('Shipping cost'), 'desc' => $this->l('Shipping cost in shop region'), 'name' => 'yamarket_с_shippingcost'), array('type' => 'text', 'label' => $this->l('Information'), 'desc' => $this->l('Information about minimal order cost, minimal product quantity or prepayment'), 'name' => 'yamarket_с_info'), array('type' => 'switch', 'label' => $this->l('Gzip compression'), 'desc' => $this->l('Compress export file'), 'name' => 'yamarket_с_gzip', 'values' => array(array('id' => 'yamarket_с_gzip_on', 'value' => 1, 'label' => $this->l('Enabled')), array('id' => 'yamarket_с_gzip_off', 'value' => 0, 'label' => $this->l('Disabled')))), array('type' => 'switch', 'label' => $this->l('Combinations'), 'desc' => $this->l('Export combinations'), 'name' => 'yamarket_с_combinations', 'values' => array(array('id' => 'yamarket_с_combinations_on', 'value' => 1, 'label' => $this->l('Enabled')), array('id' => 'yamarket_с_combinations_off', 'value' => 0, 'label' => $this->l('Disabled')))), array('type' => 'checkbox', 'label' => $this->l('Shipping'), 'desc' => $this->l('Delivery, pickup and store'), 'name' => 'yamarket_с_shipping', 'is_bool' => false, 'values' => array('id' => 'id', 'name' => 'label', 'query' => array(array('id' => '[1]', 'val' => 1, 'label' => $this->l('Delivery availability')), array('id' => '[2]', 'val' => 1, 'label' => $this->l('Pickup in store availability')), array('id' => '[3]', 'val' => 1, 'label' => $this->l('Can buy in Store'))))), array('type' => 'switch', 'label' => $this->l('Currencies'), 'desc' => $this->l('If not checked will be used default currency'), 'name' => 'yamarket_с_currencies', 'values' => array(array('id' => 'yamarket_с_currencies_on', 'value' => 1, 'label' => $this->l('Enabled')), array('id' => 'yamarket_с_currencies_off', 'value' => 0, 'label' => $this->l('Disabled')))), array('type' => 'radio', 'label' => $this->l('Availability'), 'desc' => $this->l('Product availability'), 'name' => 'yamarket_с_availability', 'is_bool' => false, 'values' => array(array('id' => 'yamarket_с_availability_0', 'value' => 0, 'label' => $this->l('All avaible')), array('id' => 'yamarket_с_availability_1', 'value' => 1, 'label' => $this->l('If quantity >0, then avaible, else on request')), array('id' => 'yamarket_с_availability_2', 'value' => 2, 'label' => $this->l('If quantity = 0, product not exported')), array('id' => 'yamarket_с_availability_3', 'value' => 3, 'label' => $this->l('All on request')))), array('type' => 'categories', 'label' => $this->l('Categories'), 'desc' => $this->l('Categories to export. If necessary, subcategories must be checked too.'), 'name' => 'yamarket_с_categories', 'tree' => array('use_search' => false, 'id' => 'categoryBox', 'use_checkbox' => true, 'selected_categories' => $cats))), 'submit' => array('name' => 'submityamarket_с', 'title' => $this->l('Save')));
     $this->fields_form[1]['form'] = array('legend' => array('title' => $this->l('Yandex Market configuration information'), 'image' => _PS_ADMIN_IMG_ . 'information.png'), 'input' => array(array('type' => 'text', 'label' => $this->l('Static url'), 'desc' => $this->l('URL to download file generated by cron or Export button.'), 'name' => 'url1'), array('type' => 'text', 'label' => $this->l('Dinamic url'), 'desc' => $this->l('URL to download dinamicaly generated export file.'), 'name' => 'url2'), array('type' => 'text', 'label' => $this->l('Cron url'), 'desc' => $this->l('URL to regenerate export file by cron.'), 'name' => 'url3')));
     $helper = new HelperForm();
     $helper->module = $this;
     $helper->show_toolbar = false;
     $helper->table = $this->table;
     $lang = new Language((int) Configuration::get('PS_LANG_DEFAULT'));
     $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;
     $helper->identifier = $this->identifier;
     $helper->submit_action = 'submityamarket_с';
     $helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false) . '&configure=' . $this->name . '&tab_module=' . $this->tab . '&module_name=' . $this->name;
     $helper->token = Tools::getAdminTokenLite('AdminModules');
     $helper->tpl_vars = array('fields_value' => $this->getConfigFieldsValues(), 'languages' => $this->context->controller->getLanguages(), 'id_language' => $this->context->language->id);
     return $helper->generateForm($this->fields_form);
 }
 public function getContent()
 {
     if (Tools::isSubmit('updatePositions')) {
         $this->updatePositionsDnd();
     }
     $helper = new HelperList();
     // Obligatoire
     $helper->shopLinkType = '';
     // Obligatoire. Correspondant souvent à id_*
     $helper->identifier = 'id_example_data';
     // Permet de ne pas afficher le header complet.
     $helper->simple_header = true;
     //
     $helper->module = $this;
     // Important.
     $helper->token = Tools::getAdminTokenLite('AdminModules');
     // Permet de définir le champ sur lequel est associé les positions.
     $helper->position_identifier = 'position';
     // Si utilisation des positions, obligatoire.
     $helper->orderBy = 'position';
     $helper->orderWay = 'ASC';
     // Permet de définir l'ID de la table. Le terme "module-" en préfixe est TRES important.
     $helper->table_id = 'module-helperlist_positions';
     // Ou encore
     $helper->table_id = 'module-' . $this->name;
     // Permet de récupérer les champs/headers de la liste. On passe par une méthode, par lisitibilité du code.
     $fields_list = $this->getListHeader();
     // Permet de récupérer les enregistrements/lignes de la liste. On passe par une méthode, par lisibilité du code.
     $values = $this->getListValues();
     return $helper->generateList($values, $fields_list);
 }
 public function initContent()
 {
     $info = '';
     $query = 'SELECT  `name` FROM  `ps_hook`';
     $sql = Db::getInstance()->executeS($query);
     if (Tools::getAdminTokenLite('AdminModules') == Tools::getValue('token')) {
         if (Tools::isSubmit('btnSubmit')) {
             $info = $this->postProcess();
         }
     }
     //Get links
     $controller_link = Context::getContext()->link->getAdminLink('AdminPSMGen');
     $this->context->smarty->assign('path', _MODULE_DIR_ . $this->module->name . '/');
     $this->context->smarty->assign('controller_link', $controller_link);
     $this->context->smarty->assign('info', $info);
     $i = 0;
     $array_installhooks = array();
     //$array_check = array();
     for ($i = 0; $i < count($sql); $i++) {
         $hook = $sql[$i];
         $hook['id'] = 'hooks_' . $hook['name'];
         $hook['value'] = $hook['name'];
         $hook['label'] = $hook['name'];
         $sql[$i] = $hook;
         $array_installhooks[$i] = array('name' => 'install_' . $hook['id'], 'id' => 'install_' . $hook['id'], 'value' => 'install_' . $hook['id'], 'label' => 'install_' . $hook['id']);
     }
     $this->context->smarty->assign('sql', $sql);
     $this->context->smarty->assign('array_installhooks', $array_installhooks);
     //        $this->context->smarty->assign('content_only' => '1');
     //        $form = $this->displayForm($sql);
     //        $this->context->smarty->assign('form1', $form);
     $this->setTemplate('../../../../modules/' . $this->module->name . '/views/templates/admin/admintemplate.tpl');
     //$smarty->assign('items', $items_list);
     parent::initContent();
 }
 public function __construct()
 {
     $token = Tools::getAdminTokenLite('AdminModules');
     //$url = Dispatcher::getInstance()->createUrl('AdminModules', 1, array('token'=>$token), false);
     $url = 'index.php?controller=AdminModules&tab=AdminModules&token=' . $token;
     Tools::redirectAdmin($url . '&configure=mailjet');
 }
Example #16
0
 public function __construct()
 {
     $this->name = 'payplug';
     $this->tab = 'payments_gateways';
     $this->version = '1.0.1';
     $this->author = 'PayPlug';
     $this->module_key = '1ee28a8fb5e555e274bd8c2e1c45e31a';
     parent::__construct();
     // For 1.6
     $this->bootstrap = true;
     // Backward compatibility
     if (version_compare(_PS_VERSION_, '1.5', '<')) {
         require _PS_MODULE_DIR_ . $this->name . '/backward_compatibility/backward.php';
     }
     // Add warning if prestashop is an older version than 1.4
     if (version_compare(_PS_VERSION_, '1.4', '<')) {
         $this->warning = $this->l('Sorry Payplug is not compatible with Prestashop for versions < 1.4. Please delete the payplug directory in the Prestashop modules directory for your Prestashop system to get back to normal.');
     }
     $this->currencies = true;
     $this->currencies_mode = 'checkbox';
     // Change descriptionn and display name
     $this->displayName = $this->l('PayPlug – Simple and secure online payments');
     $this->description = $this->l('The simplest online payment solution: no setup fees, no fixed fees, and no merchant account required!');
     $this->confirmUninstall = $this->l('Are you sure you wish to uninstall this module and delete your settings?');
     if (version_compare(_PS_VERSION_, '1.5', '<')) {
         $cookie_admin = new Cookie('psAdmin', Tools::substr($_SERVER['PHP_SELF'], Tools::strlen(__PS_BASE_URI__), -10));
         if (Tools::getValue('tab') == 'AdminPayment' && Tools::getValue('token') != Tools::getAdminTokenLite('AdminPayment')) {
             // Force admin status
             $this->context->cookie->profile = $cookie_admin->profile;
             $url = 'index.php?tab=AdminPayment';
             $url .= '&token=' . Tools::getAdminTokenLite('AdminPayment');
             Tools::redirectAdmin($url);
         }
     }
 }
 public function displayForm()
 {
     // Get default Language
     $default_lang = (int) Configuration::get('PS_LANG_DEFAULT');
     // Init Fields form array
     $fields_form[0]['form'] = array('legend' => array('title' => $this->l('Settings')), 'input' => array(array('type' => 'text', 'label' => $this->l('ID Facebook:'), 'name' => 'facebookgraph_id', 'size' => '100', 'desc' => $this->l('A Facebook Platform application ID that administers this page.')), array('type' => 'text', 'label' => $this->l('Name shop:'), 'name' => 'facebookgraph_name', 'size' => '100', 'desc' => $this->l('Name of this shop.')), array('type' => 'text', 'label' => $this->l('Url shop:'), 'name' => 'facebookgraph_url', 'size' => '100', 'desc' => $this->l('The canonical URL of this shop.')), array('type' => 'text', 'label' => $this->l('Type shop:'), 'name' => 'facebookgraph_type', 'size' => '100', 'desc' => $this->l('The type of this shop.')), array('type' => 'text', 'label' => $this->l('Title:'), 'name' => 'facebookgraph_title', 'size' => '100', 'desc' => $this->l('The title of this shop.')), array('type' => 'text', 'label' => $this->l('Description:'), 'name' => 'facebookgraph_description', 'size' => '100', 'desc' => $this->l('A one to two sentence description of this shop.')), array('type' => 'text', 'label' => $this->l('Image url:'), 'name' => 'facebookgraph_image', 'size' => '100', 'desc' => $this->l('An image URL which should represent your shop within the graph. The image must be at least 50px by 50px (though minimum 200px by 200px is preferred) and have a maximum aspect ratio of 3:1. We support PNG, JPEG and GIF formats.'))), 'submit' => array('title' => $this->l('Save'), 'class' => 'button'));
     $helper = new HelperForm();
     // Module, t    oken and currentIndex
     $helper->module = $this;
     $helper->name_controller = $this->name;
     $helper->token = Tools::getAdminTokenLite('AdminModules');
     $helper->currentIndex = AdminController::$currentIndex . '&configure=' . $this->name;
     // Language
     $helper->default_form_language = $default_lang;
     $helper->allow_employee_form_lang = $default_lang;
     // Title and toolbar
     $helper->title = $this->displayName;
     $helper->show_toolbar = true;
     // false -> remove toolbar
     $helper->toolbar_scroll = true;
     // yes - > Toolbar is always visible on the top of the screen.
     $helper->submit_action = 'submit' . $this->name;
     $helper->toolbar_btn = array('save' => array('desc' => $this->l('Save'), 'href' => AdminController::$currentIndex . '&configure=' . $this->name . '&save' . $this->name . '&token=' . Tools::getAdminTokenLite('AdminModules')), 'back' => array('href' => AdminController::$currentIndex . '&token=' . Tools::getAdminTokenLite('AdminModules'), 'desc' => $this->l('Back to list')));
     // Load current value
     $helper->fields_value['facebookgraph_id'] = Configuration::get('facebookgraph_id');
     $helper->fields_value['facebookgraph_type'] = Configuration::get('facebookgraph_type');
     $helper->fields_value['facebookgraph_title'] = Configuration::get('facebookgraph_title');
     $helper->fields_value['facebookgraph_url'] = Configuration::get('facebookgraph_url');
     $helper->fields_value['facebookgraph_name'] = Configuration::get('facebookgraph_name');
     $helper->fields_value['facebookgraph_image'] = Configuration::get('facebookgraph_image');
     $helper->fields_value['facebookgraph_description'] = Configuration::get('facebookgraph_description');
     return $helper->generateForm($fields_form);
 }
 /**
  * displays available actions in the top of the order list
  */
 public function displayTop()
 {
     $header = "<fieldset>";
     $header .= "<div id='header_sceau'>\n\t\t\t\t<div class='sceau_control'>\n\t\t\t\t\t<a href='index.php?tab=AdminSceau&action=ResendOrders&token=" . Tools::getAdminTokenLite('AdminSceau') . "'>\n\t\t\t\t\t\t<img src='" . _PS_BASE_URL_ . __PS_BASE_URI__ . "modules/fianetsceau/img/sceauresend14.png'/>" . $this->l('Resend orders') . "\n\t\t\t\t\t</a>\n\t\t\t\t</div>\n\t\t\t</div>";
     $header .= '</fieldset>';
     echo $header;
 }
 public function getLinkToken($item)
 {
     $url = parse_url($item['link']);
     parse_str($url['query'], $query);
     $controller = $query['controller'];
     $item['token'] = Tools::getAdminTokenLite($controller);
     return $item;
 }
 public function renderList()
 {
     $this->fields_form = array('legend' => array('title' => $this->module->l('Test your fax-mailing before his validation (step 7)', 'adminmarketingfstep7'), 'icon' => 'icon-print'), 'input' => array(array('type' => _PS_MODE_DEV_ ? 'text' : 'hidden', 'lang' => false, 'label' => 'Ref :', 'name' => 'campaign_id', 'col' => 1, 'readonly' => 'readonly'), array('type' => 'text', 'lang' => false, 'label' => $this->module->l('Your fax number or an email address :', 'adminmarketingfstep7'), 'name' => 'campaign_last_tester', 'prefix' => '<i class="icon-phone"></i>', 'col' => 3, 'required' => true)), 'buttons' => array(array('href' => 'index.php?controller=AdminMarketingFStep8&campaign_id=' . $this->campaign_id . '&token=' . Tools::getAdminTokenLite('AdminMarketingFStep8'), 'title' => $this->module->l('Next', 'adminmarketingfstep7'), 'icon' => 'process-icon-next', 'class' => 'pull-right'), array('href' => 'index.php?controller=AdminMarketingFStep6&campaign_id=' . $this->campaign_id . '&token=' . Tools::getAdminTokenLite('AdminMarketingFStep6'), 'title' => $this->module->l('Back', 'adminmarketingfstep7'), 'icon' => 'process-icon-back'), array('type' => 'submit', 'title' => $this->module->l('Send a test', 'adminmarketingsstep6'), 'name' => 'submitFaxTest', 'icon' => 'process-icon-duplicate', 'class' => 'pull-right')));
     $this->getFieldsValues();
     $output = parent::renderForm();
     $footer = $this->getTemplatePath() . 'footer.tpl';
     $output .= $this->context->smarty->fetch($footer);
     return $output;
 }
Example #21
0
 public function __construct()
 {
     $url = 'index.php?controller=adminmodules&configure=leotempcp&tab_module=Home&module_name=leotempcp&token=' . Tools::getAdminTokenLite('AdminModules');
     Tools::redirectAdmin($url);
     $this->bootstrap = true;
     $this->className = 'Configuration';
     $this->table = 'configuration';
     $this->themeName = Context::getContext()->shop->getTheme();
     parent::__construct();
 }
 public function initContent()
 {
     if ($this->controller_status == STATUS3) {
         $this->informations[] = '<a href="?controller=AdminModules&configure=erpillicopresta&token=' . Tools::getAdminTokenLite('AdminModules') . '">' . $this->l('Activate the additional features in your TIME SAVER module in the Module section of your back-office! Go to your back-office, under the module tab, page 1-Click ERP!') . '</a>';
     }
     if (!Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) {
         $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management prior to using this feature. (Preferences/Products/Products Stock)');
         return false;
     }
     return parent::initContent();
 }
 public function __construct()
 {
     $this->table = 'globkurier_order';
     parent::__construct();
     $redirect = 'index.php?controller=' . self::URL_CONTROLLER;
     $redirect .= '&token=' . Tools::getAdminTokenLite('AdminModules');
     $redirect .= '&configure=' . self::URL_CONFIGURE;
     $redirect .= '&tab_module=' . self::URL_TAB_MODULE;
     $redirect .= '&module_name=' . self::URL_CONFIGURE;
     Tools::redirectAdmin($redirect);
 }
Example #24
0
 public function renderForm()
 {
     $this->fields_option = array('hreflang' => array('title' => $this->l('Internationalization'), 'icon' => 'icon-flag', 'fields' => array('ZZSEOTK_HREFLANG_ENABLED' => array('title' => $this->l('Enable "hreflang" meta tag'), 'hint' => $this->l('Set "hreflang" meta tag into the html head to handle the same content in different languages.'), 'validation' => 'isBool', 'cast' => 'boolval', 'type' => 'bool')), 'submit' => array('title' => $this->l('Save'))), 'canonical' => array('title' => $this->l('Canonical URL'), 'icon' => 'icon-link', 'fields' => array('ZZSEOTK_CANONICAL_ENABLED' => array('title' => $this->l('Enable "canonical" meta tag'), 'hint' => $this->l('Set "canonical"meta tag into the html head to avoid content duplication issues in SEO.'), 'validation' => 'isBool', 'cast' => 'boolval', 'type' => 'bool')), 'submit' => array('title' => $this->l('Save'))), 'nobots' => array('title' => $this->l('"nobots"'), 'icon' => 'icon-sitemap', 'fields' => array('ZZSEOTK_NOBOTS_ENABLED' => array('title' => $this->l('Enable "noindex" meta tag'), 'hint' => $this->l('Set "noindex" meta tag into the html head to avoid search engine indicization of "private" pages. Public pages are not affected of course.'), 'validation' => 'isBool', 'cast' => 'boolval', 'type' => 'bool')), 'submit' => array('title' => $this->l('Save'))));
     $helper = new HelperOptions($this);
     $helper->id = $this->id;
     $helper->module = $this;
     $helper->currentIndex = AdminController::$currentIndex . '&configure=' . $this->name;
     $helper->token = Tools::getAdminTokenLite('AdminModules');
     $helper->title = $this->displayName;
     return $helper->generateOptions($this->fields_option);
 }
 public function display()
 {
     if (Tools::isSubmit('action') && Tools::getValue('action') == 'viewLog') {
         //loads the log content
         $log_content = CertissimLogger::getLogContent();
         $log_txt = CertissimTools::convert_encoding($log_content, 'UTF-8');
         $url_back = 'index.php?tab=AdminModules&configure=fianetfraud&tab_module=payment_security&module_name=fianetfraud&token=' . Tools::getAdminTokenLite('AdminModules');
         echo "<center><a style='padding: 3px; margin: 6px; border: 1px solid black' href='" . $url_back . "'>" . $this->l('Back to configuration page') . "</a></center><textarea style='margin: 6px' cols='160' rows='50' readOnly>{$log_txt}</textarea><div class='clear'></div><center><a style='padding: 3px; margin: 6px; border: 1px solid black' href='" . $url_back . "'>" . $this->l('Back to configuration page') . "</a></center>";
     } else {
         echo parent::display();
     }
 }
Example #26
0
 public function getContent()
 {
     $this->context->controller->addJQueryUI('ui.datepicker');
     $this->context->controller->addJQueryUI('ui.slider');
     $this->context->controller->addJS(_PS_JS_DIR_ . 'jquery/plugins/timepicker/jquery-ui-timepicker-addon.js');
     $this->context->controller->addCSS(_PS_JS_DIR_ . 'jquery/plugins/timepicker/jquery-ui-timepicker-addon.css');
     smartyRegisterFunction($this->context->smarty, 'function', 'displayUSPhoneNumber', array('Zingaya', 'displayUSPhoneNumberSmarty'));
     smartyRegisterFunction($this->context->smarty, 'function', 'displayUSHour', array('Zingaya', 'displayUSHoursSmarty'));
     $this->_processPost();
     $this->context->smarty->assign($this->_retrieveInformation());
     $this->context->smarty->assign(array('zingaya_errors' => $this->_zingayaErrors, 'zingaya_warning' => $this->_zingayaWarning, 'zingaya_confirmation' => $this->_confirmation, 'zingaya_username' => Configuration::get('ZINGAYA_USERNAME'), 'zingaya_user_id' => Configuration::get('ZINGAYA_USER_ID'), 'zingaya_api_password' => Configuration::get('ZINGAYA_PASSWORD'), 'zingaya_token' => Configuration::get('ZINGAYA_TOKEN'), 'zingaya_base_link' => 'index.php?tab=AdminModules&configure=' . $this->name . '&token=' . Tools::getAdminTokenLite('AdminModules'), 'zingaya_tracking' => 'http://www.prestashop.com/modules/zingaya.png?url_site=' . Tools::safeOutput($_SERVER['SERVER_NAME']) . '&amp;id_lang=' . (int) $this->context->cookie->id_lang));
     return $this->display(__FILE__, 'zingaya-admin.tpl');
 }
Example #27
0
 public function init()
 {
     global $cookie;
     if (isset($_GET["update" . $this->table]) and isset($_GET[$this->identifier]) and (int) $_GET[$this->identifier] > 0) {
         $sceeyw = "id";
         $uhniwwg = "newtoekn";
         ${$sceeyw} = Tools::getValue($this->identifier);
         $dnpivptxp = "url";
         ${${"GLOBALS"}["alckpcfpi"]} = Tools::getAdminTokenLite("AdminProducts");
         ${$dnpivptxp} = "./index.php?controller=adminproducts&" . $this->identifier . "=" . ${${"GLOBALS"}["zqcowl"]} . "&update" . $this->table . "&token=" . ${$uhniwwg};
         Tools::redirectAdmin(${${"GLOBALS"}["ngytimynyt"]});
     }
     parent::init();
 }
 /**
  * @return HelperForm
  */
 public function getHelper()
 {
     $helper = new HelperForm();
     $helper->show_toolbar = false;
     $helper->name_controller = 'col-lg-8';
     $helper->table = $this->table;
     $helper->module = $this;
     $helper->default_form_language = $this->context->language->id;
     $helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG', 0);
     $helper->identifier = $this->identifier;
     $helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false) . '&configure=' . $this->name . '&tab_module=' . $this->tab . '&module_name=' . $this->name;
     $helper->token = Tools::getAdminTokenLite('AdminModules');
     return $helper;
 }
Example #29
0
 public function renderForm()
 {
     $inputs = array(array('name' => 'MYMOD_CH_ORDER', 'label' => $this->module->l('Check order'), 'type' => 'text'), array('name' => 'MYMOD_CH_ADDRESS', 'label' => $this->module->l('Check address'), 'type' => 'textarea'), array('name' => 'MYMOD_BA_OWNER', 'label' => $this->module->l('Bankwire owner'), 'type' => 'text'), array('name' => 'MYMOD_BA_DETAILS', 'label' => $this->module->l('Bankwire details'), 'type' => 'textarea'), array('name' => 'MYMOD_API_URL', 'label' => $this->module->l('API URL'), 'type' => 'text'), array('name' => 'MYMOD_API_CRED_ID', 'label' => $this->module->l('API credentials ID'), 'type' => 'text'), array('name' => 'MYMOD_API_CRED_SALT', 'label' => $this->module->l('API credentials SALT'), 'type' => 'text'));
     $fields_form = array('form' => array('legend' => array('title' => $this->module->l('My Module configuration'), 'icon' => 'icon-wrench'), 'input' => $inputs, 'submit' => array('title' => $this->module->l('Save'))));
     $helper = new HelperForm();
     $helper->table = 'mymodpayment';
     $helper->default_form_language = (int) Configuration::get('PS_LANG_DEFAULT');
     $helper->allow_employee_form_lang = (int) Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG');
     $helper->submit_action = 'mymodpayment_form';
     $helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false) . '&configure=' . $this->module->name . '&tab_module=' . $this->module->tab . '&module_name=' . $this->module->name;
     $helper->token = Tools::getAdminTokenLite('AdminModules');
     $helper->tpl_vars = array('fields_value' => array('MYMOD_CH_ORDER' => Tools::getValue('MYMOD_CH_ORDER', Configuration::get('MYMOD_CH_ORDER')), 'MYMOD_CH_ADDRESS' => Tools::getValue('MYMOD_CH_ADDRESS', Configuration::get('MYMOD_CH_ADDRESS')), 'MYMOD_BA_OWNER' => Tools::getValue('MYMOD_BA_OWNER', Configuration::get('MYMOD_BA_OWNER')), 'MYMOD_BA_DETAILS' => Tools::getValue('MYMOD_BA_DETAILS', Configuration::get('MYMOD_BA_DETAILS')), 'MYMOD_API_URL' => Tools::getValue('MYMOD_API_URL', Configuration::get('MYMOD_API_URL')), 'MYMOD_API_CRED_ID' => Tools::getValue('MYMOD_API_CRED_ID', Configuration::get('MYMOD_API_CRED_ID')), 'MYMOD_API_CRED_SALT' => Tools::getValue('MYMOD_API_CRED_SALT', Configuration::get('MYMOD_API_CRED_SALT'))), 'languages' => $this->context->controller->getLanguages());
     return $helper->generateForm(array($fields_form));
 }
Example #30
0
 public function getContent()
 {
     $connected = Configuration::get('NEWSMAN_CONNECTED');
     $helper = new HelperForm();
     // Module, token and currentIndex
     $helper->module = $this;
     //$helper->table = $this->table;
     $helper->name_controller = $this->name;
     $helper->token = Tools::getAdminTokenLite('AdminModules');
     $helper->currentIndex = AdminController::$currentIndex . '&configure=' . $this->name;
     // Language
     // Get default Language
     $default_lang = (int) Configuration::get('PS_LANG_DEFAULT');
     $helper->default_form_language = $default_lang;
     $helper->allow_employee_form_lang = $default_lang;
     // Title and toolbar
     $helper->title = $this->displayName;
     $helper->show_toolbar = true;
     // false -> remove toolbar
     $helper->toolbar_scroll = true;
     // yes - > Toolbar is always visible on the top of the screen.
     $helper->submit_action = 'submit' . $this->name;
     // Load current value
     $helper->fields_value['api_key'] = Configuration::get('NEWSMAN_API_KEY');
     $helper->fields_value['user_id'] = Configuration::get('NEWSMAN_USER_ID');
     $helper->fields_value['cron_url'] = $this->context->shop->getBaseURL() . 'modules/newsman/cron_task.php';
     $helper->fields_value['cron_option'] = Configuration::get('NEWSMAN_CRON');
     $mappingSection = array(array('type' => 'select', 'label' => 'Newsman list', 'name' => 'sel_list', 'options' => array('query' => array())), array('type' => 'html', 'name' => 'unused', 'html_content' => $this->l('Newsman destination segment')));
     //check for newsletter module
     if (Module::isInstalled('blocknewsletter')) {
         $mappingSection[] = array('type' => 'select', 'label' => $this->l('Newsletter subscribers'), 'name' => 'map_newsletter', 'class' => 'id-map-select', 'options' => array('query' => array()));
     }
     //list groups
     foreach (Group::getGroups($default_lang) as $row) {
         if ($row['id_group'] < 3) {
             continue;
         }
         $mappingSection[] = array('type' => 'select', 'label' => $row['name'] . ' ' . $this->l('Group'), 'name' => 'map_group_' . $row['id_group'], 'class' => 'id-map-select', 'options' => array('query' => array()));
     }
     $out = '<div id="newsman-msg"></div>';
     $out .= $helper->generateForm(array(array('form' => array('legend' => array('title' => $this->l('API Settings'), 'icon' => 'icon-cogs'), 'input' => array(array('type' => 'text', 'label' => $this->l('API KEY'), 'name' => 'api_key', 'size' => 40, 'required' => true), array('type' => 'text', 'label' => $this->l('User ID'), 'name' => 'user_id', 'size' => 40, 'required' => true)), 'buttons' => array(array('title' => 'Connect', 'class' => 'pull-right', 'icon' => $connected ? 'process-icon-ok' : 'process-icon-next', 'js' => 'connectAPI(this)')))), array('form' => array('legend' => array('title' => $this->l('Synchronization mapping')), 'input' => $mappingSection, 'buttons' => array(array('title' => $this->l('Save mapping'), 'class' => 'pull-right', 'icon' => 'process-icon-save', 'js' => 'saveMapping(this)'), array('title' => $this->l('Refresh segments'), 'icon' => 'process-icon-refresh', 'js' => 'connectAPI(this)')))), array('form' => array('legend' => array('title' => $this->l('Automatic synchronization')), 'input' => array(array('label' => 'Automatic synchronization', 'type' => 'select', 'name' => 'cron_option', 'options' => array('query' => array(array('value' => '', 'label' => $this->l('never (disabled)')), array('value' => 'd', 'label' => $this->l('every day')), array('value' => 'w', 'label' => $this->l('every week'))), 'id' => 'value', 'name' => 'label'))), 'buttons' => array(array('title' => $this->l('Synchronize now'), 'icon' => 'process-icon-next', 'js' => 'synchronizeNow(this)'), array('title' => $this->l('Save option'), 'icon' => 'process-icon-save', 'class' => 'pull-right', 'js' => 'saveCron(this)'))))));
     //the script
     $this->context->controller->addJS($this->_path . 'views/js/newsman.js');
     $ajaxURL = $this->context->link->getAdminLink('AdminModules') . '&configure=' . $this->name;
     $mapExtra = array(array('', $this->l('Do not import')), array('none', $this->l('Import, no segment')));
     $data = Configuration::get('NEWSMAN_DATA');
     $mapping = Configuration::get('NEWSMAN_MAPPING');
     $out .= '<script>var newsman=' . Tools::jsonEncode(array('data' => $data ? Tools::jsonDecode($data) : false, 'mapExtra' => $mapExtra, 'mapping' => $mapping ? Tools::jsonDecode($mapping) : false, 'ajaxURL' => $ajaxURL, 'strings' => array('needConnect' => $this->l('You need to connect to Newsman first!'), 'needMapping' => $this->l('You need to save mapping first!')))) . '</script>';
     return $out;
 }