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


PHP AdminTab类代码示例

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


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

示例1: postProcess

 public function postProcess()
 {
     global $currentIndex;
     if (Tools::isSubmit('submitPrint')) {
         if (!Validate::isDate(Tools::getValue('date_from'))) {
             $this->_errors[] = $this->l('Invalid from date');
         }
         if (!Validate::isDate(Tools::getValue('date_to'))) {
             $this->_errors[] = $this->l('Invalid end date');
         }
         if (!sizeof($this->_errors)) {
             $orders = Order::getOrdersIdInvoiceByDate(Tools::getValue('date_from'), Tools::getValue('date_to'), NULL, 'invoice');
             if (sizeof($orders)) {
                 Tools::redirectAdmin('pdf.php?invoices&date_from=' . urlencode(Tools::getValue('date_from')) . '&date_to=' . urlencode(Tools::getValue('date_to')) . '&token=' . $this->token);
             }
             $this->_errors[] = $this->l('No invoice found for this period');
         }
     } elseif (Tools::isSubmit('submitOptionsinvoice')) {
         if (intval(Tools::getValue('PS_INVOICE_NUMBER')) == 0) {
             $this->_errors[] = $this->l('Invalid invoice number');
         } else {
             parent::postProcess();
         }
     } else {
         parent::postProcess();
     }
 }
开发者ID:vincent,项目名称:theinvertebrates,代码行数:27,代码来源:AdminInvoices.php

示例2: __construct

 public function __construct()
 {
     MondialRelay::initModuleAccess();
     $this->table = 'mr_selected';
     $this->className = 'MondialRelayClass';
     parent::__construct();
 }
开发者ID:srikanthash09,项目名称:codetestdatld,代码行数:7,代码来源:AdminMondialRelay.php

示例3: displayForm

    public function displayForm($isMainTab = true)
    {
        global $currentIndex;
        parent::displayForm();
        if (!($banner = $this->loadObject(true))) {
            return;
        }
        //echo '<pre>'; print_r( $banner ); exit;
        echo '
		<form action="' . $currentIndex . '&submitAdd' . $this->table . '=1&token=' . $this->token . '" method="post" enctype="multipart/form-data">
		' . ($banner->id_banner ? '<input type="hidden" name="id_' . $this->table . '" value="' . $banner->id_banner . '" />' : '') . '
			<fieldset>
                            <legend><img src="../img/admin/suppliers.gif" />' . $this->l('Banners') . '</legend>
                                
				<label>' . $this->l('Title:') . ' </label>
				<div class="margin-form">
					<input type="text" size="40" name="title" value="' . htmlentities(Tools::getValue('title', $banner->title), ENT_COMPAT, 'UTF-8') . '" /> <sup>*</sup>
					<span class="hint" name="help_box">' . $this->l('Invalid characters:') . ' <>;=#{}<span class="hint-pointer">&nbsp;</span></span>
				</div>
                                
				<label>' . $this->l('URL:') . ' </label>
				<div class="margin-form">
					<input type="text" size="40" name="url" value="' . htmlentities(Tools::getValue('url', $banner->url), ENT_COMPAT, 'UTF-8') . '" /> <sup>*</sup>
					<span class="hint" name="help_box">' . $this->l('Invalid characters:') . ' <>;=#{}<span class="hint-pointer">&nbsp;</span></span>
				</div>
                                
				<label>' . $this->l('Image Path:') . ' </label>
				<div class="margin-form">
					<input type="hidden" name="image_path" value="' . htmlentities(Tools::getValue('image_path', $banner->image_path), ENT_COMPAT, 'UTF-8') . '" />
					<input type="file" size="40" name="banner_image"/>';
        $image_path = Tools::getValue('image_path', $banner->image_path);
        if (!empty($image_path)) {
            echo '<a href="http://' . _MEDIA_SERVER_1_ . $this->image_dir . Tools::getValue('image_path', $banner->image_path) . '" target="__blank">';
            echo '	<img src="http://' . _MEDIA_SERVER_1_ . $this->image_dir . Tools::getValue('image_path', $banner->image_path) . '" width="200px" />';
            echo '</a>';
        }
        echo '</div>

				<label>' . $this->l('Display Order:') . ' </label>
				<div class="margin-form">
					<input type="text" size="40" name="display_order" value="' . htmlentities(Tools::getValue('display_order', $banner->display_order), ENT_COMPAT, 'UTF-8') . '" />
					<span class="hint" name="help_box">' . $this->l('Invalid characters:') . ' <>;=#{}<span class="hint-pointer">&nbsp;</span></span>
				</div>

                                
                                <label>' . $this->l('Enable:') . ' </label>
                                <div class="margin-form">
                                        <input type="radio" name="is_active" id="active_on" value="1" ' . ($this->getFieldValue($banner, 'is_active') ? 'checked="checked" ' : '') . '/>
                                        <label class="t" for="active_on"> <img src="../img/admin/enabled.gif" alt="' . $this->l('Enabled') . '" title="' . $this->l('Enabled') . '" /></label>
                                        <input type="radio" name="is_active" id="active_off" value="0" ' . (!$this->getFieldValue($banner, 'is_active') ? 'checked="checked" ' : '') . '/>
                                        <label class="t" for="active_off"> <img src="../img/admin/disabled.gif" alt="' . $this->l('Disabled') . '" title="' . $this->l('Disabled') . '" /></label>
                                </div>

				<div class="margin-form">
					<input type="submit" value="' . $this->l('   Save   ') . '" name="submitAdd' . $this->table . '" class="button" />
				</div>
				<div class="small"><sup>*</sup> ' . $this->l('Required field') . '</div>
			</fieldset>
		</form>';
    }
