Example #1
0
 public function settings()
 {
     // Get URI vars
     $keyword = uri::segment(5);
     // Get service
     if (!$keyword || !($service = $this->users_authentication_model->getService($keyword))) {
         view::setError(__('no_service', 'users_authentication'));
         router::redirect('cp/users/authentication');
     }
     // Get manifest
     $manifest = $this->users_authentication_model->getManifest($keyword);
     // Is demo mode enabled?
     if (input::demo(0)) {
         foreach ($service['settings'] as $k => $v) {
             if ($v) {
                 $service['settings'][$k] = 'hidden in this demo';
             }
         }
     }
     // Assign vars
     view::assign(array('manifest' => $manifest, 'service' => $service));
     // Process form values
     if (input::post('do_save_settings')) {
         $this->_saveSettings($keyword, $manifest, $service);
     }
     // Set title
     view::setTitle(__('settings', 'system'));
     // Set trail
     view::setTrail('cp/users/authentication/settings/' . $keyword, __('settings', 'system') . ' - ' . text_helper::entities($service['name']));
     // Load view
     view::load('cp/users/authentication/settings');
 }
Example #2
0
 public function edit()
 {
     // Get URI vars
     $templateID = (int) uri::segment(6);
     // Get template
     $template = array();
     if ($templateID && !($template = $this->messages_templates_model->getTemplate($templateID, false))) {
         view::setError(__('no_template', 'messages_templates'));
         router::redirect('cp/plugins/messages/templates');
     }
     // Assign vars
     view::assign(array('templateID' => $templateID, 'template' => $template));
     // Process form values
     if (input::post('do_save_template')) {
         $this->_saveTemplate($templateID);
     }
     // Set title
     view::setTitle($templateID ? __('template_edit', 'messages_templates') : __('template_new', 'messages_templates'));
     // Set trail
     view::setTrail('cp/plugins/messages/templates/edit/' . ($templateID ? $templateID : ''), $templateID ? __('template_edit', 'messages_templates') . ' - ' . text_helper::entities($template['name']) : __('template_new', 'messages_templates'));
     // Set actions
     if (count(config::item('languages', 'core', 'keywords')) > 1) {
         view::setAction('translate', '');
     }
     // Load view
     view::load('cp/plugins/messages/templates/edit');
 }
Example #3
0
 public function edit()
 {
     // Get URI vars
     $subjectID = (int) uri::segment(6);
     // Get subject
     $subject = array();
     if ($subjectID && !($subject = $this->reports_subjects_model->getSubject($subjectID, false))) {
         view::setError(__('no_subject', 'reports_subjects'));
         router::redirect('cp/content/reports/subjects');
     }
     // Assign vars
     view::assign(array('subjectID' => $subjectID, 'subject' => $subject));
     // Process form values
     if (input::post('do_save_subject')) {
         $this->_saveSubject($subjectID);
     }
     // Set title
     view::setTitle($subjectID ? __('subject_edit', 'reports_subjects') : __('subject_new', 'reports_subjects'));
     // Set trail
     view::setTrail('cp/content/reports/subjects/edit/' . ($subjectID ? $subjectID : ''), $subjectID ? __('subject_edit', 'reports_subjects') . ' - ' . text_helper::entities($subject['name']) : __('subject_new', 'reports_subjects'));
     // Set actions
     if (count(config::item('languages', 'core', 'keywords')) > 1) {
         view::setAction('translate', '');
     }
     // Load view
     view::load('cp/content/reports/subjects/edit');
 }
Example #4
0
 public function edit()
 {
     // Get URI vars
     $groupID = (int) uri::segment(6);
     // Get group
     $group = array();
     if ($groupID && !($group = $this->banners_groups_model->getGroup($groupID))) {
         view::setError(__('no_group', 'banners'));
         router::redirect('cp/content/banners/groups');
     }
     // Assign vars
     view::assign(array('groupID' => $groupID, 'group' => $group));
     // Process form values
     if (input::post('do_save_group')) {
         $this->_saveGroup($groupID);
     }
     // Set title
     view::setTitle($groupID ? __('group_edit', 'banners') : __('group_new', 'banners'));
     // Set trail
     view::setTrail('cp/content/banners/groups/edit/' . ($groupID ? $groupID : ''), $groupID ? __('group_edit', 'banners') . ' - ' . text_helper::entities($group['name']) : __('group_new', 'banners'));
     // Assign actions
     if ($groupID) {
         view::setAction('cp/content/banners/browse/' . $groupID, __('banners', 'banners'), array('class' => 'icon-text icon-banners'));
     }
     // Load view
     view::load('cp/content/banners/groups/edit');
 }
