Example #1
0
 public function index()
 {
     if (!empty($_POST)) {
         $this->save_links();
     }
     $directories = DM_Directory::get_all_sorted();
     $raw_dir_user = Directory_User::get_by_user_and_profile($this->c_user->id, $this->profile->id);
     $user_directories = $raw_dir_user->to_dir_array();
     $is_notified = $raw_dir_user->isNotified();
     CssJs::getInst()->c_js();
     JsSettings::instance()->add(array('autocomplete_url' => site_url('settings/directories/google_autocomplete')));
     $parsers = array();
     foreach ($directories as $_dir) {
         try {
             $parsers[$_dir->id] = Directory_Parser::factory($_dir->type);
         } catch (Exception $e) {
             $parsers[$_dir->id] = new stdClass();
         }
     }
     $receive_emails = $this->getAAC()->isGrantedPlan('email_notifications');
     $this->template->set('is_notified', $is_notified);
     $this->template->set('parsers', $parsers);
     $this->template->set('directories', $directories);
     $this->template->set('user_directories', $user_directories);
     $this->template->set('receive_emails', $receive_emails);
     $this->template->render();
 }
Example #2
0
 public function edit($directoryId = null)
 {
     $config = $this->config->item('crm_directories', 'site_config');
     $count = 0;
     if (!empty($config['count'])) {
         $count = $config['count'];
     }
     $availableDirectoriesCount = $this->getAAC()->getPlanFeatureValue('crm');
     if ($availableDirectoriesCount) {
         $count = $availableDirectoriesCount;
     }
     $userDirectories = Crm_directory::inst()->getUserDirectories(array('user_id' => $this->c_user->id, 'profile_id' => $this->profile->id))->all_to_array();
     if (count($userDirectories) >= $count) {
         $this->addFlash(lang('directories_limit_error'));
         redirect('crm/directories');
     }
     $this->lang->load('form_validation', $this->language);
     $directory = Crm_directory::inst($directoryId);
     if ($this->getRequest()->isMethod('post')) {
         $data = $this->getRequest()->request->all();
         $directory->fillFromArray($data);
         if (!$directory->save(array('user' => $this->c_user, 'profile' => $this->profile))) {
             $errors = $directory->error->all;
             JsSettings::instance()->add('errors', $errors);
             $this->template->set('recent', $data);
         } else {
             $this->addFlash(lang('record_saved_success'), 'success');
             redirect('crm/directories');
         }
     }
     $this->template->set('directory', $directory);
     $this->template->render();
 }
Example #3
0
 public function index()
 {
     $group = $this->config->item('default_group', 'ion_auth');
     $limit = $this->config->config['users_on_page'];
     $page = !empty($_GET['page']) ? $_GET['page'] : 1;
     if ($page != 1) {
         $offset = $limit * ($page - 1);
     } else {
         $offset = '';
     }
     $searchText = Arr::get($_GET, 'search', '');
     $filter = Arr::get($_GET, 'filter', '');
     if ($searchText || $filter !== '') {
         $users = $this->search();
         JsSettings::instance()->add(array('search' => $searchText, 'filter' => $filter, 'group' => $group));
     } else {
         $users = $this->ion_auth->getUsersByGroup($group);
         if ($users) {
             $users->get($limit, $offset);
         }
     }
     CssJs::getInst()->add_js('controller/admin/manage_users.js', 'footer')->add_js(array('controller/admin/users_pagination.js', 'controller/admin/autocomplete.js'))->add_js('libs/test.js', null, 'footer');
     $this->template->set('users', $users);
     $this->template->set('group', $group);
     $this->template->set('limit', $limit);
     $this->template->set('page', $page);
     $this->template->set('c_user', $this->c_user);
     $this->template->render();
 }
Example #4
0
 public function index()
 {
     $group = $this->config->item('admin_group', 'ion_auth');
     $ia = new Ion_auth_model();
     $limit = $this->config->config['users_on_page'];
     $page = !empty($_GET['page']) ? $_GET['page'] : 1;
     if ($page == 1) {
         $offset = '';
     } else {
         $offset = $limit * ($page - 1);
     }
     $searchText = Arr::get($_GET, 'search', '');
     $filter = Arr::get($_GET, 'filter', '');
     $admins = $ia->getUsersByGroup($group);
     if ($searchText || $filter !== '') {
         $admins->search($searchText, $filter, null, $limit, $offset);
         JsSettings::instance()->add(array('search' => $searchText, 'filter' => $filter, 'group' => $group));
     } else {
         if ($admins) {
             $admins->get($limit, $offset);
         }
     }
     $this->template->set('users', $admins);
     $this->template->set('group', $group);
     $this->template->set('limit', $limit);
     $this->template->set('page', $page);
     $this->template->set('c_user', $this->c_user);
     $this->template->render();
 }
