// Merge -> revision 8014
This commit is contained in:
+165
-148
@@ -25,7 +25,7 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
if (!defined('_CAN_LOAD_FILES_'))
|
||||
if (!defined('_PS_VERSION_'))
|
||||
exit;
|
||||
|
||||
class BlockLink extends Module
|
||||
@@ -35,56 +35,56 @@ class BlockLink extends Module
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'blocklink';
|
||||
$this->tab = 'front_office_features';
|
||||
$this->version = '1.5';
|
||||
$this->name = 'blocklink';
|
||||
$this->tab = 'front_office_features';
|
||||
$this->version = '1.5';
|
||||
$this->author = 'PrestaShop';
|
||||
$this->need_instance = 0;
|
||||
|
||||
parent::__construct();
|
||||
|
||||
$this->displayName = $this->l('Link block');
|
||||
$this->description = $this->l('Adds a block with additional links.');
|
||||
$this->displayName = $this->l('Link block');
|
||||
$this->description = $this->l('Adds a block with additional links.');
|
||||
$this->confirmUninstall = $this->l('Are you sure you want to delete all your links ?');
|
||||
}
|
||||
|
||||
public function install()
|
||||
{
|
||||
if (!parent::install() OR
|
||||
!$this->registerHook('leftColumn') OR
|
||||
!Db::getInstance()->Execute('
|
||||
CREATE TABLE '._DB_PREFIX_.'blocklink (
|
||||
`id_blocklink` int(2) NOT NULL AUTO_INCREMENT,
|
||||
`url` varchar(255) NOT NULL,
|
||||
`new_window` TINYINT(1) NOT NULL,
|
||||
PRIMARY KEY(`id_blocklink`))
|
||||
ENGINE='._MYSQL_ENGINE_.' default CHARSET=utf8') OR
|
||||
!Db::getInstance()->Execute('
|
||||
CREATE TABLE '._DB_PREFIX_.'blocklink_lang (
|
||||
`id_blocklink` int(2) NOT NULL,
|
||||
`id_lang` int(2) NOT NULL,
|
||||
`text` varchar(64) NOT NULL,
|
||||
PRIMARY KEY(`id_blocklink`, `id_lang`))
|
||||
ENGINE='._MYSQL_ENGINE_.' default CHARSET=utf8') OR
|
||||
!Configuration::updateValue('PS_BLOCKLINK_TITLE', array('1' => 'Block link', '2' => 'Bloc lien')))
|
||||
return false;
|
||||
return true;
|
||||
if (!parent::install() OR
|
||||
!$this->registerHook('leftColumn') OR
|
||||
!Db::getInstance()->Execute('
|
||||
CREATE TABLE '._DB_PREFIX_.'blocklink (
|
||||
`id_blocklink` int(2) NOT NULL AUTO_INCREMENT,
|
||||
`url` varchar(255) NOT NULL,
|
||||
`new_window` TINYINT(1) NOT NULL,
|
||||
PRIMARY KEY(`id_blocklink`))
|
||||
ENGINE='._MYSQL_ENGINE_.' default CHARSET=utf8') OR
|
||||
!Db::getInstance()->Execute('
|
||||
CREATE TABLE '._DB_PREFIX_.'blocklink_lang (
|
||||
`id_blocklink` int(2) NOT NULL,
|
||||
`id_lang` int(2) NOT NULL,
|
||||
`text` varchar(64) NOT NULL,
|
||||
PRIMARY KEY(`id_blocklink`, `id_lang`))
|
||||
ENGINE='._MYSQL_ENGINE_.' default CHARSET=utf8') OR
|
||||
!Configuration::updateValue('PS_BLOCKLINK_TITLE', array('1' => 'Block link', '2' => 'Bloc lien')))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public function uninstall()
|
||||
{
|
||||
if (!parent::uninstall() OR
|
||||
!Db::getInstance()->Execute('DROP TABLE '._DB_PREFIX_.'blocklink') OR
|
||||
!Db::getInstance()->Execute('DROP TABLE '._DB_PREFIX_.'blocklink_lang') OR
|
||||
!Configuration::deleteByName('PS_BLOCKLINK_TITLE') OR
|
||||
!Configuration::deleteByName('PS_BLOCKLINK_URL'))
|
||||
return false;
|
||||
return true;
|
||||
if (!parent::uninstall() OR
|
||||
!Db::getInstance()->Execute('DROP TABLE '._DB_PREFIX_.'blocklink') OR
|
||||
!Db::getInstance()->Execute('DROP TABLE '._DB_PREFIX_.'blocklink_lang') OR
|
||||
!Configuration::deleteByName('PS_BLOCKLINK_TITLE') OR
|
||||
!Configuration::deleteByName('PS_BLOCKLINK_URL'))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public function hookLeftColumn($params)
|
||||
{
|
||||
$links = $this->getLinks();
|
||||
$links = $this->getLinks();
|
||||
|
||||
$this->context->smarty->assign(array(
|
||||
'blocklink_links' => $links,
|
||||
@@ -92,7 +92,7 @@ class BlockLink extends Module
|
||||
'url' => Configuration::get('PS_BLOCKLINK_URL'),
|
||||
'lang' => 'text_'.$this->context->language->id
|
||||
));
|
||||
if (!$links)
|
||||
if (!$links)
|
||||
return false;
|
||||
return $this->display(__FILE__, 'blocklink.tpl');
|
||||
}
|
||||
@@ -104,14 +104,14 @@ class BlockLink extends Module
|
||||
|
||||
public function getLinks()
|
||||
{
|
||||
$result = array();
|
||||
/* Get id and url */
|
||||
if (!$links = Db::getInstance()->ExecuteS('SELECT `id_blocklink`, `url`, `new_window` FROM '._DB_PREFIX_.'blocklink'.((int)(Configuration::get('PS_BLOCKLINK_ORDERWAY')) == 1 ? ' ORDER BY `id_blocklink` DESC' : '')))
|
||||
return false;
|
||||
$i = 0;
|
||||
foreach ($links AS $link)
|
||||
{
|
||||
$result[$i]['id'] = $link['id_blocklink'];
|
||||
$result = array();
|
||||
/* Get id and url */
|
||||
if (!$links = Db::getInstance()->ExecuteS('SELECT `id_blocklink`, `url`, `new_window` FROM '._DB_PREFIX_.'blocklink'.((int)(Configuration::get('PS_BLOCKLINK_ORDERWAY')) == 1 ? ' ORDER BY `id_blocklink` DESC' : '')))
|
||||
return false;
|
||||
$i = 0;
|
||||
foreach ($links AS $link)
|
||||
{
|
||||
$result[$i]['id'] = $link['id_blocklink'];
|
||||
$result[$i]['url'] = $link['url'];
|
||||
$result[$i]['newWindow'] = $link['new_window'];
|
||||
/* Get multilingual text */
|
||||
@@ -121,58 +121,58 @@ class BlockLink extends Module
|
||||
$result[$i]['text_'.$text['id_lang']] = $text['text'];
|
||||
$i++;
|
||||
}
|
||||
return $result;
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function addLink()
|
||||
{
|
||||
/* Url registration */
|
||||
if (!Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'blocklink VALUES (NULL, \''.pSQL($_POST['url']).'\', '.((isset($_POST['newWindow']) AND $_POST['newWindow']) == 'on' ? 1 : 0).')') OR !$lastId = Db::getInstance()->Insert_ID())
|
||||
return false;
|
||||
/* Multilingual text */
|
||||
$languages = Language::getLanguages();
|
||||
$defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT'));
|
||||
if (!$languages)
|
||||
return false;
|
||||
foreach ($languages AS $language)
|
||||
if (!empty($_POST['text_'.$language['id_lang']]))
|
||||
{
|
||||
if (!Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'blocklink_lang VALUES ('.(int)($lastId).', '.(int)($language['id_lang']).', \''.pSQL($_POST['text_'.$language['id_lang']]).'\')'))
|
||||
return false;
|
||||
}
|
||||
else
|
||||
if (!Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'blocklink_lang VALUES ('.(int)($lastId).', '.(int)($language['id_lang']).', \''.pSQL($_POST['text_'.$defaultLanguage]).'\')'))
|
||||
return false;
|
||||
return true;
|
||||
/* Url registration */
|
||||
if (!Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'blocklink VALUES (NULL, \''.pSQL($_POST['url']).'\', '.((isset($_POST['newWindow']) AND $_POST['newWindow']) == 'on' ? 1 : 0).')') OR !$lastId = Db::getInstance()->Insert_ID())
|
||||
return false;
|
||||
/* Multilingual text */
|
||||
$languages = Language::getLanguages();
|
||||
$defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT'));
|
||||
if (!$languages)
|
||||
return false;
|
||||
foreach ($languages AS $language)
|
||||
if (!empty($_POST['text_'.$language['id_lang']]))
|
||||
{
|
||||
if (!Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'blocklink_lang VALUES ('.(int)($lastId).', '.(int)($language['id_lang']).', \''.pSQL($_POST['text_'.$language['id_lang']]).'\')'))
|
||||
return false;
|
||||
}
|
||||
else
|
||||
if (!Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'blocklink_lang VALUES ('.(int)($lastId).', '.(int)($language['id_lang']).', \''.pSQL($_POST['text_'.$defaultLanguage]).'\')'))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public function updateLink()
|
||||
{
|
||||
/* Url registration */
|
||||
if (!Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'blocklink SET `url`=\''.pSQL($_POST['url']).'\', `new_window`='.(isset($_POST['newWindow']) ? 1 : 0).' WHERE `id_blocklink`='.(int)($_POST['id'])))
|
||||
return false;
|
||||
/* Multilingual text */
|
||||
$languages = Language::getLanguages();
|
||||
$defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT'));
|
||||
if (!$languages)
|
||||
/* Url registration */
|
||||
if (!Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'blocklink SET `url`=\''.pSQL($_POST['url']).'\', `new_window`='.(isset($_POST['newWindow']) ? 1 : 0).' WHERE `id_blocklink`='.(int)($_POST['id'])))
|
||||
return false;
|
||||
/* Multilingual text */
|
||||
$languages = Language::getLanguages();
|
||||
$defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT'));
|
||||
if (!$languages)
|
||||
return false;
|
||||
if (!Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'blocklink_lang WHERE `id_blocklink` = '.(int)($_POST['id'])))
|
||||
return false ;
|
||||
foreach ($languages AS $language)
|
||||
if (!empty($_POST['text_'.$language['id_lang']]))
|
||||
foreach ($languages AS $language)
|
||||
if (!empty($_POST['text_'.$language['id_lang']]))
|
||||
{
|
||||
if (!Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'blocklink_lang VALUES ('.(int)($_POST['id']).', '.(int)($language['id_lang']).', \''.pSQL($_POST['text_'.$language['id_lang']]).'\')'))
|
||||
return false;
|
||||
if (!Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'blocklink_lang VALUES ('.(int)($_POST['id']).', '.(int)($language['id_lang']).', \''.pSQL($_POST['text_'.$language['id_lang']]).'\')'))
|
||||
return false;
|
||||
}
|
||||
else
|
||||
else
|
||||
if (!Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'blocklink_lang VALUES ('.(int)($_POST['id']).', '.$language['id_lang'].', \''.pSQL($_POST['text_'.$defaultLanguage]).'\')'))
|
||||
return false;
|
||||
return true;
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public function deleteLink()
|
||||
{
|
||||
return Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'blocklink WHERE `id_blocklink`='.(int)($_GET['id']));
|
||||
return Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'blocklink WHERE `id_blocklink`='.(int)($_GET['id']));
|
||||
}
|
||||
|
||||
public function updateTitle()
|
||||
@@ -181,92 +181,98 @@ class BlockLink extends Module
|
||||
$result = array();
|
||||
foreach ($languages AS $language)
|
||||
$result[$language['id_lang']] = $_POST['title_'.$language['id_lang']];
|
||||
if (!Configuration::updateValue('PS_BLOCKLINK_TITLE', $result))
|
||||
return false;
|
||||
return Configuration::updateValue('PS_BLOCKLINK_URL', $_POST['title_url']);
|
||||
if (!Configuration::updateValue('PS_BLOCKLINK_TITLE', $result))
|
||||
return false;
|
||||
return Configuration::updateValue('PS_BLOCKLINK_URL', $_POST['title_url']);
|
||||
}
|
||||
|
||||
public function getContent()
|
||||
{
|
||||
$this->_html = '<h2>'.$this->displayName.'</h2>
|
||||
$this->_html = '<h2>'.$this->displayName.'</h2>
|
||||
<script type="text/javascript" src="'.$this->_path.'blocklink.js"></script>';
|
||||
|
||||
/* Add a link */
|
||||
if (isset($_POST['submitLinkAdd']))
|
||||
/* Add a link */
|
||||
if (isset($_POST['submitLinkAdd']))
|
||||
{
|
||||
if (empty($_POST['text_'.Configuration::get('PS_LANG_DEFAULT')]) OR empty($_POST['url']))
|
||||
$this->_html .= $this->displayError($this->l('You must fill in all fields'));
|
||||
elseif (!Validate::isUrl(str_replace('http://', '', $_POST['url'])))
|
||||
$this->_html .= $this->displayError($this->l('Bad URL'));
|
||||
else
|
||||
if ($this->addLink())
|
||||
if (empty($_POST['text_'.Configuration::get('PS_LANG_DEFAULT')]) OR empty($_POST['url']))
|
||||
$this->_html .= $this->displayError($this->l('You must fill in all fields'));
|
||||
elseif (!Validate::isUrl(str_replace('http://', '', $_POST['url'])))
|
||||
$this->_html .= $this->displayError($this->l('Bad URL'));
|
||||
else
|
||||
if ($this->addLink())
|
||||
$this->_html .= $this->displayConfirmation($this->l('The link has been added.'));
|
||||
else
|
||||
$this->_html .= $this->displayError($this->l('An error occurred during link creation.'));
|
||||
else
|
||||
$this->_html .= $this->displayError($this->l('An error occurred during link creation.'));
|
||||
}
|
||||
/* Update a link */
|
||||
elseif (isset($_POST['submitLinkUpdate']))
|
||||
{
|
||||
if (empty($_POST['text_'.Configuration::get('PS_LANG_DEFAULT')]) OR empty($_POST['url']))
|
||||
$this->_html .= $this->displayError($this->l('You must fill in all fields'));
|
||||
elseif (!Validate::isUrl(str_replace('http://', '', $_POST['url'])))
|
||||
$this->_html .= $this->displayError($this->l('Bad URL'));
|
||||
else
|
||||
if (empty($_POST['id']) OR !is_numeric($_POST['id']) OR !$this->updateLink())
|
||||
$this->_html .= $this->displayError($this->l('An error occurred during link updating.'));
|
||||
else
|
||||
$this->_html .= $this->displayConfirmation($this->l('The link has been updated.'));
|
||||
}
|
||||
/* Update the block title */
|
||||
elseif (isset($_POST['submitTitle']))
|
||||
{
|
||||
if (empty($_POST['title_'.Configuration::get('PS_LANG_DEFAULT')]))
|
||||
$this->_html .= $this->displayError($this->l('"title" field cannot be empty.'));
|
||||
elseif (!empty($_POST['title_url']) AND !Validate::isUrl(str_replace('http://', '', $_POST['title_url'])))
|
||||
$this->_html .= $this->displayError($this->l('The \'title\' field is invalid'));
|
||||
elseif (!Validate::isGenericName($_POST['title_'.Configuration::get('PS_LANG_DEFAULT')]))
|
||||
$this->_html .= $this->displayError($this->l('The \'title\' field is invalid'));
|
||||
elseif (!$this->updateTitle())
|
||||
$this->_html .= $this->displayError($this->l('An error occurred during title updating.'));
|
||||
else
|
||||
$this->_html .= $this->displayConfirmation($this->l('The block title has been updated.'));
|
||||
}
|
||||
/* Delete a link*/
|
||||
elseif (isset($_GET['id']))
|
||||
{
|
||||
if (!is_numeric($_GET['id']) OR !$this->deleteLink())
|
||||
$this->_html .= $this->displayError($this->l('An error occurred during link deletion.'));
|
||||
else
|
||||
$this->_html .= $this->displayConfirmation($this->l('The link has been deleted.'));
|
||||
}
|
||||
if (isset($_POST['submitOrderWay']))
|
||||
/* Update a link */
|
||||
elseif (isset($_POST['submitLinkUpdate']))
|
||||
{
|
||||
if (Configuration::updateValue('PS_BLOCKLINK_ORDERWAY', (int)Tools::getValue('orderWay')))
|
||||
|
||||
if (empty($_POST['text_'.Configuration::get('PS_LANG_DEFAULT')]) OR empty($_POST['url']))
|
||||
$this->_html .= $this->displayError($this->l('You must fill in all fields'));
|
||||
elseif (!Validate::isUrl(str_replace('http://', '', $_POST['url'])))
|
||||
$this->_html .= $this->displayError($this->l('Bad URL'));
|
||||
else
|
||||
if (empty($_POST['id']) OR !is_numeric($_POST['id']) OR !$this->updateLink())
|
||||
$this->_html .= $this->displayError($this->l('An error occurred during link updating.'));
|
||||
else
|
||||
$this->_html .= $this->displayConfirmation($this->l('The link has been updated.'));
|
||||
}
|
||||
|
||||
/* Update the block title */
|
||||
elseif (isset($_POST['submitTitle']))
|
||||
{
|
||||
|
||||
if (empty($_POST['title_'.Configuration::get('PS_LANG_DEFAULT')]))
|
||||
$this->_html .= $this->displayError($this->l('"title" field cannot be empty.'));
|
||||
elseif (!empty($_POST['title_url']) AND !Validate::isUrl(str_replace('http://', '', $_POST['title_url'])))
|
||||
$this->_html .= $this->displayError($this->l('The \'title\' field is invalid'));
|
||||
elseif (!Validate::isGenericName($_POST['title_'.Configuration::get('PS_LANG_DEFAULT')]))
|
||||
$this->_html .= $this->displayError($this->l('The \'title\' field is invalid'));
|
||||
elseif (!$this->updateTitle())
|
||||
$this->_html .= $this->displayError($this->l('An error occurred during title updating.'));
|
||||
else
|
||||
$this->_html .= $this->displayConfirmation($this->l('The block title has been updated.'));
|
||||
}
|
||||
|
||||
/* Delete a link*/
|
||||
elseif (isset($_GET['id']))
|
||||
{
|
||||
|
||||
if (!is_numeric($_GET['id']) OR !$this->deleteLink())
|
||||
$this->_html .= $this->displayError($this->l('An error occurred during link deletion.'));
|
||||
else
|
||||
$this->_html .= $this->displayConfirmation($this->l('The link has been deleted.'));
|
||||
}
|
||||
|
||||
if (isset($_POST['submitOrderWay']))
|
||||
{
|
||||
if (Configuration::updateValue('PS_BLOCKLINK_ORDERWAY', (int)(Tools::getValue('orderWay'))))
|
||||
$this->_html .= $this->displayConfirmation($this->l('Sort order updated'));
|
||||
else
|
||||
$this->_html .= $this->displayError($this->l('An error occurred during sort order set-up.'));
|
||||
}
|
||||
|
||||
$this->_displayForm();
|
||||
$this->_list();
|
||||
$this->_displayForm();
|
||||
$this->_list();
|
||||
|
||||
return $this->_html;
|
||||
}
|
||||
return $this->_html;
|
||||
}
|
||||
|
||||
private function _displayForm()
|
||||
{
|
||||
/* Language */
|
||||
$defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT'));
|
||||
$defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT'));
|
||||
$languages = Language::getLanguages(false);
|
||||
$divLangName = 'text¤title';
|
||||
/* Title */
|
||||
$title_url = Configuration::get('PS_BLOCKLINK_URL');
|
||||
$title_url = Configuration::get('PS_BLOCKLINK_URL');
|
||||
|
||||
$this->_html .= '
|
||||
$this->_html .= '
|
||||
<script type="text/javascript">
|
||||
id_language = Number('.$defaultLanguage.');
|
||||
</script>
|
||||
<fieldset>
|
||||
<fieldset>
|
||||
<legend><img src="'.$this->_path.'add.png" alt="" title="" /> '.$this->l('Add a new link').'</legend>
|
||||
<form method="post" action="'.$_SERVER['REQUEST_URI'].'">
|
||||
<label>'.$this->l('Text:').'</label>
|
||||
@@ -287,7 +293,7 @@ class BlockLink extends Module
|
||||
<div class="margin-form">
|
||||
<input type="hidden" name="id" id="id" value="'.($this->error AND isset($_POST['id']) ? $_POST['id'] : '').'" />
|
||||
<input type="submit" class="button" name="submitLinkAdd" value="'.$this->l('Add this link').'" />
|
||||
<input type="submit" class="button disable" name="submitLinkUpdate" value="'.$this->l('Edit this link').'" disabled="disabled" id="submitLinkUpdate" />
|
||||
<input type="submit" class="button disable" name="submitLinkUpdate" value="'.$this->l('Edit this link').'" id="submitLinkUpdate" />
|
||||
</div>
|
||||
</form>
|
||||
</fieldset>
|
||||
@@ -327,29 +333,29 @@ class BlockLink extends Module
|
||||
|
||||
private function _list()
|
||||
{
|
||||
$links = $this->getLinks();
|
||||
$languages = Language::getLanguages();
|
||||
if ($links)
|
||||
$links = $this->getLinks();
|
||||
$languages = Language::getLanguages();
|
||||
if ($links)
|
||||
{
|
||||
$this->_html .= '
|
||||
$this->_html .= '
|
||||
<script type="text/javascript">
|
||||
var currentUrl = \''.AdminTab::$currentIndex.'&configure='.$this->name.'\';
|
||||
var token=\''.Tools::getValue('token').'\';
|
||||
var links = new Array();';
|
||||
foreach ($links AS $link)
|
||||
foreach ($links AS $link)
|
||||
{
|
||||
$this->_html .= 'links['.$link['id'].'] = new Array(\''.addslashes($link['url']).'\', '.$link['newWindow'];
|
||||
foreach ($languages AS $language)
|
||||
$this->_html .= 'links['.$link['id'].'] = new Array(\''.addslashes($link['url']).'\', '.$link['newWindow'];
|
||||
foreach ($languages AS $language)
|
||||
if (isset($link['text_'.$language['id_lang']]))
|
||||
$this->_html .= ', \''.addslashes($link['text_'.$language['id_lang']]).'\'';
|
||||
else
|
||||
$this->_html .= ', \'\'';
|
||||
$this->_html .= ');';
|
||||
$this->_html .= ');';
|
||||
}
|
||||
$this->_html .= '</script>';
|
||||
$this->_html .= '</script>';
|
||||
}
|
||||
$this->_html .= '
|
||||
<h3 class="blue space">'.$this->l('Link list').'</h3>
|
||||
$this->_html .= '
|
||||
<h3 class="blue space">'.$this->l('Link list').'</h3>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>'.$this->l('ID').'</th>
|
||||
@@ -375,9 +381,20 @@ class BlockLink extends Module
|
||||
<img src="../img/admin/delete.gif" alt="" title="" onclick="linkDeletion('.$link['id'].')" style="cursor: pointer" />
|
||||
</td>
|
||||
</tr>';
|
||||
$i = 0;
|
||||
$nb = count($languages);
|
||||
$idLng = 0;
|
||||
while($i < $nb)
|
||||
{
|
||||
if ($languages[$i]['id_lang'] == (int)Configuration::get('PS_LANG_DEFAULT'))
|
||||
{
|
||||
$idLng = $i;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$this->_html .= '
|
||||
</table>
|
||||
<input type="hidden" id="languageFirst" value="'.$languages[0]['id_lang'].'" />
|
||||
<input type="hidden" id="languageNb" value="'.sizeof($languages).'" />';
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user