Example #5
0
 public function usersViewActionsAlbums($user)
 {
     if (!$user['total_albums']) {
         return '';
     }
     echo '<li class="pictures-albums">' . html_helper::anchor('pictures/user/' . text_helper::entities($user['username']), __('pictures_albums', 'system_navigation') . ' (' . $user['total_albums'] . ')') . '</li>';
 }
Example #6
0
 public function account()
 {
     // Create account settings
     $settings = array();
     $settings['email'] = array('name' => __('email', 'users'), 'keyword' => 'email', 'type' => 'static', 'value' => text_helper::entities(session::item('email')) . ' - ' . html_helper::anchor('users/settings/email', __('email_change', 'users')) . (config::item('auth_methods', 'users', 'default') ? ' - ' . html_helper::anchor('users/settings/password', __('password_change', 'users')) : '') . (session::permission('users_account_cancel', 'users') ? ' - ' . html_helper::anchor('users/settings/cancel', __('account_cancel', 'users')) : ''));
     if (config::item('user_username', 'users')) {
         $settings['username'] = array('name' => __('username', 'users'), 'keyword' => 'username', 'type' => 'static', 'value' => text_helper::entities(session::item('username')) . (config::item('user_username_modify', 'users') ? ' - ' . html_helper::anchor('users/settings/username', __('username_change', 'users')) : ''));
     }
     if (!config::item('time_zone_override', 'system')) {
         $settings['time_zone'] = array('name' => __('time_zone', 'users_account'), 'keyword' => 'time_zone', 'type' => 'select', 'items' => date_helper::timezones(), 'value' => session::item('time_zone'), 'rules' => array('callback__is_valid_time_zone'));
     }
     if (!config::item('language_override', 'system') && session::permission('change_languages', 'system')) {
         $settings['language_id'] = array('name' => __('language', 'users_account'), 'keyword' => 'language_id', 'type' => 'select', 'items' => config::item('languages', 'core', 'names'), 'value' => session::item('language_id'), 'rules' => array('callback__is_valid_language_id'));
     }
     if (!config::item('template_override', 'system') && session::permission('change_templates', 'system')) {
         $settings['template_id'] = array('name' => __('template', 'users_account'), 'keyword' => 'template_id', 'type' => 'select', 'items' => config::item('templates', 'core', 'names'), 'value' => session::item('template_id'), 'rules' => array('callback__is_valid_template_id'));
     }
     // Filter hook
     $settings = hook::filter('users/settings/account/options', $settings);
     // Assign vars
     view::assign(array('settings' => $settings));
     // Process form values
     if (input::post('do_save_settings')) {
         $this->_saveSettings($settings);
     }
     // Set title
     view::setTitle(__('settings', 'users'));
     // Load view
     view::load('users/settings/account');
 }
Example #7
0
 public function edit()
 {
     // Get URI vars
     $templateID = (int) uri::segment(6);
     // Get template
     $template = array();
     if ($templateID && !($template = $this->newsletters_templates_model->getTemplate($templateID, false))) {
         view::setError(__('no_template', 'newsletters_templates'));
         router::redirect('cp/content/newsletters/templates');
     }
     // Assign vars
     view::assign(array('templateID' => $templateID, 'template' => $template));
     // Process form values
     if (input::post('do_save_template')) {
         $this->_saveTemplate($templateID);
     }
     // Set title
     view::setTitle($templateID ? __('template_edit', 'newsletters_templates') : __('template_new', 'newsletters_templates'));
     // Set trail
     view::setTrail('cp/content/newsletters/templates/edit/' . ($templateID ? $templateID : ''), $templateID ? __('template_edit', 'newsletters_templates') . ' - ' . text_helper::entities($template['name']) : __('template_new', 'newsletters_templates'));
     // Load ckeditor
     view::includeJavascript('externals/ckeditor/ckeditor.js');
     // Load view
     view::load('cp/content/newsletters/templates/edit');
 }