开发者ID:priyankajsr19,项目名称:indusdiva2,代码行数:60,代码来源:AdminBanners.php

示例4: postProcess

 public function postProcess()
 {
     if (Tools::isSubmit('submitAdd' . $this->table)) {
         if ($id = intval(Tools::getValue('id_attachment')) and $a = new Attachment($id)) {
             $_POST['file'] = $a->file;
             $_POST['mime'] = $a->mime;
         }
         if (!sizeof($this->_errors)) {
             if (isset($_FILES['file']) and is_uploaded_file($_FILES['file']['tmp_name'])) {
                 if ($_FILES['file']['size'] > $this->maxFileSize) {
                     $this->_errors[] = $this->l('File too large, maximum size allowed:') . ' ' . $this->maxFileSize / 1000 . ' ' . $this->l('kb');
                 } else {
                     $uploadDir = dirname(__FILE__) . '/../../download/';
                     do {
                         $uniqid = sha1(microtime());
                     } while (file_exists($uploadDir . $uniqid));
                     if (!copy($_FILES['file']['tmp_name'], $uploadDir . $uniqid)) {
                         $this->_errors[] = $this->l('File copy failed');
                     }
                     @unlink($_FILES['file']['tmp_name']);
                     $_POST['file'] = $uniqid;
                     $_POST['mime'] = $_FILES['file']['type'];
                 }
             }
         }
         $this->validateRules();
     }
     return parent::postProcess();
 }
开发者ID:sealence,项目名称:local,代码行数:29,代码来源:AdminAttachments.php

示例5: displayForm

    public function displayForm($isMainTab = true)
    {
        global $currentIndex;
        parent::displayForm();
        if (!($obj = $this->loadObject(true))) {
            return;
        }
        echo '
		<form action="' . $currentIndex . '&submitAdd' . $this->table . '=1&token=' . $this->token . '" method="post">
			' . ($obj->id ? '<input type="hidden" name="id_' . $this->table . '" value="' . $obj->id . '" />' : '') . '
			<fieldset><legend><img src="../img/admin/profiles.png" />' . $this->l('Profiles') . '</legend>
				<label>' . $this->l('Name:') . ' </label>
				<div class="margin-form">';
        foreach ($this->_languages as $language) {
            echo '
					<div id="name_' . $language['id_lang'] . '" style="display: ' . ($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none') . '; float: left;">
						<input size="33" type="text" name="name_' . $language['id_lang'] . '" value="' . htmlentities($this->getFieldValue($obj, 'name', (int) $language['id_lang']), ENT_COMPAT, 'UTF-8') . '" /><sup> *</sup>
					</div>';
        }
        $this->displayFlags($this->_languages, $this->_defaultFormLanguage, 'name', 'name');
        echo '		<div class="clear"></div>
				</div>
				<div class="margin-form">
					<input type="submit" value="' . $this->l('   Save   ') . '" name="submitAdd' . $this->table . '" class="button" />
				</div>
				<div class="small"><sup>*</sup> ' . $this->l('Required field') . '</div>
			</fieldset>
		</form>';
    }
