Cahier des charges – organisation du congrès de la SFPT

0

// The general information at the top of each file/*** @version 5.0.4 Release for Joomla 2.5* @package Joomla* @copyright Copyright (C) 2005 – 2012 Open Source Matters, Inc. All rights reserved.* @license GNU General Public License, see LICENSE.php*/ // No direct access allowed to this filedefined( ‘_JEXEC’ ) or die( ‘Restricted access’ ); // Import Joomla! Plugin library filejimport(‘joomla.plugin.plugin’);// import WeblinksHelperRouterequire_once JPATH_ROOT.’/components/com_weblinks/helpers/route.php’;//The Content plugin AllWeblinksclass plgContentAllWeblinks extends JPlugin{ // plugin parameters // _plgContentAllWeblinksReplace will set the values; protected $days_new; protected $txt_new; protected $days_mod; protected $txt_mod; protected $lengthoftitle; protected $orderby; protected $Corderby; protected $linkcount; protected $displayemptycat; // These params can also be overridden in the commmandline protected $real_url; protected $show_title; protected $show_new; protected $show_mod; protected $show_hits; protected $new_window; protected $moduleclass_sfx; protected $num_ccols; protected $num_cols; protected $layout; protected $display_ctitle; protected $show_cdate; protected $show_ldate; protected $show_author; protected $display_cdescription; protected $display_ldescription; protected $DEBUG = 0; protected $exclude_id = 0; function plgContentAllWeblinks( &$subject, $params ) { parent::__construct( $subject, $params ); } /** * Plugin that loads module positions within content */ // onPrepareContent, meaning the plugin is rendered at the first stage in preparing content for output public function onContentPrepare($context, &$article, &$params, $limitstart) { // simple performance check to determine whether bot should process further if ( JString::strpos( $article->text, ‘all_weblinks’ ) === false ) { return true; } // Don’t repeat the CSS for each instance of this bot in a page! static $included_allweblinks_css; if (!$included_allweblinks_css) { $document = JFactory::getDocument(); $url = ‘plugins/content/allweblinks/allweblinks/includes/css/allweblinks.css’; $document->addStyleSheet($url); $document->addCustomTag( ” ); $included_allweblinks_css = 1; } global $mainframe; // A database connection is created $db = JFactory::getDBO(); // expression to search for $regex = “#{all_weblinks\s*(.*?)}(.*?){/all_weblinks}#s”; // Get plugin info // check whether plugin has been unpublished if ( !$this->params->get( ‘enabled’, 1 ) ) { $article->text = preg_replace( $regex, ”, $article->text ); return true; } // find all instances of plugin and put in $matches preg_match_all( $regex, $article->text, $matches ); // Number of plugins $count = count( $matches[0] ); // plugin only processes if there are any instances of the plugin in the text if ( $count ) { $this->_process( $article, $matches, $count, $regex, $params); } // No return value } // The proccessing function protected function _process( &$article, &$matches, $count, $regex, $params ) { // Get the links for every occurence of all_weblinks for ( $i=0; $i < $count; $i++ ) { $load = str_replace( ‘all_weblinks’, ”, $matches[0][$i] ); $load = str_replace( ‘{‘, ”, $load ); $load = str_replace( ‘}’, ”, $load ); $load = trim( $load ); $this->_plgContentAllWeblinksReplace($article, $matches, $i, $count, $regex, $params ) ; } } protected function _plgContentAllWeblinksReplace(&$article, &$matches, $i, $count, $regex, $params) { // Get plugin parameters $param_line = $matches[1][$i]; $catids = trim($matches[2][$i]); $this->days_new = $this->params->def(‘Ldaysnew’); $this->txt_new = $this->params->def(‘Ltxtnew’); $this->days_mod = $this->params->def(‘Ldaysmod’); $this->txt_mod = $this- >params->def(‘Ltxtmod’); $this->lengthoftitle = $this->params->def(‘Llengthoftitle’, 30); $this->orderby = $this->params->def( ‘Lorder’, ‘created DESC’); $this->Corderby = $this->params->def( ‘LCorder’, ‘a.catid’); $this->linkcount = $this->params->def( ‘Lcatlinks’, 999); $this->displayemptycat = $this->params->def( ‘Ldisplayemptycat’, 0); // These params can also be overridden in the commmandline $this->real_url = $this->_params($param_line, ‘real_url’, $this->params->def(‘Lrealurl’)); $this->show_title = $this->_params($param_line, ‘show_title’, $this->params->def(‘Lshowtitle’)); $this->show_new = $this->_params($param_line, ‘show_new’, $this->params->def(‘Lshownew’)); $this->show_mod = $this->_params($param_line, ‘show_mod’, $this->params->def(‘Lshowmod’)); $this->show_hits = $this->_params($param_line, ‘show_hits’, $this->params->def(‘Lshowhits’)); $this->new_window = $this->_params($param_line, ‘new_window’, $this->params->def(‘Lpopuplinks’)); $this->nofollow = $this->_params($param_line, ‘nofollow’, $this->params->def(‘Lnofollowlinks’)); $this->moduleclass_sfx = $this->_params($param_line, ‘moduleclass_sfx’, $this->params->def(‘moduleclass_sfx’)); $this->num_cols = $this->_params($param_line, ‘num_cols’, $this->params->def(‘Lnumcols’)); $this->num_ccols = $this->_params($param_line, ‘num_ccols’, $this->params->def(‘Lnumccols’)); $this->layout = $this->_params($param_line, ‘layout’, $this->params->def(‘Llayout’)); $this->enablepaging = $this->_params($param_line, ‘enablepaging’, $this->params->def(‘Lenablepaging’)); $this->display_ctitle = $this->_params($param_line, ‘display_ctitle’,$this->params->def(‘Lshowheader’)); $this->show_cdate = $this->_params($param_line, ‘show_cdate’,$this->params->def(‘Lshowcdate’)); $this->show_ldate = $this->_params($param_line, ‘show_ldate’,$this->params->def(‘Lshowldate’)); $this->show_author = $this->_params($param_line, ‘show_author’,$this->params->def(‘Lshowauthor’)); $this->display_cdescription = $this->_params($param_line, ‘display_cdescription’,$this->params->def(‘Ldisplaycdescription’)); $this->display_ldescription = $this->_params($param_line, ‘display_ldescription’,$this->params->def(‘Ldisplayldescription’)); // These params can ONLY be set in the commmandline $this->DEBUG = $this->_params($param_line, ‘DEBUG’, ‘0’); $this->exclude_id = $this->_params($param_line, ‘exclude_id’, ‘0’); //$this->DEBUG=1; switch ($this->layout) { case 0 : $llayout=””; break; case 1 : $llayout=” col”; break; case 2 : $llayout=” blocks”; break; case 3 : $llayout=”pages”; break; case 4 : $llayout=”sliders”; $this->display_ctitle = 0 ;//disable category titles break; case 5 : $llayout=”tabs”; $this->display_ctitle = 0 ;//disable category titles break; default: // if a wrong layout is choosen reset to 0 $llayout=””; $this->layout=0; } $replace =””; // count Categories !isset($GLOBALS[‘all_weblinks’]) ? $GLOBALS[‘all_weblinks’] = 1 : $GLOBALS[‘all_weblinks’]++; # DEBUG if requested by specifing DEBUG=[1] if ($this->DEBUG) $replace .= “

