本文整理汇总了PHP中utils::ReadMultipleSelection方法的典型用法代码示例。如果您正苦于以下问题:PHP utils::ReadMultipleSelection方法的具体用法?PHP utils::ReadMultipleSelection怎么用?PHP utils::ReadMultipleSelection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类utils
的用法示例。
在下文中一共展示了utils::ReadMultipleSelection方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: DBObjectSearch
$oShortcut->StartRenameDialog($oPage);
break;
case 'shortcut_rename_go':
$iShortcut = utils::ReadParam('id', 0);
$oShortcut = MetaModel::GetObject('Shortcut', $iShortcut);
$sName = utils::ReadParam('attr_name', '', false, 'raw_data');
if (strlen($sName) > 0) {
$oShortcut->Set('name', $sName);
$oShortcut->DBUpdate();
$oPage->add_ready_script('window.location.reload();');
}
break;
case 'shortcut_delete_go':
$oSearch = new DBObjectSearch('Shortcut');
$oSearch->AddCondition('user_id', UserRights::GetUserId(), '=');
$aShortcuts = utils::ReadMultipleSelection($oSearch);
foreach ($aShortcuts as $iShortcut) {
$oShortcut = MetaModel::GetObject('Shortcut', $iShortcut);
$oShortcut->DBDelete();
$oPage->add_ready_script('window.location.reload();');
}
break;
case 'export_dashboard':
$sMenuId = utils::ReadParam('id', '', false, 'raw_data');
ApplicationMenu::LoadAdditionalMenus();
$index = ApplicationMenu::GetMenuIndexById($sMenuId);
$oMenu = ApplicationMenu::GetMenuNode($index);
if ($oMenu instanceof DashboardMenuNode) {
$oDashboard = $oMenu->GetDashboard();
$oPage->TrashUnexpectedOutput();
$oPage->SetContentType('text/xml');
示例2: StimulusChecker
$oP->add('<h1>' . MetaModel::GetClassIcon($sClass) . ' ' . $sActionLabel . '</h1>');
$oP->add('</div>');
$oChecker = new StimulusChecker($oFilter, $sState, $sStimulus);
$aExtraFormParams = array('stimulus' => $sStimulus, 'state' => $sState);
DisplayMultipleSelectionForm($oP, $oFilter, 'bulk_stimulus', $oChecker, $aExtraFormParams);
break;
case 'bulk_stimulus':
$sFilter = utils::ReadParam('filter', '', false, 'raw_data');
$sStimulus = utils::ReadParam('stimulus', '');
$sState = utils::ReadParam('state', '');
if (empty($sFilter) || empty($sStimulus) || empty($sState)) {
throw new ApplicationException(Dict::Format('UI:Error:3ParametersMissing', 'filter', 'stimulus', 'state'));
}
$oFilter = DBObjectSearch::unserialize($sFilter);
$sClass = $oFilter->GetClass();
$aSelectObject = utils::ReadMultipleSelection($oFilter);
if (count($aSelectObject) == 0) {
// Nothing to do, no object was selected !
throw new ApplicationException(Dict::S('UI:BulkAction:NoObjectSelected'));
} else {
$aTransitions = MetaModel::EnumTransitions($sClass, $sState);
$aStimuli = MetaModel::EnumStimuli($sClass);
$sActionLabel = $aStimuli[$sStimulus]->GetLabel();
$sActionDetails = $aStimuli[$sStimulus]->GetDescription();
$aTransition = $aTransitions[$sStimulus];
$sTargetState = $aTransition['target_state'];
$aStates = MetaModel::EnumStates($sClass);
$aTargetStateDef = $aStates[$sTargetState];
$oP->set_title(Dict::Format('UI:StimulusModify_N_ObjectsOf_Class', $sActionLabel, count($aSelectObject), $sClass));
$oP->add('<div class="page_header">');
$oP->add('<h1>' . MetaModel::GetClassIcon($sClass) . ' ' . Dict::Format('UI:StimulusModify_N_ObjectsOf_Class', $sActionLabel, count($aSelectObject), $sClass) . '</h1>');
示例3: DoAddObjects
public function DoAddObjects(WebPage $oP, $oFullSetFilter)
{
$aLinkedObjectIds = utils::ReadMultipleSelection($oFullSetFilter);
foreach ($aLinkedObjectIds as $iObjectId) {
$oLinkObj = MetaModel::GetObject($this->sLinkedClass, $iObjectId);
$oP->add($this->GetObjectRow($oP, $oLinkObj, $oLinkObj->GetKey()));
}
}
示例4: DoAddObjects
public function DoAddObjects(WebPage $oP, $oFullSetFilter, $oCurrentObj)
{
$aLinkedObjectIds = utils::ReadMultipleSelection($oFullSetFilter);
foreach ($aLinkedObjectIds as $iObjectId) {
$oLinkedObj = MetaModel::GetObject($this->m_sRemoteClass, $iObjectId);
if (is_object($oLinkedObj)) {
$aRow = $this->GetFormRow($oP, $oLinkedObj, -$iObjectId, array(), $oCurrentObj);
// Not yet created link get negative Ids
$oP->add($this->DisplayFormRow($oP, $this->m_aTableConfig, $aRow, -$iObjectId));
} else {
$oP->p(Dict::Format('UI:Error:Object_Class_Id_NotFound', $this->m_sLinkedClass, $iObjectId));
}
}
}
示例5: iTopWebPage
// Check user rights and prompt if needed
$iStep = utils::ReadParam('step', 1);
$oPage = new iTopWebPage(Dict::S('UI:Preferences'));
$sOperation = utils::ReadParam('operation', '');
try {
switch ($sOperation) {
case 'apply':
$oFilter = DBObjectSearch::FromOQL('SELECT Organization');
$sSelectionMode = utils::ReadParam('selectionMode', '');
$aExceptions = utils::ReadParam('storedSelection', array());
if ($sSelectionMode == 'negative' && count($aExceptions) == 0) {
// All Orgs selected
appUserPreferences::SetPref('favorite_orgs', null);
} else {
// Some organizations selected... store them
$aSelectOrgs = utils::ReadMultipleSelection($oFilter);
appUserPreferences::SetPref('favorite_orgs', $aSelectOrgs);
}
DisplayPreferences($oPage);
break;
case 'apply_language':
$sLangCode = utils::ReadParam('language', 'EN US');
$oUser = UserRights::GetUserObject();
$oUser->Set('language', $sLangCode);
$oUser->DBUpdate();
// Redirect to force a reload/display of the page with the new language
$oAppContext = new ApplicationContext();
$sURL = utils::GetAbsoluteUrlAppRoot() . 'pages/preferences.php?' . $oAppContext->GetForLink();
$oPage->add_header('Location: ' . $sURL);
break;
case 'apply_others':