- {$monthly_statistics}
- {$customers_service}
-
- {$stats_sales}
- {$last_orders}
+{/if}
+
+
{$tips_optimization}
-
-
-
{l s='Loading...'}
-
-
-
+
+ $('#discover_prestashop').fadeOut('slow', function() {
+ if (json.discover_prestashop != 'NOK')
+ $('#discover_prestashop').html(json.discover_prestashop);
+ else
+ $('#discover_prestashop').html('');
+ $('#discover_prestashop').fadeIn('slow');
+ });
+ },
+ error: function(XMLHttpRequest, textStatus, errorThrown)
+ {
+ $('#adminpresentation').fadeOut('slow');
+ $('#partner_preactivation').fadeOut('slow');
+ $('#discover_prestashop').fadeOut('slow');
+ }
+ });
+ });
+
+
+
{l s='Loading...'}
+
{$discover_prestashop}
-
-
-{$HOOK_BACKOFFICEHOME}
-
-
+
+ {$HOOK_BACKOFFICEHOME}
+
diff --git a/admin-dev/themes/template/header.tpl b/admin-dev/themes/template/header.tpl
index e2ba586a8..d7de60f06 100644
--- a/admin-dev/themes/template/header.tpl
+++ b/admin-dev/themes/template/header.tpl
@@ -28,7 +28,7 @@
-
PrestaShop™ - {l s='Administration panel'|escape:'htmlall':'UTF-8'}
+
{$meta_title} - PrestaShop™
diff --git a/classes/AdminController.php b/classes/AdminController.php
index d907111b4..fb5aed6f1 100644
--- a/classes/AdminController.php
+++ b/classes/AdminController.php
@@ -9,6 +9,8 @@ class AdminControllerCore extends Controller
public $content_only = false;
public $layout = 'layout.tpl';
+ public $meta_title = 'Administration panel';
+
public $template = '';
/** @var string Associated table name */
@@ -170,6 +172,9 @@ class AdminControllerCore extends Controller
{
if(!empty($this->content))
$this->context->smarty->assign('content', $this->content);
+
+ $this->context->smarty->assign('meta_title',$this->meta_title);
+
if (empty($this->template))
{
$class_name = get_class($this);
diff --git a/controllers/admin/AdminHomeController.php b/controllers/admin/AdminHomeController.php
index 541ba697a..555d457ea 100644
--- a/controllers/admin/AdminHomeController.php
+++ b/controllers/admin/AdminHomeController.php
@@ -31,6 +31,8 @@ class AdminHomeControllerCore extends AdminController
private function _displayOptimizationTips()
{
+ $link = $this->context->link;
+
$content = '';
$rewrite = 0;
if (Configuration::get('PS_REWRITING_SETTINGS'))
@@ -94,59 +96,59 @@ class AdminHomeControllerCore extends AdminController
if ($rewrite + $htaccessOptimized + $smartyOptimized + $cccOptimized + $shopEnabled + $htaccessAfterUpdate + $indexRebuiltAfterUpdate != 14)
{
- $content .= '
-
-
'.$this->l('A good beginning...')
- .'
-
-
':'href="?hideOptimizationTips" >
-
- ').'
';
- $content .= '
-
- ';
- $content .= '
-
';
+ $this->context->smarty->assign('hide_tips',Configuration::get('PS_HIDE_OPTIMIZATION_TIPS'));
+ $opti_list[] = array(
+ 'title' => $this->l('URL rewriting'),
+ 'href' => $link->getAdminLink('AdminGenerator'),
+ 'color' => $lights[$rewrite]['color'],
+ 'image' => $lights[$rewrite]['image'],
+ );
+
+ $opti_list[] = array(
+ 'title' => $this->l('Browser cache & compression'),
+ 'href' => $link->getAdminLink('AdminPerformance'),
+ 'color' => $lights[$htaccessOptimized]['color'],
+ 'image' => $lights[$htaccessOptimized]['image'],
+ );
+
+ $opti_list[] = array(
+ 'title' => $this->l('Smarty optimization'),
+ 'href' => $link->getAdminLink('AdminPerformance'),
+ 'color' => $lights[$smartyOptimized]['color'],
+ 'image' => $lights[$smartyOptimized]['image'],
+ );
+
+ $opti_list[] = array(
+ 'title' => $this->l('Combine, Compress & Cache'),
+ 'href' => $link->getAdminLink('AdminPerformance'),
+ 'color' => $lights[$cccOptimized]['color'],
+ 'image' => $lights[$cccOptimized]['image'],
+ );
+
+ $opti_list[] = array(
+ 'title' => $this->l('Shop enabled'),
+ 'href' => $link->getAdminLink('AdminPreferences'),
+ 'color' => $lights[$shopEnabled]['color'],
+ 'image' => $lights[$shopEnabled]['image'],
+ );
+
+ $opti_list[] = array(
+ 'title' => $this->l('index rebuilt after update'),
+ 'href' => $link->getAdminLink('AdminSearchConf'),
+ 'color' => $lights[$indexRebuiltAfterUpdate]['color'],
+ 'image' => $lights[$indexRebuiltAfterUpdate]['image'],
+ );
+
+ $opti_list[] = array(
+ 'title' => $this->l('.htaccess up-to-date'),
+ 'href' => $link->getAdminLink('AdminGenerator'),
+ 'color' => $lights[$htaccessAfterUpdate]['color'],
+ 'image' => $lights[$htaccessAfterUpdate]['image'],
+ );
}
- return $content;
+ $this->context->smarty->assign('opti_list',$opti_list);
+ $this->context->smarty->assign('content',$content);
+ return $this->context->smarty->fetch('home/optimizationTips.tpl');
}
public function setMedia()
@@ -372,10 +374,27 @@ class AdminHomeControllerCore extends AdminController
return $content;
}
- public function ajaxProcess()
- {
- }
+ public function ajaxProcessHideOptimizationTips()
+ {
+ if (Configuration::updateValue('PS_HIDE_OPTIMIZATION_TIPS', 1))
+ {
+ $result['result'] = 'ok';
+ $result['msg'] = $this->l('Optimization Tips will be folded by default');
+ }
+ else
+ {
+ $result['result'] = 'error';
+ $result['msg'] = $this->l('an error occured a');
+ }
+ $this->content = Tools::jsonEncode($result);
+
+ }
+
+ public function displayAjax()
+ {
+ echo $this->content;
+ }
public function ajaxProcessGetAdminHomeElement()
{
$result = array();
@@ -419,11 +438,12 @@ class AdminHomeControllerCore extends AdminController
if ($content[0] == 'OK' && Validate::isCleanHtml($content[1]))
$result['discover_prestashop'] .= $content[1];
- die(Tools::jsonEncode($result));
+ $this->content = Tools::jsonEncode($result);
}
public function getBlockPartners()
{
+ $stream_context = @stream_context_create(array('http' => array('method'=> 'GET', 'timeout' => AdminHomeController::TIPS_TIMEOUT)));
$content = @file_get_contents($protocol.'://www.prestashop.com/partner/preactivation/preactivation-block.php?version=1.0&shop='.urlencode(Configuration::get('PS_SHOP_NAME')).'&protocol='.$protocol.'&url='.urlencode($_SERVER['HTTP_HOST']).'&iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser).'&id_lang='.(int)Context::getContext()->language->id.'&email='.urlencode(Configuration::get('PS_SHOP_EMAIL')).'&date_creation='._PS_CREATION_DATE_.'&v='._PS_VERSION_.'&security='.md5(Configuration::get('PS_SHOP_EMAIL')._COOKIE_IV_), false, $stream_context);
if (!$content)
$return = ''; // NOK
@@ -453,9 +473,9 @@ class AdminHomeControllerCore extends AdminController
public function getBlockDiscover()
{
+ $stream_context = @stream_context_create(array('http' => array('method'=> 'GET', 'timeout' => AdminHomeController::TIPS_TIMEOUT)));
$content = '';
- $stream_context = @stream_context_create(array('http' => array('method'=> 'GET', 'timeout' => AdminHomeController::TIPS_TIMEOUT)));
$protocol = Tools::usingSecureMode() ? 'https' : 'http';
$isoUser = Context::getContext()->language->iso_code;
$isoCountry = Context::getContext()->country->iso_code;
@@ -494,29 +514,19 @@ class AdminHomeControllerCore extends AdminController
}
$smarty->assign('upgrade', $upgrade);
- $smarty->assign('show_screencast', $this->context->employee->show_screencast);
+ $smarty->assign('show_screencast', $this->context->employee->show_screencast);
- // quick link to add a products, category, attributes etc.
- $quick_links = $this->getQuickLinks();
- $smarty->assign('quick_links',$quick_links);
- $monthly_statistics = $this->getMonthlyStatistics();
- $smarty->assign('monthly_statistics', $monthly_statistics);
+ $smarty->assign('quick_links', $this->getQuickLinks());
- $customers_service = $this->getCustomersService();
- $smarty->assign('customers_service', $customers_service);
+ $smarty->assign('monthly_statistics', $this->getMonthlyStatistics());
- $stats_sales = $this->getStatsSales();
- $smarty->assign('stats_sales', $stats_sales);
+ $smarty->assign('customers_service', $this->getCustomersService());
- $last_orders = $this->getLastOrders();
- $smarty->assign('last_orders', $last_orders);
+ $smarty->assign('stats_sales', $this->getStatsSales());
+ $smarty->assign('last_orders',$this->getLastOrders());
- if (Tools::isSubmit('hideOptimizationTips'))
- Configuration::updateValue('PS_HIDE_OPTIMIZATION_TIPS', 1);
-
- $tips_optimization = $this->_displayOptimizationTips();
- $smarty->assign('tips_optimization', $tips_optimization);
+ $smarty->assign('tips_optimization', $this->_displayOptimizationTips());
$discover_prestashop = '
'.$this->l('Loading...').'
diff --git a/css/admin.css b/css/admin.css
index 8d5b738ea..95ce744bd 100644
--- a/css/admin.css
+++ b/css/admin.css
@@ -1094,13 +1094,13 @@ html[xmlns] .clearfix {
#column_left{
width: 610px;
float: left;
- padding-top: 20px;
+ padding-top: 5px;
}
#column_right{
width: 315px;
float: right;
- padding-top: 20px;
+ padding-top: 5px;
}
.F_list{
@@ -1708,4 +1708,4 @@ div.progressBarImage
width: 50px;
text-align: center;
float: left;
-}
\ No newline at end of file
+}
diff --git a/override/classes/AdminController.php b/override/classes/AdminController.php
new file mode 100644
index 000000000..108f21136
--- /dev/null
+++ b/override/classes/AdminController.php
@@ -0,0 +1,7 @@
+