Beispiel #1
0
 protected function _initZendX()
 {
     $view = new Zend_View();
     $view->addHelperPath('ZendX/JQuery/View/Helper/', 'ZendX_JQuery_View_Helper');
     $view->jQuery()->setVersion('1.7');
     $view->jQuery()->setUiVersion('1.8');
     $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer($view);
     Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
 }
 /** Load the form options based on the broadperiod provided
  * @access public
  * @param string $broadperiod
  * @return \GreekAndRomanCoinForm
  * @throws Exception
  */
 public function loadForm($broadperiod)
 {
     switch ($broadperiod) {
         case 'ROMAN':
             $form = new RomanCoinForm();
             $form->details->setLegend('Add Roman numismatic data');
             $form->submit->setLabel('Add Roman data');
             $this->_view->headTitle('Add a Roman coin\'s details');
             $this->_view->jQuery()->addJavascriptFile($this->_view->baseUrl() . '/js/JQuery/coinslinkedinit.js', $type = 'text/javascript');
             break;
         case 'IRON AGE':
             $form = new IronAgeCoinForm();
             $form->details->setLegend('Add Iron Age numismatic data');
             $form->submit->setLabel('Add Iron Age data');
             $this->_view->headTitle('Add an Iron Age coin\'s details');
             $this->_view->jQuery()->addJavascriptFile($this->_view->baseUrl() . '/js/JQuery/iacoinslinkedinit.js', $type = 'text/javascript');
             break;
         case 'EARLY MEDIEVAL':
             $form = new EarlyMedievalCoinForm();
             $form->details->setLegend('Add Early Medieval numismatic data');
             $form->submit->setLabel('Add Early Medieval data');
             $this->_view->headTitle('Add an Early Medieval coin\'s details');
             $this->_view->jQuery()->addJavascriptFile($this->_view->baseUrl() . '/js/JQuery/coinslinkedinitearlymededit.js', $type = 'text/javascript');
             break;
         case 'MEDIEVAL':
             $form = new MedievalCoinForm();
             $form->details->setLegend('Add Medieval numismatic data');
             $form->submit->setLabel('Add Medieval data');
             $this->_view->headTitle('Add a Medieval coin\'s details');
             $this->_view->jQuery()->addJavascriptFile($this->_view->baseUrl() . '/js/JQuery/coinslinkedinitmededit.js', $type = 'text/javascript');
             break;
         case 'POST MEDIEVAL':
             $form = new PostMedievalCoinForm();
             $form->details->setLegend('Add Post Medieval numismatic data');
             $form->submit->setLabel('Add Post Medieval data');
             $this->_view->headTitle('Add a Post Medieval coin\'s details');
             $this->_view->jQuery()->addJavascriptFile($this->_view->baseUrl() . '/js/JQuery/coinslinkedinitpostmededit.js', $type = 'text/javascript');
             break;
         case 'BYZANTINE':
             $form = new ByzantineCoinForm();
             $form->details->setLegend('Add Byzantine numismatic data');
             $form->submit->setLabel('Add Byzantine data');
             break;
         case 'GREEK AND ROMAN PROVINCIAL':
             $form = new GreekAndRomanCoinForm();
             $form->details->setLegend('Add Greek & Roman numismatic data');
             $form->submit->setLabel('Add Greek & Roman data');
             break;
         default:
             throw new Exception('You cannot have a coin for that period.');
     }
     return $form;
 }
 protected function _initViewHelpers()
 {
     $view = new Zend_View();
     $view->addHelperPath("ZendX/JQuery/View/Helper", "ZendX_JQuery_View_Helper");
     $view->jQuery()->addStylesheet($view->baseUrl . '/js/jquery/css/ui-lightness/jquery-ui-1.8.13.custom.css');
     $view->jQuery()->setLocalPath($view->baseUrl . '/js/jquery/js/jquery-1.5.1.min.js');
     $view->jQuery()->setUiLocalPath($view->baseUrl . '/js/jquery/js/jquery-ui-1.8.13.custom.min.js');
     $view->jQuery()->enable();
     $view->jQuery()->uiEnable();
     $view->addHelperPath("ZendX/Core/ViewHelper/Html", "ZendX_Core_ViewHelper_Html");
     $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();
     $viewRenderer->setView($view);
     Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
     return $view;
 }
Beispiel #4
0
 /**
  * Retrieve JQuery View Helper
  *
  * @return ZendX_JQuery_View_Helper_JQuery_Container
  */
 public function getJquery()
 {
     if (null === $this->_jquery) {
         $this->getBootstrap()->bootstrap('view');
         $this->_view = $this->getBootstrap()->view;
         ZendX_JQuery::enableView($this->_view);
         $this->_parseOptions($this->getOptions());
         $this->_jquery = $this->_view->jQuery();
     }
     return $this->_jquery;
 }