Example #8
0
 public function usersViewActionsAds($user)
 {
     if (!$user['total_classifieds']) {
         return '';
     }
     echo '<li class="classifieds">' . html_helper::anchor('classifieds/user/' . text_helper::entities($user['username']), __('classifieds', 'system_navigation') . ' (' . $user['total_classifieds'] . ')') . '</li>';
 }
Example #9
0
 public function getTypes($escape = true)
 {
     // Get user types
     $types = $this->db->query("SELECT * FROM `:prefix:users_types` ORDER BY order_id ASC")->result();
     foreach ($types as $index => $type) {
         $types[$index]['name'] = $escape ? text_helper::entities($type['name_' . session::item('language')]) : $type['name_' . session::item('language')];
     }
     return $types;
 }
Example #10
0
 public function saveSearch($conditions = array(), $values = array(), $results = 0)
 {
     $data = array('search_id' => text_helper::random(8), 'user_id' => session::item('user_id'), 'conditions' => json_encode($conditions), 'values' => json_encode($values), 'results' => $results, 'post_date' => date_helper::now());
     if (!session::item('user_id')) {
         $data['ip_address'] = input::ipaddress();
     }
     $this->db->insert('core_search', $data);
     return $data['search_id'];
 }
Example #11
0
 public function getPlans($active = true, $escape = true)
 {
     // Get plans
     $plans = $this->db->query("SELECT * FROM `:prefix:billing_plans` " . ($active ? "WHERE `active`=1" : "") . " ORDER BY `order_id` ASC")->result();
     foreach ($plans as $index => $plan) {
         $plans[$index]['name'] = $escape ? text_helper::entities($plan['name_' . session::item('language')]) : $plan['name_' . session::item('language')];
         $plans[$index]['description'] = $escape ? text_helper::entities($plan['description_' . session::item('language')]) : $plan['description_' . session::item('language')];
     }
     return $plans;
 }
Example #12
0
 public function getPlugins($escape = true)
 {
     $plugins = array();
     $result = $this->db->query("SELECT `plugin` FROM `:prefix:core_meta_tags` GROUP BY `plugin`")->result();
     foreach ($result as $plugin) {
         $plugins[$plugin['plugin']] = $escape ? text_helper::entities(config::item('plugins', 'core', $plugin['plugin'], 'name')) : config::item('plugins', 'core', $plugin['plugin'], 'name');
     }
     asort($plugins);
     return $plugins;
 }
Example #13
0
 public static function name($name1, $name2, $escape = false)
 {
     if ($name1 == '') {
         $name1 = __('user', 'users');
         $name2 = '';
     } elseif ($escape) {
         $name1 = text_helper::entities($name1);
         $name2 = text_helper::entities($name2);
     }
     $name = $name2 != '' ? $name1 . ' ' . $name2 : $name1;
     return $name;
 }
Example #14
0
 public function getPlugins($escape = true)
 {
     $plugins = array();
     foreach (config::item('plugins', 'core') as $plugin) {
         if (file_exists(DOCPATH . 'models/' . $plugin['keyword'] . '/' . $plugin['keyword'] . EXT)) {
             $model = loader::model($plugin['keyword'] . '/' . $plugin['keyword'], array(), null);
             if (method_exists($model, 'updateDbCounters')) {
                 $plugins[$plugin['keyword']] = $escape ? text_helper::entities($plugin['name']) : $plugin['name'];
             }
         }
     }
     asort($plugins);
     return $plugins;
 }
Example #15
0
 public function getNewsletters($escape = true)
 {
     // Get newsletters
     $newsletters = $this->db->query("SELECT * FROM `:prefix:newsletters` ORDER BY `subject` ASC")->result();
     foreach ($newsletters as $index => $newsletter) {
         if ($escape) {
             $newsletter['subject'] = text_helper::entities($newsletter['subject']);
             $newsletter['message_html'] = text_helper::entities($newsletter['message_html']);
             $newsletter['message_text'] = text_helper::entities($newsletter['message_text']);
         }
         $newsletters[$index] = $newsletter;
     }
     return $newsletters;
 }