### DEBUG plugin-parameters:

  • days_new=[$this->days_new]
  • txt_new=[$this->txt_new]
  • show_title=[$this->show_title]
  • show_new=[$this->show_new]
  • days_mod=[$this->days_mod]
  • txt_mod=[$this->txt_mod]
  • show_mod=[$this->show_mod]
  • displayemptycat=[$this->displayemptycat]
  • new_window=[$this->new_window]
  • nofollow=[$this->nofollow]
  • show_hits=[$this->show_hits]
  • display_ctitle=[$this->display_ctitle]
  • show_cdate=[$this->show_cdate]
  • show_ldate=[$this->show_ldate]
  • show_author=[$this->show_author]
  • lengthoftitle=[$this->lengthoftitle]
  • display_cdescription=[$this->display_cdescription]
  • display_ldescription=[$this->display_ldescription]
  • number of category columns=[$this->num_ccols]
  • number of link columns=[$this->num_cols]
  • orderby=[$this->orderby]
  • Corderby=[$this->Corderby]
  • linkcount=[$this->linkcount]
  • exclude_id=[$this->exclude_id]
  • catids=[$catids]
  • layout=[$this->layout]
  • enablepaging=[$this->enablepaging]

### DEBUG END ###”; # Initialize and clear the content from other modules if ($this->moduleclass_sfx==” && $this->layoutmoduleclass_sfx = $llayout; // Start of weblinks output $replace .= “\n