Example #5
0
 public function __construct()
 {
     parent::__construct();
     $this->lang->load('personal_settings', $this->language);
     JsSettings::instance()->add(['i18n' => $this->lang->load('personal_settings', $this->language)]);
     $this->template->set('section', 'personal');
 }
 public function __construct()
 {
     parent::__construct($this->website_part);
     $this->lang->load('admin_global', $this->language);
     JsSettings::instance()->add(['i18n' => $this->lang->load('admin_global', $this->language)]);
     $this->template->layout = 'layouts/admin';
 }
 public function __construct()
 {
     parent::__construct();
     $this->lang->load('twitter_tools', $this->language);
     $this->lang->load('social_settings', $this->language);
     JsSettings::instance()->add(['i18n' => $this->lang->load('social_settings', $this->language)]);
 }
Example #8
0
 /**
  * Rss settings page
  */
 public function index()
 {
     $rss_custom = Rss_feed::inst()->user_custom_feeds($this->c_user->id, $this->profile->id);
     JsSettings::instance()->add(array('rss' => array('custom_action' => $this->session->flashdata('rss_custom_action'), 'remove_url' => site_url('settings/rss/remove_rss_custom'))));
     CssJs::getInst()->c_js();
     $this->template->set('rss_custom', $rss_custom);
     $this->template->render();
 }
Example #9
0
 /**
  * Render Reports Page
  *
  * @access public
  * @return void
  */
 public function index()
 {
     JsSettings::instance()->add(array('reports' => array('dates' => $this->dates, 'date_format' => $this->date_format)));
     CssJs::getInst()->add_js(array('libs/highcharts/highcharts.js'));
     CssJs::getInst()->c_js('social/reports', 'index');
     CssJs::getInst()->add_js('www.google.com/jsapi', 'external', 'header');
     $this->template->render();
 }
Example #10
0
 public function __construct()
 {
     parent::__construct();
     CssJs::getInst()->add_js(array('libs/jquery.sortable.js', 'controller/admin/manage_plans.js'));
     $this->lang->load('manage_plans', $this->language);
     JsSettings::instance()->add(['i18n' => $this->lang->load('manage_plans', $this->language)]);
     $this->load->config('manage_plans');
 }
Example #11
0
 public function __construct()
 {
     parent::__construct();
     $this->lang->load('social_scheduled', $this->language);
     JsSettings::instance()->add(['i18n' => $this->lang->load('social_scheduled', $this->language)]);
     $this->isSupportScheduledPosts = $this->getAAC()->isGrantedPlan('scheduled_posts');
     $this->is_user_set_timezone = User_timezone::is_user_set_timezone($this->c_user->id);
 }
Example #12
0
 public function social($social = 'facebook')
 {
     $this->load->helper('clicable_links');
     //$social = ($social === 'twitter') ? $social : 'facebook';
     $has_access = Access_token::inst()->get_by_type($social, $this->c_user->id)->exists();
     $this->template->set('has_access', $has_access);
     if ($has_access) {
         $page = max(1, intval(Arr::get($_GET, 'page', 1)));
         $per_page = 10;
         $keyword = Arr::get($_GET, 'keyword', 0);
         $keyword_query_str = $keyword ? '&keyword=' . $keyword : '';
         $keywords = Mention_keyword::inst()->dropdown($this->c_user->id);
         $use_dates = Arr::get($_GET, 'from') || Arr::get($_GET, 'to');
         $from = date('M j, Y', strtotime(Arr::get($_GET, 'from', 'yesterday')));
         $to = date('M j, Y', strtotime(Arr::get($_GET, 'to', 'today')));
         list($from, $to) = $this->getDatesFromRequest();
         $formatedFrom = $from->format($this->dateFormat);
         $formatedTo = $to->format($this->dateFormat);
         $dates = array('from' => $formatedFrom, 'to' => $formatedTo);
         $dates_query_str = '&from=' . urlencode($formatedFrom) . '&to=' . urlencode($formatedTo);
         $this->template->set('dates', $dates);
         $this->template->set('use_dates', $use_dates);
         $mentions = Mention::inst()->by_social($this->c_user->id, $social);
         if ($keyword) {
             $mentions->where('mention_keyword_id', $keyword);
         }
         $mentions->where('created_at >=', $from->getTimestamp())->where('created_at <=', $to->getTimestamp());
         $mentions->get_paged($page, $per_page);
         $keywords_for_highlight = Mention_keyword::inst()->get_for_highlight($this->c_user->id, intval($keyword));
         JsSettings::instance()->add(array('non_ajax_pagination' => true, 'keywords' => $keywords_for_highlight, 'keyword_query_str' => $keyword_query_str, 'keyword_query_id' => $keyword, 'dates_query_str' => $dates_query_str, 'dates' => $dates));
         CssJs::getInst()->c_js('social/activity', $social)->c_js();
         if ($social === 'facebook') {
             $profile_photo = User_additional::inst()->get_value($this->c_user->id, 'facebook_profile_photo');
             if (is_null($profile_photo)) {
                 try {
                     $this->load->library('Socializer/socializer');
                     $facebook = Socializer::factory('Facebook', $this->c_user->id);
                     $profile_picture = $facebook->get_profile_picture();
                     if (isset($profile_picture['picture']['data']['url'])) {
                         $profile_photo = $profile_picture['picture']['data']['url'];
                     }
                     if ($profile_photo) {
                         User_additional::inst()->set_value($this->c_user->id, 'facebook_profile_photo', $profile_photo);
                     }
                 } catch (Exception $e) {
                     $this->template->set('socializer_error', $e->getMessage());
                 }
             }
             $this->template->set('profile_photo', $profile_photo);
         }
         $this->template->set('keyword', $keyword);
         $this->template->set('keyword_query_str', $keyword_query_str);
         $this->template->set('keywords', $keywords);
         $this->template->set('mentions', $mentions);
     }
     $this->template->set('social', $social);
     $this->template->render();
 }