Example #16
0
 public function index()
 {
     // Get plugins
     if (!($plugins = $this->plugins_model->scanPlugins())) {
         view::setError(__('no_plugins', 'system_plugins'));
         router::redirect('cp/system/config/system');
     }
     // Create table grid
     $grid = array('uri' => 'cp/system/plugins', 'keyword' => 'plugins', 'header' => array('name' => array('html' => __('name', 'system'), 'class' => 'name'), 'description' => array('html' => __('description', 'system'), 'class' => 'text'), 'version' => array('html' => __('plugin_version', 'system_plugins'), 'class' => 'version'), 'author' => array('html' => __('plugin_author', 'system_plugins'), 'class' => 'author'), 'actions' => array('html' => __('actions', 'system'), 'class' => 'actions')), 'content' => array());
     // Create grid content
     foreach ($plugins as $plugin) {
         $version = $plugin['version'] != '' ? $plugin['version'] : '1.0.0';
         if (isset($plugin['plugin_id']) && $plugin['plugin_id'] && version_compare($plugin['version_new'], $plugin['version']) == 1) {
             $version .= ' ' . html_helper::anchor('cp/system/plugins/view/' . $plugin['keyword'], '+', array('class' => 'label success small', 'title' => __('plugin_new_version', 'system_plugins', array('%version' => text_helper::entities($plugin['version_new'])))));
         }
         $author = '';
         if ($plugin['author'] || $plugin['website']) {
             if ($plugin['author'] && $plugin['website']) {
                 $author = html_helper::anchor($plugin['website'], $plugin['author'], array('target' => '_blank'));
             } elseif ($plugin['website']) {
                 $author = html_helper::anchor($plugin['website'], text_helper::entities(str_ireplace(array('http://www.', 'http://'), '', $plugin['website'])), array('target' => '_blank'));
             } elseif ($plugin['author']) {
                 $author = $plugin['author'];
             }
         }
         $actions = array();
         if (isset($plugin['plugin_id']) && $plugin['plugin_id']) {
             if ($plugin['settings']) {
                 $actions['html']['settings'] = html_helper::anchor('cp/system/plugins/settings/' . $plugin['keyword'], __('settings', 'system'), array('class' => 'settings'));
             } else {
                 $actions['html']['view'] = html_helper::anchor('cp/system/plugins/view/' . $plugin['keyword'], __('details', 'system'), array('class' => 'details'));
             }
             if (!isset($plugin['system']) || !$plugin['system']) {
                 $actions['html']['uninstall'] = html_helper::anchor('cp/system/plugins/uninstall/' . $plugin['keyword'], __('uninstall', 'system'), array('data-html' => __('plugin_uninstall?', 'system_plugins'), 'data-role' => 'confirm', 'class' => 'uninstall'));
             }
         } else {
             $actions['html']['install'] = html_helper::anchor('cp/system/plugins/install/' . $plugin['keyword'], __('install', 'system'), array('class' => 'install'));
         }
         $grid['content'][] = array('name' => array('html' => html_helper::anchor('cp/system/plugins/view/' . $plugin['keyword'], $plugin['name'])), 'description' => array('html' => text_helper::truncate($plugin['description'], 64)), 'version' => array('html' => $version), 'author' => array('html' => $author), 'actions' => $actions);
     }
     // Filter hooks
     hook::filter('cp/system/plugins/browse/grid', $grid);
     // Assign vars
     view::assign(array('grid' => $grid));
     // Set title
     view::setTitle(__('system_plugins_manage', 'system_navigation'));
     // Load view
     view::load('cp/system/plugins/browse');
 }
Example #17
0
 public function getTemplates($escape = true)
 {
     // Get templates
     $templates = $this->db->query("SELECT * FROM `:prefix:newsletters_templates` ORDER BY `name` ASC")->result();
     if ($escape) {
         foreach ($templates as $index => $template) {
             $template['name'] = text_helper::entities($template['name']);
             $template['subject'] = text_helper::entities($template['subject']);
             $template['message_html'] = text_helper::entities($template['message_html']);
             $template['message_text'] = text_helper::entities($template['message_text']);
             $templates[$index] = $template;
         }
     }
     return $templates;
 }
Example #18
0
 public function getSubjects($escape = true, $active = false)
 {
     // Get subjects
     $subjects = $this->db->query("SELECT * FROM `:prefix:reports_subjects` " . ($active ? "WHERE `active`=1" : "") . " ORDER BY `order_id` ASC")->result();
     foreach ($subjects as $index => $subject) {
         if ($escape) {
             foreach (config::item('languages', 'core', 'keywords') as $language) {
                 $subject['name_' . $language] = text_helper::entities($subject['name_' . $language]);
             }
         }
         $subject['name'] = $subject['name_' . session::item('language')];
         $subjects[$index] = $subject;
     }
     return $subjects;
 }
