public function __construct($data) { /* Reçois la zone dans laquelle le widget est appellé, voir clé ['widgets']['requestedZone'] : (LEFT, RIGHT, BOTTOM). */ $this->instance = get_instance(); $this->data = $data; $this->theme = get_core_vars('active_theme_object'); $this->location = MODULES_DIR . $this->data['currentWidget']['WIDGET_MODULE']['encrypted_dir']; if (!class_exists('News_smart')) { include_once $this->location . '/library.php'; } $this->news = new News_smart(); // Dans le cas ou aucune limite n'est fixé nous fixon la limite par défaut à 5 commentaires. $LIMIT = $this->data['currentWidget']['WIDGET_INFO']['WIDGET_PARAMETERS'] == '' ? 5 : $this->data['currentWidget']['WIDGET_INFO']['WIDGET_PARAMETERS']; // Utilisation de la limite fixée $this->data['getTotalKeyWords'] = $this->news->getAllPopularKeyWords($LIMIT); // Recupération du contrôleur attaché au module. $controler = $this->instance->tendoo->getControllersAttachedToModule('blogster'); $tags = array(); foreach ($this->data['getTotalKeyWords'] as $gtk) { $tags[] = array('link' => $this->instance->url->site_url(array($controler[0]['PAGE_CNAME'], 'tags', $gtk['URL_TITLE'])), 'text' => $gtk['TITLE']); } if (in_array($this->data['widgets']['requestedZone'], array('LEFT', 'BOTTOM', 'RIGHT'))) { $widget_title = $this->data['currentWidget']['WIDGET_INFO']['WIDGET_TITLE']; $rZone = $this->data['widgets']['requestedZone']; // requestedZone set_widget(strtolower($rZone), $widget_title, $tags, 'tags'); } }
public function __construct($data) { $this->instance = get_instance(); $this->data =& $data; $this->theme = get_core_vars('active_theme_object'); $this->location = MODULES_DIR . $this->data['currentWidget']['WIDGET_MODULE']['encrypted_dir']; if (!class_exists('News_smart')) { include_once $this->location . '/library.php'; } $this->news = new News_smart(); $setting = $this->news->getBlogsterSetting(); // if (!(bool) $this->data['currentWidget']['WIDGET_INFO']['IS_CODE']) { $LIMIT = $this->data['currentWidget']['WIDGET_INFO']['WIDGET_PARAMETERS'] == '' ? 5 : $this->data['currentWidget']['WIDGET_INFO']['WIDGET_PARAMETERS']; } else { } //eval($LIMIT) $this->data['ttCat'] = $this->news->getCatForWidgets(0, $LIMIT); $controller = $this->instance->tendoo->getControllersAttachedToModule($this->data['currentWidget']['WIDGET_MODULE']['namespace']); $final_array = array(); foreach ($this->data['ttCat'] as $t) { $final_array[] = array('text' => $t['CATEGORY_NAME'] . ' (' . $t['TOTAL_ARTICLES'] . ')', 'link' => $this->instance->url->site_url(array($controller[0]['PAGE_CNAME'])) . '/categorie/' . $t['URL_TITLE']); } $widget_title = $this->data['currentWidget']['WIDGET_INFO']['WIDGET_TITLE']; // For Each Zone if (in_array($this->data['widgets']['requestedZone'], array('LEFT', 'BOTTOM', 'RIGHT'))) { $widget_title = $this->data['currentWidget']['WIDGET_INFO']['WIDGET_TITLE']; $zone = $this->data['widgets']['requestedZone']; // requestedZone set_widget(strtolower($zone), $widget_title, $final_array, 'categories'); } }
public function __construct($data) { $this->instance = get_instance(); $this->data =& $data; $this->theme = get_core_vars('active_theme_object'); $this->location = MODULES_DIR . $this->data['currentWidget']['WIDGET_MODULE']['encrypted_dir']; if (!class_exists('News_smart')) { include_once $this->location . '/library.php'; } // var_dump($this->data['currentWidget']); $this->news = new News_smart(); $setting = $this->news->getBlogsterSetting(); // var_dump($this->data['currentWidget']['WIDGET_INFO']['WIDGET_PARAMETERS']); $LIMIT = $this->data['currentWidget']['WIDGET_INFO']['WIDGET_PARAMETERS']; $this->data['mostViewed'] = $this->news->getMostViewed(0, $LIMIT); $end = '<ul>'; $controller = $this->instance->tendoo->getControllersAttachedToModule($this->data['currentWidget']['WIDGET_MODULE']['namespace']); // var_dump( $this->data['currentWidget']['WIDGET_MODULE'] ); // var_dump( $controller ); foreach ($this->data['mostViewed'] as $t) { $end .= '<li><a href="' . $this->instance->url->site_url(array($controller[0]['PAGE_CNAME'])) . '/lecture/' . $t['URL_TITLE'] . '">' . $t['TITLE'] . '</a></li>'; } $end .= '</ul>'; // For Zones if (in_array($this->data['widgets']['requestedZone'], array('LEFT', 'BOTTOM', 'RIGHT'))) { $widget_title = $this->data['currentWidget']['WIDGET_INFO']['WIDGET_TITLE']; $zone = $this->data['widgets']['requestedZone']; // requestedZone set_widget(strtolower($zone), $widget_title, $end, 'text'); } }
public function __construct($data) { $this->instance = get_instance(); $this->data =& $data; $this->theme = get_core_vars('active_theme_object'); $this->location = MODULES_DIR . $this->data['currentWidget']['WIDGET_MODULE']['encrypted_dir']; if (!class_exists('News_smart')) { include_once $this->location . '/library.php'; } $this->news = new News_smart(); $this->data['mostViewed'] = $this->news->getMostViewed(0, 10); $end = '<ul>'; if ($this->instance->users_global->isConnected()) { $this->instance->load->library('tendoo_admin'); if ($this->instance->users_global->isAdmin()) { $priv = $this->instance->users_global->current('REF_ROLE_ID'); if ($this->instance->users_global->isSuperAdmin()) { $end .= '<li><a href="' . $this->instance->url->site_url(array('admin', 'modules')) . '">Liste des modules</a></li>'; $end .= '<li><a href="' . $this->instance->url->site_url(array('admin', 'setting')) . '">Paramètres</a></li>'; $end .= '<li><a href="' . $this->instance->url->site_url(array('admin', 'system', 'manage_actions')) . '">Gestion d\'actions</a></li>'; $end .= '<li><a href="' . $this->instance->url->site_url(array('admin', 'installer')) . '">Installer une application</a></li>'; } else { if (!$this->instance->tendoo_admin->is_public_role($priv)) { $end .= '<li><a href="' . $this->instance->url->site_url(array('admin')) . '">Espace administration</a></li>'; } } } $end .= '<li><a href="' . $this->instance->url->site_url(array('account')) . '">Mon profil</a></li>'; $end .= '<li><a href="' . $this->instance->url->site_url(array('account', 'messaging', 'home')) . '">Ma messagerie</a></li>'; } else { $options = get_meta('all'); if (riake('allow_registration', $options) == '1') { $end .= '<li><a href="' . $this->instance->url->site_url(array('registration')) . '">Inscription</a></li>'; } $end .= '<li><a href="' . $this->instance->url->site_url(array('login')) . '">Connexion</a></li>'; } $end .= '</ul>'; // For Zones if (in_array($this->data['widgets']['requestedZone'], array('LEFT', 'BOTTOM', 'RIGHT'))) { $widget_title = $this->data['currentWidget']['WIDGET_INFO']['WIDGET_TITLE']; $zone = $this->data['widgets']['requestedZone']; // requestedZone set_widget(strtolower($zone), $widget_title, $end, 'text'); } }
public function __construct($data) { /* Reçois la zone dans laquelle le widget est appellé, voir clé ['widgets']['requestedZone'] : (LEFT, RIGHT, BOTTOM). */ $this->instance = get_instance(); $this->data =& $data; $this->theme = get_core_vars('active_theme_object'); $this->location = MODULES_DIR . $this->data['currentWidget']['WIDGET_MODULE']['encrypted_dir']; if (!class_exists('News_smart')) { include_once $this->location . '/library.php'; } $this->news = new News_smart(); $setting = $this->news->getBlogsterSetting(); // Dans le cas ou aucune limite n'est fixé nous fixon la limite par défaut à 5 commentaires. $LIMIT = $this->data['currentWidget']['WIDGET_INFO']['WIDGET_PARAMETERS'] == '' ? 5 : $this->data['currentWidget']['WIDGET_INFO']['WIDGET_PARAMETERS']; $this->data['comments'] = $this->news->getComments(false, 0, $LIMIT, 'desc'); $controler = $this->instance->tendoo->getControllersAttachedToModule('news'); $end = '<ul>'; foreach ($this->data['comments'] as $c) { $user = $this->instance->users_global->getUser($c['AUTEUR']); $article = $this->news->getSpeNews($c['REF_ART']); if ($article) { if ($user) { $end .= ' <a href="' . $this->instance->url->site_url(array('account', 'profile', $user['PSEUDO'])) . '">' . $user['PSEUDO'] . '</a> dit : "' . word_limiter($c['CONTENT'], 10) . '" dans <a href="' . $this->instance->url->main_url() . 'index.php/' . $controler[0]['PAGE_CNAME'] . '/lecture/' . $article[0]['URL_TITLE'] . '">' . $article[0]['TITLE'] . '</a><br><br>'; } else { $offlineUser = $c['OFFLINE_AUTEUR'] != '' ? $c['OFFLINE_AUTEUR'] : 'Utilisateur inconnu'; $end .= ' <a href="#">' . $offlineUser . '</a> dit : "' . word_limiter($c['CONTENT'], 10) . '" dans <a href="' . $this->instance->url->main_url() . 'index.php/' . $controler[0]['PAGE_CNAME'] . '/lecture/' . $article[0]['URL_TITLE'] . '">' . $article[0]['TITLE'] . '</a><br><br>'; } } } $end .= '</ul>'; if (in_array($this->data['widgets']['requestedZone'], array('LEFT', 'BOTTOM', 'RIGHT'))) { $widget_title = $this->data['currentWidget']['WIDGET_INFO']['WIDGET_TITLE']; $zone = $this->data['widgets']['requestedZone']; // requestedZone set_widget(strtolower($zone), $widget_title, $end, 'text'); } }
public function before_frontend() { $this->instance = get_instance(); $this->data = array(); $this->tendoo =& $this->instance->tendoo; module_include('library.php', 'tendoo_widget_administrator'); $this->lib = new widhandler_common($this->data); $this->data['widgetHandler'] =& $this->lib; $this->data['getRightWidget'] = $this->lib->getWidgets('RIGHT'); // var_dump($this->data['getRightWidget']); foreach ($this->data['getRightWidget'] as $w) { // Get System Widget if (strtolower($w['WIDGET_MODNAMESPACE']) == 'system') { if ($w['WIDGET_NAMESPACE'] == 'texte') { set_widget("right", $w['WIDGET_TITLE'], $w['WIDGET_PARAMETERS'], "text"); } } else { $module = get_modules('filter_active_namespace', $w['WIDGET_MODNAMESPACE']); $configFile = MODULES_DIR . $module['encrypted_dir'] . '/config/widget_config.php'; $path = MODULES_DIR . $module['encrypted_dir'] . '/'; // Chemin d'accès if (is_file($configFile)) { include_once $configFile; // Intégration des fichiers testé if (array_key_exists($w['WIDGET_NAMESPACE'], $WIDGET_CONFIG)) { $WIDGET_CONFIG[$w['WIDGET_NAMESPACE']]['WIDGET_MODULE'] =& $module; // AJoute le module concerné au widget $WIDGET_CONFIG[$w['WIDGET_NAMESPACE']]['WIDGET_INFO'] =& $w; // Ajoute les informations spécifies par l'utilisatuer $this->data['currentWidget'] =& $WIDGET_CONFIG[$w['WIDGET_NAMESPACE']]; // Ajoute les informations sur widget au super tablea $this->data, qui sera utilisé plus tard. $this->data['widgets']['requestedZone'] = 'RIGHT'; // Set Requested Zone include_once $path . $WIDGET_CONFIG[$w['WIDGET_NAMESPACE']]['WIDGET_FILES']; // Include widget controller; $w_output = $this->instance->tendoo->interpreter($w['WIDGET_NAMESPACE'] . '_' . $w['WIDGET_MODNAMESPACE'] . '_common_widget', 'index', array(), $this->data); } } else { $this->instance->notice->push_notice('<strong>Une erreur s\'est produite durant le chargement des widgets'); } } } // Bottom widgets $this->data['getBottomWidget'] = $this->lib->getWidgets('BOTTOM'); // var_dump($this->data['getRightWidget']); foreach ($this->data['getBottomWidget'] as $w) { if (strtolower($w['WIDGET_MODNAMESPACE']) == 'system') { if ($w['WIDGET_NAMESPACE'] == 'texte') { set_widget("bottom", $w['WIDGET_TITLE'], $w['WIDGET_PARAMETERS'], "text"); } } else { $module = get_modules('filter_active_namespace', $w['WIDGET_MODNAMESPACE']); $configFile = MODULES_DIR . $module['encrypted_dir'] . '/config/widget_config.php'; $path = MODULES_DIR . $module['encrypted_dir'] . '/'; // Chemin d'accès if (is_file($configFile)) { include_once $configFile; // Intégration des fichiers testé if (array_key_exists($w['WIDGET_NAMESPACE'], $WIDGET_CONFIG)) { $WIDGET_CONFIG[$w['WIDGET_NAMESPACE']]['WIDGET_MODULE'] =& $module; // AJoute le module concerné au widget $WIDGET_CONFIG[$w['WIDGET_NAMESPACE']]['WIDGET_INFO'] =& $w; // Ajoute les informations spécifies par l'utilisatuer $this->data['currentWidget'] =& $WIDGET_CONFIG[$w['WIDGET_NAMESPACE']]; // Ajoute les informations sur widget au super tablea $this->data, qui sera utilisé plus tard. $this->data['widgets']['requestedZone'] = 'BOTTOM'; // Set Requested Zone include_once $path . $WIDGET_CONFIG[$w['WIDGET_NAMESPACE']]['WIDGET_FILES']; // Include widget controller; $w_output = $this->instance->tendoo->interpreter($w['WIDGET_NAMESPACE'] . '_' . $w['WIDGET_MODNAMESPACE'] . '_common_widget', 'index', array(), $this->data); } } else { $this->instance->notice->push_notice('<strong>Une erreur s\'est produite durant le chargement des widgets'); } } } // End Bootom widgets $this->data['getLeftWidget'] = $this->lib->getWidgets('LEFT'); foreach ($this->data['getLeftWidget'] as $w) { if (strtolower($w['WIDGET_MODNAMESPACE']) == 'system') { if ($w['WIDGET_NAMESPACE'] == 'texte') { set_widget("left", $w['WIDGET_TITLE'], $w['WIDGET_PARAMETERS'], "text"); } } else { $module = get_modules('filter_active_namespace', $w['WIDGET_MODNAMESPACE']); $configFile = MODULES_DIR . $module['encrypted_dir'] . '/config/widget_config.php'; $path = MODULES_DIR . $module['encrypted_dir'] . '/'; // Chemin d'accès if (is_file($configFile)) { include_once $configFile; // Intégration des fichiers testé if (array_key_exists($w['WIDGET_NAMESPACE'], $WIDGET_CONFIG)) { $WIDGET_CONFIG[$w['WIDGET_NAMESPACE']]['WIDGET_MODULE'] =& $module; // AJoute le module concerné au widget $WIDGET_CONFIG[$w['WIDGET_NAMESPACE']]['WIDGET_INFO'] =& $w; // Ajoute les informations spécifies par l'utilisatuer $this->data['currentWidget'] =& $WIDGET_CONFIG[$w['WIDGET_NAMESPACE']]; // Ajoute les informations sur widget au super tablea $this->data, qui sera utilisé plus tard. $this->data['widgets']['requestedZone'] = 'LEFT'; // Set Requested Zone include_once $path . $WIDGET_CONFIG[$w['WIDGET_NAMESPACE']]['WIDGET_FILES']; // Include widget controller; $w_output = $this->instance->tendoo->interpreter($w['WIDGET_NAMESPACE'] . '_' . $w['WIDGET_MODNAMESPACE'] . '_common_widget', 'index', array(), $this->data); } } else { $this->instance->notice->push_notice('<strong>Une erreur s\'est produite durant le chargement des widgets'); } } } }