Beispiel #5
0
 protected function _initView()
 {
     $baseUrl = substr($_SERVER['PHP_SELF'], 0, -9);
     $view = new Zend_View();
     $view->addHelperPath('ZendX/JQuery/View/Helper/', 'ZendX_JQuery_View_Helper');
     $view->jQuery()->uiEnable();
     $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();
     $viewRenderer->setView($view);
     Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
     $view->jQuery()->addStylesheet($baseUrl . 'js/jquery/css/overcast/jquery-ui-1.8.11.custom.css')->setLocalPath($baseUrl . 'js/jquery/js/jquery-1.5.1.min.js')->setUiLocalPath($baseUrl . 'js/jquery/js/jquery-ui-1.8.11.custom.min.js');
 }
Beispiel #6
0
 /** Construct the form
  * @access public
  */
 public function __construct()
 {
     $this->addPrefixPath('Pas_Form_Element', 'Pas/Form/Element', 'element');
     $this->addElementPrefixPath('Pas_Filter', 'Pas/Filter/', 'filter');
     $this->addElementPrefixPath('Pas_Validate', 'Pas/Validate/', 'validate');
     $this->setAttrib('class', 'form-horizontal');
     $this->setAttrib('accept-charset', 'UTF-8');
     $this->clearDecorators();
     $this->_view = Zend_Layout::getMvcInstance()->getView();
     $this->_view->jQuery()->addJavascriptFile($this->_view->baseUrl() . '/js/select2.min.js', $type = 'text/javascript');
     $this->_view->jQuery()->addJavascriptFile($this->_view->baseUrl() . '/js/selectPrettify.js', $type = 'text/javascript');
     $this->_view->headLink()->appendStylesheet($this->_view->baseUrl() . '/css/select2.css', $type = 'screen');
     $this->_view->headLink()->appendStylesheet($this->_view->baseUrl() . '/css/bootstrap-multiselect.css', $type = 'screen');
     $person = new Pas_User_Details();
     $details = $person->getPerson();
     if ($details) {
         $this->_role = $details->role;
     } else {
         $this->_role = 'public';
     }
     parent::__construct();
 }
Beispiel #7
0
 protected function _initView()
 {
     // Création et paramétrage de la vue
     $view = new Zend_View();
     $view->setEncoding('utf-8');
     $view->headMeta()->setHttpEquiv('Content-type', 'text/html; charset=utf-8');
     // Activation de jQuery
     $view->addHelperPath('ZendX/JQuery/View/Helper/', 'ZendX_JQuery_View_Helper');
     $jquery = $view->jQuery();
     $jquery->enable();
     // Si vous ne souhaitez pas utiliser google
     // on peut demander r ZendX _ JQuery de travailler
     // avec une bibliothcque locale
     //$rmode = ZendX _ JQuery::RENDER _ JQUERY _ ON _ LOAD
     // | ZendX _ JQuery::RENDER _ SOURCES;
     //$jquery->setRenderMode($rmode);
     //$jquery->addJavascriptFile('../scripts/jquery-1.3.2.min.js');
     // Enregistrement de l’objet $view comme vue principale
     $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();
     $viewRenderer->setView($view);
     Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
     return $view;
 }
 protected function _initView()
 {
     // Initialize view
     $view = new Zend_View();
     $view->doctype('HTML5');
     $view->headMeta()->appendHttpEquiv('Content-Type', 'text/html; charset=utf-8');
     //$view->addHelperPath('Zend/Dojo/View/Helper/', 'Zend_Dojo_View_Helper');
     $view->addHelperPath('ZendX/JQuery/View/Helper', 'ZendX_JQuery_View_Helper');
     //jQuery
     $view->jQuery()->setLocalPath('/jtables/scripts/jquery-1.9.1.js')->setUiLocalPath('/jtables/scripts/jquery-ui-1.10.1.custom.js')->addStyleSheet('/jtables/css/jquery-ui-1.10.1.custom.css');
     $view->headLink()->appendStylesheet('/jtables/scripts/jtable/themes/lightcolor/blue/jtable.css')->appendStylesheet('/jtables/css/bootstrap.css')->appendStylesheet('/jtables/css/bootstrap-theme.css');
     //Script
     $view->headScript()->appendFile('/jtables/scripts/jquery-1.6.4.min.js')->appendFile('/jtables/scripts/jquery-ui-1.8.16.custom.min.js')->appendFile('/jtables/scripts/jtable/jquery.jtable.min.js')->appendFile('/jtables/scripts/jtable/localization/jquery.jtable.fr.js');
     //->appendFile('/jtables/scripts/bootstrap.js');
     //Zend_Dojo::enableView($view);
     Zend_Paginator::setDefaultScrollingStyle('Elastic');
     Zend_View_Helper_PaginationControl::setDefaultViewPartial('partials/pagination.phtml');
     // Add it to the ViewRenderer
     $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
     $viewRenderer->setView($view);
     //seulement si on utilise d'autres frameworks ajax
     ZendX_JQuery_View_Helper_JQuery::enableNoConflictMode();
     return $view;
 }