Example #19
0
 public function getTemplates($escape = true, $status = false)
 {
     // Get templates
     $templates = $this->db->query("SELECT * FROM `:prefix:messages_templates` " . ($status ? "WHERE `active`=1" : "") . " ORDER BY `order_id` ASC")->result();
     foreach ($templates as $index => $template) {
         if ($escape) {
             foreach (config::item('languages', 'core', 'keywords') as $language) {
                 $template['name_' . $language] = text_helper::entities($template['name_' . $language]);
                 $template['subject_' . $language] = text_helper::entities($template['subject_' . $language]);
                 $template['message_' . $language] = text_helper::entities($template['message_' . $language]);
             }
         }
         $template['name'] = $template['name_' . session::item('language')];
         $template['subject'] = $template['subject_' . session::item('language')];
         $template['message'] = $template['message_' . session::item('language')];
         $templates[$index] = $template;
     }
     return $templates;
 }
Example #20
0
 public function edit()
 {
     // Get URI vars
     $typeID = (int) uri::segment(5);
     // Get type
     $type = array();
     if ($typeID && !($type = $this->users_types_model->getType($typeID, false))) {
         view::setError(__('no_type', 'users_types'));
         router::redirect('cp/users/types');
     }
     $fields = array();
     // Do we have an existing type?
     if ($typeID) {
         // Get text fields
         $fields = array('' => __('none', 'system'));
         foreach ($this->fields_model->getFields('users', $typeID) as $field) {
             if ($field['type'] == 'text') {
                 $fields[$field['keyword']] = $field['name'];
             }
         }
     }
     // Assign vars
     view::assign(array('typeID' => $typeID, 'type' => $type, 'fields' => $fields));
     // Process form values
     if (input::post('do_save_type')) {
         $this->_saveType($typeID, $type, $fields);
     }
     // Set title
     view::setTitle($typeID ? __('type_edit', 'users_types') : __('type_new', 'users_types'));
     // Set trail
     view::setTrail('cp/users/types/edit/' . ($typeID ? $typeID : ''), $typeID ? __('type_edit', 'users_types') . ' - ' . text_helper::entities($type['name']) : __('type_new', 'users_types'));
     // Set trail
     if ($typeID) {
         // Assign actions
         view::setAction('cp/system/fields/users/browse/' . $typeID, __('profile_questions', 'users_types'), array('class' => 'icon-text icon-system-fields'));
     }
     if (count(config::item('languages', 'core', 'keywords')) > 1) {
         view::setAction('translate', '');
     }
     // Load view
     view::load('cp/users/types/edit');
 }
Example #21
0
 public function getManifest($keyword, $existing = false, $escape = true)
 {
     $manifest = array();
     // Include manifest file
     if (@is_file(DOCPATH . 'plugins/' . $keyword . '/manifest.php') && @(include DOCPATH . 'plugins/' . $keyword . '/manifest.php')) {
         // Does params variable exist?
         if (isset($params) && isset($params['name'])) {
             $manifest = array('keyword' => $keyword, 'name' => $params['name'], 'values' => array(), 'description' => isset($params['description']) ? $params['description'] : '', 'author' => isset($params['author']) ? $params['author'] : '', 'website' => isset($params['website']) ? $params['website'] : '', 'version' => isset($params['version']) ? $params['version'] : '1.0', 'requirements' => isset($params['requirements']) && is_array($params['requirements']) ? $params['requirements'] : array(), 'settings' => isset($params['settings']) && $params['settings'] ? 1 : 0);
             if ($escape) {
                 foreach (array('name', 'description', 'author', 'version') as $item) {
                     $manifest[$item] = text_helper::entities($manifest[$item]);
                 }
             }
         }
     }
     if ($existing) {
         $plugin = $this->db->query("SELECT * FROM `:prefix:core_plugins` WHERE `keyword`=? LIMIT 1", array($keyword))->row();
         if ($plugin) {
             $manifest['version_current'] = $escape ? text_helper::entities($plugin['version']) : $plugin['version'];
         }
     }
     return $manifest;
 }
