Доброго времени суток.
Создал модуль но никак не могу ево установить не отображаеться в админке в модулях в чем проблема ?
tpl :
Код:
<div id="headerPhoneContact" class="block">
<div class="leftBlockHeaderPhoneContact">
{if $telnumber != ''}<p class="tel">{$telnumber|escape:'htmlall':'UTF-8'}</p>{/if}
{if $telnumber2 != ''}<p class="tel">{$telnumber2|escape:'htmlall':'UTF-8'}</p>{/if}
</div>
<div class="rightBlockHeaderPhoneContact">
<p>Минимальный заказ</p><br/>
{if $minOrder != ''}<p class="minOrder">{l mod='headerPhoneContact'}</p>{/if}
</div>
</div>
php :
Код:
<?php
if (!defined('_CAN_LOAD_FILES_'))
exit;
class HeaderPhoneContact extends Module
{
function __construct()
{
$this->name = 'HeaderPhoneContact';
$this->tab = 'front_office_features';
$this->version = 1.0;
parent::__construct(); // The parent construct is required for translations
$this->displayName = $this->l('HeaderPhoneContact');
$this->description = $this->l('Top contacts');
}
function install()
{
return parent::install()
&& Configuration::updateValue('HeaderPhoneContact_telnumber', '')
&& Configuration::updateValue('HeaderPhoneContact_telnumber2', '')
&& Configuration::updateValue('HeaderPhoneContact_minOrder', '')
&& $this->registerHook('displayTop');
}
public function getContent()
{
$html = '';
// If we try to update the settings
if (Tools::isSubmit('submitModule'))
{
Configuration::updateValue('HeaderPhoneContact_telnumber', Tools::getValue('telnumber'));
Configuration::updateValue('HeaderPhoneContact_telnumber2', Tools::getValue('telnumber2'));
Configuration::updateValue('HeaderPhoneContact_minOrder', Tools::getValue('minOrder'));
$html .= '<div class="confirm">'.$this->l('Configuration updated').'</div>';
}
$html .= '
<h2>'.$this->displayName.'</h2>
<form action="'.Tools::htmlentitiesutf8($_SERVER['REQUEST_URI']).'" method="post">
<fieldset>
<label for="telnumber">'.$this->l('Phone number:').'</label>
<input type="text" id="telnumber" name="telnumber" value="'.((Configuration::get('HeaderPhoneContact_telnumber') != '') ? Tools::safeOutput(Configuration::get('HeaderPhoneContact_telnumber')) : '').'" />
<div class="clear"> </div>
<label for="telnumber2">'.$this->l('Phone number 2:').'</label>
<input type="text" id="telnumber2" name="telnumber2" value="'.((Configuration::get('HeaderPhoneContact_telnumber2') != '') ? Tools::safeOutput(Configuration::get('HeaderPhoneContact_telnumber2')) : '').'" />
<div class="clear"> </div>
<label for="minOrder">'.$this->l('Minimum Order:').'</label>
<input type="text" id="minOrder" name="minOrder" value="'.((Configuration::get('HeaderPhoneContact_minOrder') != '') ? Tools::safeOutput(Configuration::get('HeaderPhoneContact_minOrder')) : '').'" />
<div class="clear"> </div>
<div class="margin-form">
<input type="submit" name="submitModule" value="'.$this->l('Update settings').'" class="button" /></center>
</div>
</fieldset>
</form>';
return $html;
}
public function hookDisplayHeader()
{
$this->context->controller->addCSS(($this->_path).'headerPhoneContact.css', 'all');
}
public function hookDisplayTop()
{
global $smarty;
$smarty->assign(array(
'telnumber' => Configuration::get('HeaderPhoneContact_telnumber'),
'telnumber2' => Configuration::get('HeaderPhoneContact_telnumber2'),
'minOrder' => Configuration::get('HeaderPhoneContact_minOrder')
));
return $this->display(__FILE__, 'headerPhoneContact.tpl');
}
}
?>