Пример #1
0
 /**
  * This function is the stn.
  *
  * @access public
  * @author arnold:tserepov <*****@*****.**>
  * @uses MENU_COMMON for the common menu
  * @uses MENU_OUTER for the menu of outer links
  * @uses MENU_INNER for the menu of inner links
  * @uses View for the visual part
  */
 public static function start()
 {
     require_once dirname(__FILE__) . '/MenuElement.php';
     require_once dirname(__FILE__) . '/Service.php';
     $services = \tuts\Service::getListOfTypeService(array('forAutocompletion' => false));
     // echo ' 41: <pre>';var_dump($services); echo '</pre>';
     $blockOfServices = '';
     foreach ($services as $idService => $service) {
         require_once dirname(__FILE__) . '/ServiceView.php';
         $blockOfServices .= \tuts\ServiceView::buildService(array('service' => $service['object']));
     }
     $logos = '';
     require_once dirname(__FILE__) . '/Logo.php';
     $arrayOfLogos = \tuts\Logo::getListOfTypeLogo(array('forAutocompletion' => false));
     foreach ($arrayOfLogos as $idLogo => $arrayOfLogo) {
         require_once dirname(__FILE__) . '/LogoView.php';
         $logos .= \tuts\LogoView::buildLogo(array('logo' => $arrayOfLogo['object']));
     }
     require_once dirname(__FILE__) . '/Human.php';
     $designer = new \tuts\Human();
     $designer->setId(ID_OF_DESIGNER);
     $designer->setCompleteHuman();
     require_once dirname(__FILE__) . '/Model.php';
     \tuts\Model::setComplete();
     require_once dirname(__FILE__) . '/MenuView.php';
     require_once dirname(__FILE__) . '/View.php';
     echo ' 69: <pre>';
     var_dump($commonMenu);
     echo '</pre>';
     echo \tuts\View::buildView(array('address' => Model::getAddress(), 'blogDate' => Model::getBlogDate(), 'blogEntry' => Model::getBlogEntry(), 'designer' => $designer, 'logos' => $logos, 'menus' => array(MENU_COMMON => MenuView::buildMenu(array('type' => MENU_COMMON)), MENU_OUTER => MenuView::buildMenu(array('type' => MENU_OUTER)), MENU_INNER => MenuView::buildMenu(array('type' => MENU_INNER))), 'phoneNumber' => Model::getPhoneNumber(), 'services' => $blockOfServices, 'title' => Model::getTitle(), 'twitter' => Model::getTwitter()));
 }
Пример #2
0
 /**
  * This function is the stn.
  *
  * @access public
  * @author kalmer:piiskop <*****@*****.**>
  * @uses View for the visual part
  */
 public static function start()
 {
     require_once dirname(__FILE__) . '/MenuElement.php';
     $menuElements = \tuts\MenuElement::getListOfTypeMenuElement(array('forAutocompletion' => false));
     $menu = '';
     foreach ($menuElements as $idMenuElement => $menuElement) {
         require_once dirname(__FILE__) . '/MenuElementView.php';
         $menu .= \tuts\MenuElementView::buildMenuElement(array('menuElement' => $menuElement['object']));
     }
     require_once dirname(__FILE__) . '/Service.php';
     $services = \tuts\Service::getListOfTypeService(array('forAutocompletion' => false));
     // 		echo ' 41: <pre>';var_dump($services); echo '</pre>';
     $blockOfServices = '';
     foreach ($services as $idService => $service) {
         require_once dirname(__FILE__) . '/ServiceView.php';
         $blockOfServices .= \tuts\ServiceView::buildService(array('service' => $service['object']));
     }
     require_once dirname(__FILE__) . '/View.php';
     echo \tuts\View::buildView(array('menu' => $menu, 'services' => $blockOfServices));
 }
Пример #3
0
 /**
  * This function is the stn.
  * 
  * @access public
  */
 public static function start()
 {
     require_once dirname(__FILE__) . '/MenuElement.php';
     require_once dirname(__FILE__) . '/Service.php';
     $services = \tuts\Service::getListOfTypeService(array('forAutocompletion' => false));
     // echo ' 41: <pre>';var_dump($services); echo '</pre>';
     $blockOfServices = '';
     foreach ($services as $idService => $service) {
         require_once dirname(__FILE__) . '/ServiceView.php';
         $blockOfServices .= \tuts\ServiceView::buildService(array('service' => $service['object']));
     }
     $logos = '';
     require_once dirname(__FILE__) . '/Logo.php';
     $arrayOfLogos = \tuts\Logo::getListOfTypeLogo(array('forAutocompletion' => false));
     foreach ($arrayOfLogos as $idLogo => $arrayOfLogo) {
         require_once dirname(__FILE__) . '/LogoView.php';
         $logos .= \tuts\LogoView::buildLogo(array('logo' => $arrayOfLogo['object']));
     }
     require_once dirname(__FILE__) . '/Model.php';
     \tuts\Model::setComplete();
     require_once dirname(__FILE__) . '/MenuView.php';
     require_once dirname(__FILE__) . '/View.php';
     echo \tuts\View::buildView(array('logos' => $logos, 'services' => $blockOfServices, 'menus' => array(MENU_COMMON => MenuView::buildMenu(array('type' => MENU_COMMON)), MENU_OUTER => MenuView::buildMenu(array('type' => MENU_OUTER)), MENU_INNER => MenuView::buildMenu(array('type' => MENU_INNER)))));
 }
