Esempio n. 1
0
 public function actionIndex()
 {
     $model = new AdminTemplate('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Page'])) {
         $model->attributes = $_GET['Page'];
     }
     $this->render('index', array('model' => $model));
 }
 public function getLogin()
 {
     if (\Sentinel::check()) {
         return $this->redirect();
     }
     $loginPostUrl = route('admin.login.post');
     return view(\AdminTemplate::view('pages.login'), ['title' => config('admin.title'), 'loginPostUrl' => $loginPostUrl]);
 }
Esempio n. 3
0
 /**
  * @return View
  */
 public function render()
 {
     $value = $this->getValue($this->instance, $this->name());
     $value = "{$value}";
     if (!empty($value) && strpos($value, '://') === false) {
         $value = asset($value);
     }
     $params = ['value' => $value, 'append' => $this->append()];
     return view(AdminTemplate::view('column.image'), $params);
 }
Esempio n. 4
0
            \Request::merge(['theme_sidebar_mini' => false]);
        } else {
            \Request::merge(['theme_sidebar_mini' => true]);
        }
        \SoaUserSetting::set('theme.sidebar_mini', \Request::input('theme_sidebar_mini'), $instance->id);
        \SoaUserSetting::save();
    }), FormItem::custom()->display(function ($instance) {
        $field_params = ['name' => 'theme.toggle_sidebar', 'lang' => null, 'label_size' => null, 'field_size' => null, 'label' => 'Toggle Sidebar', 'required_field' => false, 'value' => \SoaUserSetting::get('theme.toggle_sidebar', config('admintheme.toggle_sidebar'), $instance->id), 'help_text' => 'Toggle the left sidebar\'s state (open or collapse)'];
        return view(AdminTemplate::view('formitem.checkbox'), $field_params)->render();
    })->callback(function ($instance) {
        if (!\Request::has('theme_toggle_sidebar')) {
            \Request::merge(['theme_toggle_sidebar' => false]);
        } else {
            \Request::merge(['theme_toggle_sidebar' => true]);
        }
        \SoaUserSetting::set('theme.toggle_sidebar', \Request::input('theme_toggle_sidebar'), $instance->id);
        \SoaUserSetting::save();
    }), FormItem::custom()->display(function ($instance) {
        $field_params = ['name' => 'theme.sidebar_on_hover', 'lang' => null, 'label_size' => null, 'field_size' => null, 'label' => 'Sidebar on Hover', 'required_field' => false, 'value' => \SoaUserSetting::get('theme.sidebar_on_hover', config('admintheme.sidebar_on_hover'), $instance->id), 'help_text' => 'Let the sidebar mini expand on hover'];
        return view(AdminTemplate::view('formitem.checkbox'), $field_params)->render();
    })->callback(function ($instance) {
        if (!\Request::has('theme_sidebar_on_hover')) {
            \Request::merge(['theme_sidebar_on_hover' => false]);
        } else {
            \Request::merge(['theme_sidebar_on_hover' => true]);
        }
        \Setting::set('theme.sidebar_on_hover', \Request::input('theme_sidebar_on_hover'), $instance->id);
        \SoaUserSetting::save();
    })]]);
    return $form;
});
Esempio n. 5
0
 public function getEav($attribute)
 {
     $page = AdminTemplate::model()->findByPk($this->id);
     return $page->getEavAttribute($attribute);
 }