Example #13
0
 /**
  * Load config and google access token model
  */
 public function __construct()
 {
     parent::__construct($this->website_part);
     $this->piwik_settings = Api_key::build_config('piwik');
     $this->lang->load('piwik_settings', $this->language);
     JsSettings::instance()->add(['i18n' => $this->lang->load('piwik_settings', $this->language)]);
     if (!empty($this->piwik_settings['domain']) && !empty($this->piwik_settings['token'])) {
         $this->piwik = new \VisualAppeal\Piwik($this->piwik_settings['domain'], $this->piwik_settings['token'], "all");
     }
 }
Example #14
0
 /**
  * Default page - Website traffic with overall statistics and graph
  */
 public function index()
 {
     $this->_force_configure();
     JsSettings::instance()->add(array('analytics' => array('dates' => $this->dates, 'date_format' => $this->date_format, 'default_traffic_type' => 'web', 'traffic_types' => $this->ga_use->queries_types(), 'request_url' => site_url('traffic/data'))));
     CssJs::getInst()->add_js('www.google.com/jsapi', 'external', 'footer');
     CssJs::getInst()->add_js(array('libs/handlebar.js', 'libs/handlebars_helpers.js', 'libs/highcharts/highcharts.js'));
     CssJs::getInst()->c_js();
     $this->template->set('dates', $this->dates);
     $this->template->render();
 }
Example #15
0
 /**
  * Default rank page
  */
 public function index()
 {
     $this->keywords = Keyword::inst()->with_rank($this->c_user->id, $this->profile->id);
     $this->_force_configure();
     $available_periods_names = count($this->available_periods_names) > 1 ? $this->available_periods_names : array();
     JsSettings::instance()->add(array('google_rank' => array('filter_url' => site_url('rank/filter'))));
     CssJs::getInst()->add_js(array('libs/handlebar.js', 'libs/handlebars_helpers.js'))->c_js();
     $this->template->set('available_periods_names', $available_periods_names);
     $this->template->set('keywords', $this->keywords);
     $this->template->render();
 }
Example #16
0
 public function index()
 {
     if ($this->c_user->isTrialPlanEnds()) {
         $this->addFlash(lang('subscription_ends_error', [site_url('subscript/plans')]), 'error');
     }
     // UNCOMMENT TO USE
     // get average google rank for all keywords for chart in range
     $keyword_rank = Keyword::average_for_range($this->c_user->id, '-30 days', 'today');
     // average result for all the range
     $keywords_trending = Keyword::average_for_range($this->c_user->id, '-30 days', 'today', FALSE);
     // average for each day in range
     // analytics data
     $google_access_token = Access_token::getByTypeAndUserId('googlea', $this->c_user->id);
     list($ga_visits_chart, $ga_visits_count) = $google_access_token->google_analytics_dashboard_visits();
     $review = new Review();
     $last_reviews_count = $review->last_period_count($this->c_user->id, $this->profile->id);
     $review->clear();
     $social_values = Social_value::inst();
     $social_values->set_values($this->c_user->id, $this->profile->id, array('from' => date('Y-m-d', strtotime('-30 days')), 'to' => date('Y-m-d', time())));
     $all_socials_data = $social_values->get_data();
     $monthly_trending = array('reviews' => $review->last_month_trending($this->c_user->id, $this->profile->id), 'traffic' => $ga_visits_chart, 'keywords' => $keywords_trending, 'twitter_followers' => $all_socials_data['twitter'], 'facebook_likes' => $all_socials_data['facebook']);
     $keywordsForHighlight = Mention_keyword::inst()->get_for_highlight($this->c_user->id, 0);
     CssJs::getInst()->add_js('www.google.com/jsapi', 'external', 'footer');
     CssJs::getInst()->add_js(array('libs/lodash.compat.js', 'libs/highcharts/highcharts.js'))->c_js();
     $opportunities = $this->getOpportunities();
     if (!empty($opportunities['web_radar'])) {
         CssJs::getInst()->add_js('controller/webradar/index.js');
     }
     JsSettings::instance()->add(array('monthly_trending' => $monthly_trending, 'dashboard' => true, 'keywords' => $keywordsForHighlight, 'opportunities' => $opportunities));
     $summary = array('reviews' => (int) $last_reviews_count, 'fb_likes' => (int) $all_socials_data['likes_count'], 'twiter_followers' => (int) $all_socials_data['followers_count'], 'web_traffic' => (int) $ga_visits_count, 'google_rank' => (int) round($keyword_rank, 3));
     $this->isSupportScheduledPosts = $this->getAAC()->isGrantedPlan('scheduled_posts');
     $this->load->helper('my_url_helper');
     $this->template->set('isSupportScheduledPosts', $this->isSupportScheduledPosts);
     $this->template->set('socials', Social_post::getActiveSocials($this->profile->id));
     $this->is_user_set_timezone = User_timezone::is_user_set_timezone($this->c_user->id);
     JsSettings::instance()->add(array('twitterLimits' => array('maxLength' => 140, 'midLength' => 117, 'lowLength' => 94), 'twitterLimitsText' => lang('twitter_error'), 'linkedinLimits' => array('maxLength' => 400), 'linkedinLimitsText' => lang('linkedin_error')));
     CssJs::getInst()->add_css(array('custom/pick-a-color-1.css'));
     CssJs::getInst()->add_js(array('libs/jq.file-uploader/jquery.iframe-transport.js', 'libs/jq.file-uploader/jquery.fileupload.js', 'libs/fabric/fabric.min.js', 'libs/fabric/StackBlur.js', 'libs/color/tinycolor-0.9.15.min.js', 'libs/color/pick-a-color-1.2.3.min.js'));
     CssJs::getInst()->c_js('social/create', 'post_update');
     CssJs::getInst()->c_js('social/create', 'post_cron');
     CssJs::getInst()->c_js('social/create', 'post_attachment');
     CssJs::getInst()->c_js('social/create', 'social_limiter');
     CssJs::getInst()->c_js('social/create', 'schedule_block');
     CssJs::getInst()->c_js('social/create', 'bulk_upload');
     $this->template->set('is_user_set_timezone', User_timezone::is_user_set_timezone($this->c_user->id));
     $user_posts = Social_post::inst()->get_user_scheduled_posts($this->c_user->id, $this->profile->id, 1, 3, 'all');
     $this->template->set('posts', $user_posts);
     $this->load->helper('Image_designer_helper');
     $this->template->set('imageDesignerImages', Image_designer::getImages());
     $this->template->set('summary', $summary);
     $this->template->set('opportunities', $opportunities);
     $this->template->set('need_welcome_notification', User_notification::needShowNotification($this->c_user->id, User_notification::WELCOME));
     $this->template->render();
 }
