public function __construct() { parent::__construct(); $this->loadClass(array('CalendarModel', 'CalendarLangModel')); Route::get('calendar/cron', [$this, 'email_notifications']); $cron_date = \SettingsModel::one('calendar_cron_time'); if (date("Y-m-d", intval($cron_date)) !== date('Y-m-d')) { \SettingsModel::put('calendar_cron_time', time()); $this->email_notifications(); } Template::registerViewMethod('page', $this->page_view_mod, 'Pagina calendar', array($this, 'calendarViewMod'), true); }
public function postChecktpl() { if (!Session::get('step3')) { return Redirect::to('install/step3'); } $tpl = trim(Input::get('tpl'), './'); $templatesDir = '/apps/frontend/views/templates/'; $tempalteDir = $_SERVER['DOCUMENT_ROOT'] . $templatesDir . $tpl; if ($tpl && is_dir($tempalteDir)) { $templates = glob($_SERVER['DOCUMENT_ROOT'] . $templatesDir . "*", GLOB_ONLYDIR); foreach ($templates as $template) { if ($tempalteDir != $template) { //File::deleteDirectory($template); } } SettingsModel::put('template_frontend', $tpl); Session::put('step4', true); return Illuminate\Support\Facades\Redirect::to('install/step5'); } else { Session::put('step4', false); return Illuminate\Support\Facades\Redirect::to('install/step4')->with('tplerror', 'Șablon invalid.'); } }