public function index() { Cache::loadPage('', 30); $inputData = array(); $postid = 0; Model::loadWithPath('page', System::getThemePath() . 'model/'); if (!($match = Uri::match('page\\/(.*?)\\.html$'))) { Redirect::to('404page'); } $friendly_url = addslashes($match[1]); $loadData = Pages::get(array('cacheTime' => 30, 'where' => "where friendly_url='{$friendly_url}'")); if (!isset($loadData[0]['pageid'])) { Redirect::to('404page'); } $inputData = $loadData[0]; $postid = $loadData[0]['pageid']; if (Uri::isNull()) { System::setTitle(ucfirst($loadData[0]['title'])); } $keywords = isset($loadData[0]['keywords'][4]) ? $loadData[0]['keywords'] : System::getKeywords(); System::setKeywords($keywords); if ($loadData[0]['page_type'] == 'fullwidth') { self::makeContent('pageFullWidth', $inputData); } else { self::makeContent('page', $inputData); } Cache::savePage(); }
public function form() { $this->views = new Views(new Template("admin")); Phalanx::loadClasses('Pages'); $this->views->data = Pages::get($this->get->page_id); $this->views->display('pages_form.phtml'); }
function insertProcess() { $send = Request::get('send'); $valid = Validator::make(array('send.title' => 'min:1|slashes', 'send.content' => 'min:1', 'send.keywords' => 'slashes', 'send.page_type' => 'slashes', 'send.allowcomment' => 'slashes')); if (!$valid) { throw new Exception("Error Processing Request: " . Validator::getMessage()); } $friendlyUrl = trim(String::makeFriendlyUrl($send['title'])); $getData = Pages::get(array('where' => "where friendly_url='{$friendlyUrl}'")); if (isset($getData[0]['pageid'])) { throw new Exception("This page exists in database."); } $uploadMethod = Request::get('uploadMethod'); switch ($uploadMethod) { case 'frompc': if (Request::hasFile('imageFromPC')) { if (Request::isImage('imageFromPC')) { $send['image'] = File::upload('imageFromPC'); } } break; case 'fromurl': if (Request::isImage('imageFromUrl')) { $url = Request::get('imageFromUrl'); $send['image'] = File::upload('uploadFromUrl'); } break; } if (!($id = Pages::insert($send))) { throw new Exception("Error. " . Database::$error); } }
function pageProcess($inputData) { $match = Uri::match('^page-(\\d+)-(.*?)\\.html'); if (!$match) { Redirect::to('404page'); // Alert::make('Page not found'); } $id = $match[1]; $friendly_url = $match[2]; $loadData = Pages::get(array('where' => "where pageid='{$id}' AND friendly_url='{$friendly_url}' AND status='1'")); if (!isset($loadData[0]['title'])) { Redirect::to('404page'); // Alert::make('Page not found'); } $inputData['title'] = $loadData[0]['title']; $inputData['content'] = $loadData[0]['content']; $inputData['page_type'] = $loadData[0]['page_type']; if (strlen($loadData[0]['keywords']) > 5) { $inputData['keywords'] = $loadData[0]['keywords']; } return $inputData; }
public function edit() { if (!($match = Uri::match('\\/edit\\/(\\d+)'))) { Redirect::to(ADMINCP_URL . 'pages/'); } $pageid = $match[1]; $post = array('alert' => ''); if (Request::has('btnSave')) { try { updateProcess($pageid); $post['alert'] = '<div class="alert alert-success">Save changes success.</div>'; } catch (Exception $e) { $post['alert'] = '<div class="alert alert-warning">' . $e->getMessage() . '</div>'; } } $loadData = Pages::get(array('where' => "where pageid='{$pageid}'", 'isHook' => 'no', 'cache' => 'no')); $post['edit'] = $loadData[0]; System::setTitle('Edit page - ' . ADMINCP_TITLE); View::make('admincp/head'); self::makeContents('pagesEdit', $post); View::make('admincp/footer'); }
/** * Get a page from IMDb, which will be cached in memory for repeated use * @param string $context Name of the page or some other context to build the URL with to retrieve the page * @return string */ protected function getPage($context = null) { return $this->pages->get($this->buildUrl($context)); }
private function getPages() { $allPages = new Pages(new OneDimension($this->orygWidth, $this->leftRightMargin, $this->width), new OneDimension($this->orygHeight, $this->topBottomMargin, $this->height), $this->sep); return $allPages->get(); }
@extends('layouts.qlm_administrator') @section('content') <?php $_countPage = DB::table('qlm_pagedetails')->count(); $pages = Pages::get(); ?> <!-- Page Heading --> <div id="errorMessage" class="alert alert-success" style="display: none;">Delete page successfully!</div> <div class="row"> <div class="col-lg-12"> <h1 class="page-header"> List of pages </h1> </div> </div> <!-- /.row --> <div class="row"> <div class="col-lg-12 col-md-12"> <div class="panel panel-primary"> <div class="panel-heading"> <div class="row"> <div class="col-xs-3"> <i class="fa fa-edit fa-5x"></i> </div> <div class="col-xs-9 text-right"> <div class="huge">{{ $_countPage }}</div> <div>pages in database!</div> </div> </div> </div> <a href="{{asset('qlm-admin/add-new-page')}}">