public function buildForm(FormBuilderInterface $builder, array $options) { if ($this->_isEdit) { $read_only = true; } else { $read_only = false; } $builder->add('enabled', 'checkbox', array('data' => true, 'label' => 'pi.form.label.field.enabled'))->add('id', 'choice', array('choices' => \Sfynx\ToolBundle\Util\PiStringManager::allLocales($this->_locale), 'multiple' => false, 'required' => true, 'empty_value' => 'pi.form.label.select.choose.option', "attr" => array("class" => "pi_simpleselect"), 'read_only' => $read_only))->add('label'); }
/** * We return the clean of a string. * * @param string $string * * @return string name * @access private * @author Etienne de Longeaux <*****@*****.**> */ private function _cleanName($string) { $string = PiStringManager::minusculesSansAccents($string); $string = PiStringManager::cleanFilename($string); return $string; }
/** * @param \Doctrine\Common\EventArgs $args * @return boolean * * @author Etienne de Longeaux <*****@*****.**> */ protected function isChangePosition($eventArgs, $type) { $entity = $eventArgs->getEntity(); $entityManager = $eventArgs->getEntityManager(); $entity_name = get_class($entity); $metadata = $entityManager->getClassMetadata($entity_name); $reflectionClass = new ReflectionClass($entity); $properties = $reflectionClass->getProperties(); // $_is_change_position = false; if (isset($GLOBALS['ENTITIES'][$type]) && isset($GLOBALS['ENTITIES'][$type][$entity_name])) { if (is_array($GLOBALS['ENTITIES'][$type][$entity_name])) { $route = $this->container->get('request')->get('_route'); if (empty($route) || $route == "_internal") { $route = $this->container->get('sfynx.tool.route.factory')->getMatchParamOfRoute('_route', $this->container->get('request')->getLocale()); } if (in_array($route, $GLOBALS['ENTITIES'][$type][$entity_name])) { $_is_change_position = true; } } elseif ($GLOBALS['ENTITIES'][$type][$entity_name] == true) { $_is_change_position = true; } } else { foreach ($properties as $refProperty) { //print_r($this->annReader->getPropertyAnnotations($refProperty)); if ($this->annReader->getPropertyAnnotation($refProperty, $this->annotationclass)) { // we have annotation and if it decrypt operation, we must avoid duble decryption $propName = $refProperty->getName(); $methodName = \Sfynx\ToolBundle\Util\PiStringManager::capitalize($propName); if ($reflectionClass->hasMethod($getter = 'get' . $methodName) && $reflectionClass->hasMethod($setter = 'set' . $methodName)) { // we get the route name $route = $this->container->get('request')->get('_route'); if (empty($route) || $route == "_internal") { $route = $this->container->get('sfynx.tool.route.factory')->getMatchParamOfRoute('_route', $this->container->get('request')->getLocale()); } // $properties = $this->annReader->getPropertyAnnotation($refProperty, $this->annotationclass); if ($properties->routes === true || is_array($properties->routes) && in_array($route, $properties->routes)) { $_is_change_position = true; } } } } } return $_is_change_position; }
/** * Function for finding tags with an identifier associated and other parameters. * * @access public * @static * @param str $chaine text on which search * @param str $tag the search term * @return array tags and ID required. * * @author Etienne de Longeaux <*****@*****.**> */ public static function searchLinkByParam($chaine, $tag) { $w_var = PiStringManager::trimUltime($chaine); if (preg_match_all("|<{$tag}(.*)>|U", $w_var, $matches, PREG_SET_ORDER)) { return $result = array('items' => $matches, 'split' => preg_split("|<{$tag}(.*)>|U", $w_var)); } else { return false; } }
/** * Create Ajax query * * @param string $type ["select","count"] * @param string $table * @param string $aColumns * @param string $table * @param array $dateSearch * @param array $cacheQuery_hash * * @return array * @access protected * @author Etienne de Longeaux <*****@*****.**> */ public function createAjaxQuery($type, $aColumns, $qb = null, $tablecode = 'u', $table = null, $dateSearch = null, $cacheQuery_hash = null) { $request = $this->container->get('request'); $locale = $this->container->get('request')->getLocale(); $em = $this->getDoctrine()->getManager(); if (is_null($qb)) { $qb = $em->createQueryBuilder(); if ($type == 'select') { $qb->add('select', $tablecode); } elseif ($type == "count") { $qb->add('select', $tablecode . '.id'); } else { throw ControllerException::NotFoundOption('type'); } if (isset($this->_entityName) && !empty($this->_entityName)) { $qb->add('from', $this->_entityName . ' ' . $tablecode); } elseif (!is_null($table)) { $qb->add('from', $table . ' ' . $tablecode); } else { throw ControllerException::NotFoundOption('table'); } } elseif ($type == "count") { $qb->add('select', $tablecode . '.id'); } /** * Date */ if (!is_null($dateSearch) && is_array($dateSearch)) { foreach ($dateSearch as $k => $columnSearch) { $idMin = "date-{$columnSearch['idMin']}"; $idMax = "date-{$columnSearch['idMax']}"; if ($request->get($idMin) != '') { $date = \DateTime::createFromFormat($columnSearch['format'], $request->get($idMin)); $dateMin = $date->format('Y-m-d 00:00:00'); //$dateMin = $this->container->get('sfynx.tool.date_manager')->format($date->getTimestamp(), 'long','medium', $locale, "yyyy-MM-dd 00:00:00"); $qb->andWhere("{$columnSearch['column']} >= '" . $dateMin . "'"); } if ($request->get($idMax) != '') { $date = \DateTime::createFromFormat($columnSearch['format'], $request->get($idMax)); $dateMax = $date->format('Y-m-d 23:59:59'); $qb->andWhere("{$columnSearch['column']} <= '" . $dateMax . "'"); } } } /** * Filtering * NOTE this does not match the built-in DataTables filtering which does it * word by word on any field. It's possible to do here, but concerned about efficiency * on very large tables, and MySQL's regex functionality is very limited */ $array_params = array(); $and = $qb->expr()->andx(); for ($i = 0; $i < count($aColumns); $i++) { if ($request->get('bSearchable_' . $i) == "true" && $request->get('sSearch_' . $i) != '') { $search_tab = explode("|", $request->get('sSearch_' . $i)); $or = $qb->expr()->orx(); foreach ($search_tab as $s) { $or->add("LOWER(" . $aColumns[intval($i) - 1] . ") LIKE :var" . $i . ""); // $current_encoding = mb_detect_encoding($s, 'auto'); $s = iconv($current_encoding, 'UTF-8', $s); $s = PiStringManager::withoutaccent($s); // $array_params["var" . $i] = '%' . strtolower($s) . '%'; } $and->add($or); } } if ($and != "") { $qb->andWhere($and); } $or = $qb->expr()->orx(); for ($i = 0; $i < count($aColumns); $i++) { if ($request->get('bSearchable_' . $i) == "true" && $request->get('sSearch') != '') { $search_tab = explode("|", $request->get('sSearch')); foreach ($search_tab as $s) { if (!empty($s)) { $or->add("LOWER(" . $aColumns[$i] . ") LIKE :var2" . $i . ""); // $current_encoding = mb_detect_encoding($s, 'auto'); $s = iconv($current_encoding, 'UTF-8', $s); $s = PiStringManager::withoutaccent($s); // $array_params["var2" . $i] = '%' . strtolower($s) . '%'; } } } } if ($or != "") { $qb->andWhere($or); } /** * Grouping */ $qb->groupBy($tablecode . '.id'); /** * Ordering */ $iSortingCols = $request->get('iSortingCols', ''); if (!empty($iSortingCols)) { for ($i = 0; $i < intval($request->get('iSortingCols')); $i++) { $iSortCol_ = $request->get('iSortCol_' . $i, ''); $iSortCol_col = intval($iSortCol_) - 1; if (!empty($iSortCol_) && $request->get('bSortable_' . intval($iSortCol_)) == "true" && isset($aColumns[$iSortCol_col])) { $column = $aColumns[$iSortCol_col]; $sort = $request->get('sSortDir_' . $i) === 'asc' ? 'ASC' : 'DESC'; $qb->addOrderBy($column, $sort); } } } /** * Paging */ if ($type == 'select') { $iDisplayStart = $request->get('iDisplayStart', 0); $iDisplayLength = $request->get('iDisplayLength', 25); $qb->setFirstResult($iDisplayStart); $qb->setMaxResults($iDisplayLength); } $qb->setParameters($array_params); //$query_sql = $qb->getQuery()->getSql(); //var_dump($query_sql); //exit; if (is_null($cacheQuery_hash)) { $qb = $qb->getQuery(); } elseif (is_array($cacheQuery_hash)) { // we define all options if (!isset($cacheQuery_hash['time'])) { $cacheQuery_hash['time'] = 3600; } if (!isset($cacheQuery_hash['mode'])) { $cacheQuery_hash['mode'] = 3; } // \Doctrine\ORM\Cache::MODE_NORMAL; if (!isset($cacheQuery_hash['setCacheable'])) { $cacheQuery_hash['setCacheable'] = true; } if (!isset($cacheQuery_hash['input_hash'])) { $cacheQuery_hash['input_hash'] = ''; } if (!isset($cacheQuery_hash['namespace'])) { $cacheQuery_hash['namespace'] = ''; } // we set the query result $qb = $em->getRepository($this->_entityName)->cacheQuery($qb->getQuery(), $cacheQuery_hash['time'], $cacheQuery_hash['mode'], $cacheQuery_hash['setCacheable'], $cacheQuery_hash['namespace'], $cacheQuery_hash['input_hash']); } $result = $em->getRepository($this->_entityName)->setTranslatableHints($qb, $locale, false, true)->getResult(); if ($type == 'count') { $result = count($result); } return $result; }
/** * Process (encrypt/decrypt) entities fields * * @param LifecycleEventArgs $args * @param Boolean $isEncryptOperation If true - encrypt, false - decrypt entity * * @return void * @access protected * @author etienne de Longeaux <*****@*****.**> */ protected function processFields(LifecycleEventArgs $args, $isEncryptOperation = true) { if ($this->_load_enabled == true) { $entity = $args->getEntity(); $em = $args->getEntityManager(); $className = get_class($entity); $metadata = $em->getClassMetadata($className); $encryptorMethod = $isEncryptOperation ? 'encrypt' : 'decrypt'; $reflectionClass = new ReflectionClass($entity); $properties = $reflectionClass->getProperties(); foreach ($properties as $refProperty) { foreach ($this->options as $key => $encrypter) { if (isset($encrypter['encryptor_annotation_name']) && isset($encrypter['encryptor_class']) && isset($encrypter['encryptor_options'])) { $this->encryptor = $this->getEncryptorService($key); if ($this->annReader->getPropertyAnnotation($refProperty, $encrypter['encryptor_annotation_name'])) { // we have annotation and if it decrypt operation, we must avoid duble decryption $propName = $refProperty->getName(); if ($refProperty->isPublic()) { $entity->{$propName} = $this->encryptor->{$encryptorMethod}($refProperty->getValue()); } else { $methodName = \Sfynx\ToolBundle\Util\PiStringManager::capitalize($propName); if ($reflectionClass->hasMethod($getter = 'get' . $methodName) && $reflectionClass->hasMethod($setter = 'set' . $methodName)) { if ($isEncryptOperation) { // we set the encrypt value $currentPropValue = $entity->{$getter}(); if (!empty($currentPropValue)) { $currentPropValue = $this->encryptor->{$encryptorMethod}($currentPropValue); } // we set locale value $entity->{$setter}($currentPropValue); } else { // we get the locale value $locale = $entity->getTranslatableLocale(); // if (!empty($locale) && !is_null($locale)) { } elseif (isset($_GET['_locale'])) { $locale = $_GET['_locale']; } else { $locale = $this->locale; } // if (!$this->annReader->getPropertyAnnotation($refProperty, 'Gedmo\\Mapping\\Annotation\\Translatable')) { if (!$this->hasInDecodedRegistry($className, $entity->getId(), $locale, $methodName)) { $currentPropValue = $entity->{$getter}(); if (!empty($currentPropValue)) { $currentPropValue = $this->encryptor->{$encryptorMethod}($currentPropValue); } $entity->{$setter}($currentPropValue); $this->addToDecodedRegistry($className, $entity->getId(), $locale, $methodName, $currentPropValue); } } else { $locales = $this->container->get('sfynx.auth.locale_manager')->getAllLocales(true); foreach ($locales as $key => $lang) { if ($lang['enabled'] == 1) { if (!$this->hasInDecodedRegistry($className, $entity->getId(), $lang['id'], $methodName)) { $currentPropValue_locale = $entity->translate($lang['id'])->{$getter}(); if (!empty($currentPropValue_locale)) { $currentPropValue_locale = $this->encryptor->{$encryptorMethod}($currentPropValue_locale); } if ($locale == $lang['id']) { $entity->{$setter}($currentPropValue_locale); } $entity->translate($lang['id'])->{$setter}($currentPropValue_locale); $this->addToDecodedRegistry($className, $entity->getId(), $lang['id'], $methodName, $currentPropValue_locale); //print_r($this->decodedRegistry); } } } } } } else { throw new \RuntimeException(sprintf("Property %s isn't public and doesn't has getter/setter")); } } } } else { throw new \RuntimeException(sprintf("encrypter %s is not correctly configured", $key)); } } } } }
/** * Refresh the cache of a widget. * * @param Widget $widget Widget entity * @param string $lang Lang value * * @return void * @access public * @author Etienne de Longeaux <*****@*****.**> * @since 2014-04-08 */ public function cacheRefreshWidget(Widget $widget, $lang) { // we get the id of the widget. $id = $widget->getId(); // we refesh only if the widget is in cash. $Etag_widget = 'widget:' . $id . ':' . $lang; // we refesh only if the widget is in cash. $this->cacheRefreshByname($Etag_widget); // we manage the "transwidget" $params_transwidget = json_encode(array('widget-id' => $id), JSON_UNESCAPED_UNICODE); $widget_translations = $this->getWidgetManager()->setWidgetTranslations($widget); if (is_array($widget_translations)) { foreach ($widget_translations as $translang => $translationWidget) { // we create the cache name of the transwidget $Etag_transwidget = 'transwidget:' . $translationWidget->getId() . ':' . $translang . ':' . $params_transwidget; // we refresh the cache of the transwidget $this->cacheRefreshByname($Etag_transwidget); } } // If the widget is a "content snippet" if ($widget->getPlugin() == 'content' && $widget->getAction() == 'snippet') { $xmlConfig = $widget->getConfigXml(); // if the configXml field of the widget is configured correctly. try { $xmlConfig = new \Zend_Config_Xml($xmlConfig); if ($xmlConfig->widgets->get('content')) { $id_snippet = $xmlConfig->widgets->content->id; // we create the cache name of the snippet $Etag_snippet = 'transwidget:' . $id_snippet . ':' . $lang . ':' . $params_transwidget; // we refresh the cache of the snippet $this->cacheRefreshByname($Etag_snippet); } } catch (\Exception $e) { } } // If the widget is a "gedmo snippet" if ($widget->getPlugin() == 'gedmo' && $widget->getAction() == 'snippet') { $xmlConfig = $widget->getConfigXml(); $new_widget = null; // if the configXml field of the widget is configured correctly. try { $xmlConfig = new \Zend_Config_Xml($xmlConfig); if ($xmlConfig->widgets->get('gedmo')) { $id = $xmlConfig->widgets->gedmo->id; // we refesh only if the widget is in cash. $Etag_widget = 'widget:' . $id . ':' . $lang; // we refesh only if the widget is in cash. $this->cacheRefreshByname($Etag_widget); } } catch (\Exception $e) { } } $path_json_file = $this->createJsonFileName('widget', $id, $lang); if (file_exists($path_json_file)) { $info = explode('|', file_get_contents($path_json_file)); if (isset($info[1])) { $info[1] = \Sfynx\ToolBundle\Util\PiStringManager::cleanWhitespace($info[1]); $this->cacheRefreshByname($info[1]); //print_r($info[1]); //print_r('<br />');print_r('<br />'); } } $path_json_file_history = $this->createJsonFileName('widget-history', $id, $lang); if (file_exists($path_json_file_history)) { $reading = fopen($path_json_file_history, 'r'); while (!feof($reading)) { $info = explode('|', fgets($reading)); if (isset($info[1])) { $info[1] = \Sfynx\ToolBundle\Util\PiStringManager::cleanWhitespace($info[1]); $this->cacheRefreshByname($info[1]); //print_r($info[1]); //print_r('<br />');print_r('<br />'); } } fclose($reading); } $path_json_file = $this->createJsonFileName('esi', $id, $lang); if (file_exists($path_json_file)) { $reading = fopen($path_json_file, 'r'); while (!feof($reading)) { $info = explode('|', fgets($reading)); if (isset($info[1])) { // we get the esi url $info[1] = \Sfynx\ToolBundle\Util\PiStringManager::cleanWhitespace($info[1]); // we delete the cache widget file $this->container->get("sfynx.cache.filecache")->getClient()->setPath($this->createCacheWidgetRepository()); $this->container->get("sfynx.cache.filecache")->clear($info[1]); //print_r($id);print_r($info[1]); //print_r('<br />');print_r('<br />'); } } fclose($reading); } }
/** * render chart with a click event. * * @param string $sliders * @param array $options * @access private * @return string * * @author Etienne de Longeaux <*****@*****.**> */ private function renderdefaultAction($sliders, $options = null) { $em = $this->container->get('doctrine')->getManager(); // if (isset($options['params']) && is_array($options['params']) && count($options['params']) >= 1) { $results = array_map(function ($key, $value) { if (in_array($value, array("true", "false"))) { return $key . ":" . $value; } elseif (preg_match_all("/[a-zA]+/", $value, $matches, PREG_SET_ORDER)) { return $key . ':"' . $value . '"'; } elseif (preg_match_all("/[0-9]+/", $value, $matches, PREG_SET_ORDER)) { return $key . ":" . $value; } }, array_keys($options['params']), array_values($options['params'])); $params = implode(", \n", $results); } else { $params = ' animation: "fade", animationLoop: true, direction: "horizontal", redirection: true, startAt: 0, slideshow: true, slideshowSpeed: 6000, animationSpeed: 800, directionNav: true, pausePlay: false, minItems: 1, maxItems: 1, controlNav: true, '; } $startAt = ""; // if the page is sluggify, we get the entity associated $page_options = $this->container->get('pi_app_admin.manager.page')->getPageMetaInfo($this->locale); if (isset($page_options['entity']) && !empty($page_options['entity'])) { $entity = $page_options['entity']; $position = $entity->getPosition() - 1; if (isset($options['params']['maxItems']) && !empty($options['params']['maxItems']) && $options['params']['maxItems'] != 0) { $mod = $options['params']['maxItems']; $position = ($position - $position % $mod) / $mod; } $startAt = ",startAt:{$position}"; } // if (isset($options['insert_js']) && !empty($options['insert_js'])) { $insert_js = (int) $options['insert_js']; } else { $insert_js = true; } // if (isset($options['id']) && !empty($options['id'])) { $id_c = "id='{$options['id']}'"; $id = "#{$options['id']}"; } else { $options['id'] = 'flex-slider' . \Sfynx\ToolBundle\Util\PiStringManager::random(11); $id_c = "id='{$options['id']}'"; $id = "#{$options['id']}"; } if (!isset($options['class']) || empty($options['class'])) { $options['class'] = ""; } // if (!isset($options['width']) || empty($options['width'])) { $options['width'] = "100%"; } if (!isset($options['height']) || empty($options['height'])) { $options['height'] = "100%"; } // $templateContent = $this->container->get('twig')->loadTemplate("SfynxTemplateBundle:Template\\Slider:{$options['template']}"); if ($templateContent->hasBlock("body")) { $slider_result = $templateContent->renderBlock("body", array_merge($options, array('slides' => $sliders))) . " \n"; } else { $slider_result = "<div {$id_c} class='" . $options['class'] . "' >\n"; $slider_result .= " <ul class='slides'>\n"; if (is_array($sliders['boucle'])) { $slider_result .= $sliders['boucle']; } else { $slider_result .= $sliders['boucle']; } $slider_result .= " </ul>\n"; $slider_result .= "</div>\n"; } $slider_result = utf8_decode(mb_convert_encoding($slider_result, "UTF-8", "HTML-ENTITIES")); // We open the buffer. ob_start(); ?> <?php echo $slider_result; ?> <?php if ($insert_js) { ?> <script type="text/javascript"> //<![CDATA[ jQuery(document).ready(function() { $("<?php echo $id; ?> ").flexslider({ <?php echo $params; ?> <?php echo $startAt; ?> <?php if (isset($options['params']['redirection']) && $options['params']['redirection'] == "true") { ?> , after: function(){ var id = $('#<?php echo $options['id']; ?> .flex-control-nav li a.flex-active').text()-1; <?php foreach ($sliders['routenames'] as $pos => $routename) { if (!empty($routename) && isset($options['params']['startAt']) && $pos != $options['params']['startAt']) { ?> if (id==<?php echo $pos; ?> ){document.location.href = "<?php echo $this->container->get('router')->generate($routename); ?> ";} <?php } } ?> } <?php } ?> }); }); //]]> </script> <?php } ?> <?php // We retrieve the contents of the buffer. $_content = ob_get_contents(); // We clean the buffer. ob_clean(); // We close the buffer. ob_end_flush(); return $_content; }
/** * Extract data from a PDF document and add this to the Lucene index. * * @param \Zend_Search_Lucene_Proxy $Index The Lucene index object. * @param string $type ['html', 'docx', 'xsls', 'pptx', 'content'] * @param array $indexValues * @param string $locale * @param object $obj * @param string $pathFile The path to the PDF document. * * @return \Zend_Search_Lucene_Proxy * @access public * @static * @author Etienne de Longeaux <*****@*****.**> * @since 2012-06-11 */ public static function index(\Zend_Search_Lucene_Proxy $Index, $type, $indexValues = null, $locale = '', $obj = null, $pathFile = '') { // ignore invalid characters for lucene text search \Zend_Search_Lucene_Search_QueryParser::setDefaultEncoding('utf-8'); \Zend_Search_Lucene_Analysis_Analyzer::setDefault(new \Zend_Search_Lucene_Analysis_Analyzer_Common_Utf8_CaseInsensitive()); self::$_index = $Index; self::$_doc = null; switch ($type) { case "html": self::$_doc = \Zend_Search_Lucene_Document_Html::loadHtmlFile($pathFile, false); $indexValues['Key'] = filemtime($pathFile); $indexValues['Contents'] = self::$_doc->getFieldUtf8Value('body'); break; case "docx": self::$_doc = \Zend_Search_Lucene_Document_Docx::loadDocxFile($pathFile, false); $indexValues['Key'] = filemtime($pathFile); $indexValues['Contents'] = self::$_doc->getFieldUtf8Value('body'); break; case "xsls": self::$_doc = \Zend_Search_Lucene_Document_Xlsx::loadXlsxFile($pathFile, false); $indexValues['Key'] = filemtime($pathFile); $indexValues['Contents'] = self::$_doc->getFieldUtf8Value('body'); break; case "pptx": self::$_doc = \Zend_Search_Lucene_Document_Pptx::loadPptxFile($pathFile, false); $indexValues['Key'] = filemtime($pathFile); $indexValues['Contents'] = self::$_doc->getFieldUtf8Value('body'); break; case "page": // we create a new instance of Zend_Search_Lucene_Document self::$_doc = \Zend_Search_Lucene_Document_Html::loadHTML($indexValues['Contents'], false); $indexValues['Contents'] = self::$_doc->getFieldUtf8Value('body'); break; } if (self::$_doc instanceof \Zend_Search_Lucene_Document) { // Remove all accens $indexValues['Contents'] = \Sfynx\ToolBundle\Util\PiStringManager::minusculesSansAccents($indexValues['Contents']); // Remove all doublons $indexValues['Contents'] = \Sfynx\ToolBundle\Util\PiStringManager::uniqueWord($indexValues['Contents']); // clean the content $indexValues['Contents'] = \Sfynx\ToolBundle\Util\PiStringManager::cleanContent($indexValues['Contents']); // Delete all stop words $stopWord = \Sfynx\ToolBundle\Util\PiStringManager::stopWord(strtolower($locale)); if ($stopWord) { $wordsIndex = explode(' ', $indexValues['Contents']); $diff = array_diff($wordsIndex, $stopWord); $indexValues['Contents'] = implode(' ', $diff); } // print_r($locale); // print_r('<br /><br /><br />'); // print_r(implode(' ', $wordsIndex)); // print_r('<br /><br /><br />'); // print_r(implode(' ', $stopWord)); // print_r('<br /><br /><br />'); // print_r($indexValues['Contents']); // print_r('<br /><br /><br />'); // If the document creation was sucessful then add it to our index. try { setlocale(LC_ALL, $locale); self::defaultAddFields($indexValues); self::addDocument(); // print_r($indexValues['Key']); // print_r('<br />'); // print_r($indexValues['Contents']); // print_r('<br /><br /><br />'); } catch (\Exception $e) { setlocale(LC_ALL, 'fr_FR'); self::defaultAddFields($indexValues); try { self::addDocument(); } catch (\Exception $e) { } } } // Return the Lucene index object. return self::$_index; }