Skip to content
Browse files

update dashboard

  • Loading branch information...
1 parent 0ecf81c commit eba9f06dc4ac84af75af7fba870974a6d21969a6 @vincentchalamon committed
Showing with 40 additions and 38 deletions.
  1. +39 −37 lib/view/sfAdminTemplateView.class.php
  2. +1 −1 modules/sfAdminDashboard/templates/dashboardSuccess.php
View
76 lib/view/sfAdminTemplateView.class.php
@@ -2,42 +2,44 @@
class sfAdminTemplateView extends sfPHPView
{
- public function configure() {
- parent::configure();
- // Use admin theme
- if(preg_match(sprintf('/^(%s)/i', implode('|', sfConfig::get('app_sf_admin_template_templates', array('admin', 'clean')))), $this->getDecoratorTemplate(), $matches)) {
- $response = $this->context->getResponse();
- $request = $this->context->getRequest();
- if($response->getStatusCode() != 200) {
- $this->decoratorTemplate = "clean".$this->getExtension();
- }
- $this->decoratorDirectory = sfConfig::get('sf_app_template_dir');
- if(!is_file($this->decoratorDirectory.DIRECTORY_SEPARATOR.$this->getDecoratorTemplate())) {
- $this->decoratorDirectory = sfConfig::get('sf_plugins_dir').DIRECTORY_SEPARATOR."sfAdminTemplatePlugin".DIRECTORY_SEPARATOR."templates";
- }
- $this->setDecorator(true);
- // Stylesheets
- $stylesheets = array('/sfAdminTemplatePlugin/css/layout.css', '/sfAdminTemplatePlugin/css/styles.css', '/sfAdminTemplatePlugin/js/jqtransformplugin/jqtransform.css', '/sfAdminTemplatePlugin/css/jquery.fancybox-1.3.4.css', '/sfAdminTemplatePlugin/js/validationEngine/validationEngine.jquery.css');
- foreach($stylesheets as $css) {
- $response->addStylesheet($css, 'first', array('media' => 'all'));
- }
- // Javascripts
- $javascripts = is_dir(sfConfig::get('sf_plugins_dir').'/sfEPFactoryFormPlugin') ? array('/sfEPFactoryFormPlugin/js/jquery.min.js') : array('/sfAdminTemplatePlugin/js/jquery.min.js');
- $javascripts[] = '/sfAdminTemplatePlugin/js/autoresize.jquery.js';
- $javascripts[] = '/sfAdminTemplatePlugin/js/jqtransformplugin/jquery.jqtransform.js';
- $javascripts[] = '/sfAdminTemplatePlugin/js/jquery.fancybox-1.3.4.pack.js';
- $javascripts[] = '/sfAdminTemplatePlugin/js/admin.js';
- $javascripts[] = '/sfAdminTemplatePlugin/js/validationEngine/jquery.validationEngine-fr.js';
- $javascripts[] = '/sfAdminTemplatePlugin/js/validationEngine/jquery.validationEngine.js';
- foreach($javascripts as $js) {
- $response->addJavascript($js, preg_match('/(jquery\.min\.js)/i', $js) ? 'first' : '');
- }
- if($this->decoratorTemplate == "clean".$this->getExtension()) {
- $response->addStylesheet('/sfAdminTemplatePlugin/css/login.css', '', array('media' => 'all'));
- }
- if($request->isXmlHttpRequest()) {
- $this->setDecorator(false);
- }
+
+ public function configure()
+ {
+ parent::configure();
+ // Use admin theme
+ if (preg_match(sprintf('/^(%s)/i', implode('|', sfConfig::get('app_sf_admin_template_templates', array('admin', 'clean')))), $this->getDecoratorTemplate(), $matches)) {
+ $response = $this->context->getResponse();
+ $request = $this->context->getRequest();
+ if ($response->getStatusCode() != 200) {
+ $this->decoratorTemplate = "clean".$this->getExtension();
+ }
+ $this->decoratorDirectory = sfConfig::get('sf_app_template_dir');
+ if (!is_file($this->decoratorDirectory.DIRECTORY_SEPARATOR.$this->getDecoratorTemplate())) {
+ $this->decoratorDirectory = sfConfig::get('sf_plugins_dir').DIRECTORY_SEPARATOR."sfAdminTemplatePlugin".DIRECTORY_SEPARATOR."templates";
+ }
+ $this->setDecorator(true);
+ // Stylesheets
+ $stylesheets = array('/sfAdminTemplatePlugin/css/layout.css', '/sfAdminTemplatePlugin/css/styles.css', '/sfAdminTemplatePlugin/js/jqtransformplugin/jqtransform.css', '/sfAdminTemplatePlugin/css/jquery.fancybox-1.3.4.css', '/sfAdminTemplatePlugin/js/validationEngine/validationEngine.jquery.css');
+ foreach ($stylesheets as $css) {
+ $response->addStylesheet($css, 'first', array('media' => 'all'));
+ }
+ // Javascripts
+ $javascripts = is_dir(sfConfig::get('sf_plugins_dir').'/sfEPFactoryFormPlugin') ? array('/sfEPFactoryFormPlugin/js/jquery.min.js') : array('/sfAdminTemplatePlugin/js/jquery.min.js');
+ $javascripts[] = '/sfAdminTemplatePlugin/js/autoresize.jquery.js';
+ $javascripts[] = '/sfAdminTemplatePlugin/js/jqtransformplugin/jquery.jqtransform.js';
+ $javascripts[] = '/sfAdminTemplatePlugin/js/jquery.fancybox-1.3.4.pack.js';
+ $javascripts[] = '/sfAdminTemplatePlugin/js/admin.js';
+ $javascripts[] = '/sfAdminTemplatePlugin/js/validationEngine/jquery.validationEngine-fr.js';
+ $javascripts[] = '/sfAdminTemplatePlugin/js/validationEngine/jquery.validationEngine.js';
+ foreach ($javascripts as $js) {
+ $response->addJavascript($js, preg_match('/(jquery\.min\.js)/i', $js) ? 'first' : '');
+ }
+ if ($this->decoratorTemplate == "clean".$this->getExtension()) {
+ $response->addStylesheet('/sfAdminTemplatePlugin/css/login.css', '', array('media' => 'all'));
+ }
+ if ($request->isXmlHttpRequest()) {
+ $this->setDecorator(false);
+ }
+ }
}
- }
}
View
2 modules/sfAdminDashboard/templates/dashboardSuccess.php
@@ -1,7 +1,7 @@
<?php use_helper('I18N', 'Date') ?>
<?php $sf_response->addMeta('title', __("Administration | Dashboard", null, "sf_admin")) ?>
<?php slot('breadcrumb', array(array('url' => '@sf_admin_dashboard', 'label' => 'Tableau de bord'))) ?>
-<?php slot('menu', 'dashboard') ?>
+<?php slot('menu', 'sf_admin_dashboard') ?>
<?php use_stylesheet(public_path('/sfAdminTemplatePlugin/css/dashboard.css')) ?>
<?php include_partial('sfAdminDashboard/flashes') ?>

0 comments on commit eba9f06

Please sign in to comment.
Something went wrong with that request. Please try again.