function ajax_exec_cat() { if (!getperms('0|7')) { exit; } //require_once (e_HANDLER.'js_helper.php'); $e107 = e107::getInstance(); $category = array(); if ($e107->sql->db_Select("news_category", "*", "category_id=" . $this->getId())) { $category = $e107->sql->db_Fetch(); } if (empty($category)) { e_jshelper::sendAjaxError(404, 'Page not found!', 'Requested news category was not found in the DB.', true); } $jshelper = new e_jshelper(); $jshelper->addResponseAction('fill-form', $category); //show cancel and update, hide create buttons; disable create button (just in case) $jshelper->addResponseAction('element-invoke-by-id', array('show' => 'category-clear,update-category', 'disabled,1' => 'create-category', 'hide' => 'create-category', 'newsScrollToMe' => 'core-newspost-cat-create')); //Send the prefered response type $jshelper->sendResponse('XML'); }
//it's grouped userclass if ($row['userclass_type'] == UC_TYPE_GROUP) { //Response action - show group, hide standard $jshelper->addResponseAction('element-invoke-by-id', array('show' => 'userclass_type_groups', 'hide' => 'userclass_type_standard')); //fill in the classes array $tmp = explode(',', $row['userclass_accum']); foreach ($tmp as $uid) { $row['group_classes_select_' . $uid] = $uid; } } else { //hide group, show standard rows $jshelper->addResponseAction('element-invoke-by-id', array('hide' => 'userclass_type_groups', 'show' => 'userclass_type_standard')); } unset($row['userclass_accum']); $jshelper->addResponseAction('fill-form', $row); $jshelper->sendResponse('XML'); // $jshelper->sendResponse('JSON'); - another option (tested) - faster transfer! } else { e_jshelper::sendAjaxError('500', 'Database read error!'); } } exit; } e107::getJs()->headerCore('core/admin.js'); /* * Authorization should be done a bit later! */ require_once "auth.php"; $emessage = e107::getMessage(); //--------------------------------------------------- // Set Initial Classes