/** * Get Entities to be display into a grid into the "All files modules" */ public function getEntities() { if (!AccountManager::getInstance()->isLogged()) { return JsonResponseBuilder::failure(); } $path = $this->getRequestVariable('path'); $r = EntitiesAcronymsFetcher::getInstance()->getEntities(); return JsonResponseBuilder::success(array('nbItems' => count($r), 'Items' => $r)); }
/** * Check all acronyms * Add an entry into the error's stack if an acronym is found without <acronym> tag * */ function checkAcronym() { // Get acronyms $acronyms = EntitiesAcronymsFetcher::getInstance()->getAcronyms(); for ($i = 0; $i < count($acronyms); $i++) { $match = array(); $acronym = $acronyms[$i]['items']; preg_match_all("/\\s({$acronym})\\s/si", $this->en_content, $match); for ($j = 0; $j < count($match[1]); $j++) { $this->addError(array('value_en' => $match[1][$j], 'value_lang' => '', 'type' => 'acronym')); } } }