public function show() { // sitemap $sitemap = $this->controller->sitemap(); // legal notice $left = array_key_exists('legal_notice', $this->config) ? $this->config['legal_notice'] : ''; $left = '<div class="col-md-8"><p>' . $left . '</p></div>'; $right = '<div class="col-md-4"><p class="pull-right"><a href="#" class="page-scroll">Back to top</a></p></div>'; // social $social = ''; $general = Config::getInstance()->getGeneralArray('general'); if (array_key_exists('social', $general) && $general['social']) { $buttons = Social::getInstance()->socialButtons('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], Head::getInstance()->getTitle()); $span = floor(6 / count($buttons)); $xs = floor(12 / count($buttons)); foreach ($buttons as $b) { $social .= '<div class="col-xs-' . $xs . ' col-md-' . $span . ' text-center">' . $b . '</div>'; } $x = floor((8 - count($buttons)) / 2); $social = '<div class="row"><div class="col-md-offset-2 col-md-' . $x . '"></div>' . $social . '</div>'; } // powered by $poweredby = ''; if (isset($this->config['poweredby'])) { $poweredby = '<p class="poweredby text-center">' . $this->config['poweredby'] . '</p>'; $poweredby = '<div class="row"><div class="col-md-8 col-md-offset-2">' . $poweredby . '</div></div>'; } // put it together $sitemap = $sitemap . '<div class="footer-inner row">' . $left . $right . '</div>' . $social . $poweredby; return Utils::obfuscateMailTo($sitemap, Script::getInstance()); }
public function __construct() { $this->actionListener(); $this->output = Utils::obfuscateMailTo($this->view->show(), Script::getInstance()); // TODO prepend msg thrown by Logger Logger::getInstance()->writeLog(); }
/** * This function loads all images contained in the folder stored in $this->path, * generate the bootstrap modal carousel and returns it. * * @param int $index * @return string generated carousel */ public function parse($index) { $files = ScanDir::getFilesOfType($this->config['path'], self::MIME, $index); try { Head::getInstance()->link('lib/owl-carousel/css/owl.carousel.css'); Head::getInstance()->link('lib/owl-carousel/css/owl.theme.css'); Script::getInstance()->link('lib/owl-carousel/js/owl.carousel.js'); Head::getInstance()->link('lib/owl-carousel/css/lazy_load.css'); Script::getInstance()->link('lib/owl-carousel/js/lazy_load.js'); $items = ''; foreach ($files as $f) { $items .= '<div class="item"><img class="lazyOwl" data-src="' . Config::getInstance()->app_root . $this->config['path'] . $f . '" /></div>'; } return '<div id="carousel" class="owl-carousel owl-theme">' . $items . '</div>'; } catch (Exception $e) { Logger::getInstance()->add(new Error('An unexpected error has occurred.', 'OwlCarousel::parse("' . $this->config['path'] . '")', $e->getMessage())); return ''; } }
/** * This function loads all images contained in the folder stored in $this->path, * generate the bootstrap modal carousel and returns it. * * @param int $index * @return string generated carousel */ public function parse($index) { $files = ScanDir::getFilesOfType($this->config['path'], self::MIME, $index); try { Head::getInstance()->link(PUBLIC_LIB_DIR . 'photoswipe/photoswipe.css'); Head::getInstance()->link(PUBLIC_LIB_DIR . 'photoswipe/default-skin/default-skin.css'); Script::getInstance()->link(PUBLIC_LIB_DIR . 'photoswipe/photoswipe.min.js'); Script::getInstance()->link(PUBLIC_LIB_DIR . 'photoswipe/photoswipe-ui-default.min.js'); Script::getInstance()->link(PUBLIC_LIB_DIR . 'photoswipe/init.js'); $html = file_get_contents(PUBLIC_LIB_DIR . 'photoswipe/photoswipe.html'); $items = ''; foreach ($files as $f) { list($width, $height) = getimagesize($this->config['path'] . $f); $src = 'data-src="' . Config::getInstance()->app_root . $this->config['path'] . $f . '"'; $width = 'data-width="' . $width . '"'; $height = 'data-height="' . $height . '"'; $items .= '<span ' . $src . $width . $height . '" class="img-swipe">'; } return '<div class="hidden">' . $items . '</div>' . $html; } catch (Exception $e) { Logger::getInstance()->add(new Error('An unexpected error has occurred.', 'PhotoSwipe::parse("' . $this->config['path'] . '")', $e->getMessage())); return ''; } }
set_error_handler("error_handler", E_ALL); /** * Parse REQUEST_URI to enable pretty URLS */ URLs::getInstance()->parseURI(); /** * setup page and load provided business-casual.php */ $config = Config::getInstance()->getGeneralArray('general'); if (isset($config['highlight']) && $config['highlight']) { $style = isset($config['scheme']) ? $config['scheme'] : 'default.css'; Head::getInstance()->link(PUBLIC_LIB_DIR . 'prismjs/css/' . $style); Script::getInstance()->link(PUBLIC_LIB_DIR . 'prismjs/js/prism.js'); } if (array_key_exists('img_resize', $config) && $config['img_resize']) { Script::getInstance()->link('image.js'); } Head::getInstance()->link(PUBLIC_LIB_DIR . 'bootstrap/css/bootstrap.min.css'); Head::getInstance()->link(PUBLIC_LIB_DIR . 'font-awesome/css/font-awesome.min.css'); // Add jquery and bootstrap into header so included HTML pages can use the libs Head::getInstance()->linkScript(PUBLIC_LIB_DIR . 'jquery/js/jquery.min.js'); Head::getInstance()->linkScript(PUBLIC_LIB_DIR . 'bootstrap/js/bootstrap.min.js'); // Onepager or not if (URLs::getInstance()->isPlugin()) { // plugin $layout = Config::getInstance()->getGeneral('general', 'plugin_layout'); } else { $layout = Config::getInstance()->getGeneral('general', 'page_layout'); } switch ($layout) { case "floating":
public function display() { $output = (new $this->view($this->model))->show(); Logger::getInstance()->writeLog(); return Utils::obfuscateMailTo($output, Script::getInstance()); }