本文整理汇总了PHP中Tab::add方法的典型用法代码示例。如果您正苦于以下问题:PHP Tab::add方法的具体用法?PHP Tab::add怎么用?PHP Tab::add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tab
的用法示例。
在下文中一共展示了Tab::add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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 Staticblocks');
}
$tab->class_name = 'AdminPosstaticblocks';
$tab->id_parent = (int) Tab::getIdFromClassName('AdminPosMenu');
$tab->module = $this->name;
$tab->add();
// Set some defaults
return parent::install() && $this->registerHook('top') && $this->registerHook('brandSlider') && $this->registerHook('bannerSlide') && $this->registerHook('blockPosition1') && $this->registerHook('blockPosition2') && $this->registerHook('blockPosition3') && $this->registerHook('blockPosition4') && $this->registerHook('blockPosition5') && $this->registerHook('blockPosition6') && $this->registerHook('bannerTabcate') && $this->registerHook('blockDetailProduct') && $this->registerHook('leftColumn') && $this->registerHook('rightColumn') && $this->registerHook('home') && $this->registerHook('footer') && $this->registerHook('displayHeader') && $this->registerHook('displayBackOfficeHeader');
}
示例2: install
public function install()
{
// Prepare tab
$tab = new Tab();
$tab->active = 1;
$tab->class_name = "AdminBlockCategories";
$tab->name = array();
foreach (Language::getLanguages(true) as $lang) {
$tab->name[$lang['id_lang']] = 'BlockCategories';
}
$tab->id_parent = -1;
$tab->module = $this->name;
if (!$tab->add() || !parent::install() || !$this->registerHook('footer') || !$this->registerHook('header') || !$this->registerHook('categoryAddition') || !$this->registerHook('categoryUpdate') || !$this->registerHook('categoryDeletion') || !$this->registerHook('actionAdminMetaControllerUpdate_optionsBefore') || !$this->registerHook('actionAdminLanguagesControllerStatusBefore') || !$this->registerHook('displayBackOfficeCategory') || !Configuration::updateValue('BLOCK_CATEG_MAX_DEPTH', 4) || !Configuration::updateValue('BLOCK_CATEG_DHTML', 1) || !Configuration::updateValue('BLOCK_CATEG_ROOT_CATEGORY', 1)) {
return false;
}
// Hook the module either on the left or right column
$theme = new Theme(Context::getContext()->shop->id_theme);
if ((!$theme->default_left_column || !$this->registerHook('leftColumn')) && (!$theme->default_right_column || !$this->registerHook('rightColumn'))) {
// If there are no colums implemented by the template, throw an error and uninstall the module
$this->_errors[] = $this->l('This module need to be hooked in a column and your theme does not implement one');
parent::uninstall();
return false;
}
return true;
}
示例3: install
/**
* @return boolean
*/
public function install()
{
if (Shop::isFeatureActive()) {
Shop::setContext(Shop::CONTEXT_ALL);
}
// Install invisible tab
$tab = new Tab();
$tab->name[$this->context->language->id] = $this->l('SecurionPay');
$tab->class_name = 'AdminSecurionPay';
$tab->id_parent = -1;
// No parent tab
$tab->module = $this->name;
$tab->add();
//Init
Configuration::updateValue('SECURIONPAY_CONF', '');
if (!parent::install()) {
return false;
}
if (!Configuration::updateValue(self::MODE, self::MODE_TEST)) {
return false;
}
if (!$this->registerHook('payment') || !$this->registerHook('displayAdminOrder')) {
return false;
}
return true;
}
示例4: 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');
}
示例5: 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');
}
示例6: install
/**
* @see Module::install()
*/
public function install()
{
// Prepare tab
$tab = new Tab();
$tab->active = 1;
$tab->class_name = 'AdminLeoSliderLayer';
$tab->name = array();
foreach (Language::getLanguages(true) as $lang) {
$tab->name[$lang['id_lang']] = 'LeoSliderLayer';
}
$tab->id_parent = -1;
$tab->module = $this->name;
/* Adds Module */
if ($tab->add() && parent::install() && Configuration::updateValue('LEOSLIDERLAYER_GROUP_DE', '1')) {
$res = true;
$res &= $this->registerHook('header');
$res &= $this->registerHook('actionShopDataDuplication');
foreach ($this->_hookSupport as $value) {
$res &= $this->registerHook($value);
}
/* Sets up configuration */
/* Creates tables */
$res &= $this->createTables();
return (bool) $res;
}
return false;
}
示例7: upgrade_module_1_0_3
function upgrade_module_1_0_3($object)
{
$sql = array();
$sql[] = 'CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'simpleblog_tag` (
`id_simpleblog_tag` INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_lang` INT( 11 ) unsigned NOT NULL,
`name` VARCHAR(60) NOT NULL,
PRIMARY KEY (`id_simpleblog_tag`)
) ENGINE = ' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=utf8';
$sql[] = 'CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'simpleblog_post_tag` (
`id_simpleblog_post` INT( 11 ) unsigned NOT NULL,
`id_simpleblog_tag` INT( 11 ) unsigned NOT NULL,
PRIMARY KEY (`id_simpleblog_tag`)
) ENGINE = ' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=utf8';
foreach ($sql as $s) {
if (!Db::getInstance()->Execute($s)) {
return false;
}
}
$context = Context::getContext();
$tab = new Tab();
$tab->name[$context->language->id] = $object->l('Tags');
$tab->class_name = 'AdminSimpleBlogTags';
$tab->id_parent = Tab::getIdFromClassName('AdminSimpleBlog');
$tab->module = $object->name;
$tab->add();
return true;
}
示例8: install
public function install()
{
if (!parent::install() || !$this->registerHook('displayHeader') || !$this->registerHook('displayBackOfficeHeader') || !$this->installDB()) {
return false;
}
if (!$this->backupAllModulesHook('hook_module', 'ovic_backup_hook_module')) {
return false;
}
$result = true;
foreach (self::$OptionHookAssign as $hookname) {
if (!$this->registerHook($hookname)) {
$result &= false;
break;
}
}
if (!$result || !$this->registerHook('actionModuleRegisterHookAfter') || !$this->installSampleData()) {
return false;
}
//$defaultfont = htmlentities("<link href='http://fonts.googleapis.com/css?family=Cuprum' rel='stylesheet' type='text/css'>");
// if (is_string($defaultfont) === true)
// $defaultfont = urldecode(preg_replace('/((\%5C0+)|(\%00+))/i', '', urlencode($defaultfont)));
// $defaultfont = !is_string($defaultfont)? $defaultfont : stripslashes($defaultfont);
// Configuration::updateValue('OVIC_FONT_LINK', $defaultfont);
// Configuration::updateValue('OVIC_MAIN_COLOR','#fe983d');
// Configuration::updateValue('OVIC_BTN_COLOR','#333');
// Configuration::updateValue('OVIC_BTN_HOVER_COLOR','#000');
// Configuration::updateValue('OVIC_BTN_TEXT_COLOR','#fff');
// Configuration::updateValue('OVIC_BTN_TEXT_HOVER_COLOR','#fff');
$langs = Language::getLanguages();
$tab = new Tab();
$tab->class_name = "AdminThemeConfig";
foreach ($langs as $l) {
$tab->name[$l['id_lang']] = $this->l('Ovic Theme config');
}
$tab->module = '';
$tab->id_parent = 0;
//Root tab
$tab->save();
$tab_id = $tab->id;
$newtab = new Tab();
$newtab->class_name = "AdminLayoutSetting";
foreach ($langs as $l) {
$newtab->name[$l['id_lang']] = $this->l('Layout Control');
}
$newtab->module = $this->name;
$newtab->id_parent = $tab_id;
$newtab->add();
$newtab = new Tab();
$newtab->class_name = "AdminLayoutBuilder";
foreach ($langs as $l) {
$newtab->name[$l['id_lang']] = $this->l('Layout Builder');
}
$newtab->module = $this->name;
$newtab->id_parent = $tab_id;
$newtab->add();
return true;
}
示例9: adminInstall
private function adminInstall($idParentTab = "7")
{
$tab = new Tab();
$tab->class_name = 'AdminNewsletter';
$tab->id_parent = $idParentTab;
$tab->module = 'newslettertabmodule';
$tab->name[(int)(Configuration::get('PS_LANG_DEFAULT'))] = $this->l('Newsletters');
return $tab->add();
}
示例10: install
public function install()
{
if (!parent::install() || !$this->installDB()) {
return false;
}
if (!$this->registerHook('displayHeader') || !$this->registerHook('displayBackOfficeHeader') || !$this->registerHook('displayProductListReviews')) {
return false;
}
if (!$this->backupAllModulesHook('hook_module', 'ovic_backup_hook_module')) {
return false;
}
$result = true;
foreach (self::$OptionHookAssign as $hookname) {
if (!$this->registerHook($hookname)) {
$result &= false;
break;
}
}
if (!$result || !$this->registerHook('actionModuleRegisterHookAfter')) {
return false;
}
if (!$this->installSampleData()) {
return false;
}
$langs = Language::getLanguages();
$tab = new Tab();
$tab->class_name = "AdminThemeConfig";
foreach ($langs as $l) {
$tab->name[$l['id_lang']] = $this->l('Ovic Theme config');
}
$tab->module = '';
$tab->id_parent = 0;
//Root tab
$tab->save();
$tab_id = $tab->id;
$newtab = new Tab();
$newtab->class_name = "AdminLayoutSetting";
foreach ($langs as $l) {
$newtab->name[$l['id_lang']] = $this->l('Layout Control');
}
$newtab->module = $this->name;
$newtab->id_parent = $tab_id;
$newtab->add();
$newtab = new Tab();
$newtab->class_name = "AdminLayoutBuilder";
foreach ($langs as $l) {
$newtab->name[$l['id_lang']] = $this->l('Layout Builder');
}
$newtab->module = $this->name;
$newtab->id_parent = $tab_id;
$newtab->add();
//Theme::getThemeInfo($this->context->shop->id_theme)
return true;
}
示例11: installTab
public function installTab()
{
$tab = new Tab();
$tab->active = 1;
$tab->class_name = 'AdminAccountBank';
foreach (Language::getLanguages(true) as $lang) {
$tab->name[$lang['id_lang']] = 'Account Bank';
}
$tab->id_parent = (int) Tab::getIdFromClassName('AdminParentOrders');
$tab->module = $this->name;
return $tab->add();
}
示例12: installTab
public function installTab()
{
$tab = new Tab();
$tab->active = 1;
$tab->class_name = 'AdminOnboarding';
$tab->name = array();
foreach (Language::getLanguages(true) as $lang) {
$tab->name[$lang['id_lang']] = 'Onboarding';
}
$tab->id_parent = 99999;
$tab->module = $this->name;
return $tab->add();
}
示例13: installTab
public function installTab()
{
$tab = new Tab();
$tab->active = 1;
$tab->class_name = 'AdminGetresponse';
$tab->name = array();
foreach (Language::getLanguages(true) as $lang) {
$tab->name[$lang['id_lang']] = 'GetResponse';
}
$tab->id_parent = (int) Tab::getIdFromClassName('AdminAdmin');
$tab->module = $this->name;
return $tab->add();
}
示例14: install
public function install()
{
// Install Tabs
$parent_tab = new Tab();
// Need a foreach for the language
$parent_tab->name[(int) Configuration::get('PS_LANG_DEFAULT')] = $this->l('Newsletter2Go');
$parent_tab->class_name = 'Newsletter2GoTab';
$parent_tab->id_parent = 0;
// Home tab
$parent_tab->module = $this->name;
$parent_tab->add();
return parent::install() && $this->registerUrls() && $this->registerHook('backOfficeHeader');
}
示例15: installAdminTab
public function installAdminTab($class_name, $parent = null, $active = true)
{
$tab = new Tab();
$tab->class_name = $class_name;
$tab->active = $active;
$tab->name = array();
foreach (Language::getLanguages(true) as $lang) {
$tab->name[$lang['id_lang']] = $this->module->displayName;
}
$tab->id_parent = (int) Tab::getIdFromClassName($parent == null ? 'AdminParentModules' : $parent);
$tab->module = $this->module->name;
return $tab->add();
}