Example #17
0
 public function index()
 {
     if (!$this->piwik) {
         $this->addFlash(lang('please_select_site'));
         redirect('settings/piwik');
     }
     JsSettings::instance()->add(array('analytics' => array('dates' => $this->dates, 'date_format' => $this->date_format, 'request_url' => site_url('piwik/data'))));
     CssJs::getInst()->add_js(array('libs/handlebar.js', 'libs/handlebars_helpers.js', 'libs/highcharts/highcharts.js'));
     CssJs::getInst()->c_js();
     $this->template->set('dates', $this->dates);
     $this->template->render();
 }
Example #18
0
 public function index($social = null)
 {
     $this->load->helper('clicable_links');
     /* @var Core\Service\Radar\Radar $radar */
     $radar = $this->get('core.radar');
     $this->config->load('web_radar');
     $limit = $this->config->config['mentions_limit'];
     $offset = Arr::get($_GET, 'offset', 0);
     $radar->addFilterParams(array('user_id' => $this->c_user->id, 'profile_id' => $this->profile->id))->setLimit($limit)->setOffset($offset);
     $socials = $radar->getSocials();
     if ($social && !in_array($social, $socials)) {
         $social = null;
     }
     $this->activeSocials = Access_token::inst()->get_user_socials($this->c_user->id, $this->profile->id);
     list($from, $to) = $this->getDatesFromRequest();
     if ($keyword = Arr::get($_GET, 'keyword', 0)) {
         $radar->addFilterParams(array('mention_keyword_id' => $keyword));
     }
     if ($social) {
         $radar->addFilterParams(array('social' => $social));
     }
     if ($from) {
         $radar->addFilterParams(array('from' => $from->getTimestamp()));
     }
     if ($to) {
         $radar->addFilterParams(array('to' => $to->getTimestamp()));
     }
     $mentions = $radar->getRadarMentions();
     $feed = $this->getHtmlData($mentions);
     if ($this->template->is_ajax()) {
         echo json_encode(array('html' => $feed));
         exit;
     }
     $keywordQueryStr = $keyword ? '&keyword=' . $keyword : '';
     $formatedFrom = $from->format($this->dateFormat);
     $formatedTo = $to->format($this->dateFormat);
     $dates = array('from' => $formatedFrom, 'to' => $formatedTo);
     $keywords = Mention_keyword::inst()->dropdown($this->c_user->id, $this->profile->id);
     $keywordsForHighlight = Mention_keyword::inst()->get_for_highlight($this->c_user->id, intval($keyword));
     CssJs::getInst()->add_js(array('controller/webradar/index.js', 'libs/jsUtils.min.js'));
     JsSettings::instance()->add(array('non_ajax_pagination' => true, 'keywords' => $keywordsForHighlight, 'keyword_query_id' => $keyword, 'keyword_query_str' => $keywordQueryStr, 'social' => $social, 'socials' => $socials, 'dates' => $dates));
     $this->template->set('dates', $dates);
     $this->template->set('dateRange', $diff = $from->diff($to)->format("%a"));
     $this->template->set('keyword', $keyword);
     $this->template->set('keywordQueryStr', $keywordQueryStr);
     $this->template->set('keywords', $keywords);
     $this->template->set('socials', $socials);
     $this->template->set('feed', $feed);
     $socialName = $social ? ucfirst($social) : lang('all_mentions');
     $this->template->set('social', $socialName);
     $this->template->current_view = 'social/webradar/index';
     $this->template->render();
 }