Example #22
0
 public function edit()
 {
     // Get URI vars
     $plugin = uri::segment(5, 'system');
     // Assign vars
     view::assign(array('plugin' => $plugin));
     // Does plugin exist?
     if (!config::item('plugins', 'core', $plugin)) {
         view::setError(__('no_config_plugin', 'system_config'));
         router::redirect('cp/system/config/' . $plugin);
     }
     // Get meta tags
     if (!($tags = $this->metatags_model->getMetaTags($plugin))) {
         view::setError(__('no_meta_tags', 'system_metatags'));
         router::redirect('cp/system/config/' . $plugin);
     }
     // Process form values
     if (input::post('do_save_meta_tags')) {
         $this->_saveMetaTags($plugin, $tags);
     }
     // Assign vars
     view::assign(array('tags' => $tags));
     // Set title
     view::setTitle(__('system_meta_tags_manage', 'system_navigation'));
     // Set trail
     view::setTrail('cp/system/metatags/edit/' . $plugin, text_helper::entities(config::item('plugins', 'core', $plugin, 'name')));
     // Set actions
     if (count(config::item('languages', 'core', 'keywords')) > 1) {
         view::setAction('translate', '');
     }
     // Set tabs
     foreach ($tags as $keyword => $group) {
         view::setTab('#' . $keyword, __($keyword, $plugin . '_metatags'), array('class' => 'group_' . $keyword));
     }
     // Load view
     view::load('cp/system/metatags/edit');
 }
Example #23
0
 public function settings()
 {
     // Get URI vars
     $keyword = uri::segment(5);
     // Get service
     if (!$keyword || !($service = $this->storage_model->getService($keyword))) {
         view::setError(__('no_service', 'system_storage'));
         router::redirect('cp/system/storage');
     }
     // Get manifest
     $manifest = $this->storage_model->getManifest($keyword);
     // Assign vars
     view::assign(array('manifest' => $manifest, 'service' => $service));
     // Process form values
     if (input::post('do_save_settings')) {
         $this->_saveSettings($keyword, $manifest, $service);
     }
     // Set title
     view::setTitle(__('settings', 'system'));
     // Set trail
     view::setTrail('cp/system/storage/settings/' . $keyword, __('settings', 'system') . ' - ' . text_helper::entities($service['name']));
     // Load view
     view::load('cp/system/storage/settings');
 }
Example #24
0
 public function settings()
 {
     // Get URI vars
     $keyword = uri::segment(5);
     // Get captcha
     if (!$keyword || !($captcha = $this->captchas_model->getCaptcha($keyword))) {
         view::setError(__('no_captcha', 'security_forms'));
         router::redirect('cp/security/forms');
     }
     // Get manifest
     $manifest = $this->captchas_model->getManifest($keyword);
     // Assign vars
     view::assign(array('manifest' => $manifest, 'captcha' => $captcha));
     // Process form values
     if (input::post('do_save_settings')) {
         $this->_saveSettings($keyword, $manifest, $captcha);
     }
     // Set title
     view::setTitle(__('settings', 'system'));
     // Set trail
     view::setTrail('cp/security/forms/settings/' . $keyword, __('settings', 'system') . ' - ' . text_helper::entities($captcha['name']));
     // Load view
     view::load('cp/security/forms/settings');
 }
Example #25
0
 public function upload($filename, $extensions, $maxsize, $maxdimensions = '')
 {
     if ($maxdimensions && !is_array($maxdimensions)) {
         $maxdimensions = explode('x', $maxdimensions);
     }
     // Upload path
     $suffix = implode('/', str_split(text_helper::random(4, 'numeric')));
     $path = $this->relativePath . '/' . $suffix;
     // Does upload path exist?
     if (!$this->createPath($this->relativePath, $suffix)) {
         return false;
     }
     // Uploader configuration
     $config = array('upload_path' => BASEPATH . $path, 'allowed_types' => str_replace(',', '|', $extensions), 'max_size' => $maxsize * 1024, 'max_width' => isset($maxdimensions[0]) ? $maxdimensions[0] : 0, 'max_height' => isset($maxdimensions[1]) ? $maxdimensions[1] : 0, 'encrypt_name' => true, 'clean_name' => false, 'overwrite' => true);
     // Load uploader library
     loader::library('uploader', $config);
     if (!$this->uploader->run($filename)) {
         $this->setError($this->uploader->getError());
         return false;
     }
     $file = $this->uploader->getData();
     $file['path_suffix'] = $suffix;
     return $file;
 }
