Пример #1
1
 public function actionOne()
 {
     $id = isset($_GET['id']) ? $_GET['id'] : 1;
     $view = new View();
     $page = new PageController();
     $view->assign('item', News::getOne($id));
     $view->assign('links', $page->createLink($this->ctrl));
     $view->display($this->view_one);
 }
Пример #2
0
 function run()
 {
     DB::connect();
     //determin controller
     switch ($_GET['ctrl']) {
         case 'page':
             $ctrl = new PageController();
             break;
         case 'wine':
             $ctrl = new WineController();
             break;
         case 'response':
             $ctrl = new ResponseController();
             break;
         case 'report':
             $ctrl = new ReportController();
             break;
         case 'dp':
             $ctrl = new DianPingController();
             break;
         default:
             $ctrl = new PageController();
     }
     return $ctrl->dispatch($_GET['action'] . "Action");
     DB::close();
 }
Пример #3
0
 public function renderView()
 {
     if (!isset($_SESSION['cart'])) {
         $cart = new Cart();
         $_SESSION['cart'] = serialize($cart);
     }
     foreach ($this->model->getUris() as $key => $value) {
         if (preg_match("#^{$value}\$#", $this->uriView)) {
             if ($this->model->getView($key) === "PageView") {
                 $pagecontroller = new PageController($this->additionalParam);
                 $pagecontroller->renderView();
             } else {
                 if ($this->model->getView($key) === "ProductView") {
                     $productscontroller = new ProductsController();
                     $productscontroller->renderView();
                 } else {
                     if ($this->model->getView($key) === "SingleProductView") {
                         $singleproductcontroller = new SingleProductController($this->additionalParam);
                         $singleproductcontroller->renderView();
                     } else {
                         if ($this->model->getView($key) === "LoginView") {
                             $logincontroller = new LoginController($this->additionalParam);
                             $logincontroller->renderView();
                         } else {
                             if ($this->model->getView($key) === "CustomerView") {
                                 $customercontroller = new CustomerController();
                                 $customercontroller->renderView();
                             } else {
                                 if ($this->model->getView($key) === "CartView") {
                                     $cartcontroller = new CartController($this->additionalParam);
                                     $cartcontroller->renderView();
                                 } else {
                                     if ($this->model->getView($key) === "ContactView") {
                                         $contactcontroller = new ContactController($this->additionalParam);
                                         $contactcontroller->renderView();
                                     } else {
                                         if ($this->model->getView($key) === "RegisterView") {
                                             $registrationcontroller = new RegistrationController($this->additionalParam);
                                             $registrationcontroller->renderView();
                                         } else {
                                             if ($this->model->getView($key) === "CheckoutView") {
                                                 $checkoutcontroller = new CheckoutController($this->additionalParam);
                                                 $checkoutcontroller->renderView();
                                             } else {
                                                 $useView = $this->model->getView($key);
                                                 $view = new $useView();
                                                 $view->render();
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }
Пример #4
0
 public function getController()
 {
     $controllerClass = $this->ClassName . 'Controller';
     if (ClassManifest::has_class($controllerClass)) {
         $controller = new $controllerClass();
     } else {
         $controller = new PageController();
     }
     $controller->setRecord($this);
     return $controller;
 }
Пример #5
0
 /**
  * Validates if there aren't any errors at the image, the rombinoscope or the password.
  **/
 public function controlGestion()
 {
     $pageController = new PageController();
     $erreur = $pageController->uploadPhoto();
     $erreur2 = $pageController->uploadTrombi();
     $erreur3 = $pageController->modifyPassword();
     if ($erreur == 0 && $erreur2 == 0 && $erreur3 == 0) {
         $accountModel = new AccountModel();
         $accountModel->uploadInfoUser();
     } else {
         header('Location: gestion.php');
     }
 }
  public function __construct()
  {
    parent::__construct();

    global $container;
    $this->activityRepository = new Jacobemerick\Web\Domain\Stream\Activity\MysqlActivityRepository($container['db_connection_locator']);
  }
 /** Construtor responsavel por selecionar o tipo de banco **/
 public function __construct()
 {
     parent::__construct();
     $this->pageController = PageController::getInstance();
     //$propertiesDom = new PropertiesDom('conf/properties.xml');
     //$this->picture_directory = $propertiesDom->getPropertie("path");
 }
Пример #8
0
 public function __construct()
 {
     if (!$this->displayName) {
         $this->displayName = 'Login Form';
     }
     parent::__construct();
 }
 public static function getInstance()
 {
     if (!isset(self::$instance)) {
         $class = __CLASS__;
         self::$instance = new $class();
     }
     return self::$instance;
 }
Пример #10
0
 /**
  * 公告列表
  */
 public function index()
 {
     $search = I('get.search');
     // 拼接搜索条件
     $news = D('News');
     // 调用分页控制器实例分页功能
     $page = new PageController();
     $count = $page->getCount('title', $search, $news);
     $show = $page->show($count);
     $list = $page->page('title', $search, $news);
     // 向模板中分配数据及显示模板
     $this->assign('title', '新闻列表');
     $this->assign('count', $count);
     $this->assign('page', $show);
     $this->assign('info', $list);
     $this->display();
 }
Пример #11
0
 public function __construct()
 {
     Auth::requireAdmin();
     if (!$this->displayName) {
         $this->displayName = 'Manage Images';
     }
     parent::__construct();
 }
Пример #12
0
 public static function run($page = false, $db = false, $options = [])
 {
     ErrorHandler::$customHandler = function ($errno, $errstr, $errfile, $errline, $errcontext, $errorName) {
         $controller = new ApiController();
         $controller->errorResponse("Unknown Error", "{$errorName} {$errstr}", "{$errfile} on line {$errline}");
     };
     parent::run($page, $db, $options);
 }
Пример #13
0
 /**
  * 建议列表
  */
 public function index()
 {
     $search = I('get.search');
     // 拼接搜索条件
     $uid = I('get.id');
     $advice = D('Advice');
     // 调用分页控制器实例分页功能(注意写入的字段和数据库中的字段必须一致)
     $page = new PageController();
     if (!$uid) {
         // 所有用户的分类列表
         // $info = D('LogCate') -> select();
         $count = $page->getCount('name', $search, $advice);
         $show = $page->show($count);
         $list = $page->page('name', $search, $advice);
     } else {
         // 具体用户的分类列表
         $count = $page->getCount('name', $search, $advice, 'uid=' . $uid);
         $show = $page->show($count);
         $list = $page->page('name', $search, $advice, 'uid=' . $uid);
         $name = I('get.name');
         $this->assign('name', $name);
     }
     //$data = D('Advice') -> where(array('uid'=>$id)) -> select();
     $this->assign('count', $count);
     $this->assign('page', $show);
     $this->assign('info', $list);
     $this->display();
 }
Пример #14
0
 /**
  * __construct
  *
  * PageController constructor
  *
  * @param string $template
  */
 public function __construct($template = null, $post_type = null)
 {
     $this->post_type = $post_type ? $post_type : get_post_type();
     if (!$template) {
         // try to guess the view for custom post types
         $template = sprintf("single%s.twig", $this->post_type === 'post' ? '' : "-{$this->post_type}");
     }
     parent::__construct(array($template, 'single.twig'));
 }
 /**
  * Constructor of this class.
  * It initializes some class variables used to display the right product types.
  */
 public function __construct($titleKey, $class, $type, $limit = 0)
 {
     $this->class = $class === ProductType::CLASS_UNKNOWN ? null : $class;
     $this->type = $type === ProductType::TYPE_UNKNOWN ? null : $type;
     $this->limit = $limit;
     $this->id = null;
     $view = new ProductView($titleKey, Template::PRODUCT_SECTION, new ProductModel());
     parent::__construct($view);
 }
 /**
  * Log user in using the standard Chamilo way of logging in.
  * Useful when the normal login screen is removed from the user interface
  * - replaced by Shibboleth login - and user want to login using a standard
  * account
  */
 public function admin_login()
 {
     $title = get_lang('internal_login');
     if (Shibboleth::session()->is_logged_in()) {
         $message = get_lang('already_logged_in');
         Shibboleth::display()->message_page($message, $title);
     }
     $html = PageController::displayLoginForm();
     Shibboleth::display()->page($html, $title);
 }
 public static function ActionCreateQuiz()
 {
     if (ModeratorModel::isModerator() and isset($_POST['id']) and isset($_POST['number'])) {
         $variables = ['template' => 'panel.php', 'panel_template' => 'moderator_create_quiz.php', 'id' => $_POST['id'], 'number' => $_POST['number']];
         $variables = array_merge_recursive(PageController::getMainVariables(), $variables);
         Template::render('template.php', $variables);
     } else {
         header('Location: ' . $_SERVER['HTTP_REFERER']);
     }
 }
Пример #18
0
 public static function ActionThemes()
 {
     if (AdminModel::isAdmin()) {
         $variables = ['template' => 'panel.php', 'panel_template' => 'admin_themes.php', 'themes' => AdminModel::getThemes()];
         $variables = array_merge_recursive(PageController::getMainVariables(), $variables);
         Template::render('template.php', $variables);
     } else {
         header('Location: ' . $_SERVER['HTTP_REFERER']);
     }
 }
Пример #19
0
 public static function ActionProfile()
 {
     $user = UserModel::getUser(UserModel::getUserId());
     if (UserModel::isUserLoggedIn()) {
         $variables = ['template' => 'profile.php', 'links' => ['profile.css'], 'scripts' => ['fileUploader.js'], 'themes' => AdminModel::getThemes(), 'profile' => ['id' => UserModel::getUserId(), 'email' => $user['email'], 'about' => $user['about']]];
         $variables = array_replace_recursive(PageController::getMainVariables(), $variables);
         Template::render('template.php', $variables);
     } else {
         header("Location: " . $_SERVER['HTTP_REFERER']);
     }
 }
Пример #20
0
 /**
  * 前台目录列表
  */
 public function showlist()
 {
     $search = I('get.search');
     // 拼接搜索条件
     $dir = D('Dir');
     // 调用分页控制器实例分页功能(注意写入的字段和数据库中的字段必须一致)
     $page = new PageController();
     $count = $page->getCount('name', $search, $dir, 'flag=1');
     $show = $page->show($count);
     $list = $page->page('name', $search, $dir, 'flag=1');
     // // 获取前台目录列表信息
     // $info = D('Dir') -> where(array('flag'=>'1')) -> select();
     // 向模板中分配数据及显示模板
     $this->assign('title', '前台目录列表');
     $this->assign('flag', '1');
     $this->assign('info', $list);
     $this->assign('count', $count);
     $this->assign('page', $show);
     $this->display('Dir/index');
 }
Пример #21
0
 public function results()
 {
     $keywords = Input::get('words');
     $this->data['words'] = strip_tags($keywords);
     $this->data['results'] = Post::search($keywords);
     if (count($this->data['results']) === 1) {
         return Illuminate\Support\Facades\Redirect::to(WebAPL\Language::url('topost/' . $this->data['results'][0]->id));
     }
     WebAPL\Template::setPageTitle("Search: {$this->data['words']}", true);
     PageController::loadGeneralResources();
     $this->layout->content = View::make('sections.search.results', $this->data);
 }
 /**
  * Construct cron controller
  *
  * @param Request $request
  * @return null
  */
 function __construct($request)
 {
     parent::__construct($request);
     if (defined('PROTECT_SCHEDULED_TASKS') && PROTECT_SCHEDULED_TASKS) {
         $code = $this->request->get('code');
         if (empty($code) || strtoupper($code) != strtoupper(substr(LICENSE_KEY, 0, 5))) {
             $this->httpError(HTTP_ERR_FORBIDDEN);
         }
         // if
     }
     // if
 }
Пример #23
0
 public function init()
 {
     parent::init();
     Requirements::javascript("themes/echo-theme/javascript/menu.js");
     Requirements::css("themes/echo-theme/css/menu.css");
     Requirements::css("themes/echo-theme/css/contact.css");
     // 	$css[] = $this->ThemeDir() . '/css/home.css';
     // 	$css[] = $this->ThemeDir() . '/css/menu.css';
     // 	// $css[] = $this->ThemeDir() . '/css/stylesheet3.css';
     // 	Requirements::combine_files('combined.css', $css);
     // 	Requirements::process_combined_files();
 }
Пример #24
0
 public function __construct()
 {
     Auth::requireAdmin();
     if (!$this->noun) {
         $this->noun = preg_replace('/^.+\\\\/', '', $this->entity);
     }
     if (!$this->nounPlural) {
         $this->nounPlural = $this->noun . 's';
     }
     if (!$this->displayName) {
         $this->displayName = 'Manage ' . $this->nounPlural;
     }
     parent::__construct();
 }
Пример #25
0
 public function actionNew()
 {
     $view = new View();
     $page = new PageController();
     $id = isset($_POST['id_news']) ? $_POST['id_news'] : null;
     if (isset($_POST['news_save'])) {
         AdminNews::$id = $id;
         AdminNews::$title = isset($_POST['title']) ? $_POST['title'] : null;
         AdminNews::$intro = isset($_POST['intro']) ? $_POST['intro'] : null;
         AdminNews::$text = isset($_POST['text']) ? $_POST['text'] : null;
         if ($id) {
             AdminNews::update();
         } else {
             $id = AdminNews::save();
         }
     }
     if ($id) {
         $view->id = $id;
         $view->item = AdminNews::getOne($id);
     }
     $view->assign('links', $page->createLink($this->ctrl));
     $view->display($this->view_new);
 }
 protected function loadPage()
 {
     if (!isset($this->settings['header']['ga_options']['_setAccount'])) {
         $this->settings['header']['ga_options']['_setAccount'] = Config::get('GoogleAnalyticsID');
     }
     // automatically prepend same text to all headers
     if (isset($this->settings['header']['title']) && $this->settings['header']['title']) {
         $this->settings['header']['title'] = 'Passing Green :: ' . $this->settings['header']['title'];
     }
     if (isset($this->settings['breadcrumb'])) {
         $this->settings['header']['breadcrumb'] = $this->settings['breadcrumb'];
     }
     parent::loadPage();
 }
Пример #27
0
 public function index()
 {
     $manager = D('Manager');
     $search = I('get.search');
     // 拼接搜索条件
     // 调用分页控制器实例分页功能(注意写入的字段和数据库中的字段必须一致)
     $page = new PageController();
     $count = $page->getCount('username', $search, $manager);
     $show = $page->show($count);
     $info = $page->page('username', $search, $manager);
     $this->assign('count', $count);
     $this->assign('page', $show);
     // 获取管理员中的角色id
     $rids = '';
     foreach ($info as $k => $v) {
         $rids .= $v['rid'] . ',';
     }
     $rids = rtrim($rids, ',');
     if ($rids) {
         $map = "id in ({$rids})";
         // 查询角色表
         $data = D('Role')->where($map)->getField('id,name', true);
         // 处理职位(一利用连接查询 二使用双循环)
         foreach ($info as $k => $v) {
             foreach ($data as $key => $value) {
                 if ($v['rid'] == $key) {
                     $info[$k]['rid'] = $value;
                     break;
                 }
             }
         }
     }
     $this->assign('info', $info);
     $this->assign('title', '管理员列表');
     $this->display();
 }
Пример #28
0
 /**
  * @return void
  * @Description Sitenin çalışabilmesi için gerekli bileşenlerin load edildiği method
  */
 public static final function setPage()
 {
     // session bilgilerini set eder
     Session::set();
     $LANGUAGE = new \model\language\Language($_GET);
     $LANGUAGE->init();
     // login bilgilerini set eder
     //$AUTH = Auth::getInstance();
     //$AUTH->init();
     // formlar için token oluşturur
     Token::createTokenSession();
     // ################################################################
     parent::init();
     // formMessage bilgisini siliyoruz
     Session::deleteSession(['formMessage']);
     // session commit
     Session::commit();
 }
Пример #29
0
 public function __construct()
 {
     parent::__construct();
     $this->jsFiles['index.js'] = array('index.js');
     $this->cssFiles['index.css'] = array('index.css');
 }
Пример #30
0
 /**
  * Simple (i.e. popup) windows are deprecated.
  *
  * @param bool $popup
  *
  * @return $this
  */
 public function pageHeader($popup = true)
 {
     return parent::pageHeader($popup);
 }