Example #19
0
 public function index()
 {
     $request = $this->getRequest();
     $limit = $this->config->config['transactions_on_page'];
     $offset = ($page = $request->query->get('page', 1)) ? ($page - 1) * $limit : '';
     $filter = $request->query->get('filter', null);
     JsSettings::instance()->add(array('filter' => $filter, 'limit' => $limit));
     $transactions = Payment_transaction::getFiltered($limit, $offset, $filter);
     $this->template->set('transactions', $transactions);
     $this->template->set('page', $page);
     $this->template->set('filter', $filter);
     $this->template->render();
 }
Example #20
0
 function __construct()
 {
     parent::__construct();
     $this->load->helper('url');
     $this->form_validation->set_error_delimiters('', '<br>');
     $this->template->layout = 'layouts/auth';
     CssJs::getInst()->add_js('libs/test.js', null, 'footer');
     //placeholder for old IE
     $this->load->library('form_validation');
     $this->load->config('manage_plans');
     $this->lang->load('auth', $this->language);
     JsSettings::instance()->add(['i18n' => $this->lang->load('auth', $this->language)]);
     $this->template->set('showHeaderLinks', false);
 }
Example #21
0
 public function index()
 {
     $this->load->helper('clicable_links');
     $radar = $this->get('core.radar');
     $this->config->load('web_radar');
     $limit = $this->config->config['mentions_limit'];
     $offset = Arr::get($_GET, 'offset', 0);
     $radar->addFilterParams(array('user_id' => $this->c_user->id))->setLimit($limit)->setOffset($offset);
     $socials = $radar->getSocials();
     $this->activeSocials = Access_token::inst()->get_user_socials($this->c_user->id, $this->profile->id);
     //$this->fbUserImageUrl = $radar->getFBUserImage($this->c_user->id);
     $from = date($this->dateFormat, strtotime(Arr::get($_GET, 'from', 'yesterday')));
     $to = date($this->dateFormat, strtotime(Arr::get($_GET, 'to', 'today')));
     list($from, $to) = $this->getDatesFromRequest();
     if ($keyword = Arr::get($_GET, 'keyword', 0)) {
         $radar->addFilterParams(array('mention_keyword_id' => $keyword));
     }
     if ($social = Arr::get($_GET, 'social', 0)) {
         $radar->addFilterParams(array('social' => $social));
     }
     if ($from) {
         $radar->addFilterParams(array('from' => $from->getTimestamp()));
     }
     if ($to) {
         $radar->addFilterParams(array('to' => $to->getTimestamp()));
     }
     $mentions = $radar->getRadarInfluencers($this->c_user->id);
     $feed = $this->getHtmlData($mentions);
     if ($this->template->is_ajax()) {
         echo json_encode(array('html' => $feed));
         exit;
     }
     $keywordQueryStr = $keyword ? '&keyword=' . $keyword : '';
     $formatedFrom = $from->format($this->dateFormat);
     $formatedTo = $to->format($this->dateFormat);
     $dates = array('from' => $formatedFrom, 'to' => $formatedTo);
     $keywords = Mention_keyword::inst()->dropdown($this->c_user->id, $this->profile->id);
     $keywordsForHighlight = Mention_keyword::inst()->get_for_highlight($this->c_user->id, intval($keyword));
     CssJs::getInst()->c_js();
     JsSettings::instance()->add(array('non_ajax_pagination' => true, 'keywords' => $keywordsForHighlight, 'keyword_query_id' => $keyword, 'keyword_query_str' => $keywordQueryStr, 'socials' => $socials, 'dates' => $dates));
     $this->template->set('dates', $dates);
     $this->template->set('keyword', $keyword);
     $this->template->set('keywordQueryStr', $keywordQueryStr);
     $this->template->set('keywords', $keywords);
     $this->template->set('socials', $socials);
     $this->template->set('feed', $feed);
     $this->template->render();
 }
Example #22
0
 public function all($directory_id)
 {
     if (empty($directory_id) || !is_numeric($directory_id)) {
         show_404();
     }
     $directory_user = Directory_User::get_user_dir($this->c_user->id, $directory_id, $this->profile->id);
     if (!$directory_user->exists()) {
         return $this->link_to_config();
     }
     JsSettings::instance()->add(array('stars' => (int) $directory_user->directory->stars));
     CssJs::getInst()->add_js(array('libs/raty/jquery.raty.min.js', 'libs/lodash.compat.js'))->c_js();
     $reviews = new Review();
     $reviews->latest_reviews_paged($directory_id, $this->c_user->id, (int) $this->input->get('page'));
     sMenu::getInst()->set_pal('reviews/' . $directory_id);
     $this->template->set('reviews', $reviews);
     $this->template->set('directory_id', $directory_id);
     $this->template->set('type', $directory_user->directory->type);
     $this->template->render();
 }
