Beispiel #1
0
 public function renderView()
 {
     $header = new HeaderView();
     $header->render();
     $this->view->render();
     $footer = new FooterView();
     $footer->render();
 }
Beispiel #2
0
 public function render()
 {
     $header = new HeaderView();
     $header->render();
     echo "  <div  id='top' class='callbacks_container'>\n\n                <!--- slider --->\n\n                    <link rel='stylesheet' href='/myshop/css/flickity.css' media='screen'>\n                    <script src='/myshop/js/flickity.js'></script>\n\n                    <div class='slider'>\n                        <div class='slider-cell'>\n                            <img src='images/slide1.png' alt=''>\n                            <div class='caption'>\n                                <div class='slide-text-info'>\n                                    <h1>WILL HELM</h1>\n                                    <label>SCHNAPS</label>\n                                    <a class='slide-btn' href='#'><span>99.90\$</span> <small>GET NOW</small><label> </label></a>\n                                </div>\n                            </div>\n                        </div>\n                        <div class='slider-cell'>\n                            <img src='images/slide2.png' alt=''>\n                            <div class='caption'>\n                                <div class='slide-text-info'>\n                                    <h1>FAST NER2</h1>\n                                    <label>Dress Shoe</label>\n                                    <a class='slide-btn' href='#'><span>99.90\$</span> <small>GET NOW</small><label> </label></a>\n                                </div>\n                            </div>\n                        </div>\n                    </div>\n\n\n\n                <!--- end slider --->\n\n                ";
     //render Products
     $products = new Products();
     $productsview = new ProductView($products);
     $productsview->render();
     echo "</div>";
     echo "<script>\n                    \$('.slider').flickity({\n                          // options\n                          cellAlign: 'left',\n                          contain: true,\n                          wrapAround: true,\n                          autoPlay: 10000\n                        });\n                    </script>";
     $footer = new FooterView();
     $footer->render();
 }
