A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_URI::$config is deprecated
Filename: core/URI.php
Line Number: 101
Backtrace:
File: /var/www/clients/client120/web196/web/index.php
Line: 293
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property MY_Router::$uri is deprecated
Filename: core/Router.php
Line Number: 126
Backtrace:
File: /var/www/clients/client120/web196/web/index.php
Line: 293
Function: require_once
defined('BASEPATH') OR exit('No direct script access allowed');
$oldLang=DEFAULT_LANG;
class Index extends MX_Controller {
const DEFAULT_MODULE='Home';
const DEFAULT__METHOD='index';
private $module;
private $method;
private $meta;
private $user;
private $language;
private $menu;
public function __construct()
{
parent::__construct();
$this->load->library('encrypt');
$this->load->model('Model\\Index','index');
$this->load->model('Settings/Model\\Seo','seo');
$this->load->model('Settings/Model\\LiveData','live_data');
$this->index->updateModule();
$this->setProject();
}
public function getModule()
{
return $this->module;
}
public function index()
{
$this->autoRender();
$q=$this->input->get('q');
if(!empty($q)){
$this->search($q);
}else{
$this->module();
}
$this->data['module'] = $this->module;
$this->my_twig->render('index',$this->data);
}
private function module()
{
if($this->data['page']!=null && $this->data['page']->module!=null)
$this->module=$this->data['page']->module->module;
$module=modules::run($this->module.'/getThis');
////////////// SET SEO META TAGS/////////////////////////////
$emailData = \Model\LiveData::where(['key' => 'email'])->get();
if( count($emailData) == 0 ) {
$email = new \Model\LiveData();
$email->key = 'email';
$email->save();
}
$seoData = \Model\Seo::where(['menu_id' => 0])->get();
if( count($seoData) == 0 ) {
$seo = new \Model\Seo();
$seo->menu_id = 0;
$seo->save();
}
// M.B. SET default values for META
$meta = \Model\Seo::where('menu_id',NAVIGATE_ID)->first();
if($meta != null) {
$this->setMetaByModel($meta,getLanguage());
} else {
$meta = \Model\Seo::where('menu_id',0)->first();
$this->setMetaByModel($meta,getLanguage());
}
if($module instanceof SeoImp)
{
$this->data['meta'] = $module->setModuleSeo();
}
////////////////////////////////////////////////////////////
// M.B. SET GOOGLE ANALYTICS
$analitics = \Model\LiveData::where(['key' => 'google_analitics' ])->get();
if( count($analitics) == 0 ) {
$seo = new \Model\LiveData();
$seo->key = 'google_analitics';
$seo->save();
}
$this->data['analytics'] = \Model\LiveData::where(['key' => 'google_analitics'])->get()->first();
$this->data['analytics']->value = $this->encrypt->decode($this->data['analytics']->value);
// SET GOOGLE RECAPTCHA
$analitics = \Model\LiveData::where(['key' => 'recaptcha' ])->get();
if( count($analitics) == 0 ) {
$seo = new \Model\LiveData();
$seo->key = 'recaptcha';
$seo->save();
}
$this->data['recaptcha'] = \Model\LiveData::where(['key' => 'recaptcha'])->get()->first();
if($module instanceof MX_Controller){
$this->data['page']->content='';
$module->setBaseData($this->data);
$module->setPage($this->data['page']);
$module->setUrlParams();
}
if($module instanceof AthorizationImp){
try{
$this->authdecorator->setObject($module);
$this->data['module_view']=$this->authdecorator->index();
}catch(ErrorException $e){
$this->data['error']=$e;
$this->data['module_view']= $this->my_twig->view('error',$this->data);
}
}
else if(method_exists($module,'index')){
$this->data['module_view']=$module->index();
}
$this->my_twig->registerTwig();
$this->data['header']=$this->project->header_link;
}
private function setMetaByModel(Model\Seo $meta,$lang)
{
// M.B. set default meta
$seoData = \Model\Seo::where(['menu_id' => 0])->get();
if( count($seoData) == 0 ) {
$seo = new \Model\Seo();
$seo->menu_id = 0;
$seo->save();
}
$defaultMeta = \Model\Seo::where('menu_id',0)->first();
// crazy conditions :D
if( $meta->getLanguageColumn('meta_title',$lang) == '' || $meta->getLanguageColumn('meta_title',$lang) == null) {
$this->data['meta']['title'] = $defaultMeta->getLanguageColumn('meta_title',$lang);
} else {
$this->data['meta']['title'] = $meta->getLanguageColumn('meta_title',$lang);
}
if( $meta->getLanguageColumn('meta_description',$lang) == '' || $meta->getLanguageColumn('meta_description',$lang) == null) {
$this->data['meta']['description'] = $defaultMeta->getLanguageColumn('meta_description',$lang);
} else {
$this->data['meta']['description'] = $meta->getLanguageColumn('meta_description',$lang);
}
if( $meta->getLanguageColumn('meta_keywords',$lang) == '' || $meta->getLanguageColumn('meta_keywords',$lang) == null) {
$this->data['meta']['keywords'] = $defaultMeta->getLanguageColumn('meta_keywords',$lang);
} else {
$this->data['meta']['keywords'] = $meta->getLanguageColumn('meta_keywords',$lang);
}
if( $meta->getLanguageColumn('h1',$lang) == '' || $meta->getLanguageColumn('h1',$lang) == null) {
$this->data['meta']['h1'] = $defaultMeta->getLanguageColumn('h1',$lang);
} else {
$this->data['meta']['h1'] = $meta->getLanguageColumn('h1',$lang);
}
}
private function setProject(){
$this->language=modules::run('Languages/getThis');
$lang=$this->input->get('lang');
$lang_segment=$this->uri->segment(1);
if(isset($lang)){
global $old_lang;
$old_lang=get_cookie('lang');
$this->language->setLanguage($lang);
} else if(isset($lang_segment) && get_cookie('lang') != $lang_segment){
$this->language->setLanguage($lang_segment);
}
$this->menu=modules::run('Menu/getThis') ;
$this->user=modules::run('Users/getThis');
$this->user->index();
$this->load->config('paginator');
}
private function autoRender(){
$this->data['language_panel']=$this->language->renderPanel();
$this->data['page']=$this->menu->getPage();
// If setted redirect -> redirect
if($this->data['page']->redirect_to != 0){
redirect(getPage_url($this->data['page']->redirect_to));
}
}
private function search($q){
$attributes = ['*_name','*_content'];
$menus = \Model\Menu::where(function ($query) use ($attributes,$q)
{
foreach ($attributes as $value)
{
$query->orWhere($value,'like','%'.$q."%");
}
})->get();
$results=array();
foreach($menus as $key=>$menu){
$results['structure'][$key]['name']=$menu->name;
$results['structure'][$key]['url']=base_url().getLanguage().'/'.$menu->seo;
}
$this->data['q']=$q;
$this->data['results']=$results;
$this->data['module_view'] = $this->my_twig->view('search',$this->data);
}
}
A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /var/www/clients/client120/web196/web/application/modules/Index/controllers/Index.php:1)
Filename: core/Common.php
Line Number: 564
Backtrace:
File: /var/www/clients/client120/web196/web/index.php
Line: 293
Function: require_once
404 Page Not Found
dasdasdasdsa
404 Page Not Found
The page you requested was not found.