开发者ID:Evil1991,项目名称:PrestaShop-1.4,代码行数:29,代码来源:AdminProfiles.php

示例6: postProcess

 public function postProcess()
 {
     if (isset($_POST['submitAdd' . $this->table])) {
         $search = strval(Tools::getValue('search'));
         $string = strval(Tools::getValue('alias'));
         $aliases = explode(',', $string);
         if (empty($search) or empty($string)) {
             $this->_errors[] = $this->l('aliases and result are both required');
         }
         if (!Validate::isValidSearch($search)) {
             $this->_errors[] = $search . ' ' . $this->l('is not a valid result');
         }
         foreach ($aliases as $alias) {
             if (!Validate::isValidSearch($alias)) {
                 $this->_errors[] = $alias . ' ' . $this->l('is not a valid alias');
             }
         }
         if (!sizeof($this->_errors)) {
             Alias::deleteAliases($search);
             foreach ($aliases as $alias) {
                 $obj = new Alias(NULL, trim($alias), trim($search));
                 $obj->save();
             }
         }
     } else {
         parent::postProcess();
     }
 }
开发者ID:Bruno-2M,项目名称:prestashop,代码行数:28,代码来源:AdminAliases.php

示例7: postProcess

 public function postProcess()
 {
     global $currentIndex;
     $this->product = new Product(intval(Tools::getValue('id_product')));
     if (isset($_POST['generate'])) {
         if (!is_array(Tools::getValue('options'))) {
             $this->_errors[] = Tools::displayError('You need to choose at least 1 attribute.');
         } else {
             $tab = array_values($_POST['options']);
             if (sizeof($tab) and Validate::isLoadedObject($this->product)) {
                 self::setAttributesImpacts($this->product->id, $tab);
                 $this->combinations = array_values(self::createCombinations($tab));
                 $values = array_values(array_map(array($this, 'addAttribute'), $this->combinations));
                 $this->product->deleteProductAttributes();
                 $res = $this->product->addProductAttributeMultiple($values);
                 $this->product->addAttributeCombinationMultiple($res, $this->combinations);
             } else {
                 $this->_errors[] = Tools::displayError('Unable to initialize parameters, combinations is missing or object cannot be load.');
             }
         }
     } elseif (isset($_POST['back'])) {
         Tools::redirectAdmin($currentIndex . '&id_product=' . intval(Tools::getValue('id_product')) . '&id_category=' . intval(Tools::getValue('id_category')) . '&addproduct' . '&tabs=2&token=' . Tools::getValue('token'));
     }
     parent::postProcess();
 }
开发者ID:redb,项目名称:prestashop,代码行数:25,代码来源:AdminAttributeGenerator.php

