public function widgets() { session_start(); $isLoggedIn = Authentification::isLoggedIn(); $view->isLoggedIn = $isLoggedIn; if (!$view->isLoggedIn) { $view = new XView(No_Access_View); $view->title = 'Access denied | Make'; $this->__common($view); return; } $view = new XView(Widgets_Config_View); $view->title = 'Widgets'; session_start(); if ($_POST['submit_widget_update']) { WidgetModel::update('sidebar', $_POST['widgets']); header('Location:' . SERVER_ROOT_URL . '/index'); } $this->__common($view); }
public function __common(XView $view) { // INSTALLING THE SESSION session_start(); $isLoggedIn = Authentification::isLoggedIn(); $view->isLoggedIn = $isLoggedIn; // юмюкхг лернднб йкюяяю $list = get_class_methods($this); $sidebar = explode(' ', trim(WidgetModel::get('sidebar'))); // янонярюбкемхе юдпеяю осрел оепеанпю лернднб йнмрпнккепю foreach ($list as $method) { if ($method != '__common') { $view->{$name} = SERVER_ROOT_URL . '/' . $method; } } $view->stylesheet = STYLESHEET_FOLDER; switch ($_GET['relative_address']) { case 'widget': print '<div class="clear">'; print $view->display(); print '</div>'; break; case "inscribed": print '<div class="clear" data-content data-content-type="inscribed">'; print $view->display(); print '</div>'; break; default: require_once $view->getHeader(); require_once $view->getSidebar(); print '<div class="col-md-8" data-content data-content-type="inscribed">'; //print Template::construct('div')->apply('class', 'col-md-8' )->append( $view->display() )->display(); print $view->display(); print '</div>'; require_once $view->getFooter(); break; } return $view; }