Beispiel #3
0
 /**
  * This function builds the whole page.
  * 
  * @access public
  * @author kalmer
  * @param string[string] $parameters['middle'] the middle part of the
  * 		content of the page
  * @return string
  */
 public static function buildPage($parameters)
 {
     require_once 'HTML/Template/IT.php';
     $templateForBody = new \HTML_Template_IT(dirname(__FILE__) . '/../html');
     $templateForBody->loadTemplatefile('html.html');
     $html = '';
     require_once 'HeaderView.php';
     $html .= HeaderView::buildHeader();
     $html .= $parameters['middle'];
     require_once 'FooterView.php';
     $html .= FooterView::buildFooter();
     $templateForBody->setCurrentBlock('html');
     $templateForBody->setVariable(array('BODY' => $html));
     $templateForBody->parse('html');
     return $templateForBody->get('html');
 }
 /**
  * Execute the action.
  * @param array command line parameters specific for this command
  */
 public function run($args)
 {
     set_time_limit('1800');
     if (!isset($args[0])) {
         $this->usageError('A username must be specified.');
     }
     try {
         Yii::app()->user->userModel = User::getByUsername($args[0]);
     } catch (NotFoundException $e) {
         $this->usageError('The specified username does not exist.');
     }
     $group = Group::getByName(Group::SUPER_ADMINISTRATORS_GROUP_NAME);
     if (!$group->users->contains(Yii::app()->user->userModel)) {
         $this->usageError('The specified user is not a super administrator.');
     }
     $overwriteExistingReadTables = false;
     $overwriteReadTablesMessage = Zurmo::t('Commands', 'Skipping existing read Tables.');
     if (isset($args[1]) && $args[1] == 1) {
         $overwriteExistingReadTables = true;
         $overwriteReadTablesMessage = Zurmo::t('Commands', 'Overwriting any existing read Tables.');
     }
     $startTime = microtime(true);
     $template = "{message}\n";
     $messageStreamer = new MessageStreamer($template);
     $messageStreamer->setExtraRenderBytes(0);
     $messageStreamer->add(Zurmo::t('Commands', 'Starting schema update process.'));
     $messageLogger = new MessageLogger($messageStreamer);
     $messageLogger->logDateTimeStamp = false;
     InstallUtil::runAutoBuildFromUpdateSchemaCommand($messageLogger);
     $messageStreamer->add(Zurmo::t('Commands', 'Autobuild complete, rebuilding read permissions.'));
     if (SHOW_QUERY_DATA) {
         $messageStreamer->add(FooterView::getTotalAndDuplicateQueryCountContent());
     }
     $messageStreamer->add($overwriteReadTablesMessage);
     AllPermissionsOptimizationUtil::rebuild($overwriteExistingReadTables, false, $messageStreamer);
     $messageStreamer->add(Zurmo::t('Commands', 'Rebuild read permissions complete.'));
     $endTime = microtime(true);
     $messageStreamer->add(Zurmo::t('Commands', 'Schema update complete.'));
     $messageStreamer->add(Zurmo::t('Commands', 'Total run time: {formattedTime} seconds.', array('{formattedTime}' => number_format($endTime - $startTime, 3))));
     if (SHOW_QUERY_DATA) {
         $messageStreamer->add(FooterView::getTotalAndDuplicateQueryCountContent());
     }
 }
 /**
  * Method to run installation from command line. Use @InstallCommand.
  * @param array $args
  */
 public static function runFromInstallCommand($args, $validateForm = false)
 {
     assert('is_array($args)');
     $form = new InstallSettingsForm();
     $template = "{message}\n";
     $messageStreamer = new MessageStreamer($template);
     $messageStreamer->setExtraRenderBytes(0);
     $messageStreamer->add(Zurmo::t('InstallModule', 'Connecting to Database.'));
     $form->databaseHostname = $args[0];
     $form->databaseName = $args[1];
     $form->databaseUsername = $args[2];
     $form->databasePassword = $args[3];
     $form->databasePort = $args[4];
     $form->superUserPassword = $args[5];
     $form->removeExistingData = 1;
     if (!empty($args[6])) {
         $form->hostInfo = $args[6];
         Yii::app()->getRequest()->setHostInfo($form->hostInfo);
     }
     if (!empty($args[7])) {
         $form->scriptUrl = $args[7];
     }
     $formHasErrors = false;
     if ($validateForm) {
         $form->validate();
         if ($form->hasErrors()) {
             $errors = $form->getErrors();
             foreach ($errors as $fieldErrors) {
                 foreach ($fieldErrors as $fieldError) {
                     $messageStreamer->add($fieldError);
                 }
             }
             $formHasErrors = true;
         }
     }
     if (!$formHasErrors) {
         static::runInstallation($form, $messageStreamer);
         if (isset($args[8])) {
             $messageStreamer->add(Zurmo::t('InstallModule', 'Starting to load demo data.'));
             $messageLogger = new MessageLogger($messageStreamer);
             $messageLogger->logDateTimeStamp = false;
             $startTime = microtime(true);
             if (isset($args[9])) {
                 DemoDataUtil::load($messageLogger, intval($args[9]));
             } else {
                 DemoDataUtil::load($messageLogger, 6);
             }
             $endTime = microtime(true);
             $messageStreamer->add(Zurmo::t('InstallModule', 'Total demodata build time: {formattedTime} seconds.', array('{formattedTime}' => number_format($endTime - $startTime, 3))));
             if (SHOW_QUERY_DATA) {
                 $messageStreamer->add(FooterView::getTotalAndDuplicateQueryCountContent());
                 $messageStreamer->add(PageView::makeNonHtmlDuplicateCountAndQueryContent());
             }
             $messageStreamer->add(Zurmo::t('InstallModule', 'Finished loading demo data.'));
         }
         if (empty($args[6]) || empty($args[7])) {
             // Send notification to super admin that need to setup hostInfo and scriptUrl params in perInstance.php
             $message = new NotificationMessage();
             $message->textContent = Zurmo::t('InstallModule', 'The system has detected that the hostInfo and/or scriptUrl are ' . 'not set up. Please open the perInstance.php config file and ' . 'set up these parameters.');
             $rules = new HostInfoAndScriptUrlNotSetupNotificationRules();
             NotificationsUtil::submit($message, $rules);
         }
         $messageStreamer->add(Zurmo::t('InstallModule', 'Locking Installation.'));
         static::writeInstallComplete(INSTANCE_ROOT);
         $messageStreamer->add(Zurmo::t('InstallModule', 'Installation Complete.'));
     }
 }
Beispiel #6
0
<!DOCTYPE html>
<html>
    <head>
        <?php 
require_once "inc/head.php";
?>
    </head>
    <body>
        <!--- menu and header --->
        <?php 
$header = new HeaderView();
$header->render();
?>
        <!--- end menu and header --->

        <!--- content --->
        <?php 
$routecontroller->renderView();
//update headerinfo (buttons)
$header->update();
?>
        <!--- end content --->

        <!--- footer --->
        <?php 
$footer = new FooterView();
$footer->render();
?>
        <!--- end footer --->
    </body>
</html>
 protected function renderContent()
 {
     $content = parent::renderContent();
     $footerView = new FooterView();
     return ZurmoHtml::tag('div', array('class' => 'AppContainer'), $content) . $footerView->render();
 }