示例8: displayForm

    public function displayForm($isMainTab = true)
    {
        global $currentIndex;
        parent::displayForm();
        if (!($obj = $this->loadObject(true))) {
            return;
        }
        echo '
		<form action="' . $currentIndex . '&submitAdd' . $this->table . '=1&token=' . $this->token . '" method="post">
		' . ($obj->id ? '<input type="hidden" name="id_' . $this->table . '" value="' . $obj->id . '" />' : '') . '
			<fieldset><legend><img src="../img/admin/search.gif" />' . $this->l('Aliases') . '</legend>
				<label>' . $this->l('Alias:') . ' </label>
				<div class="margin-form">
					<input type="text" size="40" name="alias" value="' . Tools::getValue('alias', htmlentities($obj->getAliases(), ENT_COMPAT, 'UTF-8')) . '" /> <sup>*</sup>
					<p class="clear">' . $this->l('Enter each alias separated by a comma (\',\')') . ' ' . $this->l('(e.g., \'prestshop,preztashop,prestasohp\')') . '<br />
					' . $this->l('Forbidden characters:') . ' <>;=#{}</p>
				</div>
				<label>' . $this->l('Result:') . ' </label>
				<div class="margin-form">
					<input type="text" size="15" name="search" value="' . htmlentities($this->getFieldValue($obj, 'search'), ENT_COMPAT, 'UTF-8') . '" /> <sup>*</sup>
					<p class="clear">' . $this->l('Search this word instead.') . '</p>
				</div>
				<div class="margin-form">
					<input type="submit" value="' . $this->l('   Save   ') . '" name="submitAdd' . $this->table . '" class="button" />
				</div>
				<div class="small"><sup>*</sup> ' . $this->l('Required field') . '</div>
			</fieldset>
		</form>';
    }
开发者ID:nicolasjeol,项目名称:hec-ecommerce,代码行数:29,代码来源:AdminAliases.php

示例9: viewAccess

 public function viewAccess($disable = false)
 {
     $result = parent::viewAccess($disable);
     $this->adminCategories->tabAccess = $this->tabAccess;
     $this->adminProducts->tabAccess = $this->tabAccess;
     return $result;
 }
开发者ID:raulgimenez,项目名称:dreamongraphics_shop,代码行数:7,代码来源:AdminCatalog.php

示例10: __construct

 public function __construct()
 {
     $this->table = 'delivery';
     $currency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT'));
     $this->_fieldsHandling = array('PS_SHIPPING_HANDLING' => array('title' => $this->l('Handling charges'), 'suffix' => $currency, 'validation' => 'isPrice', 'cast' => 'floatval'), 'PS_SHIPPING_FREE_PRICE' => array('title' => $this->l('Free shipping starts at'), 'suffix' => $currency, 'validation' => 'isPrice', 'cast' => 'floatval'), 'PS_SHIPPING_FREE_WEIGHT' => array('title' => $this->l('Free shipping starts at'), 'suffix' => Configuration::get('PS_WEIGHT_UNIT'), 'validation' => 'isUnsignedFloat', 'cast' => 'floatval'), 'PS_SHIPPING_METHOD' => array('title' => $this->l('Billing'), 'validation' => 'isBool', 'cast' => 'intval'));
     parent::__construct();
 }
开发者ID:nicolasjeol,项目名称:hec-ecommerce,代码行数:7,代码来源:AdminShipping.php

示例11: array

 function __construct()
 {
     parent::__construct();
     $this->_moduleCacheFile = _PS_ROOT_DIR_ . '/config/modules_list.xml';
     //refresh modules_list.xml every week
     if (!$this->isFresh()) {
         $this->refresh();
     }
     $this->listTabModules = array('administration' => $this->l('Administration'), 'advertising_marketing' => $this->l('Advertising & Marketing'), 'analytics_stats' => $this->l('Analytics & Stats'), 'billing_invoicing' => $this->l('Billing & Invoicing'), 'checkout' => $this->l('Checkout'), 'content_management' => $this->l('Content Management'), 'export' => $this->l('Export'), 'front_office_features' => $this->l('Front Office Features'), 'i18n_localization' => $this->l('I18n & Localization'), 'merchandizing' => $this->l('Merchandizing'), 'migration_tools' => $this->l('Migration Tools'), 'payments_gateways' => $this->l('Payments & Gateways'), 'payment_security' => $this->l('Payment Security'), 'pricing_promotion' => $this->l('Pricing & Promotion'), 'quick_bulk_update' => $this->l('Quick / Bulk update'), 'search_filter' => $this->l('Search & Filter'), 'seo' => $this->l('SEO'), 'shipping_logistics' => $this->l('Shipping & Logistics'), 'slideshows' => $this->l('Slideshows'), 'smart_shopping' => $this->l('Smart Shopping'), 'market_place' => $this->l('Market Place'), 'social_networks' => $this->l('Social Networks'), 'others' => $this->l('Other Modules'));
     $xmlModules = @simplexml_load_file($this->_moduleCacheFile);
     foreach ($xmlModules->children() as $xmlModule) {
         if ($xmlModule->attributes() == 'native') {
             foreach ($xmlModule->children() as $module) {
                 foreach ($module->attributes() as $key => $value) {
                     if ($key == 'name') {
                         $this->listNativeModules[] = (string) $value;
                     }
                 }
             }
         }
     }
     if ($xmlModule->attributes() == 'partner') {
         foreach ($xmlModule->children() as $module) {
             foreach ($module->attributes() as $key => $value) {
                 if ($key == 'name') {
                     $this->listPartnerModules[] = (string) $value;
                 }
             }
         }
     }
 }