Example #23
0
 /**
  * Form with keywords list
  */
 public function index()
 {
     $this->load->config('site_config', TRUE);
     $keywords_config = $this->config->item('keywords', 'site_config');
     $keywords_count = isset($keywords_config['count']) && $keywords_config['count'] ? $keywords_config['count'] : 10;
     // get user additional info (address)
     $user_additional = User_additional::inst()->get_by_user_and_profile($this->c_user->id, $this->profile->id);
     // get available keywords
     $keywords = Keyword::inst()->get_user_keywords($this->c_user->id, $this->profile->id);
     if ($this->input->post()) {
         // validate posted address name
         $new_address_name = $this->input->post('address');
         $adress_error_string = User_additional::validate_address($this->input->post());
         // validate posted keywords
         $new_keywords_names = array_slice($this->input->post('keywords'), 0, $keywords_count);
         $keywords_errors = Keyword::validate_keywords($new_keywords_names);
         // chek for errors
         if (empty($adress_error_string) && empty($keywords_errors)) {
             $user_additional = $user_additional->update_address($this->input->post(), $this->c_user->id, $this->profile->id);
             $keywords = $keywords->update_keywords($new_keywords_names, $this->c_user->id, $this->profile->id);
             $this->addFlash(lang('keywords_saved_success'), 'success');
         } else {
             $address_name = $new_address_name;
             $keywords_names = array_slice(array_values($this->input->post('keywords')), 0, $keywords_count);
             $errors = array('keywords' => $keywords_errors, 'address' => $adress_error_string);
             $this->addFlash($errors);
         }
         redirect('settings/keywords');
     }
     // escape keywords names and website name
     $address_name = isset($address_name) ? HTML::chars($address_name) : HTML::chars($user_additional->address);
     $keywords_names = isset($keywords_names) ? HTML::chars_arr($keywords_names) : HTML::chars_arr(array_values($keywords->all_to_single_array('keyword')));
     JsSettings::instance()->add(array('autocomplete_url' => site_url('settings/keywords/google_autocomplete')));
     CssJs::getInst()->c_js();
     $this->template->set('address_id', $user_additional->address_id);
     $this->template->set('address_name', $address_name);
     $this->template->set('keywords_names', $keywords_names);
     $this->template->set('keywords_count', $keywords_count);
     $this->template->render();
 }
Example #24
0
 /**
  * - Show all accounts page, accounts loaded by ajax
  * - Save new ga profile 
  */
 public function accounts()
 {
     if (!$this->access_token->token1 or !$this->access_token->token2) {
         $this->addFlash('Please, connect your Google Analytics account.');
         redirect('settings/analytics');
     }
     if ($this->input->post()) {
         $new_profile = $this->input->post('profile');
         $account_info = Arr::extract($this->input->post(), array('account_name', 'webproperty_name', 'profile_name'));
         $this->access_token->data = serialize($account_info);
         $this->access_token->instance_id = $new_profile;
         $this->access_token->save();
         $this->addFlash('Profile saved.', 'success');
         redirect('settings/analytics');
     }
     JsSettings::instance()->add(array('analytics' => array('get_accounts_url' => site_url('settings/analytics/get_accounts'))));
     CssJs::getInst()->c_js();
     $this->template->set('account_info', $this->access_token->account_info());
     $this->template->render();
 }
