예제 #1
0
 /**
  * Singleton accessor
  */
 function &getInstance()
 {
     static $instance;
     if (!is_object($instance)) {
         $instance = new mosHtmlHelper();
         $lang = mamboCore::get('current_language');
         $instance->charset = $lang->charset;
         if (mamboCore::is_set('mosConfig_doctype')) {
             $instance->doctype = mamboCore::get('mosConfig_doctype');
         }
         $instance->loadHeadTags();
     }
     return $instance;
 }
예제 #2
0
 /**
  * Constructor
  */
 function mosMambotHandler()
 {
     $my = mamboCore::is_set('currentUser') ? mamboCore::get('currentUser') : null;
     $gid = $my ? $my->gid : 0;
     $this->_events = array();
     $database =& mamboDatabase::getInstance();
     $database->setQuery("SELECT folder, element, published, params, CONCAT_WS('/',folder,element) AS lookup" . "\nFROM #__mambots" . "\nWHERE published >= 1 AND access <= {$gid}" . "\nORDER BY ordering");
     $this->_bots = $database->loadObjectList();
     if (!$this->_bots) {
         $this->_bots = array();
     }
 }
예제 #3
0
파일: sef.php 프로젝트: jwest00724/mambo
 function mosSEF()
 {
     /*******************************************************************************
      **  The following are parameters for the ReMOSef Search Engine
      **  Optimisation component.  $this->SEF_SPACE should be set to the
      **  character that is to replace blanks in names that form the URL.
      **  You can vary this, although the only sensible choices seem to be
      **  underscore or hyphen (_ or -).
      **
      **  The arrays $this->custom_code and $this->custom_name must be kept exactly
      **  in step with each other.  $this->custom_code is a list of the components
      **  that are to be handled by ReMOSef.
      **
      **  The array $this->custom_name is the alternative name that will be used
      **  in the optimised URL to identify the component and can be whatever
      **  you please so long as it is unique and legal for a URL.  Apart from
      **  using the custom name for the component, ReMOSef will do no further
      **  translation of the URL than is done by the standard Mambo SEF - UNLESS
      **  there is a sef_ext.php file installed for that component.  The
      **  exception to this is ReMOSitory - the optimisation code for Remository
      **  is integrated in ReMOSef.  For other components, if a sef_ext.php is
      **  present, it will be invoked by ReMOSef.
      **
      **  The array $remosef_content_task is capable of translating the tasks
      **  understood by the Mambo content component.  Please DO NOT CHANGE what
      **  is to the left of the equals sign.  When putting different values on
      **  the right hand side, remember that they must all be different, and must
      **  also be different from any of the custom names used for components.
      **  Without that, Remosef cannot figure out what a SEF URL means and will
      **  give unpredictable results.
      **
      **  Note that the names in custom_name must not be allowed to clash with
      **  the names used as tasks by the content component, in their
      **  translated form - see below.
      *******************************************************************************/
     $this->SEF_SPACE = "_";
     // divide words with underscores
     // can be changed to a hyphen "-"
     $this->custom_code = array('com_frontpage', 'com_contact');
     $this->custom_name = array('Frontpage', 'Contact_Us');
     /*******************************************************************************
      **  The following are the parameters for the optional content specific
      **  URL optimisation.  They are not used within the standard SEF processing
      **  unless you add in a sef_ext.php that is integrated with the Mambo SEF.
      **
      **  The following two lines define the translations that SEF will perform on
      **  names of sections and categories when translating them for inclusion in a URL.
      **  Each item in $this->sef_name_chars is translated into the corresponding
      **  element of $this->sef_translate_chars.
      **
      **  NOTE it is important that space be the last translate character, since the
      **  characters are processed in the order in which they appear.  Since earlier
      **  translates may create new spaces, it is vital that the space translation is
      **  done last.
      **
      **  You can extend these arrays as you wish, although it is obviously important
      **  to make sure that the items of one match the items of the other exactly.
      *******************************************************************************/
     $this->sef_name_chars = array('?', '&', '/', ' ');
     $this->sef_translate_chars = array('', 'and', ' or ', $this->SEF_SPACE);
     $this->sef_name_string = '�\'';
     $this->sef_translate_string = '--';
     /************** DO NOT MAKE CHANGES IN THE FOLLOWING LINES EXCEPT AT YOUR OWN RISK! ********************/
     if (mamboCore::is_set('mosConfig_sef_prefix')) {
         $this->prefix = mamboCore::get('mosConfig_sef_prefix');
     } else {
         $this->prefix = 'mos';
     }
     if ($this->prefix == 'content' or $this->prefix == 'component') {
         $this->prefix = 'mos';
     }
     foreach ($this->custom_code as $code) {
         $codefile = "components/{$code}/sef_ext.php";
         if (file_exists($codefile)) {
             include $codefile;
             $this->custom_PHP[] = true;
         } else {
             $this->custom_PHP[] = false;
         }
         $split = explode('_', $code);
         $this->custom_short[] = $split[1];
     }
     $this->sef_content_task['findkey'] = 'findkey';
     $this->sef_content_task['view'] = 'view';
     $this->sef_content_task['section'] = 'section';
     $this->sef_content_task['category'] = 'category';
     $this->sef_content_task['blogsection'] = 'blogsection';
     $this->sef_content_task['blogcategorymulti'] = 'blogcategorymulti';
     $this->sef_content_task['blogcategory'] = 'blogcategory';
     $this->sef_content_task['archivesection'] = 'archivesection';
     $this->sef_content_task['archivecategory'] = 'archivecategory';
     $this->sef_content_task['save'] = 'save';
     $this->sef_content_task['cancel'] = 'cancel';
     $this->sef_content_task['emailform'] = 'emailform';
     $this->sef_content_task['emailsend'] = 'emailsend';
     $this->sef_content_task['vote'] = 'vote';
     $this->sef_content_task['showblogsection'] = 'showblogsection';
 }