开发者ID:priyankajsr19,项目名称:indusdiva2,代码行数:31,代码来源:AdminModules.php

示例12: viewAccess

 public function viewAccess($disable = false)
 {
     $result = parent::viewAccess($disable);
     $this->adminOrdersStates->tabAccess = $this->tabAccess;
     $this->adminReturnStates->tabAccess = $this->tabAccess;
     return $result;
 }
开发者ID:sealence,项目名称:local,代码行数:7,代码来源:AdminStatuses.php

示例13: displayForm

    public function displayForm($isMainTab = true)
    {
        global $currentIndex;
        parent::displayForm();
        if (!($obj = $this->loadObject(true))) {
            return;
        }
        echo '
		<form action="' . $currentIndex . '&submitAdd' . $this->table . '=1&token=' . $this->token . '" method="post">
		' . ($obj->id ? '<input type="hidden" name="id_' . $this->table . '" value="' . $obj->id . '" />' : '') . '
			<fieldset><legend>' . $this->l('Referrer') . '</legend>
				<label>' . $this->l('Server') . ' </label>
				<div class="margin-form">
					<input type="text" size="20" name="server" value="' . htmlentities($this->getFieldValue($obj, 'server'), ENT_COMPAT, 'UTF-8') . '" /> <sup>*</sup>
				</div>
				<label>' . $this->l('$_GET variable') . ' </label>
				<div class="margin-form">
					<input type="text" size="40" name="getvar" value="' . htmlentities($this->getFieldValue($obj, 'getvar'), ENT_COMPAT, 'UTF-8') . '" /> <sup>*</sup>
				</div>
				<div class="margin-form">
					<input type="submit" value="' . $this->l('   Save   ') . '" name="submitAdd' . $this->table . '" class="button" />
				</div>
				<div class="small"><sup>*</sup> ' . $this->l('Required field') . '</div>
			</fieldset>
		</form>';
    }
开发者ID:Evil1991,项目名称:PrestaShop-1.4,代码行数:26,代码来源:AdminSearchEngines.php

示例14: __construct

 public function __construct()
 {
     /* Get all modules then select only payment ones*/
     $modules = Module::getModulesOnDisk();
     foreach ($modules as $module) {
         if ($module->tab == 'Payment') {
             if ($module->id) {
                 $module->country = array();
                 $countries = DB::getInstance()->ExecuteS('SELECT id_country FROM ' . _DB_PREFIX_ . 'module_country WHERE id_module = ' . intval($module->id));
                 foreach ($countries as $country) {
                     $module->country[] = $country['id_country'];
                 }
                 $module->currency = array();
                 $currencies = DB::getInstance()->ExecuteS('SELECT id_currency FROM ' . _DB_PREFIX_ . 'module_currency WHERE id_module = ' . intval($module->id));
                 foreach ($currencies as $currency) {
                     $module->currency[] = $currency['id_currency'];
                 }
                 $module->group = array();
                 $groups = DB::getInstance()->ExecuteS('SELECT id_group FROM ' . _DB_PREFIX_ . 'module_group WHERE id_module = ' . intval($module->id));
                 foreach ($groups as $group) {
                     $module->group[] = $group['id_group'];
                 }
             } else {
                 $module->country = NULL;
                 $module->currency = NULL;
                 $module->group = NULL;
             }
             $this->paymentModules[] = $module;
         }
     }
     parent::__construct();
 }