Example #26
0
 public function settings()
 {
     // Get URI vars
     $keyword = uri::segment(5);
     // Get gateway
     if (!$keyword || !($gateway = $this->gateways_model->getGateway($keyword))) {
         view::setError(__('no_gateway', 'billing_gateways'));
         router::redirect('cp/billing/gateways');
     }
     // Get manifest
     $manifest = $this->gateways_model->getManifest($keyword);
     $settings = array();
     // Create settings
     foreach ($manifest['settings'] as $setting) {
         if ($setting['type'] != 'system') {
             $settings[] = $setting;
         }
     }
     // Do we have any settings for this gateway?
     if (!$manifest['settings']) {
         view::setError(__('no_gateway_settings', 'billing_gateways'));
         router::redirect('cp/billing/gateways');
     }
     // Assign vars
     view::assign(array('manifest' => $manifest, 'gateway' => $gateway, 'settings' => $settings));
     // Process form values
     if (input::post('do_save_settings')) {
         $this->_saveSettings($keyword, $manifest, $gateway, $settings);
     }
     // Set title
     view::setTitle(__('settings', 'system'));
     // Set trail
     view::setTrail('cp/billing/gateways/settings/' . $keyword, __('settings', 'system') . ' - ' . text_helper::entities($gateway['name']));
     // Load view
     view::load('cp/billing/gateways/settings');
 }
Example #27
0
view::load('cp/system/elements/template/header');
?>

<section class="plugin-timeline message-edit">

	<?php 
echo form_helper::openForm();
?>

		<fieldset class="form <?php 
echo text_helper::alternate();
?>
">

			<div class="row <?php 
echo text_helper::alternate('odd', 'even');
?>
" id="input_row_message_edit_message">

				<label for="input_edit_message_edit_message">
					<?php 
echo __('message', 'timeline');
?>
 <span class="required">*</span>
				</label>

				<div class="field">

					<?php 
view::load('system/elements/field/edit', array('prefix' => 'message_edit', 'field' => array('keyword' => 'message', 'type' => 'textarea'), 'value' => $message));
?>
Example #28
0
 public function edit()
 {
     // Get URI vars
     $userID = (int) uri::segment(4);
     // Assign vars
     view::assign(array('userID' => $userID));
     // Get user
     $user = array();
     if ($userID && !($user = $this->users_model->getUser($userID))) {
         view::setError(__('no_user', 'users'));
         router::redirect('cp/users');
     }
     // Get user groups
     $groups = config::item('usergroups', 'core');
     unset($groups[config::item('group_guests_id', 'users')]);
     // Create privacy settings
     $settings = array();
     $settings['email'] = array('name' => __('email', 'users'), 'keyword' => 'email', 'type' => 'text', 'class' => 'input-xlarge', 'value' => $user ? input::demo(0) ? current(explode('@', $user['email'])) . '@hidden.com' : $user['email'] : '', 'rules' => array('required', 'max_length' => 255, 'valid_email', 'callback__is_unique_email' => $userID));
     if (config::item('user_username', 'users')) {
         $settings['username'] = array('name' => __('username', 'users'), 'keyword' => 'username', 'type' => 'text', 'class' => 'input-xlarge', 'value' => $user ? $user['username'] : '', 'rules' => array('required', 'min_length' => 3, 'max_length' => 128, 'callback__is_valid_username' => $userID));
     }
     $settings['password'] = array('name' => __('password', 'users'), 'keyword' => 'password', 'type' => 'password', 'maxlength' => 128, 'class' => 'input-xlarge', 'rules' => array(!$userID ? 'required' : '', 'max_length' => 128));
     $settings['password2'] = array('name' => __('password_confirm', 'users'), 'keyword' => 'password2', 'type' => 'password', 'maxlength' => 128, 'class' => 'input-xlarge', 'rules' => array('max_length' => 128, 'matches' => 'password'));
     $settings['type_id'] = array('name' => __('user_type', 'users'), 'keyword' => 'type_id', 'keyword' => 'type_id', 'type' => 'select', 'items' => $userID ? array($user['type_id'] => text_helper::entities(config::item('usertypes', 'core', 'names', $user['type_id']))) : config::item('usertypes', 'core', 'names'), 'value' => $user ? $user['type_id'] : config::item('type_default_id', 'users'), 'rules' => array('intval'));
     $settings['group_id'] = array('name' => __('user_group', 'users'), 'keyword' => 'group_id', 'type' => 'select', 'items' => $userID && $userID == session::item('user_id') ? array($user['group_id'] => config::item('usergroups', 'core', $user['group_id'])) : $groups, 'value' => $user ? $user['group_id'] : config::item('group_default_id', 'users'), 'rules' => array('intval'));
     if ($userID != session::item('user_id')) {
         $settings['verified'] = array('name' => __('verified', 'users'), 'keyword' => 'verified', 'type' => 'boolean', 'value' => $user ? $user['verified'] : '1', 'rules' => array('intval'));
         $settings['active'] = array('name' => __('active', 'system'), 'keyword' => 'active', 'type' => 'boolean', 'value' => $user ? $user['active'] : '1', 'rules' => array('intval'));
     }
     if ($userID) {
         $settings['join_date'] = array('name' => __('join_date', 'users'), 'keyword' => 'join_date', 'type' => 'static', 'value' => date_helper::formatDate($user['join_date'], 'date-time'));
         $settings['visit_date'] = array('name' => __('visit_date', 'users'), 'keyword' => 'visit_date', 'type' => 'static', 'value' => $user['visit_date'] ? date_helper::formatDate($user['visit_date'], 'date-time') : __('never', 'system'));
         $settings['ip_address'] = array('name' => __('ip_address', 'users'), 'keyword' => 'ip_address', 'type' => 'static', 'value' => input::demo(0) ? 'Hidden in this demo' : $user['ip_address']);
     }
     // Filter hook
     $settings = hook::filter('users/settings/account/options', $settings, $user);
     // Assign vars
     view::assign(array('user' => $user, 'settings' => $settings));
     // Process form values
     if (input::post('do_save_user')) {
         $this->_saveUser($userID, $settings, $user);
     }
     // Set title
     view::setTitle($userID ? __('user_edit', 'users') : __('user_new', 'users'));
     // Assign tabs
     if ($userID) {
         $this->_userActions($userID, 'account');
     }
     // Set trail
     view::setTrail('cp/users/edit/' . ($userID ? $userID : ''), $userID ? __('user_edit', 'users') . ' - ' . ($user['name1'] ? $user['name'] : $user['email']) : __('user_new', 'users'));
     // Assign actions
     if ($userID && $user['user_id'] != session::item('user_id') && $user['group_id'] != config::item('group_cancelled_id', 'users') && $user['active'] && $user['verified']) {
         view::setAction('cp/users/login/spy/' . $user['user_id'], __('login', 'system_navigation'), array('class' => 'icon-text icon-users-login'));
     }
     // Load view
     view::load('cp/users/edit');
 }