Example #25
0
 public function index()
 {
     $this->form_validation->set_rules('first_name', 'First Name', 'required|xss_clean');
     $this->form_validation->set_rules('last_name', 'Last Name', 'required|xss_clean');
     if (isset($_POST) && !empty($_POST)) {
         $config = $this->config->config;
         if (!$config['change_settings']) {
             $this->addFlash('<span class="err_icon"></span>Demo version settings can\'t be changed');
         } else {
             $data = array('first_name' => $this->input->post('first_name'), 'last_name' => $this->input->post('last_name'));
             if ($this->input->post('old_password')) {
                 $old_password = $this->input->post('old_password');
                 $ion_model = new Ion_auth_model();
                 $valid_old = $ion_model->hash_password_db($this->c_user->id, $old_password);
                 $password_min = $this->config->item('min_password_length', 'ion_auth');
                 $password_max = $this->config->item('max_password_length', 'ion_auth');
                 $this->form_validation->set_rules('new_password', 'New Password', 'required|min_length[' . $password_min . ']|max_length[' . $password_max . ']|matches[confirm_password]');
                 $this->form_validation->set_rules('confirm_password', 'Confirm New Password', 'required');
                 if ($valid_old) {
                     $data['password'] = $this->input->post('new_password');
                 } else {
                     $this->form_validation->create_error('Invalid Old Password');
                 }
             }
             if ($this->form_validation->run() === TRUE) {
                 $update = $this->ion_auth->update($this->c_user->id, $data);
                 if ($update) {
                     $this->addFlash('Personal Settings Updated', 'success');
                     redirect('settings/personal');
                 } else {
                     $this->addFlash($this->ion_auth->errors());
                 }
             } else {
                 if (validation_errors()) {
                     $this->addFlash(validation_errors());
                 }
             }
         }
     }
     $this->template->set('email', $this->c_user->email);
     $this->template->set('first_name', $this->form_validation->set_value('first_name', $this->c_user->first_name));
     $this->template->set('last_name', $this->form_validation->set_value('last_name', $this->c_user->last_name));
     /*directories*/
     $directories = DM_Directory::get_all_sorted();
     $raw_dir_user = Directory_User::get_by_user($this->c_user->id);
     $user_directories = $raw_dir_user->to_dir_array();
     $is_notified = $raw_dir_user->isNotified();
     CssJs::getInst()->c_js();
     JsSettings::instance()->add(array('autocomplete_directories_url' => site_url('settings/directories/google_autocomplete')));
     $parsers = array();
     foreach ($directories as $_dir) {
         try {
             $parsers[$_dir->id] = Directory_Parser::factory($_dir->type);
         } catch (Exception $e) {
             $parsers[$_dir->id] = new stdClass();
         }
     }
     $receive_emails = $this->getAAC()->isGrantedPlan('email_notifications');
     $this->template->set('is_notified', $is_notified);
     $this->template->set('parsers', $parsers);
     $this->template->set('directories', $directories);
     $this->template->set('user_directories', $user_directories);
     $this->template->set('receive_emails', $receive_emails);
     /*end directories*/
     /*google keywords*/
     $this->load->config('site_config', TRUE);
     $keywords_config = $this->config->item('keywords', 'site_config');
     $keywords_count = isset($keywords_config['count']) && $keywords_config['count'] ? $keywords_config['count'] : 10;
     // get user additional info (address)
     $user_additional = User_additional::inst()->get_by_user_id($this->c_user->id);
     // get available keywords
     $keywords = Keyword::inst()->get_user_keywords($this->c_user->id);
     // escape keywords names and website name
     $address_name = isset($address_name) ? HTML::chars($address_name) : HTML::chars($user_additional->address);
     $keywords_names = isset($keywords_names) ? HTML::chars_arr($keywords_names) : HTML::chars_arr(array_values($keywords->all_to_single_array('keyword')));
     JsSettings::instance()->add(array('autocomplete_keywords_url' => site_url('settings/keywords/google_autocomplete')));
     CssJs::getInst()->c_js();
     $this->template->set('address_id', $user_additional->address_id);
     $this->template->set('address_name', $address_name);
     $this->template->set('keywords_names', $keywords_names);
     $this->template->set('keywords_count', $keywords_count);
     /*end google keywords*/
     /*socialmedia settings*/
     $this->load->library('Socializer/socializer');
     $this->load->config('timezones');
     CssJs::getInst()->c_js('settings/socialmedia', 'index')->c_js('settings/socialmedia', 'twitter');
     $tokens = new Access_token();
     $linkedin_data = $tokens->get_linkedin_token($this->c_user->id);
     $this->template->set('linkedin_token', $linkedin_data->id);
     $facebook_data = $tokens->get_facebook_token($this->c_user->id);
     if ($facebook_data->id) {
         try {
             $facebook = Socializer::factory('Facebook', $this->c_user->id);
             $user_facebook_pages = $facebook->get_user_pages();
             $this->template->set('fb_pages', $user_facebook_pages);
             $selected_fanpage = Facebook_Fanpage::inst()->get_selected_page($this->c_user->id);
             $this->template->set('selected_fanpage_id', $selected_fanpage->fanpage_id);
         } catch (Exception $e) {
             if ($e->getCode() !== Socializer::FBERRCODE) {
                 $this->addFlash($e->getMessage());
             }
         }
     }
     $this->template->set('facebook_token', $facebook_data->id);
     $twitter_data = $tokens->get_twitter_token($this->c_user->id);
     $this->template->set('twitter_token', $twitter_data->id);
     $youtube_data = $tokens->get_youtube_token($this->c_user->id);
     $this->template->set('youtube_token', $youtube_data->id);
     $google_data = $tokens->get_google_token($this->c_user->id);
     $this->template->set('google_token', $google_data->id);
     $instagram_data = $tokens->get_instagram_token($this->c_user->id);
     $this->template->set('instagram_token', $instagram_data->id);
     $timezones = $this->config->item('timezones');
     $this->template->set('timezones', $timezones);
     $current_timezone = User_timezone::get_user_timezone($this->c_user->id, TRUE);
     $this->template->set('current_timezone', $current_timezone);
     /*end socialmedia settings*/
     /*mention keywords*/
     $this->load->config('site_config', TRUE);
     $keywords_config = $this->config->item('mention_keywords', 'site_config');
     $config_count = isset($keywords_config['count']) && $keywords_config['count'] ? $keywords_config['count'] : 10;
     $availableKeywordsCount = $this->getAAC()->getPlanFeatureValue('brand_reputation_monitoring');
     if ($availableKeywordsCount) {
         $config_count = $availableKeywordsCount;
     }
     $keywords = Mention_keyword::inst()->get_user_keywords($this->c_user->id);
     JsSettings::instance()->add(array('max_keywords' => $config_count));
     CssJs::getInst()->add_js(array('libs/handlebar.js', 'libs/handlebars_helpers.js'));
     $this->template->set('keywords', $keywords);
     $this->template->set('config_count', $config_count);
     /*end mention keywords*/
     /*analytics*/
     $analyticsData = array();
     if ($this->session->flashdata('ga_redirect_to_accounts')) {
         if (!$this->access_token->token1 or !$this->access_token->token2) {
             $analyticsData['error'] = 'Please, connect your Google Analytics account.';
         } else {
             JsSettings::instance()->add(array('analytics' => array('get_accounts_url' => site_url('settings/analytics/get_accounts'))));
             CssJs::getInst()->c_js();
             $analyticsData['account_info'] = $this->access_token->account_info();
         }
     } else {
         JsSettings::instance()->add(array('analytics' => array('client_id' => $this->analytics_settings['client_id'], 'redirect_uri' => $this->analytics_settings['redirect_uri'])));
         CssJs::getInst()->c_js();
         $analyticsData['access_token'] = $this->access_token;
         $analyticsData['account_info'] = $this->access_token->account_info();
     }
     $this->template->set('analyticsData', $analyticsData);
     /*end analytics*/
     CssJs::getInst()->add_js('controller/settings/index.js');
     $this->template->render();
 }
