Пример #1
0
 function getFieldData(array $requestData = array())
 {
     $data = array();
     $ins_id = $this->getInsertId();
     if (isset($requestData[$ins_id])) {
         $data['value'] = $requestData[$ins_id];
     } else {
         global $prefs;
         $data['value'] = $this->getValue();
         $langutil = new Services_Language_Utilities();
         $itemLang = null;
         if ($this->getItemId()) {
             try {
                 $itemLang = $langutil->getLanguage('trackeritem', $this->getItemId());
             } catch (Services_Exception $e) {
                 $itemLang = null;
             }
         }
         $freetaglib = TikiLib::lib('freetag');
         $data['freetags'] = $freetaglib->_parse_tag($data['value']);
         $data['tag_suggestion'] = $freetaglib->get_tag_suggestion(implode(' ', $data['freetags']), $prefs['freetags_browse_amount_tags_suggestion'], $itemLang);
     }
     return $data;
 }
Пример #2
0
 /**
  * _tag_object_array
  *
  * @param mixed $user
  * @param mixed $itemId
  * @param mixed $type
  * @param mixed $tagArray
  * @param mixed $lang
  * @access protected
  * @return void
  */
 function _tag_object_array($user, $itemId, $type, $tagArray, $lang = null)
 {
     // first check for lang of object
     if (!$lang) {
         $langutil = new Services_Language_Utilities();
         try {
             $lang = $langutil->getLanguage($type, $itemId);
         } catch (Services_Exception $e) {
             $lang = null;
         }
     }
     foreach ($tagArray as $tag) {
         $tag = trim($tag);
         if ($tag != '') {
             if (!get_magic_quotes_gpc()) {
                 $tag = addslashes($tag);
             }
             $this->safe_tag($user, $itemId, $type, $tag, $lang);
         }
     }
 }
Пример #3
0
 private function attachTranslations($syncInfo, $type, $objectMap)
 {
     $unprocessed = $objectMap;
     $utilities = new Services_Language_Utilities();
     while (reset($unprocessed)) {
         $remoteSource = key($unprocessed);
         unset($unprocessed[$remoteSource]);
         $translations = $this->getRemoteTranslations($syncInfo, $type, $remoteSource);
         foreach ($translations as $remoteTarget) {
             unset($unprocessed[$remoteTarget]);
             $utilities->insertTranslation($type, $objectMap[$remoteSource], $objectMap[$remoteTarget]);
         }
     }
 }