issue #0001627: Add the logic to the theme plugin, interface change

This commit is contained in:
Arman KYOKCHAN 2013-10-29 07:37:41 +00:00
parent add02110b8
commit 6f5b29be85
4 changed files with 43 additions and 32 deletions

View File

@ -35,7 +35,7 @@
<?=$this->form->pays?>
</div>
<?php }?>
<div data-role="fieldcontain">
<div data-role="fieldcontain" class='fbuttons'>
<?=$this->form->submit?>
<?=$this->form->reset?>
</div>

View File

@ -25,7 +25,16 @@ if (!empty($this->info)) {
<?php
foreach ( $this->liste as $item ) {
?>
<li style="list-style-type:decimal;" class="StyleInfoData" type="1" value="<?=$item['position']?>">
<li style="list-style-type:decimal;border: 1px solid #efefef;
box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.60);
-moz-box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.60);
-webkit-box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.60);
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
-khtml-border-radius: 6px;
border-radius: 6px;
behavior: url(/pie.htc);
padding: 17px;" class="StyleInfoData" type="1" value="<?=$item['position']?>">
<b><a title="Voir la fiche d'identité de cet établissement" href="<?=$this->url(array(
'controller' => 'identite',
'action' => 'fiche',

View File

@ -5,10 +5,9 @@ class Application_Controller_Plugin_Theme extends Zend_Controller_Plugin_Abstrac
{
$auth = Zend_Auth::getInstance();
$theme = 'default';
if ( $auth->hasIdentity() ) {
$theme = !empty($auth->getIdentity()->theme) ? $auth->getIdentity()->theme : 'default';
if ($auth->getIdentity()->browser->mobile && $auth->getIdentity()->browser->mobile==1) {
$theme = 'mobile';
}
//Sauvegarde des paramètres du themes pour gérer les scripts et styles à utiliser
$paramsTheme = new stdClass();
$paramsTheme->name = $theme;
@ -22,34 +21,34 @@ class Application_Controller_Plugin_Theme extends Zend_Controller_Plugin_Abstrac
$viewPath = APPLICATION_PATH . '/views/' . $theme;
//Load bootstrap
$bootstrap = Zend_Controller_Front::getInstance()->getParam('bootstrap');
$bootstrap = Zend_Controller_Front::getInstance()->getParam('bootstrap');
//Get useragent and device informations
$userAgent = $bootstrap->getResource('useragent');
$device = $userAgent->getDevice();
//Override path for view and layout
$view = $bootstrap->bootstrap('View')->getResource('View');
$view = $bootstrap->bootstrap('View')->getResource('View');
$view->setBasePath($viewPath);
$layout = $bootstrap->bootstrap('Layout')->getResource('Layout');
$layout->setLayout('main');
$layout = $bootstrap->bootstrap('Layout')->getResource('Layout');
$layout->setLayout('main');
$layout->setLayoutPath($layoutPath);
//Load default style and javascript files for the selected theme
switch ( $theme )
{
default:
case 'default':
$view->doctype('HTML5');
//Load default style and javascript files for the selected theme
switch ( $theme )
{
default:
case 'default':
$view->headMeta()
->appendHttpEquiv('Content-Type', 'text/html; charset=UTF-8')
$view->doctype('HTML5');
$view->headMeta()
->appendHttpEquiv('Content-Type', 'text/html; charset=UTF-8')
->appendHttpEquiv('Content-Language', 'fr-FR');
$view->headLink()
->headLink(array('rel' => 'favicon', 'type' => 'image/png', 'href' => '/favicon.png'));
$view->headLink()
$view->headLink()
->headLink(array('rel' => 'favicon', 'type' => 'image/png', 'href' => '/favicon.png'));
$view->headLink()
->headLink(array('rel' => 'shortcut icon', 'type' => 'image/x-icon', 'href' => '/favicon.ico'));
$isIE6 = false;
@ -74,7 +73,7 @@ class Application_Controller_Plugin_Theme extends Zend_Controller_Plugin_Abstrac
$view->headScript()
->appendFile('/libs/jquery/jquery-1.10.1.min.js', 'text/javascript');
//===> JavaScript
//===> JavaScript
if ($isIE6) {
//Old JQuery version for IE6
$view->headScript()
@ -87,8 +86,8 @@ class Application_Controller_Plugin_Theme extends Zend_Controller_Plugin_Abstrac
->appendFile('/libs/ui-1.10.3/jquery-ui-i18n.min.js', 'text/javascript');
}
$view->headScript()
->appendFile('/libs/qtip/jquery.qtip.js', 'text/javascript')
->appendFile($paramsTheme->pathScript.'/script.js', 'text/javascript');
->appendFile('/libs/qtip/jquery.qtip.js', 'text/javascript')
->appendFile($paramsTheme->pathScript.'/script.js', 'text/javascript');
/*
* Specialized Controller - Action javascript
@ -169,7 +168,7 @@ class Application_Controller_Plugin_Theme extends Zend_Controller_Plugin_Abstrac
}
break;
case 'mobile': //@todo
$view->doctype('HTML5');
@ -178,17 +177,17 @@ class Application_Controller_Plugin_Theme extends Zend_Controller_Plugin_Abstrac
->appendName('charset', 'utf-8')
->appendName('viewport', 'width=device-width, initial-scale=1');
//Style
$view->headLink()
->appendStylesheet('/libs/mobile/1.3.0/jquery.mobile-1.3.0.min.css', 'all');
//JavaScript
//Style
$view->headLink()
->appendStylesheet('/libs/mobile/1.3.0/jquery.mobile-1.3.0.min.css', 'all')
->appendStylesheet($paramsTheme->pathStyle.'/main.css', 'all');
//JavaScript
$view->headScript()
->appendFile('/libs/jquery/jquery-1.9.1.min.js', 'text/javascript')
->appendFile('/libs/mobile/1.3.0/jquery.mobile-1.3.0.min.js', 'text/javascript')
->appendFile($paramsTheme->pathScript.'/script.js', 'text/javascript');
break;
break;
}
}
}

View File

@ -0,0 +1,3 @@
.fbuttons {
text-align: right;
}