本文整理汇总了PHP中Phpfox::massCallback方法的典型用法代码示例。如果您正苦于以下问题:PHP Phpfox::massCallback方法的具体用法?PHP Phpfox::massCallback怎么用?PHP Phpfox::massCallback使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Phpfox
的用法示例。
在下文中一共展示了Phpfox::massCallback方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: query
public function query($sQuery, $iPage, $iTotalShow, $sView = null)
{
if ($sView !== null && Phpfox::isModule($sView))
{
$aModuleResults = Phpfox::callback($sView . '.globalUnionSearch', $this->preParse()->clean($sQuery));
}
else
{
$aModuleResults = Phpfox::massCallback('globalUnionSearch', $this->preParse()->clean($sQuery));
}
$iOffset = ($iPage * $iTotalShow);
$aRows = $this->database()->select('item.*, ' . Phpfox::getUserField())
->unionFrom('item')
->join(Phpfox::getT('user'), 'u', 'u.user_id = item.item_user_id')
->limit($iOffset, $iTotalShow)
->order('item_time_stamp DESC')
->execute('getSlaveRows');
$aResults = array();
foreach ($aRows as $iKey => $aRow)
{
$aResults[] = array_merge($aRow, (array) Phpfox::callback($aRow['item_type_id'] . '.getSearchInfo', $aRow));
}
return $aResults;
}
示例2: getAll
public function getAll()
{
$aInputs = $this->database()->select('i.*')->from(Phpfox::getT('input_field'), 'i')->order('i.ordering ASC')->execute('getSlaveRows');
$aOut = array();
$aCallbacks = Phpfox::massCallback('getEnabledInputField');
foreach ($aInputs as $aInput) {
$sName = '';
foreach ($aCallbacks as $sModule => $aVals) {
foreach ($aVals as $aVal) {
if ($aVal['action'] == $aInput['action']) {
$sName = $aVal['module_phrase'];
break 2;
}
}
}
if (empty($sName)) {
continue;
}
if (!isset($aOut[$sName])) {
$aOut[$sName] = array();
}
if (!isset($aOut[$sName][$aInput['action']])) {
$aOut[$sName][$aInput['action']] = array();
}
// we need to add the phrase to this
$aOut[$sName][$aInput['action']][] = $aInput;
}
return $aOut;
}
示例3: getSiteStatsForAdmin
public function getSiteStatsForAdmin($iStartTime, $iEndTime)
{
$aStats = array();
$iTime = 0;
$aCallback = Phpfox::massCallback('getSiteStatsForAdmin', $iStartTime, $iEndTime);
$sSetting = Phpfox::getParam('core.official_launch_of_site');
$aParams = explode('/', $sSetting);
if (isset($aParams[0]) && isset($aParams[1])) {
$iDiff = round(abs(mktime(0, 0, 0, $aParams[0], $aParams[1], $aParams[2]) - PHPFOX_TIME) / 86400);
}
foreach ($aCallback as $iKey => $aValue) {
if (isset($aValue[0])) {
foreach ($aValue as $aSubValue) {
$aCallback[] = $aSubValue;
}
unset($aCallback[$iKey]);
}
}
foreach ($aCallback as $aValue) {
if (empty($aValue['total'])) {
continue;
}
if (isset($iDiff)) {
$aValue['average'] = round((int) $aValue['total'] / ($iDiff == 0 ? 1 : $iDiff), 2);
}
$aStats[] = $aValue;
}
return $aStats;
}
示例4: get
public function get($iUserId = null)
{
$aUserPrivacy = Phpfox::getService('user.privacy')->getUserSettings($iUserId);
$aNotifications = Phpfox::massCallback('getNotificationSettings');
$aProfiles = Phpfox::massCallback('getProfileSettings');
$aItems = Phpfox::massCallback('getGlobalPrivacySettings');
if (is_array($aNotifications)) {
foreach ($aNotifications as $sModule => $aModules) {
if (!is_array($aModules)) {
continue;
}
foreach ($aModules as $sKey => $aNotification) {
if (isset($aUserPrivacy['notification'][$sKey])) {
$aNotifications[$sModule][$sKey]['default'] = 0;
}
}
}
}
foreach ($aProfiles as $sModule => $aModules) {
foreach ($aModules as $sKey => $aProfile) {
if (isset($aUserPrivacy['privacy'][$sKey])) {
$aProfiles[$sModule][$sKey]['default'] = $aUserPrivacy['privacy'][$sKey];
} else {
$aProfiles[$sModule][$sKey]['default'] = isset($aProfiles[$sModule][$sKey]['default']) ? $aProfiles[$sModule][$sKey]['default'] : 0;
}
}
}
foreach ($aItems as $sModule => $aModules) {
foreach ($aModules as $sKey => $aItem) {
$aItems[$sModule][$sKey]['custom_id'] = str_replace('.', '_', $sKey);
}
}
return array($aUserPrivacy, $aNotifications, $aProfiles, $aItems);
}
示例5: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
if ($this->request()->get('update')) {
$aModules = Phpfox::massCallback('getSqlTitleField');
$aParseTables = array();
if (is_array($aModules) && count($aModules)) {
foreach ($aModules as $aModule) {
if (isset($aModule['table'])) {
$aModule = array($aModule);
}
foreach ($aModule as $aInfo) {
$aParseTables[] = $aInfo;
}
}
}
$oDb = Phpfox::getLib('database');
foreach ($aParseTables as $aParseTable) {
if (isset($aParseTable['has_index'])) {
$aIndexes = Phpfox::getLib('database.support')->getIndexes(Phpfox::getT($aParseTable['table']), null, $oDb, true);
foreach ($aIndexes as $aIndex) {
if ($aIndex['Column_name'] == $aParseTable['has_index']) {
$oDb->query('ALTER TABLE ' . Phpfox::getT($aParseTable['table']) . ' DROP INDEX ' . $aIndex['Key_name']);
}
}
}
Phpfox::getLib('database')->query('ALTER TABLE ' . Phpfox::getT($aParseTable['table']) . ' CHANGE ' . $aParseTable['field'] . ' ' . $aParseTable['field'] . ' text');
}
$this->url()->send('admincp.sql.title', null, Phpfox::getPhrase('admincp.database_tables_updated'));
}
$this->template()->setTitle(Phpfox::getPhrase('admincp.alter_title_fields'))->setBreadcrumb(Phpfox::getPhrase('admincp.alter_title_fields'))->assign(array());
}
示例6: update
public function update()
{
Phpfox::massCallback('getGlobalNotifications');
if ($sPlugin = Phpfox_Plugin::get('notification.component_ajax_update_1')) {
eval($sPlugin);
}
$this->call('$Core.notification.setTitle();');
}
示例7: process
/**
* Controller
*/
public function process()
{
$this->_setMenuName('admincp.user.browse');
$bIsEdit = false;
if ($iId = $this->request()->getInt('id')) {
if ($aUser = Phpfox::getService('user')->getForEdit($iId)) {
$bIsEdit = true;
if (!empty($aUser['birthday'])) {
$aUser = array_merge($aUser, Phpfox::getService('user')->getAgeArray($aUser['birthday']));
}
$this->template()->assign('aForms', $aUser);
if (Phpfox::getService('user')->isAdminUser($aUser['user_id'])) {
return Phpfox_Error::display(Phpfox::getPhrase('user.you_are_unable_to_edit_a_site_administrators_account'));
}
}
}
if (!isset($aUser)) {
$this->url()->send('admincp', null, 'This section requires that you select.');
}
if ($aVals = $this->request()->getArray('val')) {
if ($bIsEdit) {
if (Phpfox::getService('user.process')->updateAdvanced($aUser['user_id'], $aVals)) {
Phpfox::getService('custom.process')->updateFields($aUser['user_id'], Phpfox::getUserId(), $this->request()->getArray('custom'));
if (Phpfox::getUserParam('user.can_edit_other_user_privacy')) {
Phpfox::getService('user.privacy.process')->update($aVals, $aUser['user_id']);
}
$this->url()->send('admincp.user.add', array('id' => $aUser['user_id']), Phpfox::getPhrase('user.user_successfully_updated'));
}
} else {
}
}
$aUserGroups = array();
foreach (Phpfox::getService('user.group')->get() as $aUserGroup) {
$aUserGroups[$aUserGroup['user_group_id']] = Phpfox_Locale::instance()->convert($aUserGroup['title']);
}
$aLanguages = array();
foreach (Phpfox::getService('language')->get(array('l.user_select = 1')) as $aLanguage) {
$aLanguages[$aLanguage['language_id']] = Phpfox::getLib('parse.output')->clean($aLanguage['title']);
}
$aEditForm = array('basic' => array('title' => Phpfox::getPhrase('user.basic_information'), 'data' => array(array('title' => Phpfox::getPhrase('user.display_name'), 'value' => isset($aVals['full_name']) ? $aVals['full_name'] : (isset($aUser['full_name']) ? $aUser['full_name'] : ''), 'type' => 'input:text', 'id' => 'full_name', 'required' => true), array('title' => Phpfox::getPhrase('user.username'), 'value' => isset($aVals['user_name']) ? $aVals['user_name'] : (isset($aUser['user_name']) ? $aUser['user_name'] : ''), 'type' => 'input:text:check', 'id' => 'user_name', 'required' => true), array('title' => Phpfox::getPhrase('user.password'), 'value' => '', 'type' => 'input:password:check', 'id' => 'password', 'required' => true), array('title' => Phpfox::getPhrase('user.email'), 'value' => isset($aVals['email']) ? $aVals['email'] : (isset($aUser['email']) ? $aUser['email'] : ''), 'type' => 'input:text:check', 'id' => 'email', 'required' => true), array('title' => Phpfox::getPhrase('user.user_group'), 'value' => isset($aVals['user_group_id']) ? $aVals['user_group_id'] : (isset($aUser['user_group_id']) ? $aUser['user_group_id'] : ''), 'type' => 'select', 'id' => 'user_group_id', 'options' => $aUserGroups, 'required' => true), array('title' => Phpfox::getPhrase('user.location'), 'value' => isset($aVals['country_iso']) ? $aVals['country_iso'] : (isset($aUser['country_iso']) ? $aUser['country_iso'] : ''), 'type' => 'select', 'id' => 'country_iso', 'options' => Phpfox::getService('core.country')->get()), array('title' => Phpfox::getPhrase('user.city'), 'value' => isset($aVals['city_location']) ? $aVals['city_location'] : (isset($aUser['city_location']) ? $aUser['city_location'] : ''), 'type' => 'input:text', 'id' => 'city_location'), array('title' => Phpfox::getPhrase('user.zip_postal_code'), 'value' => isset($aVals['postal_code']) ? $aVals['postal_code'] : (isset($aUser['postal_code']) ? $aUser['postal_code'] : ''), 'type' => 'input:text', 'id' => 'postal_code'), array('title' => Phpfox::getPhrase('user.gender'), 'value' => isset($aVals['gender']) ? $aVals['gender'] : (isset($aUser['gender']) ? $aUser['gender'] : ''), 'type' => 'select', 'id' => 'gender', 'options' => Phpfox::getService('core')->getGenders(), 'required' => true), array('title' => Phpfox::getPhrase('user.date_of_birth'), 'type' => 'date_of_birth'), array('title' => Phpfox::getPhrase('user.time_zone'), 'value' => isset($aVals['time_zone']) ? $aVals['time_zone'] : (isset($aUser['time_zone']) ? $aUser['time_zone'] : ''), 'type' => 'select', 'id' => 'time_zone', 'options' => Phpfox::getService('core')->getTimeZones()), array('title' => Phpfox::getPhrase('user.status'), 'value' => isset($aVals['status']) ? $aVals['status'] : (isset($aUser['status']) ? $aUser['status'] : ''), 'type' => 'input:text', 'id' => 'status'), array('title' => Phpfox::getPhrase('user.spam_count'), 'value' => isset($aVals['total_spam']) ? $aVals['total_spam'] : (isset($aUser['total_spam']) ? $aUser['total_spam'] : ''), 'type' => 'input:text', 'id' => 'total_spam'), array('title' => Phpfox::getPhrase('user.primary_language'), 'value' => isset($aVals['language_id']) ? $aVals['language_id'] : (isset($aUser['language_id']) ? $aUser['language_id'] : ''), 'type' => 'select', 'id' => 'language_id', 'options' => $aLanguages), array('title' => Phpfox::getPhrase('user.forum_signature'), 'value' => isset($aVals['signature']) ? $aVals['signature'] : (isset($aUser['signature']) ? $aUser['signature'] : ''), 'type' => 'input:textarea', 'id' => 'signature'))));
($sPlugin = Phpfox_Plugin::get('user.component_controller_admincp_add')) ? eval($sPlugin) : false;
list($aUserPrivacy, $aNotifications, $aProfiles) = Phpfox::getService('user.privacy')->get($aUser['user_id']);
$this->setParam('aUser', $aUser);
$aActivityPoints = array();
$aActivityPoints['activity_total'] = array(Phpfox::getPhrase('user.total_activity') => $aUser['activity_total']);
$aActivityPoints['activity_points'] = array(Phpfox::getPhrase('user.total_activity_points') => $aUser['activity_points']);
$aMassActivityCallback = Phpfox::massCallback('getActivityPointField');
foreach ($aMassActivityCallback as $aMassActivityCallbackModules) {
foreach ($aMassActivityCallbackModules as $sName => $sValue) {
$aActivityPoints[$sValue] = array($sName => $aUser[$sValue]);
}
}
$aSettings = Phpfox::getService('custom')->getForEdit(array('user_main', 'user_panel', 'profile_panel'), $aUser['user_id'], $aUser['user_group_id'], false, $aUser['user_id']);
$this->template()->setSectionTitle('Members')->setTitle(Phpfox::getPhrase('user.editing_member'))->setBreadcrumb(Phpfox::getPhrase('user.browse_members'), $this->url()->makeUrl('admincp.user.browse'))->setBreadcrumb($bIsEdit ? Phpfox::getPhrase('user.editing_member') . ': ' . $aUser['full_name'] . ' (#' . $aUser['user_id'] . ')' : Phpfox::getPhrase('user.add_new_member'), null, true)->setPhrase(array('user.loading_custom_fields'))->setHeader('cache', array('country.js' => 'module_core'))->assign(array('bIsEdit' => $bIsEdit, 'iFormUserId' => $bIsEdit ? $aUser['user_id'] : '', 'aEditForm' => $aEditForm, 'aSettings' => $aSettings, 'aUser' => $aUser, 'aPrivacyNotifications' => $aNotifications, 'aProfiles' => $aProfiles, 'aUserPrivacy' => $aUserPrivacy, 'aActivityPoints' => $aActivityPoints, 'sDobStart' => Phpfox::getParam('user.date_of_birth_start'), 'sDobEnd' => Phpfox::getParam('user.date_of_birth_end')));
}
示例8: process
/**
* Controller
*/
public function process()
{
$aUser = Phpfox::getService('user')->get(Phpfox::getUserId(), true);
$aModules = Phpfox::massCallback('getDashboardActivity');
$aActivites = array(Phpfox::getPhrase('core.total_items') => $aUser['activity_total'], Phpfox::getPhrase('core.activity_points') => $aUser['activity_points'] . (Phpfox::getParam('user.can_purchase_activity_points') ? '<span id="purchase_points_link">(<a href="#" onclick="$Core.box(\'user.purchasePoints\', 500); return false;">' . Phpfox::getPhrase('user.purchase_points') . '</a>)</span>' : ''));
foreach ($aModules as $aModule) {
foreach ($aModule as $sPhrase => $sLink) {
$aActivites[$sPhrase] = $sLink;
}
}
$this->template()->assign(array('aActivites' => $aActivites));
}
示例9: getMenu
public function getMenu()
{
$aMenus = array();
$aCallback = Phpfox::massCallback('mobileMenu');
foreach ($aCallback as $sModule => $aReturn)
{
$aMenus[] = $aReturn;
}
return $aMenus;
}
示例10: process
/**
* Controller
*/
public function process()
{
$aModules = Phpfox::massCallback('reparserList');
foreach ($aModules as $iKey => $aModule) {
if (!isset($aModule['name'])) {
unset($aModules[$iKey]);
$iCnt = 0;
foreach ($aModule as $iModuleKey => $aCacheModule) {
$iCnt++;
$aModules = array_merge($aModules, array('custom' . $iCnt => $aCacheModule));
}
}
}
foreach ($aModules as $iKey => $aModule) {
if (!isset($aModule['name'])) {
foreach ($aModule as $iSubKey => $aSub) {
$aModules[$iKey . '_' . $iSubKey] = $aSub;
}
unset($aModules[$iKey]);
}
if (is_array($aModule['table'])) {
$aModule['table'] = $aModule['table'][0];
}
$aModules[$iKey]['total_record'] = Phpfox_Database::instance()->select('COUNT(*)')->from(Phpfox::getT($aModule['table']))->execute('getSlaveField');
if ($aModules[$iKey]['total_record'] == 0) {
unset($aModules[$iKey]);
}
}
$iPage = $this->request()->get('page');
$iLimit = 200;
if (($sModule = $this->request()->get('module')) && isset($aModules[$sModule])) {
$iCnt = Phpfox::getService('admincp.maintain')->reParseText($aModules[$sModule], $iPage, $iLimit);
Phpfox_Pager::instance()->set(array('page' => $iPage, 'size' => $iLimit, 'count' => $iCnt));
$iTotalPages = (int) Phpfox_Pager::instance()->getTotalPages();
$iCurrentPage = (int) Phpfox_Pager::instance()->getCurrentPage();
$iPage = (int) Phpfox_Pager::instance()->getNextPage();
if ($iTotalPages === $iCurrentPage || $iTotalPages === 0) {
$this->url()->send('admincp.maintain.reparser', null, Phpfox::getPhrase('admincp.parsing_completed'));
} else {
$this->template()->assign(array('bInProcess' => true, 'iCurrentPage' => $iCurrentPage, 'iTotalPages' => $iTotalPages))->setHeader(array('<meta http-equiv="refresh" content="2;url=' . Phpfox_Url::instance()->makeUrl('admincp.maintain.reparser', array('module' => $sModule, 'page' => $iPage)) . '" />'));
}
}
$this->template()->setTitle(Phpfox::getPhrase('admincp.text_reparser'))->setSectionTitle('Content Re-Parser')->assign(array('aReparserLists' => $aModules));
}
示例11: getTagCloud
public function getTagCloud($sCategory, $iUserId = null, $mMaxDisplay = null)
{
($sPlugin = Phpfox_Plugin::get('tag.service_tag_gettagcloud_start')) ? eval($sPlugin) : false;
if ($sCategory === null) {
$aParams = Phpfox::massCallback('getTagCloud');
} else {
$aParams = Phpfox::callback($sCategory . '.getTagCloud');
}
$aTempTags = array();
$sCacheId = $this->cache()->set('tag_cloud_' . ($sCategory === null ? 'global' : str_replace('/', '_', $aParams['link'])) . ($iUserId !== null ? '_' . $iUserId : '') . (defined('TAG_ITEM_ID') ? '_' . TAG_ITEM_ID : ''));
if (defined('PHPFOX_IS_GROUP_INDEX')) {
$sCategory = 'video_group';
}
if (!($aTempTags = $this->cache()->get($sCacheId, Phpfox::getParam('tag.tag_cache_tag_cloud')))) {
$aWhere = array();
if (defined('TAG_ITEM_ID')) {
$aWhere[] = 'AND item_id = ' . (int) TAG_ITEM_ID;
}
if ($sCategory !== null) {
$aWhere[] = "AND category_id = '" . $this->database()->escape($aParams['category']) . "'" . ($iUserId !== null ? ' AND user_id = ' . (int) $iUserId : '');
}
if (!defined('TAG_ITEM_ID')) {
$aWhere[] = 'AND added > ' . (PHPFOX_TIME - 86400 * Phpfox::getParam('tag.tag_days_treading'));
}
$aRows = $this->database()->select('category_id, tag_text AS tag, tag_url, COUNT(item_id) AS total')->from(Phpfox::getT('tag'))->where($aWhere)->group('tag_text, tag_url')->having('total > ' . (int) Phpfox::getParam('tag.tag_min_display'))->order('total DESC')->limit(Phpfox::getParam('tag.tag_trend_total_display'))->execute('getSlaveRows');
if (!count($aRows)) {
return array();
}
if ($sCategory === null) {
$aParams['link'] = 'search';
}
$aTempTags = array();
foreach ($aRows as $aRow) {
$aTempTags[] = array('value' => $aRow['total'], 'key' => $aRow['tag'], 'url' => $aRow['tag_url'], 'link' => $sCategory === null && Phpfox::getParam('tag.enable_hashtag_support') ? Phpfox::getLib('url')->makeUrl('hashtag', array($aRow['tag_url'])) : Phpfox::getLib('url')->makeUrl($aParams['link'], array('tag', $aRow['tag_url'])));
}
if (!count($aTempTags)) {
return array();
}
$this->cache()->save($sCacheId, $aTempTags);
}
($sPlugin = Phpfox_Plugin::get('tag.service_tag_gettagcloud_end')) ? eval($sPlugin) : false;
return $aTempTags;
}
示例12: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
$aMethods = array();
$aCallbacks = Phpfox::massCallback('getApiSupportedMethods');
foreach ($aCallbacks as $sModule => $aCallback) {
foreach ($aCallback['methods'] as $iKey => $aMethod) {
$aCallback['methods'][$iKey]['response'] = str_replace('[DOMAIN_REPLACE]', Phpfox::getParam('core.host'), str_replace('stdClass ', '', highlight_string(print_r(json_decode($aMethod['response']), true), true)));
$sUrl = '/api.php?method=' . $aCallback['module'] . '.' . $aMethod['call'] . '';
if (isset($aMethod['requires']) && is_array($aMethod['requires'])) {
foreach ($aMethod['requires'] as $sRequireKey => $sRequireType) {
$sUrl .= '&' . $sRequireKey . '=#{' . strtoupper($sRequireType) . '}';
}
}
$aCallback['methods'][$iKey]['url'] = $sUrl;
}
$aMethods[] = $aCallback;
}
$sTokenResponse = str_replace('stdClass ', '', highlight_string(print_r(json_decode('{"token":"LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUc4d0RRWUpLb1pJaHZjTkFRRUJCUUFEWGdBd1d3SlVBdHFZdmVWOXFEdDd6NFhXTXYzS3VZM2JyWXpUKzR0VgpBbERrN1dQWjhqRVpoVzBNWjE1Z3lHdGNlNm5ueFRNenp4SXpHM29BRVIzc0JVRCtYdStHb21JeVV4UE1RN1NtCkVPdFg0ZTNwekp6R081cUxBZ01CQUFFPQotLS0tLUVORCBQVUJMSUMgS0VZLS0tLS0K"}'), true), true));
$this->template()->setTitle(Phpfox::getPhrase('apps.app_developers'))->setBreadcrumb(Phpfox::getPhrase('apps.apps'), $this->url()->makeUrl('apps'))->setBreadcrumb(Phpfox::getPhrase('apps.developers'), $this->url()->makeUrl('apps.developer'), true)->setFullSite()->setHeader(array('apps.css' => 'style_css', 'apps.js' => 'module_apps'))->assign(array('sSiteName' => Phpfox::getParam('core.site_title'), 'aMethods' => $aMethods, 'sSampleCall' => Phpfox::getParam('core.path') . 'api.php?token=#{TOKEN}&method=#{METHOD_NAME}', 'sTokenSampleCall' => Phpfox::getParam('core.path') . 'token.php?key=$_GET[\'key\']', 'sTokenResponse' => $sTokenResponse, 'sAppLink' => $this->url()->makeUrl('apps.add')));
}
示例13: process
/**
* Controller
*/
public function process()
{
$bIsEdit = false;
if ($iEditId = $this->request()->getInt('id')) {
Phpfox::getUserParam('custom.can_manage_custom_fields', true);
if (($aGroup = Phpfox::getService('custom.group')->getForEdit($iEditId)) && isset($aGroup['group_id'])) {
$bIsEdit = true;
$this->template()->assign(array('aForms' => $aGroup));
}
} else {
Phpfox::getUserParam('custom.can_add_custom_fields_group', true);
}
$aGroupValidation = array('product_id' => Phpfox::getPhrase('custom.select_a_product_this_custom_field_will_belong_to'), 'module_id' => Phpfox::getPhrase('custom.select_a_module_this_custom_field_will_belong_to'), 'type_id' => Phpfox::getPhrase('custom.select_where_this_custom_field_should_be_located'));
$oGroupValidator = Phpfox_Validator::instance()->set(array('sFormName' => 'js_group_field', 'aParams' => $aGroupValidation, 'bParent' => true));
$aGroupTypes = array();
foreach (Phpfox::massCallback('getCustomGroups') as $sModule => $aCustomGroups) {
foreach ($aCustomGroups as $sKey => $sPhrase) {
$aGroupTypes[$sKey] = $sPhrase;
}
}
if ($aVals = $this->request()->getArray('val')) {
if ($oGroupValidator->isValid($aVals)) {
if ($bIsEdit === true) {
if (Phpfox::getService('custom.group.process')->update($aGroup['group_id'], $aVals)) {
$this->url()->send('admincp.custom.group.add', array('id' => $aGroup['group_id']), Phpfox::getPhrase('custom.group_successfully_updated'));
}
} else {
if (Phpfox::getService('custom.group.process')->add($aVals)) {
$this->url()->send('admincp.custom.group.add', null, Phpfox::getPhrase('custom.group_successfully_added'));
}
}
}
}
$aUserGroups = Phpfox::getService('user.group')->get();
foreach ($aUserGroups as $iKey => $aUserGroup) {
if (!Phpfox::getUserGroupParam($aUserGroup['user_group_id'], 'custom.has_special_custom_fields')) {
unset($aUserGroups[$iKey]);
}
}
$this->template()->setTitle(Phpfox::getPhrase('custom.add_a_new_custom_group'))->setBreadcrumb(Phpfox::getPhrase('custom.add_a_new_custom_group'))->assign(array('sGroupCreateJs' => $oGroupValidator->createJS(), 'sGroupGetJsForm' => $oGroupValidator->getJsForm(), 'aGroupTypes' => $aGroupTypes, 'bIsEdit' => $bIsEdit, 'aUserGroups' => $aUserGroups));
}
示例14: process
/**
* Controller
*/
public function process()
{
$aModules = Phpfox::massCallback('removeDuplicateList');
$sCheck = $this->request()->get('table');
$aLists = array();
foreach ($aModules as $sModule => $aList) {
if (isset($aList['name'])) {
$aList = array($aList);
}
foreach ($aList as $iKey => $aRow) {
if (!empty($sCheck) && $aRow['table'] == $sCheck) {
$mReturn = Phpfox::getService('admincp.maintain')->removeDuplicates($aRow);
if ($mReturn === true) {
$this->url()->send('admincp.maintain.duplicate', null, Phpfox::getPhrase('admincp.successfully_removed_duplicate_entries'));
}
break;
}
}
$aLists = array_merge($aLists, $aList);
}
$this->template()->setTitle(Phpfox::getPhrase('admincp.remove_duplicates'))->setSectionTitle(Phpfox::getPhrase('admincp.remove_duplicates'))->assign(array('aLists' => $aLists));
}
示例15: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
$aModulesEnabled = Phpfox::massCallback('getEnabledInputField');
$jLanguages = json_encode(Phpfox::getService('language')->getForAdminCp());
$bIsEdit = false;
$aUserGroups = Phpfox::getService('user.group')->get();
$sJsAction = 'prepareAdd();';
$aOut = array();
foreach ($aModulesEnabled as $aInput) {
if (isset($aInput['module_id'])) {
$aOut[] = $aInput;
} else {
foreach ($aInput as $aSub) {
$aOut[] = $aSub;
}
}
}
$aModulesEnabled = $aOut;
if ($iId = $this->request()->getInt('id')) {
if ($aVals = $this->request()->getArray('val')) {
if (Phpfox::getService('input.process')->update(array_merge($aVals, array('field_id' => $iId)))) {
$this->url()->send('admincp.input.add', array('id' => $iId), 'Field updated successfully');
} else {
Phpfox_Error::set('Oops');
}
}
$aInput = Phpfox::getService('input')->getForEdit($iId);
$sJsAction = 'prepareEdit(\'' . json_encode($aInput) . '\');';
$bIsEdit = $iId;
$this->template()->setHeader(array('drag.js' => 'static_script', 'jquery/ui.js' => 'static_script', '<script type="text/javascript">$Behavior.addSort = function(){Core_drag.init({table: \'.js_drag_drop\', ajax: \'input.optionsOrdering\'});}</script>'));
}
if ($aVal = $this->request()->get('val')) {
if (Phpfox::getService('input.process')->add($aVal)) {
$this->url()->send('admincp.input.add', null, 'New field added successfully');
}
}
$this->template()->setTitle(Phpfox::getPhrase('input.add_input_field'))->setBreadcrumb(Phpfox::getPhrase('input.add_input_field'), null, true)->setHeader(array('admin.js' => 'module_input', 'admin.css' => 'module_input', '<script type="text/javascript"> $Behavior.initInput = function(){$Core.input.setLanguages(\'' . $jLanguages . '\'); $Core.input.' . $sJsAction . ' }</script>'))->assign(array('bIsEdit' => $bIsEdit, 'aModulesEnabled' => $aModulesEnabled, 'aUserGroups' => $aUserGroups));
}