private function getReserved()
 {
     $array = array();
     $array['admin'] = 'admin';
     $array['default'] = 'default';
     $front = JO_Front::getInstance()->getModuleDirectoryWithDefault('default/controllers');
     foreach (WM_Modules::getControllersWithFolders($front) as $controller) {
         $controllerName = JO_Front::getInstance()->formatControllerName($controller);
         $array[$controller] = $controller;
         $array = array_merge($array, WM_Modules::getControllerActions($controllerName, $front));
     }
     $array = JO_Utf8::array_change_key_case_unicode($array);
     return $array;
 }
Example #2
0
 public function renameIfExist($uniqueSlug)
 {
     $db = JO_Db::getDefaultAdapter();
     $query = $db->select()->from('url_alias', array('keyword', 'keyword'))->where('keyword = ?', $uniqueSlug)->orWhere('keyword LIKE ?', $uniqueSlug . '-%');
     $array = $db->fetchPairs($query);
     foreach (WM_Modules::getControllersWithFolders() as $controller) {
         $controllerName = JO_Front::getInstance()->formatControllerName($controller);
         $array[$controller] = $controller;
         $array = array_merge($array, WM_Modules::getControllerActions($controllerName));
     }
     $array['admin'] = 'admin';
     $array['default'] = 'default';
     $array['board'] = 'board';
     $array = JO_Utf8::array_change_key_case_unicode($array);
     return $this->rename_if_exists($array, mb_strtolower($uniqueSlug, 'utf-8'));
 }
Example #3
0
 public function getTotalKey($keyword)
 {
     $db = JO_Db::getDefaultAdapter();
     $array = array();
     $array['admin'] = 'admin';
     $array['default'] = 'default';
     $front = JO_Front::getInstance()->getModuleDirectoryWithDefault('default/controllers');
     foreach (WM_Modules::getControllersWithFolders($front) as $controller) {
         $controllerName = JO_Front::getInstance()->formatControllerName($controller);
         $array[$controller] = $controller;
         $array = array_merge($array, WM_Modules::getControllerActions($controllerName, $front));
     }
     $array = JO_Utf8::array_change_key_case_unicode($array);
     if (isset($array[mb_strtolower($keyword, 'utf-8')])) {
         return 1;
     }
     $query = $db->select()->from('url_alias', new JO_Db_Expr('COUNT(url_alias_id)'))->where("LOWER(keyword) = ?", (string) mb_strtolower($keyword, 'utf-8'));
     return $db->fetchOne($query);
 }