public function __construct(Application $app)
 {
     parent::__construct($app, __CLASS__);
     $this->logoHost = $this->baseHost . \Config::getSafe('portal_url', '/stalker_portal/') . "misc/logos";
     $this->logoDir = str_replace('/admin', '', $this->baseDir) . "/misc/logos";
     $this->app['error_local'] = array();
     $this->app['baseHost'] = $this->baseHost;
 }
 public function __construct(Application $app)
 {
     parent::__construct($app, __CLASS__);
     $this->logoHost = $this->baseHost . \Config::getSafe('portal_url', '/stalker_portal/') . "misc/logos";
     $this->logoDir = str_replace('/admin', '', $this->baseDir) . "/misc/logos";
     $this->app['error_local'] = array();
     $this->app['baseHost'] = $this->baseHost;
     $this->app['allArchive'] = array(array('id' => 1, 'title' => $this->setLocalization('Yes')), array('id' => 2, 'title' => $this->setLocalization('No')));
     $this->app['allStatus'] = array(array('id' => 1, 'title' => $this->setLocalization('Published')), array('id' => 2, 'title' => $this->setLocalization('Unpublished')));
     $this->app['allMonitoringStatus'] = array(array('id' => 1, 'title' => $this->setLocalization('monitoring off')), array('id' => 2, 'title' => $this->setLocalization('errors occurred')), array('id' => 3, 'title' => $this->setLocalization('no errors')), array('id' => 4, 'title' => $this->setLocalization('there are some problems')));
 }
 private function getConfigOptionalyFormField($field_name, $config_option)
 {
     $return_opt = array('name' => $field_name, 'type' => 'hidden', 'option' => array());
     if (\Config::getSafe($config_option, false)) {
         $return_opt['type'] = 'checkbox';
         $return_opt['option'] = array('required' => false);
     }
     return $return_opt;
 }
 private function get_option_services()
 {
     $option_services = \Config::getSafe('option_services', array());
     $result = array_map(function ($item) {
         return array('id' => $item, 'name' => $item);
     }, $option_services);
     return $result;
 }
 private function getUsersListDropdownAttribute()
 {
     $attribute = array(array('name' => 'mac', 'title' => 'MAC', 'checked' => TRUE), array('name' => 'ip', 'title' => 'IP', 'checked' => TRUE), array('name' => 'login', 'title' => $this->setLocalization('Login'), 'checked' => TRUE), array('name' => 'ls', 'title' => $this->setLocalization('Account'), 'checked' => TRUE), array('name' => 'fname', 'title' => $this->setLocalization('Name'), 'checked' => TRUE), array('name' => 'now_playing_type', 'title' => $this->setLocalization('Type'), 'checked' => FALSE), array('name' => 'now_playing_content', 'title' => $this->setLocalization('Media'), 'checked' => FALSE), array('name' => 'last_change_status', 'title' => $this->setLocalization('Last modified'), 'checked' => TRUE), array('name' => 'state', 'title' => $this->setLocalization('State'), 'checked' => TRUE), array('name' => 'status', 'title' => $this->setLocalization('Status'), 'checked' => TRUE));
     if (empty($this->app['reseller'])) {
         $attribute[] = array('name' => 'reseller_name', 'title' => $this->setLocalization('Reseller'), 'checked' => TRUE);
     }
     if (\Config::getSafe('enable_internal_billing', 'false')) {
         $attribute[] = array('name' => 'expire_billing_date', 'title' => $this->setLocalization('Expire billing date'), 'checked' => TRUE);
     }
     $attribute[] = array('name' => 'operations', 'title' => $this->setLocalization('Operations'), 'checked' => TRUE);
     return $attribute;
 }
 protected function getCoverFolder($id)
 {
     $dir_name = ceil($id / 100);
     $dir_path = realpath(PROJECT_PATH . '/../' . \Config::getSafe('screenshots_path', 'screenshots/')) . '/' . $dir_name;
     if (!is_dir($dir_path)) {
         umask(0);
         if (!mkdir($dir_path, 0777)) {
             return -1;
         } else {
             return $dir_path;
         }
     } else {
         return $dir_path;
     }
 }