Example #1
0
 /**
  * Public timeline
  *
  * @access public
  */
 public function public_timeline()
 {
     $this->data['page_title'] = ucwords($this->config->item('public_timeline'));
     $pt = $this->Message->getPublicTimeline();
     $this->data['messages'] = Page::make('Message', $pt);
     $this->data['profile'] = $this->userData;
     $this->data['homeMenu'] = true;
     $this->load->view('messages/public_timeline', $this->data);
 }
Example #2
0
<?php

$options = Page::make('options', 'Configuration SLHB')->set(['capability' => 'manage_options', 'icon' => 'dashicons-hammer', 'position' => 50, 'tabs' => true]);
// Partenaires Section
$sections[] = Section::make('section-slhb-options', 'Paramètres généraux');
$options->addSections($sections);
$settings['section-slhb-options'] = [Field::collection('logos', ['title' => 'Logos des partenaires']), Field::text('facebook_url', ['title' => 'Url Facebook']), Field::text('gmap_url', ['title' => 'Url vers la page de contact', 'default' => '/infos-utiles'])];
$options->addSettings($settings);
Example #3
0
 /**
  * View a group
  *
  * @todo Change that bad hand-off of user data
  * @access public
  * @param string $name	
  */
 public function view($groupname = null, $replyTo = null)
 {
     $group = $this->Group->getByName($groupname);
     if (!$group) {
         $this->redirect("/groups");
     }
     $this->data['page_title'] = ucwords($group['fullname']);
     $this->setReplyTo($replyTo);
     if (isset($this->data['User'])) {
         $user = $this->data['User'];
     } else {
         $user = array();
     }
     $this->data['group'] = $group;
     $this->data['group']['groupname'] = $group['name'];
     $this->data['group']['is_owner'] = $this->Group->isOwner($this->userData['id'], $group['owner_id']);
     $this->data['group']['member_count'] = count($group['members']);
     $this->data['group']['im_a_member'] = $this->Group->isMember($group['members'], $this->userData['id']);
     $this->data['embedchat'] = $this->embedChat($group);
     echo $this->data['embedchat'];
     if ($this->data['group']['im_a_member']) {
         if ($this->userData['threading']) {
             $messages = $this->data['group']['messages_threaded'];
         } else {
             $messages = $this->data['group']['messages'];
         }
         rsort($messages);
     } else {
         $messages = $this->data['group']['mentions'];
     }
     $this->data['messages'] = Page::make('Message', $messages);
     if ($this->data['group']['member_count'] > 0) {
         $this->User->updateReadGroup($this->userData, $group);
         $this->data['redirect'] = $this->getRedirect(true, '/group/' . $group['name']);
         $this->load->view('groups/view', $this->data);
     } else {
         $this->redirect('/groups');
     }
 }
Example #4
0
<?php

$page = Page::make('theme-option', 'Option du theme')->set();
$sections = [Section::make('theme-option-general', __('General', THEME_TEXT_DOMAIN)), Section::make('theme-option-info', __("Society Information", THEME_TEXT_DOMAIN)), Section::make('theme-option-social', __("Social Network", THEME_TEXT_DOMAIN)), Section::make('theme-option-custom-code', __('Code', THEME_TEXT_DOMAIN)), Section::make('theme-option-analytic', __('Analytics', THEME_TEXT_DOMAIN)), Section::make('theme-option-image', __('Default Images', THEME_TEXT_DOMAIN))];
$settings = ['theme-option-general' => [Field::text('name', ['title' => __('Name', THEME_TEXT_DOMAIN)]), Field::text('separator', ['title' => __('Title separator', THEME_TEXT_DOMAIN), 'default' => '-']), Field::select('seplocation', [['right' => __("Right", THEME_TEXT_DOMAIN), 'left' => __("Left", THEME_TEXT_DOMAIN)]], ['title' => __("Title separator emplacement", THEME_TEXT_DOMAIN), 'default' => 'right']), Field::checkbox('showAuthor', ['activate' => 'Afficher l\'auteur'])], 'theme-option-custom-code' => [Field::textarea('javascript', ['title' => __('Javascript', THEME_TEXT_DOMAIN)], ['id' => 'javascript-editor', "class" => "hidden"]), Field::textarea('style', ['title' => __('Style', THEME_TEXT_DOMAIN)], ['id' => 'style-editor', "class" => "hidden"])], 'theme-option-info' => [Field::text('name', ['title' => __('Name', THEME_TEXT_DOMAIN)]), Field::textarea('biography', ['title' => __('Biography', THEME_TEXT_DOMAIN)]), Field::text('address', ['title' => __('Address', THEME_TEXT_DOMAIN)]), Field::text('phoneNumberPrimary', ['title' => __('Phone Number', THEME_TEXT_DOMAIN)], ['type' => 'tel']), Field::text('phoneNumberSecondary', ['title' => __('Phone Number', THEME_TEXT_DOMAIN)], ['type' => 'tel']), Field::text('emailPrimary', ['title' => __('Phone Number', THEME_TEXT_DOMAIN)], ['type' => 'email']), Field::text('emailSecondary', ['title' => __('Phone Number', THEME_TEXT_DOMAIN)], ['type' => 'email'])], 'theme-option-analytic' => [], 'theme-option-social' => [Field::text('facebook', ['title' => 'Facebook'], ['type' => 'url']), Field::text('twitter', ['title' => 'Twitter'], ['type' => 'url']), Field::text('google-plus', ['title' => 'Google plus'], ['type' => 'url']), Field::text('linkedin', ['title' => 'linkedIn'], ['type' => 'url']), Field::text('youtube', ['title' => 'YouTube'], ['type' => 'url']), Field::text('vkontakte', ['title' => 'Vkontakte'], ['type' => 'url']), Field::text('instagram', ['title' => 'Instagram'], ['type' => 'url']), Field::text('rss', ['title' => 'Feed'])], 'theme-option-image' => [Field::media('favicon', ['title' => __("Favicon", THEME_TEXT_DOMAIN)]), Field::media('logo', ['title' => __("Logo", THEME_TEXT_DOMAIN)])]];
$validation = ['name' => ['min:3', 'textfield'], 'facebook' => ['url'], 'twitter' => ['url'], 'google-plus' => ['url'], 'linkedin' => ['url'], 'youtube' => ['url'], 'vkontakte' => ['url'], 'Instagram' => ['url'], 'rss' => ['url']];
$page->addSections($sections);
$page->addSettings($settings);
$page->validate($validation);
Example #5
0
 /**
  * View a users public page
  *
  * @access public
  * @param string $username
  */
 public function view($username = null)
 {
     $user = $this->User->getByUsername($username);
     $this->sidebar = "users/userprofile";
     if (!$user) {
         $this->show404();
     }
     $this->data['page_title'] = ucwords($user['realname']);
     $this->load->loadHelper('Html');
     $this->data['page_title'] = $this->load->passData['html']->name($user);
     $this->data['view_user'] = $user;
     $this->data['username'] = $user['username'];
     $this->data['profile'] = $user;
     $this->isProfile = true;
     $this->data['isLocked'] = $this->User->isLocked($user, $this->userData);
     $this->data['friend_status'] = $this->User->getFriendStatus($user, $this->userData);
     if (!$this->data['isLocked']) {
         $this->Message->threaded = false;
         //force threading
         $this->data['messages'] = Page::make('Message', $user['public']);
     }
     //if a user is locked, don't show rss. Doesn't matter what the relationship is
     $this->data['rss_updates'] = !$user['locked'];
     $this->load->view('users/view', $this->data);
 }