當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PMF_Category::checkLanguage方法代碼示例

本文整理匯總了PHP中PMF_Category::checkLanguage方法的典型用法代碼示例。如果您正苦於以下問題:PHP PMF_Category::checkLanguage方法的具體用法?PHP PMF_Category::checkLanguage怎麽用?PHP PMF_Category::checkLanguage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PMF_Category的用法示例。


在下文中一共展示了PMF_Category::checkLanguage方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

 $category->setUser($currentAdminUser);
 $category->setGroups($currentAdminGroups);
 $parentId = PMF_Filter::filterInput(INPUT_POST, 'parent_id', FILTER_VALIDATE_INT);
 $categoryData = array('id' => PMF_Filter::filterInput(INPUT_POST, 'id', FILTER_VALIDATE_INT), 'lang' => PMF_Filter::filterInput(INPUT_POST, 'catlang', FILTER_SANITIZE_STRING), 'parent_id' => $parentId, 'name' => PMF_Filter::filterInput(INPUT_POST, 'name', FILTER_SANITIZE_STRING), 'description' => PMF_Filter::filterInput(INPUT_POST, 'description', FILTER_SANITIZE_STRING), 'user_id' => PMF_Filter::filterInput(INPUT_POST, 'user_id', FILTER_VALIDATE_INT));
 $permissions = array();
 if ('all' === PMF_Filter::filterInput(INPUT_POST, 'userpermission', FILTER_SANITIZE_STRING)) {
     $permissions += array('restricted_user' => array(-1));
 } else {
     $permissions += array('restricted_user' => array(PMF_Filter::filterInput(INPUT_POST, 'restricted_users', FILTER_VALIDATE_INT)));
 }
 if ('all' === PMF_Filter::filterInput(INPUT_POST, 'grouppermission', FILTER_SANITIZE_STRING)) {
     $permissions += array('restricted_groups' => array(-1));
 } else {
     $permissions += PMF_Filter::filterInputArray(INPUT_POST, array('restricted_groups' => array('filter' => FILTER_VALIDATE_INT, 'flags' => FILTER_REQUIRE_ARRAY)));
 }
 if (!$category->checkLanguage($categoryData['id'], $categoryData['lang'])) {
     if ($category->addCategory($categoryData, $parentId, $categoryData['id']) && $category->addPermission('user', array($categoryData['id']), $permissions['restricted_user']) && $category->addPermission('group', array($categoryData['id']), $permissions['restricted_groups'])) {
         printf('<p class="alert alert-success">%s</p>', $PMF_LANG['ad_categ_translated']);
     } else {
         printf('<p class="alert alert-error">%s</p>', $faqConfig->getDb()->error());
     }
 } else {
     if ($category->updateCategory($categoryData)) {
         $category->deletePermission('user', array($categoryData['id']));
         $category->deletePermission('group', array($categoryData['id']));
         $category->addPermission('user', array($categoryData['id']), $permissions['restricted_user']);
         $category->addPermission('group', array($categoryData['id']), $permissions['restricted_groups']);
         printf('<p class="alert alert-success">%s</p>', $PMF_LANG['ad_categ_updated']);
     } else {
         printf('<p class="alert alert-error">%s</p>', $faqConfig->getDb()->error());
     }
開發者ID:kapljr,項目名稱:Jay-Kaplan-Farmingdale-BCS-Projects,代碼行數:31,代碼來源:category.main.php

示例2: printf

         }
         printf('<p class="success">%s</p>', $PMF_LANG['ad_categ_added']);
     } else {
         printf('<p class="error">%s</p>', $db->error());
     }
 }
 // Updates an existing category
 if ($action == 'updatecategory') {
     $category = new PMF_Category($current_admin_user, $current_admin_groups, false);
     $parent_id = PMF_Filter::filterInput(INPUT_POST, 'parent_id', FILTER_VALIDATE_INT);
     $category_data = array('id' => PMF_Filter::filterInput(INPUT_POST, 'id', FILTER_VALIDATE_INT), 'lang' => PMF_Filter::filterInput(INPUT_POST, 'catlang', FILTER_SANITIZE_STRING), 'parent_id' => $parent_id, 'name' => PMF_Filter::filterInput(INPUT_POST, 'name', FILTER_SANITIZE_STRING), 'description' => PMF_Filter::filterInput(INPUT_POST, 'description', FILTER_SANITIZE_STRING), 'user_id' => PMF_Filter::filterInput(INPUT_POST, 'user_id', FILTER_VALIDATE_INT));
     $userperm = PMF_Filter::filterInput(INPUT_POST, 'userpermission', FILTER_SANITIZE_STRING);
     $user_allowed = 'all' == $userperm ? -1 : PMF_Filter::filterInput(INPUT_POST, 'restricted_users', FILTER_VALIDATE_INT);
     $groupperm = PMF_Filter::filterInput(INPUT_POST, 'grouppermission', FILTER_SANITIZE_STRING);
     $group_allowed = 'all' == $groupperm ? -1 : PMF_Filter::filterInput(INPUT_POST, 'restricted_groups', FILTER_VALIDATE_INT);
     if (!$category->checkLanguage($category_data['id'], $category_data['lang'])) {
         if ($category->addCategory($category_data, $parent_id, $category_data['id']) && $category->addPermission('user', array($category_data['id']), $user_allowed) && $category->addPermission('group', array($category_data['id']), $group_allowed)) {
             printf('<p class="success">%s</p>', $PMF_LANG['ad_categ_translated']);
         } else {
             printf('<p class="error">%s</p>', $db->error());
         }
     } else {
         if ($category->updateCategory($category_data)) {
             $category->deletePermission('user', array($category_data['id']));
             $category->deletePermission('group', array($category_data['id']));
             $category->addPermission('user', array($category_data['id']), $user_allowed);
             $category->addPermission('group', array($category_data['id']), $group_allowed);
             printf('<p class="success">%s</p>', $PMF_LANG['ad_categ_updated']);
         } else {
             printf('<p class="error">%s</p>', $db->error());
         }
開發者ID:atlcurling,項目名稱:tkt,代碼行數:31,代碼來源:category.main.php


注:本文中的PMF_Category::checkLanguage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。