// Context part 11

This commit is contained in:
tDidierjean
2011-07-18 15:50:58 +00:00
parent 4b7dee58b7
commit 6551a3ece7
60 changed files with 378 additions and 520 deletions
+8 -10
View File
@@ -83,14 +83,14 @@ class BlockLink extends Module
public function hookLeftColumn($params)
{
global $cookie, $smarty;
$context = Context::getContext();
$links = $this->getLinks();
$smarty->assign(array(
$context->controller->smarty->assign(array(
'blocklink_links' => $links,
'title' => Configuration::get('PS_BLOCKLINK_TITLE', $cookie->id_lang),
'title' => Configuration::get('PS_BLOCKLINK_TITLE', $context->language->id),
'url' => Configuration::get('PS_BLOCKLINK_URL'),
'lang' => 'text_'.$cookie->id_lang
'lang' => 'text_'.$context->language->id
));
if (!$links)
return false;
@@ -255,7 +255,6 @@ class BlockLink extends Module
private function _displayForm()
{
global $cookie;
/* Language */
$defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT'));
$languages = Language::getLanguages(false);
@@ -329,15 +328,14 @@ class BlockLink extends Module
private function _list()
{
$links = $this->getLinks();
global $currentIndex, $cookie, $adminObj;
$context = Context::getContext();
$languages = Language::getLanguages();
if ($links)
{
$this->_html .= '
<script type="text/javascript">
var currentUrl = \''.$currentIndex.'&configure='.$this->name.'\';
var token=\''.$adminObj->token.'\';
var currentUrl = \''.AdminTab::$currentIndex.'&configure='.$this->name.'\';
var token=\''.$context->tab->token.'\';
var links = new Array();';
foreach ($links AS $link)
{
@@ -371,7 +369,7 @@ class BlockLink extends Module
$this->_html .= '
<tr>
<td>'.$link['id'].'</td>
<td>'.$link['text_'.$cookie->id_lang].'</td>
<td>'.$link['text_'.$context->language->id].'</td>
<td>'.$link['url'].'</td>
<td>
<img src="../img/admin/edit.gif" alt="" title="" onclick="linkEdition('.$link['id'].')" style="cursor: pointer" />