public function SetAcceptMODxURLDocIdsString($acceptMODxURLDocIdsString, $save = TRUE)
 {
     if (!is_string($acceptMODxURLDocIdsString)) {
         return FALSE;
     }
     $newAcceptMODxURLDocIds = preg_split('/\\s*,\\s*/x' . YamsUtils::UTF8Modifier(), $acceptMODxURLDocIdsString, -1, PREG_SPLIT_NO_EMPTY);
     if ($newAcceptMODxURLDocIds === FALSE) {
         return FALSE;
     }
     foreach ($newAcceptMODxURLDocIds as $id => $docId) {
         if ($docId == '*') {
             continue;
         }
         if (YamsUtils::IsValidId($docId)) {
             continue;
         }
         unset($newAcceptMODxURLDocIds[$id]);
     }
     $this->itsAcceptMODxURLDocIds = array_unique($newAcceptMODxURLDocIds);
     if ($save) {
         return $this->SaveCurrentSettings();
     }
     return TRUE;
 }
예제 #2
0
 protected function Initialise()
 {
     global $modx;
     // This is close to the maximum size allowed in the content field
     ini_set('pcre.backtrack_limit', '16000000');
     $this->itsOutputQuerySeparator = ini_get('arg_separator.output');
     if (is_null($this->itsOutputQuerySeparator)) {
         $this->itsOutputQuerySeparator = '&';
     }
     $this->itsInputQuerySeparator = ini_get('arg_separator.input');
     if (is_null($this->itsInputQuerySeparator)) {
         $this->itsInputQuerySeparator = '&';
     }
     $this->itsMODx =& $modx;
     parent::Initialise();
     //      @include( dirname( __FILE__ ) . '/../yams.config.inc.php');
     //
     //      // Check if UTF-8 is being used
     //      // (Assume the encoding of the web page output
     //      // is the same as the encoding of the manager)
     //      YamsUtils::$itsUTF8Modifier == $this->itsEncodingModifierMode;
     $this->itsUTF8Modifier = YamsUtils::UTF8Modifier();
     //      switch ( $this->itsEncodingModifierMode )
     //      {
     //      case '':
     //      case 'u':
     //        $this->itsEncodingModifier = $this->itsEncodingModiferMode;
     //        break;
     //      default:
     //        $this->itsEncodingModifier = '';
     //        if ( $this->itsMODx->config['modx_charset'] == 'UTF-8')
     //        {
     //          $this->itsEncodingModifier = 'u';
     //        }
     //      }
     $this->UpdateLanguageDependentServerNamesMode();
     $this->UpdateLanguageDependentRootNamesMode();
     $this->UpdateLanguageQueryParamMode();
     $this->UpdateUniqueMultilingualAliasMode();
     $this->UpdateMonolingualDocIds();
     $this->CacheDocumentAliasInfo();
     // Set the current language
     $this->itsCurrentLangId = $this->DetermineCurrentLangId();
     // $this->itsCurrentLangId = $this->itsDefaultLangId;
 }