本文整理汇总了PHP中ModuleManager::GetNextModule方法的典型用法代码示例。如果您正苦于以下问题:PHP ModuleManager::GetNextModule方法的具体用法?PHP ModuleManager::GetNextModule怎么用?PHP ModuleManager::GetNextModule使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModuleManager
的用法示例。
在下文中一共展示了ModuleManager::GetNextModule方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Timeline
/**
* Shows the TimeLine
*/
public function Timeline()
{
$db =& $this->db;
$user =& $this->user;
$response = new ResponseManager();
$response->html = '';
$layoutId = Kit::GetParam('layoutid', _GET, _INT);
$regionId = Kit::GetParam('regionid', _REQUEST, _STRING);
// Make sure we have permission to edit this region
Kit::ClassLoader('region');
$region = new region($db);
$ownerId = $region->GetOwnerId($layoutId, $regionId);
$regionAuth = $this->user->RegionAssignmentAuth($ownerId, $layoutId, $regionId, true);
if (!$regionAuth->edit) {
trigger_error(__('You do not have permissions to edit this region'), E_USER_ERROR);
}
// Library location
$libraryLocation = Config::GetSetting('LIBRARY_LOCATION');
// Present a canvas with 2 columns, left column for the media icons
$buttons = array();
// Always output a Library assignment button
$buttons[] = array('id' => 'media_button_library', 'url' => 'index.php?p=content&q=LibraryAssignForm&layoutid=' . $layoutId . '®ionid=' . $regionId, 'text' => __('Library'));
// Get a list of the enabled modules and then create buttons for them
if (!($enabledModules = new ModuleManager($db, $user))) {
trigger_error($enabledModules->message, E_USER_ERROR);
}
// Loop through the buttons we have and output each one
while ($modulesItem = $enabledModules->GetNextModule()) {
$mod = Kit::ValidateParam($modulesItem['Module'], _STRING);
$caption = Kit::ValidateParam($modulesItem['Name'], _STRING);
$mod = strtolower($mod);
$title = Kit::ValidateParam($modulesItem['Description'], _STRING);
$img = Kit::ValidateParam($modulesItem['ImageUri'], _STRING);
$buttons[] = array('id' => 'media_button_' . $mod, 'url' => 'index.php?p=module&q=Exec&mod=' . $mod . '&method=AddForm&layoutid=' . $layoutId . '®ionid=' . $regionId, 'text' => __($caption));
}
Theme::Set('media_buttons', $buttons);
$response->html .= '<div class="container-fluid">';
$response->html .= '<div class="row-fluid">';
$response->html .= Theme::RenderReturn('layout_designer_form_timeline');
// Load the XML for this layout and region, we need to get the media nodes.
// These form the timeline and go in the right column
// Generate an ID for the list (this is passed into the reorder function)
$timeListMediaListId = uniqid('timelineMediaList_');
$response->html .= '<div class="span10">';
$response->html .= '<div id="timelineControl" class="timelineColumn" layoutid="' . $layoutId . '" regionid="' . $regionId . '">';
$response->html .= ' <div class="timelineMediaVerticalList">';
$response->html .= ' <ul id="' . $timeListMediaListId . '" class="timelineSortableListOfMedia">';
// How are we going to colour the bars, my media type or my permissions
$timeBarColouring = Config::GetSetting('REGION_OPTIONS_COLOURING');
// Create a layout object
$region = new Region($db);
foreach ($region->GetMediaNodeList($layoutId, $regionId) as $mediaNode) {
// Put this node vertically in the region timeline
$mediaId = $mediaNode->getAttribute('id');
$lkId = $mediaNode->getAttribute('lkid');
$mediaType = $mediaNode->getAttribute('type');
$mediaDuration = $mediaNode->getAttribute('duration');
$ownerId = $mediaNode->getAttribute('userId');
// Permissions for this assignment
$auth = $user->MediaAssignmentAuth($ownerId, $layoutId, $regionId, $mediaId, true);
// Skip over media assignments that we do not have permission to see
if (!$auth->view) {
continue;
}
Debug::LogEntry('audit', sprintf('Permission Granted to View MediaID: %s', $mediaId), 'layout', 'TimeLine');
// Create a media module to handle all the complex stuff
require_once "modules/{$mediaType}.module.php";
$tmpModule = new $mediaType($db, $user, $mediaId, $layoutId, $regionId, $lkId);
$mediaName = $tmpModule->GetName();
$transitionIn = $tmpModule->GetTransition('in');
$transitionOut = $tmpModule->GetTransition('out');
// Colouring for the media block
if ($timeBarColouring == 'Permissions') {
$mediaBlockColouringClass = 'timelineMediaItemColouring_' . ($auth->edit ? 'enabled' : 'disabled');
} else {
$mediaBlockColouringClass = 'timelineMediaItemColouring_' . $mediaType;
}
// Create the list item
$response->html .= '<li class="timelineMediaListItem" mediaid="' . $mediaId . '" lkid="' . $lkId . '">';
// In transition
$response->html .= ' <div class="timelineMediaInTransition">';
if ($transitionIn != 'None') {
$response->html .= '<span>' . $transitionIn . '</span>';
}
$response->html .= ' </div>';
// Media Bar
$response->html .= ' <div class="timelineMediaItem">';
$response->html .= ' <ul class="timelineMediaItemLinks">';
// Create some links
if ($auth->edit) {
$response->html .= '<li><a class="XiboFormButton timelineMediaBarLink" href="index.php?p=module&mod=' . $mediaType . '&q=Exec&method=EditForm&layoutid=' . $layoutId . '®ionid=' . $regionId . '&mediaid=' . $mediaId . '&lkid=' . $lkId . '" title="' . __('Click to edit this media') . '">' . __('Edit') . '</a></li>';
}
if ($auth->del) {
$response->html .= '<li><a class="XiboFormButton timelineMediaBarLink" href="index.php?p=module&mod=' . $mediaType . '&q=Exec&method=DeleteForm&layoutid=' . $layoutId . '®ionid=' . $regionId . '&mediaid=' . $mediaId . '&lkid=' . $lkId . '" title="' . __('Click to delete this media') . '">' . __('Delete') . '</a></li>';
}
if ($auth->modifyPermissions) {
$response->html .= '<li><a class="XiboFormButton timelineMediaBarLink" href="index.php?p=module&mod=' . $mediaType . '&q=Exec&method=PermissionsForm&layoutid=' . $layoutId . '®ionid=' . $regionId . '&mediaid=' . $mediaId . '&lkid=' . $lkId . '" title="Click to change permissions for this media">' . __('Permissions') . '</a></li>';
//.........这里部分代码省略.........
示例2: displayForms
/**
* Display the forms
*/
function displayForms()
{
$db =& $this->db;
$user =& $this->user;
//displays all the content add forms - tabbed.
$response = new ResponseManager();
// Get a list of the enabled modules and then create buttons for them
if (!($enabledModules = new ModuleManager($user, 0, '', -1))) {
trigger_error($enabledModules->message, E_USER_ERROR);
}
$buttons = array();
// Loop through the buttons we have and output store HTML for each one in $buttons.
while ($modulesItem = $enabledModules->GetNextModule()) {
$button['mod'] = Kit::ValidateParam($modulesItem['Module'], _STRING);
$button['caption'] = __('Add') . ' ' . Kit::ValidateParam($modulesItem['Name'], _STRING);
$button['mod'] = strtolower($button['mod']);
$button['title'] = Kit::ValidateParam($modulesItem['Description'], _STRING);
$button['img'] = Theme::Image(Kit::ValidateParam($modulesItem['ImageUri'], _STRING));
$button['uri'] = 'index.php?p=module&q=Exec&mod=' . $button['mod'] . '&method=AddForm';
$buttons[] = $button;
}
Theme::Set('buttons', $buttons);
$response->html = Theme::RenderReturn('library_form_add');
$response->dialogTitle = __('Add Media to the Library');
$response->dialogSize = true;
$response->dialogWidth = '650px';
$response->dialogHeight = '280px';
$response->AddButton(__('Help'), 'XiboHelpRender("' . HelpManager::Link('Content', 'AddtoLibrary') . '")');
$response->AddButton(__('Close'), 'XiboDialogClose()');
$response->Respond();
}
示例3: ThemeSetModuleButtons
private function ThemeSetModuleButtons($layoutId, $regionId)
{
// Present a canvas with 2 columns, left column for the media icons
$buttons = array();
// Always output a Library assignment button
$buttons[] = array('id' => 'media_button_library', 'url' => 'index.php?p=content&q=LibraryAssignForm&layoutid=' . $layoutId . '®ionid=' . $regionId, 'text' => __('Library'));
// Get a list of the enabled modules and then create buttons for them
if (!($enabledModules = new ModuleManager($this->user))) {
trigger_error($enabledModules->message, E_USER_ERROR);
}
// Loop through the buttons we have and output each one
while ($modulesItem = $enabledModules->GetNextModule()) {
$mod = Kit::ValidateParam($modulesItem['Module'], _STRING);
$caption = Kit::ValidateParam($modulesItem['Name'], _STRING);
$mod = strtolower($mod);
$title = Kit::ValidateParam($modulesItem['Description'], _STRING);
$img = Kit::ValidateParam($modulesItem['ImageUri'], _STRING);
$buttons[] = array('id' => 'media_button_' . $mod, 'url' => 'index.php?p=module&q=Exec&mod=' . $mod . '&method=AddForm&layoutid=' . $layoutId . '®ionid=' . $regionId, 'text' => __($caption));
}
Theme::Set('media_buttons', $buttons);
}