Beispiel #9
0
 protected function _initZendX()
 {
     $view = new Zend_View();
     $website = Zend_Registry::get('website');
     $misc = Zend_Registry::get('misc');
     $url = preg_replace('~^https?://~', '', $website['url']);
     $request = new Zend_Controller_Request_Http();
     $protocol = $request->getScheme();
     $view->addHelperPath('ZendX/JQuery/View/Helper/', 'ZendX_JQuery_View_Helper');
     if ($misc['jquery'] == 'local') {
         $view->jQuery()->setLocalPath($protocol . '://' . $url . 'system/js/external/jquery/jquery.js');
     } else {
         $view->jQuery()->setCdnSsl($request->isSecure())->setVersion($misc['jqversion']);
     }
     if ($misc['jqueryui'] == 'local') {
         $view->jQuery()->setUiLocalPath($protocol . '://' . $url . 'system/js/external/jquery/jquery-ui.js');
     } else {
         $view->jQuery()->setUiVersion($misc['jquversion']);
     }
     $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer($view);
     Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
 }
Beispiel #10
0
// establishment of the database
$db = Zend_Db::factory($app_config->db);
Zend_Db_Table::setDefaultAdapter($db);
$db->query('SET NAMES utf8');
$registry->set('db', $db);
$registry->set('extranet_root', $extranet_path);
$registry->set('www_root', $www_root);
$registry->set('lucene_index', realpath(dirname(__FILE__) . '/../') . "/indexation/all_index");
// Enables the loading of helpers from /lib/Cible/View/Helper
$view = new Zend_View();
$view->addHelperPath("Cible/View/Helper", "Cible_View_Helper");
$view->addHelperPath("ZendX/JQuery/View/Helper", "ZendX_JQuery_View_Helper");
$view->addBasePath("{$lib_path}/Cible/View");
$view->addBasePath("{$lib_path}/ZendX/JQuery/View");
$view->addBasePath("{$lib_path}/Cible/Validate");
$jquery = $view->jQuery();
$jquery->setCdnVersion('1.4.1');
$jquery->setUiCdnVersion('1.8.2');
$jquery->addStylesheet("{$web_root}/themes/default/css/jquery/smoothness/jquery-ui-1.8.2.custom.css");
$viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();
$viewRenderer->setView($view);
Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
$frontendOptions = array('lifetime' => 0, 'automatic_serialization' => true);
$backendOptions = array('cache_dir' => $cache_path);
// getting a Zend_Cache_Core object
$cache = Zend_Cache::factory('Core', 'File', $frontendOptions, $backendOptions);
$registry->set('cache', $cache);
// setup the layout
require_once 'Zend/Layout.php';
Zend_Layout::startMvc(array('layoutPath' => "{$extranet_path}/layouts"));
// setup controller
Beispiel #11
0
 //Zend_Session::setOptions(array('strict' => true));
 Zend_Session::start();
 //load configuration
 $config = new Zend_Config_Ini("../application/config.ini", "dev");
 $registry = Zend_Registry::getInstance();
 $registry->set('config', $config);
 //setup database
 $db = Zend_Db::factory($config->db);
 Zend_Db_Table::setDefaultAdapter($db);
 $registry->set('db', $db);
 $db->query("SET NAMES 'utf8'");
 //setup view
 $view = new Zend_View();
 $view->addHelperPath('Wildfire/View/Helper', 'Wildfire_View_Helper');
 $view->addHelperPath("ZendX/JQuery/View/Helper", "ZendX_JQuery_View_Helper");
 $view->jQuery()->enable();
 ZendX_JQuery_View_Helper_JQuery::enableNoConflictMode();
 //$view->headScript()->appendFile($view->baseUrl().'/scripts/jquery.corner.js');
 $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();
 $viewRenderer->setView($view);
 Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
 //setup cache
 $frontendOptions = array('lifetime' => $config->cache->frontendOptions->maxLifetime, 'automatic_serialization' => true);
 $backendOptions = array('cache_dir' => $config->cache->backendOptions->cache_dir, 'lifetime' => $config->cache->backendOptions->maxLifetime);
 $cache = Zend_Cache::factory('Core', 'File', $frontendOptions, $backendOptions);
 $registry->set('cache', $cache);
 $registry->set('testEnv', $testEnv);
 // setup controller
 $frontController = Zend_Controller_Front::getInstance();
 if ($testEnv == 1) {
     $frontController->throwExceptions(true);
Beispiel #12
0
 protected function _initView()
 {
     // Initialize view
     $view = new Zend_View();
     // Set encoding and doctype
     $view->setEncoding('utf-8');
     $view->doctype('HTML4_STRICT');
     //====================== Set the content type, language and title ====================//
     $view->headMeta()->appendHttpEquiv('Content-Type', 'text/html; charset=utf-8');
     $view->headMeta()->appendHttpEquiv('Content-Language', 'en-US');
     $view->headMeta()->appendName('description', 'tour bus, booking, website');
     $view->headMeta()->appendName('keywords', 'Tour bus booking website is where we can book tickets for trip');
     $view->headTitle('Tour Bus Booking');
     //===================================================================================//
     //================== Include blueprint css framework =============//
     $view->headLink()->appendStylesheet('/css/blueprint/screen.css', 'screen, projection');
     $view->headLink()->appendStylesheet('/css/blueprint/print.css', 'print');
     $view->headLink()->appendStylesheet('/css/blueprint/ie.css', 'screen, projection', 'lt IE8');
     //===============================================================//
     //=============== Include jquery library ================//
     $view->headScript()->appendFile('/scripts/libraries/jquery-1.4.2.min.js', 'text/javascript');
     $view->headScript()->appendFile('/scripts/libraries/jquery.tablesorter.js', 'text/javascript');
     $view->headScript()->appendFile('/scripts/libraries/jquery.dataTables.js', 'text/javascript');
     //=============== add jquery library ================//
     // Why can't?????
     // add jquery UI library
     //$view->headScript()->appendFile('/scripts/libraries/jquery-ui-1.8.7.custom.min.js', 'text/javascript');
     //$view->headLink()->appendStylesheet('/css/ui-lightness/jquery-ui-1.8.7.custom.css');
     //========== Set skin for website ==========//
     $skin = 'blues';
     $view->skin = $skin;
     Zend_Registry::set('skin', $skin);
     //==========================================//
     //================== Add helper path ====================//
     // this helper path for LoadSkin
     $view->addHelperPath('TBB/View/Helper', 'TBB_View_Helper');
     // this helper path for ZendX datepicker
     $view->addHelperPath('ZendX/JQuery/View/Helper', 'ZendX_JQuery_View_Helper');
     //=======================================================//
     //================ Include jquery UI (this way by Stackoverflow, not me)==================//
     $view->jQuery()->addStylesheet('/css/ui-lightness/jquery-ui-1.8.7.custom.css')->setLocalPath('/scripts/libraries/jquery-1.4.2.min.js')->setUiLocalPath('/scripts/libraries/jquery-ui-1.8.7.custom.min.js');
     //====================================================================================//
     //================ Set view for view renderer ===============//
     $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
     $viewRenderer->setView($view);
     //===========================================================//
     // Return it, so that it can be stored by the bootstrap
     return $view;
 }
Beispiel #13
0
 /**
  * Set Jquery
  *
  * @return void
  */
 public function setJquery()
 {
     ZendX_JQuery::enableView($this->_view);
     $options = array_change_key_case($this->getOptions(), CASE_LOWER);
     foreach ($options as $key => $value) {
         switch ($key) {
             case 'cdnssl':
                 $this->_view->jQuery()->setCdnSsl($value);
                 break;
             case 'javascriptfiles':
                 foreach ($value as $name => $path) {
                     $this->_view->jQuery()->addJavascriptFile($path);
                 }
                 break;
             case 'localpath':
                 $this->_view->jQuery()->setLocalPath($value);
                 break;
             case 'rendermode':
                 $this->_view->jQuery()->setRenderMode($value);
                 break;
             case 'stylesheets':
                 foreach ($value as $name => $path) {
                     $this->_view->jQuery()->addStylesheet($path);
                 }
                 break;
             case 'uilocalpath':
                 $this->_view->jQuery()->setUiLocalPath($value);
                 break;
             case 'uiversion':
                 $this->_view->jQuery()->setUiVersion($value);
                 break;
             case 'version':
                 $this->_view->jQuery()->setVersion($value);
                 break;
         }
     }
     if (array_key_exists('enable', $options) && $options['enable']) {
         $this->_view->jQuery()->enable();
     } else {
         $this->_view->jQuery()->disable();
     }
     if (array_key_exists('uiEnable', $options) && $options['uiEnable']) {
         $this->_view->jQuery()->uiEnable();
     } else {
         $this->_view->jQuery()->uiDisable();
     }
 }