Example #29
0
				<li class="<?php 
        echo text_helper::alternate('odd', 'even');
        ?>
" id="row-picture-<?php 
        echo $picture['picture_id'];
        ?>
">

					<figure class="image classifieds-image">
						<div class="image thumbnail" style="background-image:url('<?php 
        echo storage_helper::getFileURL($picture['file_service_id'], $picture['file_path'], $picture['file_name'], $picture['file_ext'], 't', $picture['file_modify_date']);
        ?>
');">
							<?php 
        echo html_helper::anchor('classifieds/pictures/view/' . $picture['picture_id'] . '/' . text_helper::slug($picture['data_description'], 100), '<span class="name">' . $picture['data_description'] . '</span>', array('class' => 'image'));
        ?>
						</div>
					</figure>

				</li>

			<?php 
    }
    ?>

		</ul>

	<?php 
}
?>
Example #30
0
        ?>
								<?php 
        echo html_helper::anchor('pictures/index/' . $album['album_id'] . '/' . text_helper::slug($album['data_title'], 100), '<span class="name">' . $album['data_title'] . '</span>', array('class' => 'image'));
        ?>
								<div class="overlay element pictures">
									<?php 
        echo __('pictures_num' . ($album['total_pictures'] == 1 ? '_one' : ''), 'system_info', array('%pictures' => $album['total_pictures']));
        ?>
								</div>
							</div>
						</figure>

						<header class="item-header">
							<h2>
								<?php 
        echo html_helper::anchor('pictures/index/' . $album['album_id'] . '/' . text_helper::slug($album['data_title'], 100), $album['data_title']);
        ?>
							</h2>
						</header>

						<div class="item-article">
							<?php 
        if ($album['data_description']) {
            ?>
								<?php 
            echo $album['data_description'];
            ?>
							<?php 
        }
        ?>
						</div>