Example #26
0
?>
</title>

    <link rel="shortcut icon" href="<?php 
echo base_url();
?>
favicon.png">

    <?php 
echo CssJs::getInst()->get_css();
?>
    <?php 
echo CssJs::getInst()->get_header_js();
?>
    <?php 
echo JsSettings::instance()->get_settings_string();
?>
</head>

<body>

<?php 
echo $this->template->block('_header', 'blocks/header/admin');
?>

<div class="page-wrapper">
    <div class="wrapper">
        <?php 
echo $this->template->block('_sidebar', 'blocks/sidebar/sidebar_admin');
?>
        <?php 
 public function __construct()
 {
     parent::__construct();
     $this->lang->load('admin_dashboard', $this->language);
     JsSettings::instance()->add(['i18n' => $this->lang->load('admin_dashboard', $this->language)]);
 }
Example #28
0
 /**
  * - Show all accounts page, accounts loaded by ajax
  * - Save new ga profile 
  */
 public function accounts()
 {
     if (!$this->access_token->token1 or !$this->access_token->token2) {
         $this->addFlash(lang('please_connect_error'));
         redirect('settings/analytics');
     }
     if ($this->input->post()) {
         $new_profile = $this->input->post('profile');
         $account_info = Arr::extract($this->input->post(), array('account_name', 'webproperty_name', 'profile_name'));
         $this->access_token->data = serialize($account_info);
         $this->access_token->instance_id = $new_profile;
         $this->access_token->save();
         $this->addFlash(lang('profile_saved_success'), 'success');
         redirect('settings/analytics');
     }
     JsSettings::instance()->add(array('analytics' => array('get_accounts_url' => site_url('settings/analytics/get_accounts'))));
     CssJs::getInst()->c_js();
     CssJs::getInst()->add_js(array('libs/handlebar.js', 'libs/handlebars_helpers.js'));
     $this->template->set('account_info', $this->access_token->account_info());
     $this->template->render();
 }
 public function account($managerId)
 {
     $limit = $this->config->config['users_on_page'];
     $page = !empty($_GET['page']) ? $_GET['page'] : 1;
     if ($page == 1) {
         $offset = '';
     } else {
         $offset = $limit * ($page - 1);
     }
     $users = new User($managerId);
     $search = Arr::get($_GET, 'search', '');
     $filter = Arr::get($_GET, 'filter', '');
     $group = $this->config->item('default_group', 'ion_auth');
     if ($filter != '' || $search) {
         $users->search($search, $filter, null, $limit, $offset, $managerId);
         JsSettings::instance()->add(array('search' => $search, 'filter' => $filter, 'group' => $group));
         $searchList = true;
     } else {
         $users->getManagerUsers($limit, $offset);
         $searchList = false;
     }
     $groupId = $this->ion_auth->getGroupByName($group)->id;
     $members = $this->ion_auth->getUsersByGroup($group);
     if ($members) {
         $members = $members->getFreeUsersDropdown($managerId, $groupId);
     }
     $limit = $this->config->config['users_on_page'];
     $this->template->set('searchList', $searchList);
     $this->template->set('limit', $limit);
     $this->template->set('users', $users);
     $this->template->set('freeusers', $members);
     $this->template->set('page', $page);
     $this->template->set('c_user', $this->c_user);
     $this->template->set('group', $group);
     $this->template->set('managerAccount', $managerId);
     $this->template->render();
 }
Example #30
0
 public function __construct()
 {
     parent::__construct();
     $this->lang->load('profiles_settings', $this->language);
     JsSettings::instance()->add(['i18n' => $this->lang->load('profiles_settings', $this->language)]);
 }