开发者ID:vincent,项目名称:theinvertebrates,代码行数:32,代码来源:AdminPayment.php

示例15: __construct

    public function __construct()
    {
        global $cookie;
        $this->table = 'manufacturer';
        $this->className = 'Manufacturer';
        $this->lang = false;
        $this->edit = true;
        $this->delete = true;
        // Sub tab addresses
        $countries = Country::getCountries(intval($cookie->id_lang));
        foreach ($countries as $country) {
            $this->countriesArray[$country['id_country']] = $country['name'];
        }
        $this->fieldsDisplayAddresses = array('id_address' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), 'm!manufacturer_name' => array('title' => $this->l('Manufacturer'), 'width' => 100), 'firstname' => array('title' => $this->l('First name'), 'width' => 80), 'lastname' => array('title' => $this->l('Last name'), 'width' => 100, 'filter_key' => 'a!name'), 'postcode' => array('title' => $this->l('Post/Zip code'), 'align' => 'right', 'width' => 50), 'city' => array('title' => $this->l('City'), 'width' => 150), 'country' => array('title' => $this->l('Country'), 'width' => 100, 'type' => 'select', 'select' => $this->countriesArray, 'filter_key' => 'cl!id_country'));
        $this->_includeTabTitle = array($this->l('Manufacturers addresses'));
        $this->_joinAddresses = 'LEFT JOIN `' . _DB_PREFIX_ . 'country_lang` cl ON 
		(cl.`id_country` = a.`id_country` AND cl.`id_lang` = ' . intval($cookie->id_lang) . ') ';
        $this->_joinAddresses .= 'LEFT JOIN `' . _DB_PREFIX_ . 'manufacturer` m ON (a.`id_manufacturer` = m.`id_manufacturer`)';
        $this->_selectAddresses = 'cl.`name` as country, m.`name` AS manufacturer_name';
        $this->_includeTab = array('Addresses' => array('addressType' => 'manufacturer', 'fieldsDisplay' => $this->fieldsDisplayAddresses, '_join' => $this->_joinAddresses, '_select' => $this->_selectAddresses));
        $this->view = true;
        $this->_select = 'COUNT(`id_product`) AS `products`, (SELECT COUNT(ad.`id_manufacturer`) as `addresses` FROM `' . _DB_PREFIX_ . 'address` ad WHERE ad.`id_manufacturer` = a.`id_manufacturer` GROUP BY ad.`id_manufacturer`) as `addresses`';
        $this->_join = 'LEFT JOIN `' . _DB_PREFIX_ . 'product` p ON (a.`id_manufacturer` = p.`id_manufacturer`)';
        $this->_joinCount = false;
        $this->_group = 'GROUP BY a.`id_manufacturer`';
        $this->fieldImageSettings = array('name' => 'logo', 'dir' => 'm');
        $this->fieldsDisplay = array('id_manufacturer' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), 'name' => array('title' => $this->l('Name'), 'width' => 200), 'logo' => array('title' => $this->l('Logo'), 'align' => 'center', 'image' => 'm', 'orderby' => false, 'search' => false), 'addresses' => array('title' => $this->l('Addresses'), 'align' => 'right', 'tmpTableFilter' => true, 'width' => 20), 'products' => array('title' => $this->l('Products'), 'align' => 'right', 'tmpTableFilter' => true, 'width' => 20));
        $countries = Country::getCountries(intval($cookie->id_lang));
        foreach ($countries as $country) {
            $this->countriesArray[$country['id_country']] = $country['name'];
        }
        parent::__construct();
    }
开发者ID:sealence,项目名称:local,代码行数:33,代码来源:AdminManufacturers.php


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