本文整理汇总了PHP中iaUtil::updateItemPOSTFields方法的典型用法代码示例。如果您正苦于以下问题:PHP iaUtil::updateItemPOSTFields方法的具体用法?PHP iaUtil::updateItemPOSTFields怎么用?PHP iaUtil::updateItemPOSTFields使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类iaUtil
的用法示例。
在下文中一共展示了iaUtil::updateItemPOSTFields方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: elseif
$iaCore->set_cfg('body', 'none');
if ($mod == 'manage_recipecats') {
$iaCore->grid('_IA_URL_packages/recipes/js/admin/recipecats');
$iaCore->display('none');
} elseif ($mod == 'edit_recipecat' || $mod == 'add_recipecat') {
$iaCore->set_breadcrumb(_t('manage_recipecats'), IA_ADMIN_URL . 'manage/recipecats/');
$iaCore->set_cfg('body', 'edit_recipecat');
if (isset($vals[0])) {
$_GET['id'] = (int) $_GET['id'];
}
$recipecat = $mod == 'add_recipecat' || empty($_GET['id']) ? array() : $iaDb->row('*', sprintf("`id`=%d", $_GET['id']));
$fields = $iaCore->getAllFields(true, "", "recipecats");
if (!empty($_POST)) {
if ($fields) {
$iaUtil = $iaCore->factory('core', 'util');
list($data, $error, $msg, $error_fields) = iaUtil::updateItemPOSTFields($fields, $recipecat, true);
}
if (!$error) {
$iaCore->startHook("phpAdminBeforeRecipecatSubmit");
$data['locked'] = (int) $_POST['locked'];
$data['status'] = $_POST['status'];
$data['title_alias'] = !empty($_POST['title_alias']) ? $_POST['title_alias'] : $_POST['title'];
// transliterate title alias
if ($iaCore->get('recipes_auto_alias')) {
$iaUtil = $iaCore->factory('core', 'util');
if (!defined('IA_NOUTF')) {
iaUtf8::loadUTF8Core();
iaUtf8::loadUTF8Util('ascii', 'utf8_to_ascii');
}
if (!utf8_is_ascii($data['title_alias'])) {
$data['title_alias'] = utf8_to_ascii($data['title_alias']);
示例2: elseif
} elseif ($mod == 'edit_cookbook' || $mod == 'add_cookbook') {
$iaCore->set_breadcrumb(_t('manage_cookbooks'), IA_ADMIN_URL . 'manage/cookbooks/');
$iaCore->set_cfg('body', 'edit_cookbook');
if (isset($vals[0])) {
$_GET['id'] = (int) $_GET['id'];
}
if ($mod == 'add_cookbook' || empty($_GET['id'])) {
$cookbook = array();
} else {
$cookbook = $iaCookbook->getCookbookById($_GET['id']);
}
$fields = $iaCore->getAllFields(true, "", "cookbooks");
if (!empty($_POST)) {
if ($fields) {
$iaUtil = $iaCore->factory('core', 'util');
list($data, $error, $msg, $error_fields) = iaUtil::updateItemPOSTFields($fields, $cookbook, true);
}
if (!$error) {
$iaCore->startHook("phpAdminBeforeCookbookSubmit");
$data['status'] = $_POST['status'];
$data['title_alias'] = !empty($_POST['title_alias']) ? $_POST['title_alias'] : $_POST['title'];
// transliterate title alias
if ($iaCore->get('recipes_auto_alias')) {
$iaUtil = $iaCore->factory('core', 'util');
if (!defined('IA_NOUTF')) {
iaUtf8::loadUTF8Core();
iaUtf8::loadUTF8Util('ascii', 'utf8_to_ascii');
}
if (!utf8_is_ascii($data['title_alias'])) {
$data['title_alias'] = utf8_to_ascii($data['title_alias']);
}
示例3: list
if ($id) {
$sections = $iaCore->getAcoGroupsFields(false, 'lyrics', "`f`.`type` <> 'pictures'");
$iaCore->assign_by_ref('sections', $sections);
$pictures_sections = $iaCore->getAcoGroupsFields(false, 'lyrics', "`f`.`type`='pictures'", false);
$iaCore->assign_by_ref('pictures_sections', $pictures_sections);
} else {
$sections = $iaCore->getAcoGroupsFields(false, 'lyrics');
$iaCore->assign_by_ref('sections', $sections);
}
if (iaView::REQUEST_HTML == $iaView->getRequestType()) {
if (!empty($_POST)) {
$fields = $iaCore->getAcoFieldsList(false, 'lyrics', false, true);
if ($fields) {
$data = '';
iaCore::util();
list($data, $error, $messages, $errorFields) = iaUtil::updateItemPOSTFields($fields, $lyric);
}
if (!$error) {
$iaCore->startHook("beforeEstateSubmit");
$dmsg = '';
if ($iaCore->get('lyrics_auto_approval') || $action == 'deleted') {
$data['status'] = 'active';
} else {
$data['status'] = 'approval';
$dmsg = '_apporval';
}
if (empty($lyric)) {
$action = 'added';
$data['id'] = $iaLyric->add($data);
if ($data['id'] == 0) {
$error = true;