function init(){ parent::init(); $this->addLocation('atk4-addons',array( 'php'=>array( 'mvc', 'misc/lib', ) )) ->setParent($this->pathfinder->base_location); $this->add('jUI'); $this->dbConnect(); $this->js() ->_load('atk4_univ') ; $this->template->tryDel('Menu'); $this->add('H1',null,'logo')->set('Open Coffee London Google+ Invite Tracker'); $this->add('P',null,'logo')->set('Developed in 20 minutes by <a href="http://agiletech.ie/">Romans</a>, 074 2759 9339 for Web Development'); $this->add('HtmlElement',null,'logo')->setElement('a')->setAttr('href','https://github.com/romaninsh/ocplus') ->set('Fork this app on GitHub'); $cr=$this->add('CRUD'); $cr->setModel('OcPlus',array('invite_me'),array('invite_me','is_invited')); if($cr->add_button){ $cr->grid->addColumn('confirm','invited','Mark as "Invited"'); $cr->grid->addOrder()->move('invited','before','edit')->now(); $cr->grid->dq->order('id desc'); $cr->add_button->set('Invite me to Google +'); if($_GET['invited']){ $cr->grid->getModel()->loadData($_GET['invited'])->set('is_invited',true)->update(); $cr->grid->js()->reload()->execute(); } } }
function init() { parent::init(); // Keep this if you are going to use database on all pages //$this->dbConnect(); $this->api->dbConnect(); $this->requires('atk', '4.2.0'); // This will add some resources from atk4-addons, which would be located // in atk4-addons subdirectory. $this->addLocation('atk4-addons', array('php' => array('mvc', 'misc/lib')))->setParent($this->pathfinder->base_location); //$this->api->dbConnect(); // A lot of the functionality in Agile Toolkit requires jUI $this->add('jUI'); // Initialize any system-wide javascript libraries here // If you are willing to write custom JavaScritp code, // place it into templates/js/atk4_univ_ext.js and // include it here $this->js()->_load('atk4_univ')->_load('ui.atk4_notify'); // If you wish to restrict actess to your pages, use BasicAuth class $this->add('BasicAuth')->allow('demo', 'demo'); // This method is executed for ALL the peages you are going to add, // before the page class is loaded. You can put additional checks // or initialize additional elements in here which are common to all // the pages. // Menu: // If you are using a complex menu, you can re-define // it and place in a separate class $this->add('Menu', null, 'Menu')->addMenuItem('master', 'Master')->addMenuItem('index', 'Welcome'); $this->addLayout('UserMenu'); }
function init(){ parent::init(); // Keep this if you are going to use database on all pages $this->dbConnect(); // This will add some resources from atk4-addons, which would be located // in atk4-addons subdirectory. $this->addLocation('atk4-addons',array( 'php'=>array( 'mvc', 'misc/lib', ) )) ->setParent($this->pathfinder->base_location); // A lot of the functionality in Agile Toolkit requires jUI $this->add('jUI'); // Initialize any system-wide javascript libraries here // If you are willing to write custom JavaScritp code, // place it into templates/js/atk4_univ_ext.js and // include it here $this->js() ->_load('atk4_univ') // ->_load('ui.atk4_expander') ; // If you are using a complex menu, you can re-define // it and place in a separate class $m=$this->add('Menu',null,'Menu'); $m->addMenuItem('jobs'); $m->addMenuItem('test'); }
function init() { parent::init(); $this->dbConnect(); $this->requires('atk', '4.2.0'); $this->add('jUI'); $this->pathfinder->addLocation('.', array('addons' => array('my-addons', 'ambient-addons'))); $this->add("cms/Controller_Cms"); $this->add('Auth')->usePasswordEncryption(function ($password, $salt) { return $password . $salt; })->setModel('User'); $this->auth->allowPage(array('register', 'index', 'dsql')); //$this->template->setHTML('mytag','<b>bold</b>'); //$this->add('HelloWorld',null,'mytag'); if ($this->auth->isLoggedIn()) { $menu = $this->add('Menu', null, 'Menu')->addMenuItem('index', 'Welcome')->addMenuItem('items/list', 'List')->addMenuItem('items/report', 'Report an Item'); $is_admin = $this->api->auth->model['is_admin']; if ($is_admin) { $menu->addMenuItem("cmsadmin", "Manage CMS")->addMenuItem("fileadmin", "Manage Files")->addMenuItem('admin'); } $menu->addMenuItem('user', 'User Preferences')->addMenuItem('logout'); } else { $menu = $this->add('Menu', null, 'Menu')->addMenuItem('index', 'Welcome')->addMenuItem('login')->addMenuItem('register'); } $this->auth->check(); }
function init() { parent::init(); $this->add('jUI'); $menu = $this->add('Menu', null, 'Menu'); $menu->addMenuItem('register'); }
function init() { parent::init(); // Keep this if you are going to use database on all pages //$this->dbConnect(); $this->api->dbConnect(); $this->requires('atk', '4.2.1'); // This will add some resources from atk4-addons, which would be located // in atk4-addons subdirectory. $this->addLocation('atk4-addons', array('php' => array('mvc', 'misc/lib', 'filestore/lib')))->setParent($this->pathfinder->base_location); $this->addLocation('.', array("addons" => 'xavoc-addons')); //$this->api->dbConnect(); // A lot of the functionality in Agile Toolkit requires jUI $this->add('jUI'); // Initialize any system-wide javascript libraries here // If you are willing to write custom JavaScritp code, // place it into templates/js/atk4_univ_ext.js and // include it here $this->js()->_load('atk4_univ')->_load('ui.atk4_notify'); // If you wish to restrict actess to your pages, use BasicAuth class // $auth= $this->add('Auth') // // ->allow('nitin','bvmsss') // // use check() and allowPage for white-list based auth checking $auth = $this->add('BasicAuth'); $auth->setModel('xavoc_acl/ACLUser', 'username', 'password'); $auth->allowPage(array('corrections')); $auth->check(); // This method is executed for ALL the peages you are going to add, // before the page class is loaded. You can put additional checks // or initialize additional elements in here which are common to all // the pages. // Menu: // If you are using a complex menu, you can re-define // it and place in a separate class // $pp=$this->api->auth->model['master']; // $dd=$this->api->auth->model['data']; // $rr=$this->api->auth->model['reports']; // $usr=$this->api->auth->model['user']; $m = $this->add('Menu', null, 'Menu'); $m->addMenuItem('index', 'Welcome'); // if($pp==1) // { $m->addMenuItem('masters', 'Master'); // } $m->addMenuItem('schooldata', 'School Data'); $m->addMenuItem('staffdata', 'Staff Data'); $m->addMenuItem('hosteldata', 'Hostel Data'); $m->addMenuItem('storedata', 'Store Data'); $m->addMenuItem('reports', 'Reports'); $m->addMenuItem('users', 'Users'); $m->addMenuItem('logout'); //$this->add('H1', null, 'logo')->set("BVMSSS"); $this->addLayout('UserMenu'); $name = $this->api->auth->model['username']; $this->welcome = $this->add('H5', null, 'welcome')->set('Welcome : ' . $name); $this->add('Text', null, 'date')->set(date('D, M d, Y')); $this->add('H5', null, 'date')->set("Session: " . $this->add('Model_Sessions_Current')->tryLoadAny()->get('name')); }
function init() { parent::init(); $this->dbConnect(); $l = $this->addLocation('..', array( 'php' => 'lib' )); $this->addLocation('atk4-addons', array( 'php' => array( 'mvc', 'misc/lib', ), )) ->setParent($l); $this->add('jUI'); $this->js() ->_load('ui.atk4_notify') ->_load('atk4_univ') ; $this->add('BasicAuth') ->allow('admin', 'admin') ->check(); $m = $this->add('Menu', null, 'Menu'); $m->addMenuItem('jobs'); $m->addMenuItem('filestore'); $m->addMenuItem('logout'); $this->initLayout(); }
function init() { parent::init(); if (!$this->recall('session_started', null)) { $this->memorize('session_started', time()); } // Keep this if you are going to use plug-ins $this->addLocation('atk4-addons', array('template' => 'misc/templates', 'mail' => 'misc/templates/mail', 'js' => 'misc/templates/js', 'php' => array('mvc', 'billing/lib', 'misc/lib', 'crm/lib')))->setParent($this->pathfinder->base_location); // Keep this if you will use jQuery UI in your project $this->add('jMyUI'); // Initialize any system-wide javascript libraries here $this->js()->_load('atk4_univ')->_load('atk4web1'); list($fp, $junk) = explode('_', $this->page, 2); if ($fp == 'commercial' || $fp == 'account') { // will need database $this->dbConnectATK(); } $this->auth = $this->add('FrontendAuth'); $this->auth->setModel('ATK_User_Valid'); $this->auth->cookieLogin(); if ($_GET['t_recovery'] || $_GET['t_register'] || $_GET['t']) { $this->checkTokens(); } if ($this->auth->isLoggedIn()) { $this->template->trySet('user', $this->auth->get('email')); } else { $this->template->trySet('user', 'Login'); } list($main, $junk) = explode('_', $this->page, 2); if ($main == 'blog-article' || $main == 'blog') { $this->page_class = 'Page_Blog'; } }
function init(){ parent::init(); if(!($this->recall('session_started',null))){ $this->memorize('session_started',time()); } // Keep this if you are going to use plug-ins $this->addLocation('atk4-addons',array( 'template'=>'misc/templates', 'php'=>array('mvc', 'billing/lib', 'misc/lib', 'crm/lib', ) )) ->setParent($this->pathfinder->base_location); // Keep this if you will use jQuery UI in your project $this->add('jUI'); // Initialize any system-wide javascript libraries here $this->js() ->_load('atk4_univ') ->_load('atk4web') // ->_load('ui.atk4_expander') ; list($main,$junk)=explode('_',$this->page,2); if($main=='blog-article'||$main=='blog')$this->page_class='Page_Blog'; $this->initLayout(); }
function init() { parent::init(); $this->add('jUI'); $m = $this->add('Menu', null, 'Menu'); $m->addMenuItem('index', 'Back'); }
function init() { parent::init(); $this->add('Layout_Widgets'); $this->dbConnect(); $this->add('jUI'); $this->template->set('css', 'widgets.css'); }
function init() { parent::init(); $this->add('jUI'); $this->dbConnect(); $this->add('Auth')->setModel('User', 'email', 'clear'); $this->auth->check(); $menu = $this->add('Menu', null, 'Menu'); $menu->addMenuItem('users', 'User Management')->addMenuItem('domains', 'Domains')->addMenuItem('About')->addMenuItem('Logout'); }
function init() { parent::init(); $this->api_public_path = dirname(@$_SERVER['SCRIPT_FILENAME']); $this->api_base_path = dirname(dirname(@$_SERVER['SCRIPT_FILENAME'])); $this->add('Layout_Centered'); $this->addLocations(); $this->addProjectLocations(); $this->addAddonsLocations(); $this->add('jUI'); $this->initAddons(); }
function init() { parent::init(); $this->add('jUI'); $this->dbConnect(); $this->add('GmailImporter'); //$this->api->add('VersionControl'); $this->template->trySet('page_title', $this->apinfo['name']); $this->auth = $this->api->add('BasicAuth'); $this->auth->setModel('User', 'email', 'clear'); #->setNoCrypt(); }
function init() { parent::init(); // Add jQuery UI and connect to database $this->add('jUI'); $this->dbConnect(); // Creates menu on top $menu = $this->add('Menu', null, 'Menu'); $menu->addMenuItem('books'); $menu->addMenuItem('members'); $menu->addMenuItem('staff'); $menu->addMenuItem('history'); }
function init() { parent::init(); $this->dbConnect(); $menu = $this->add('Menu', null, 'Menu'); $menu->addMenuItem('index', 'Blog'); $menu->addMenuItem($this->api->url('/')->setBaseURL('..'), 'Back'); $menu->addMenuItem('admin'); // I define auth class here, but I am not checking auth yet. $this->auth = $this->add('BasicAuth')->allow('demo', 'demo'); if ($this->auth->isLoggedIn()) { $menu->addMenuItem('logout'); } }
function init() { parent::init(); //DB Connect not default added by rakesh $this->dbConnect(); // Might come handy when multi-timezone base networks integrates $this->today = date('Y-m-d', strtotime($this->recall('current_date', date('Y-m-d')))); $this->now = date('Y-m-d H:i:s', strtotime($this->recall('current_date', date('Y-m-d H:i:s')))); $this->api_public_path = dirname(@$_SERVER['SCRIPT_FILENAME']); $this->api_base_path = dirname(dirname(@$_SERVER['SCRIPT_FILENAME'])); $this->template->set('css', 'svc.css'); $this->add('jUI'); $frontend_user = $this->add('Model_User'); $auth = $this->add('BasicAuth', ['login_layout_class' => 'Layout_Empty']); $auth->allowPage(array('index', 'blogs', 'blogpost')); $auth->setModel($frontend_user, 'email', 'password'); // $auth->allow(["demo",'demo']); if (!$auth->isLoggedIn()) { $this->add('Layout_Empty'); } else { $this->add('Layout_User')->setModel($this->api->auth->model); // $user_menu = $this->layout->add('Menu',null,'UserMenu'); // $user_menu->addMenuItem('dashboard','Home'); // $user_menu->addMenuItem('dashboard','Profile'); // $user_menu->addMenuItem('dashboard','Marksheet'); // $user_menu->addMenuItem('dashboard','History'); // $user_menu->addMenuItem('logout','Logout'); // $menu = $this->layout->add('Menu',null,'Top_Menu'); // $menu->addMenuItem('company','Company(if owner)'); } $auth->check(); //$footer=$l->addFooter(); //$header=$l->addHeader(); // $this->add('Layout_Centered'); $this->initAddons(); $this->addLocations(); $this->addProjectLocations(); $this->addAddonsLocations(); // $client_menu=$this->layout->add('Menu',['swatch'=>''],'Top_Menu')->addClass('mymenu'); // if($this->api->auth->isLoggedIn()){ // $client_menu->addMenuItem('dashboard','Dashbaord'); // $client_menu->addMenuItem('oln','Devices (Temp Menu)'); // $client_menu->addMenuItem('graph','Graph'); // $client_menu->addMenuItem('calendar','Calendar'); // $client_menu->addMenuItem('clientconfig','Configuration'); // } // $client_menu->addMenuItem('logout','Logout'); //$footer->add('View')->set('Design and Implemented by agiletoolkit.org'); }
function init() { parent::init(); $this->dbConnect(); $this->addLocation('../atk4-addons', array('php' => array('mvc', 'misc/lib')))->setParent($this->pathfinder->atk_location); $menu = $this->add('Menu', null, 'Menu'); $menu->addMenuItem('index', 'Blog'); $menu->addMenuItem($this->api->url('/')->setBaseURL('..'), 'Back'); $menu->addMenuItem('admin'); // I define auth class here, but I am not checking auth yet. $this->auth = $this->add('BasicAuth')->allow('demo', 'demo'); if ($this->auth->isLoggedIn()) { $menu->addMenuItem('logout'); } }
function init() { parent::init(); $this->dbConnect(); $this->addLocation('..', array('php' => array('lib')))->setParent($this->pathfinder->base_location); $this->addLocation('../atk4-addons', array('php' => array('mvc', 'misc/lib')))->setParent($this->pathfinder->atk_location); $this->add('jUI'); $this->js()->_load('atk4_univ')->_load('ui.atk4_notify'); // Allow user: "******", with password: "******" to use this application $this->add('BasicAuth')->allow('demo', 'demo')->check(); $menu = $this->add('Menu', null, 'Menu'); $menu->addMenuItem('back'); $menu->addMenuItem('Manager', 'mgr'); $this->add('H1', null, 'logo')->set('Welcome to DVDRental Admin'); }
function init() { parent::init(); $this->addLocation('../atk4-addons', array('php' => array('mvc', 'misc/lib')))->setParent($this->pathfinder->atk_location); $this->add('jUI'); $this->js()->_load('atk4_univ')->_load('ui.atk4_notify'); $this->dbConnect(); $this->auth = $this->add('RentalAuth'); $menu = $this->add('Menu', null, 'Menu'); if ($this->auth->isLoggedIn()) { $menu->addMenuItem('video', 'Home'); $menu->addMenuItem('account'); $menu->addMenuItem('logout'); } else { $menu->addMenuItem('index', 'Home'); } $menu->addMenuItem('admin'); }
function init() { parent::init(); $this->dbConnect(); $l = $this->addLocation('..', array('php' => 'lib', 'js' => 'templates/js', 'mail' => 'templates/mail')); $this->addLocation('atk4-addons', array('mail' => 'misc/templates/mail', 'php' => array('mvc', 'misc/lib')))->setParent($l); $this->add('jUI'); $this->js()->_load('atk4_univ')->_load('ui.atk4_notify'); $this->auth = $this->add('AtkAuth'); $this->auth->setModel('ATK_Admin'); $this->auth->check(); $m = $this->add('Menu', null, 'Menu'); $m->addMenuItem('Dashboard', 'index'); $m->addMenuItem('Users', 'users'); $m->addMenuItem('purchases'); $m->addMenuItem('content'); $m->addMenuItem('Log out', 'logout'); }
function init() { parent::init(); $this->dbConnect(); $this->add('jUI'); $this->add('Auth', 'frontendauth'); if (!$this->auth->recall('id') && $this->auth->info['id']) { $this->auth->memorize('id', $this->auth->info['id']); // compatibility } $this->auth->setModel('User', 'email', 'password'); $this->auth->usePasswordEncryption('sha256/salt'); $this->auth->check(); $m = $this->add('Menu', null, 'Menu'); $m->addMenuItem('index', 'Your Account'); $m->addMenuItem('licenses'); $m->addMenuItem('content'); $m->addMenuItem('profile'); $m->addMenuItem('logout'); }
function init() { parent::init(); //DB Connect not default added by rakesh $this->dbConnect(); // Might come handy when multi-timezone base networks integrates $this->today = date('Y-m-d', strtotime($this->recall('current_date', date('Y-m-d')))); $this->now = date('Y-m-d H:i:s', strtotime($this->recall('current_date', date('Y-m-d H:i:s')))); $this->api_public_path = dirname(@$_SERVER['SCRIPT_FILENAME']); $this->api_base_path = dirname(dirname(@$_SERVER['SCRIPT_FILENAME'])); $this->add('jUI'); $this->api->pathfinder->addLocation(array('addons' => array('vendor', 'shared/addons2', 'shared/addons')))->setBasePath($this->pathfinder->base_location->getPath()); // Should come from any local DB store $this->xepan_addons = $addons = ['xepan\\base']; $this->xepan_app_initiators = $app_initiators = []; $app_initiators = []; foreach ($addons as $addon) { $this->xepan_app_initiators[$addon] = $app_initiators[$addon] = $this->add("{$addon}\\Initiator")->setup_frontend(); } }
function init() { parent::init(); $this->dbConnect(); $this->pathfinder->addLocation('./', array('docs' => 'docs', 'addons' => array('atk4-addons', 'addons', 'ds-addons'), 'php' => array('atk4-addons/mvc', 'atk4-addons/misc/lib'))); $this->add('jUI'); $this->md_pages = array('scaffolding', 'simple_views', 'navigation', 'interactive-views', 'combined-example', 'your-snippets'); $this->real_page = $this->page; $r = $this->add("Controller_PatternRouter"); foreach ($this->md_pages as $page) { $r->addRule($page, 'mdpage', array('args')); $r->addRule($page . '\\/(.*)', 'mdpage', array('args')); } $r->route(); // TODO We will need this after removing initLayout() method // It shows menu on the left-hand side // if(!$this->tree && $this->template->hasTag('SubMenu')){ // $tree=$this->add('TreeView',null,'SubMenu',array('submenu')); // $tree->setModel('Menu'); // } }
function init() { parent::init(); $this->add('jUI'); $this->add('Menu_Light', null, 'LightMenu'); }
function init(){ parent::init(); // Keep this if you are going to use database on all pages //$this->dbConnect(); // This will add some resources from atk4-addons, which would be located // in atk4-addons subdirectory. $this->addLocation('atk4-addons',array( 'php'=>array( 'mvc', 'misc/lib', ) )) ->setParent($this->pathfinder->base_location); // A lot of the functionality in Agile Toolkit requires jUI $this->add('jUI'); // Initialize any system-wide javascript libraries here // If you are willing to write custom JavaScritp code, // place it into templates/js/atk4_univ_ext.js and // include it here $this->js() ->_load('atk4_univ') // ->_load('ui.atk4_expander') ; // If you wish to restrict actess to your pages, use BasicAuth class $this->add('BasicAuth') ->allow('demo','demo') // use check() and allowPage for white-list based auth checking //->check() ; // Initialize objects which you want to see on ALL of your pages in this method // If you, however, want to place object only on a single page, then // create page/mytestpage.php with class page_mytestpage and put objects // into it's init() method. // Menu: // If you are using a complex menu, you can re-define // it and place in a separate class $m=$this->add('Menu',null,'Menu'); $m->addMenuItem('Welcome','index'); $m->addMenuItem('How Do I..?','how'); $m->addMenuItem('Database Test','dbtest'); $m->addMenuItem('Auth test','authtest'); $m->addMenuItem('about'); $m->addMenuItem('logout'); // If you want to use ajax-ify your menu // $m->js(true)->_load('ui.atk4_menu')->atk4_menu(array('content'=>'#Content')); // Finally if you want to use a simple menu, you can either put it into shared.html // or include it from other file // $m=$this->add('Menu',null,'Menu',array('view/mymenu')); // You need to call initLayout which will determine current page and load // respective page/...php class. $this->initLayout(); }
function init() { parent::init(); // A lot of the functionality in Agile Toolkit requires jUI if (!file_exists('config-default.php')) { // Not installed and installation required // TODO : check security issues $config['url_postfix'] = ''; $config['url_prefix'] = '?page='; $this->setConfig($config); $this->add('jUI'); // A lot of the functionality in Agile Toolkit requires jUI $this->js()->_load('atk4_univ')->_load('ui.atk4_notify'); $this->page = 'install'; } else { // already installed connect to provided settings and go on $this->dbConnect(); $this->requires('atk', '4.2.0'); $this->addLocation('templates', array('css' => 'default/css')); $this->addLocation('.', array('addons' => array('epan-addons', 'epan-components', 'xavoc-addons'))); // This will add Epan Market Place Location $this->addLocation('epan-addons', array('page' => array("."))); // This will add Epan Market Place Location $this->addLocation('epan-components', array('page' => array("."))); // This will add some resources from atk4-addons, which would be located // in atk4-addons subdirectory. $this->addLocation('atk4-addons', array('php' => array('mvc', 'misc/lib')))->setParent($this->pathfinder->base_location); $this->add('jUI'); $this->api->template->appendHTML('js_include', '<script src="templates/js/jquery-migrate-1.2.1.min.js"></script>' . "\n"); /** * TODO: wrap in a IF(page does not contains owner_ / branch_ / system_ ) * only then you need to get all this, as you are looking front of a website * ----------------------------------------------------------------------- * Get the request from browser query string and set various Api variables like * current_website, current_page, website_requested and page_requested * Once set that can be accessed all CMS vise like * $this->api->current_website */ $auth = $this->add('BasicAuth'); $auth->setModel('Users', 'username', 'password'); if (true) { // ALWAYS TRUE BECAUSE // WE WANT PLUGINS TO BE AVAILABLE IN BACKEND AS WELL // PLUGINS ARE BASED ON EPAN_ID so always need to run the code below $site_parameter = $this->getConfig('url_site_parameter'); $page_parameter = $this->getConfig('url_page_parameter'); $this->stickyGET($site_parameter); $this->stickyGET($page_parameter); $this->website_requested = $this->getConfig('default_site'); /** * $this->page_requested finds and gets the requested page * Always required in both multi site mode and single site mode * * @var String */ $this->page_requested = trim($_GET[$page_parameter], '/') ? trim($_GET[$page_parameter], '/') : $this->getConfig('default_page'); if ($this->isAjaxOutput() or $_GET['cut_page']) { // set page_requested to referrer page not the page requested by // ajax request $this->add('Controller_AjaxRequest'); } $this->current_website = $this->add('Model_Epan')->tryLoadBy('name', $this->website_requested); if ($this->current_website->loaded()) { $this->current_page = $this->current_website->ref('EpanPage')->addCondition('name', $this->page_requested)->tryLoadAny(); // LOAD DEFAULT PAGE IF NO SUCH PAGE FOUND OR 404 ERROR ??? } else { $this->exec_plugins('error404', $this->website_requested); } $this->add('Controller_EpanCMSApp')->frontEnd(); // MULTISITE CONTROLER // $this->load_plugins(); // $this->add( 'Controller_EpanCMSApp' )->frontEnd(); // if ( $this->current_website->loaded() ) // $this->exec_plugins( 'website-loaded', $this->api->current_website ); // if ( $this->current_page->loaded() ) // $this->exec_plugins( 'website-page-loaded', $this->api->page_requested ); // IS USER ALLOWED TO SEE THE PAGE ??? if ($this->current_page['access_level'] > 0 and $this->current_page['access_level'] > ($this->api->auth->model['type'] ?: 0)) { $this->api->redirect($this->api->url(null, array('login_required' => 1, $page_parameter => $this->getConfig('default_page')))); exit; } } if ($this->api->auth->isLoggedIn() and $this->api->auth->model->ref('epan_id')->get('name') == $this->api->website_requested and $this->api->auth->model['type'] >= 80) { $this->edit_mode = true; } if ($_GET['edit_template']) { $this->edit_template = true; // $this->api->template->appendHTML('js_include','\nsfjdhkj;\n'); $this->stickyGET('edit_template'); } $this->load_plugins(); // Global Template Setting if (in_array('shared', $this->defaultTemplate()) and $this->page == 'index') { $temp = array(); $this->exec_plugins('beforeTemplateInit', $temp); if ($this->edit_template) { $current_template = $this->add('Model_EpanTemplates')->load($_GET['edit_template']); } else { $current_template = $this->current_page->ref('template_id'); } if ($current_template->loaded()) { if (!$this->edit_template) { // Remove contenteditable from template strings // In General Page View Mode $this->api->exec_plugins('content-fetched', $current_template); } $shared_template = file_get_contents('templates/default/shared.html'); /*$content .= '<?$Content?>';*/ if (!$this->edit_template) { include_once getcwd() . '/lib/phpQuery.php'; $pq = new \phpQuery(); $doc = $pq->newDocument($current_template['content']); $content_divs = $doc['div:contains("{{Content}}")']; $i = 0; foreach ($content_divs as $temp) { $i++; } if ($i == 0) { $current_template['content'] .= "{{Content}}"; } $current_template['content'] = str_replace("{{Content}}", '<?$Content?>', $current_template['content']); $shared_template = str_replace('<?$Content?>', $current_template['content'], $shared_template); } else { $shared_template = str_replace('<?$Content?>', $current_template['content'], $shared_template); $shared_template .= '<?$Content?>'; } // Saving since serverside components have been run already // as plugin and they may have set some js_include ect in shared // But now shared template is about to load from string and // old includes etc will be lost so ... $old_jui = $this->api->jui; $old_js_include = $this->template->tags['js_include']; // throw new Exception(print_r($old_js_include,true) , 1); $this->template->loadTemplateFromString($shared_template); $this->template->appendHTML('js_include', implode("\n", $old_js_include[0])); $this->template->trySet('template_css', $current_template['css']); $this->template->trySet('style', $current_template['body_attributes']); // if(isset($old_jui)) //DELETE $this->api->jui = $old_jui; } if ($this->current_website->loaded()) { $this->exec_plugins('website-model-loaded', $this->api->current_website); } if ($this->current_page->loaded()) { $this->exec_plugins('website-page-model-loaded', $this->api->page_requested); } } // unset($this->api->jui); // $this->add( 'jUI' ); // A lot of the functionality in Agile Toolkit requires jUI $this->js()->_load('atk4_univ')->_load('ui.atk4_notify'); } }
function init() { parent::init(); }