Пример #4
0
 /**
  * This function builds the main structure in HTML.
  *
  * @access public
  * @author arnold<*****@*****.**>
  * @param string $parameters['address']
  *        	the address
  * @param string $parameters['blogDate']
  *        	the date of the blog
  * @param string $parameters['blogEntry']
  *        	the blog entry
  * @param Human $parameters['designer']
  *        	the designer
  * @param string $parameters['menu']
  *        	the body
  * @param string $parameters['phoneNumber']
  *        	the phone number
  * @param string $parameters['title']
  *        	the title
  * @param string $parameters['twitter']
  *        	the Twitter-time
  * @return string the parsed HTML-structure
  * @uses BEGINNING_OF_URL for links
  * @uses MENU_COMMON for the common menu
  * @uses MENU_OUTER for the menu of outer links
  * @uses MENU_INNER for the menu of inner links
  */
 public static function buildView($parameters)
 {
     require_once 'HTML/Template/IT.php';
     require_once dirname(__FILE__) . '/ErrorView.php';
     ///////////////////////
     \PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array(new ErrorView(), 'raiseError'));
     $tpl = new \HTML_Template_IT(ROOT_FOLDER . 'tutshtml');
     $tpl->loadTemplatefile('burnstudio2-template.html');
     // echo ' 182: <pre>';var_dump($parameters); echo '</pre>';
     if (isset($parameters['logos'])) {
         $tpl->setCurrentBlock('logos');
         $tpl->setVariable(array('LOGO' => $parameters['logos']));
         $tpl->parse('logos');
     }
     if (isset($parameters['menus'])) {
         if (isset($parameters['menus'][MENU_COMMON])) {
             $tpl->setCurrentBlock('menu-items');
             $tpl->setVariable(array('MENU-ITEMS' => $parameters['menus'][MENU_COMMON]));
             $tpl->parse('menu-items');
             // echo ' 190: ', $tpl->get('menu-items');
         }
         if (isset($parameters['menus'][MENU_OUTER])) {
             $tpl->setCurrentBlock('outer-links');
             $tpl->setVariable(array('OTHER' => \pstk\String::translate('other'), 'LINKS' => \pstk\String::translate('links'), 'OUTER-LINKS' => $parameters['menus'][MENU_OUTER]));
             $tpl->parse('outer-links');
         }
         if (isset($parameters['menus'][MENU_INNER])) {
             $tpl->setCurrentBlock('inner-links');
             $tpl->setVariable(array('INNER-LINK' => $parameters['menus'][MENU_INNER]));
             $tpl->parse('inner-links');
         }
     }
     if (isset($parameters['services'])) {
         $tpl->setCurrentBlock('services');
         $tpl->setVariable(array('SERVICES' => $parameters['services']));
         $tpl->parse('services');
     }
     $tpl->setCurrentBlock('html');
     $tpl->setVariable(array('ACTION' => '', 'ADDRESS' => $parameters['address'], 'BEGINNING-OF-URL' => BEGINNING_OF_URL, 'BLOG-DATE' => date('m.d.Y', strtotime($parameters['blogDate'])), 'BLOG-ENTRY' => $parameters['blogEntry'], 'LATEST' => \pstk\String::translate('latest'), 'BLOG' => \pstk\String::translate('blog'), 'HREF-OF-BLOG' => BLOG, 'CALL-US' => \pstk\String::translate('callUs'), 'NOW' => \pstk\String::translate('now'), 'EMAIL-OF-DESIGNER' => $parameters['designer']->getEmail(), 'HREF-OF-DESIGNER' => $parameters['designer']->getHref(), 'LABEL-OF-DESIGNER' => $parameters['designer']->getLabel(), 'NAME-OF-DESIGNER' => \str_replace(' ', '&#160', $parameters['designer']->getName()), 'HREF-OF-VIDEOS' => VIDEOS, 'PHONE-NUMBER' => $parameters['phoneNumber'], 'QUICK' => \pstk\String::translate('quick'), 'VIDEOS' => \pstk\String::translate('videos'), 'HEADING-TO-VIDEOS' => \pstk\String::translate('headingToVideos'), 'SEARCH' => \pstk\String::translate('search'), 'STYLE' => \tuts\View::buildCss(), 'TIME' => \tuts\View::findDifference(array('timestampInPast' => $parameters['twitter'])), 'TITLE' => $parameters['title'], 'TWITTER' => \pstk\String::translate('twitter'), 'FEED' => \pstk\String::translate('feed'), 'LIKE' => \pstk\String::translate('like'), 'OUR' => \pstk\String::translate('our'), 'LOCATION' => \pstk\String::translate('location'), 'DESIGNED-BY' => \pstk\String::translate('designedBy')));
     $tpl->parse('html');
     return $tpl->get('html');
 }