本文整理汇总了PHP中CController::getModule方法的典型用法代码示例。如果您正苦于以下问题:PHP CController::getModule方法的具体用法?PHP CController::getModule怎么用?PHP CController::getModule使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CController
的用法示例。
在下文中一共展示了CController::getModule方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: resolveBreadCrumbViewForDetailsControllerAction
public static function resolveBreadCrumbViewForDetailsControllerAction(CController $controller, $stickySearchKey, RedBeanModel $model)
{
assert('is_string($stickySearchKey)');
if (ArrayUtil::getArrayValue(GetUtil::getData(), 'stickyOffset') !== null && StickySearchUtil::getDataByKey($stickySearchKey) != null) {
$stickyLoadUrl = Yii::app()->createUrl($controller->getModule()->getId() . '/' . $controller->getId() . '/renderStickyListBreadCrumbContent', array('stickyKey' => $stickySearchKey, 'stickyOffset' => ArrayUtil::getArrayValue(GetUtil::getData(), 'stickyOffset'), 'stickyModelId' => $model->id));
} else {
$stickyLoadUrl = null;
}
$className = static::resolveStickyDetailsAndRelationsBreadCrumbViewClassName();
return new $className($controller->getId(), $controller->getModule()->getId(), static::resolveBreadcrumbLinks($model), $controller->getModule()->getModuleLabelByTypeAndLanguage('Plural'), $stickyLoadUrl);
}
示例2: renderList
/**
* @return rendered content from view as string.
*/
public static function renderList(CController $controller, $dataProvider)
{
assert('$dataProvider instanceof RedBeanModelDataProvider');
$auditEventsListView = new AuditEventsModalListView($controller->getId(), $controller->getModule()->getId(), 'AuditEvent', $dataProvider, 'modal');
$view = new ModalView($controller, $auditEventsListView);
return $view->render();
}
示例3: renderList
/**
* @return rendered content from view as string.
*/
public static function renderList(CController $controller, $dataProvider, $action)
{
assert('$dataProvider instanceof RedBeanModelDataProvider');
$modalListLinkProvider = new UserDetailsModalListLinkProvider('users', 'default', 'details');
$usersListView = new UsersByModelModalListView($controller->getId(), $controller->getModule()->getId(), $action, 'User', $modalListLinkProvider, $dataProvider, 'modal');
$view = new ModalView($controller, $usersListView);
return $view->render();
}
示例4: renderModalSearchList
/**
* @return rendered content from view as string.
*/
protected static function renderModalSearchList(CController $controller, $modalListLinkProvider, $stateMetadataAdapterClassName = null)
{
assert('$modalListLinkProvider instanceof ModalListLinkProvider');
$className = $controller->getModule()->getPluralCamelCasedName() . 'ModalSearchAndListView';
$modelClassName = $controller->getModule()->getPrimaryModelName();
$searchViewClassName = $className::getSearchViewClassName();
if ($searchViewClassName::getModelForMetadataClassName() != null) {
$formModelClassName = $searchViewClassName::getModelForMetadataClassName();
$model = new $modelClassName(false);
$searchModel = new $formModelClassName($model);
} else {
throw new NotSupportedException();
}
$pageSize = Yii::app()->pagination->resolveActiveForCurrentUserByType('modalListPageSize', get_class($controller->getModule()));
$dataProvider = $controller->makeRedBeanDataProviderByDataCollection($searchModel, $pageSize, $stateMetadataAdapterClassName);
$searchAndListView = new $className($controller->getId(), $controller->getModule()->getId(), $controller->getAction()->getId(), $modalListLinkProvider, $searchModel, $model, $dataProvider, 'modal');
$view = new ModalView($controller, $searchAndListView);
return $view->render();
}
示例5: makeHeaderView
protected static function makeHeaderView(CController $controller)
{
$headerView = null;
$settingsMenuItems = MenuUtil::getOrderedAccessibleHeaderMenuForCurrentUser();
$settingsMenuItems = static::resolveHeaderMenuItemsForMobile($settingsMenuItems);
$userMenuItems = static::getAndResolveUserMenuItemsForHeader();
$applicationName = ZurmoConfigurationUtil::getByModuleName('ZurmoModule', 'applicationName');
if (Yii::app()->userInterface->isMobile()) {
$headerView = new MobileHeaderView($settingsMenuItems, $userMenuItems, $applicationName);
} else {
$shortcutsCreateMenuItems = MenuUtil::getAccessibleShortcutsCreateMenuByCurrentUser();
$moduleNamesAndLabels = GlobalSearchUtil::getGlobalSearchScopingModuleNamesAndLabelsDataByUser(Yii::app()->user->userModel);
$sourceUrl = Yii::app()->createUrl('zurmo/default/globalSearchAutoComplete');
GlobalSearchUtil::resolveModuleNamesAndLabelsDataWithAllOption($moduleNamesAndLabels);
$headerView = new HeaderView($controller->getId(), $controller->getModule()->getId(), $settingsMenuItems, $userMenuItems, $shortcutsCreateMenuItems, $moduleNamesAndLabels, $sourceUrl, $applicationName);
}
return $headerView;
}
示例6: renderModalMapView
/**
* Map modal view for map popup..
* @return rendered content from view as string.
*/
protected function renderModalMapView(CController $controller, $modalMapAddressData, $stateMetadataAdapterClassName = null)
{
$renderAndMapModalView = new AddressMapModalView($controller->getId(), $controller->getModule()->getId(), $modalMapAddressData, 'modal');
$view = new ModalView($controller, $renderAndMapModalView);
return $view->render();
}
示例7: getLayoutFile
/**
* Finds the layout file for the specified controller's layout.
* @param CController $controller the controller
* @param string $layoutName the layout name
* @return string the layout file path. False if the file does not exist.
*/
public function getLayoutFile($controller, $layoutName)
{
$moduleViewPath = $basePath = $this->getViewPath();
$module = $controller->getModule();
if (empty($layoutName)) {
while ($module !== null) {
if ($module->layout === false) {
return false;
}
if (!empty($module->layout)) {
break;
}
$module = $module->getParentModule();
}
if ($module === null) {
$layoutName = Yii::app()->layout;
} else {
$layoutName = $module->layout;
$moduleViewPath .= '/' . $module->getId();
}
} else {
if ($module !== null) {
$moduleViewPath .= '/' . $module->getId();
}
}
return $controller->resolveViewFile($layoutName, $moduleViewPath . '/layouts', $basePath, $moduleViewPath);
}
示例8: showCoin
/**
* Eventually refactor to support different randomness seeds on a per module basis, but until this is fleshed
* out more, we will just hard-code the seeding here.
*/
public static function showCoin(CController $controller)
{
//Reporting and Data cleanup actions should show coins more frequently
if ($controller->getModule()->getId() == 'reports') {
$value = mt_rand(1, 25);
} else {
$value = mt_rand(1, 50);
}
if ($value == 7) {
return true;
}
return false;
}
示例9: makeTwoViewsWithBreadcrumbsForCurrentUser
/**
* Given a controller, two contained views, construct the gridview
* used by the designer page view.
* @param CController $controller
* @param View $containedView
* @param View $secondContainedView
* @param array $breadCrumbLinks
* @param $breadcrumbViewClassName
* @param array $cssClasses
* @return GridView
*/
public static function makeTwoViewsWithBreadcrumbsForCurrentUser(CController $controller, View $containedView, View $secondContainedView, $breadCrumbLinks, $breadcrumbViewClassName, $cssClasses = array())
{
assert('is_array($breadCrumbLinks)');
$gridView = new GridView(3, 1);
$gridView->setCssClasses($cssClasses);
$gridView->setView(new $breadcrumbViewClassName($controller->getId(), $controller->getModule()->getId(), $breadCrumbLinks), 0, 0);
$gridView->setView($containedView, 1, 0);
$gridView->setView($secondContainedView, 2, 0);
return static::makeStandardViewForCurrentUser($controller, $gridView);
}
示例10: getActionInstances
/**
* Gets the action instances for the given controller
* @param \CController $controller the controller to get actions for
*
* @return \CAction[] the controller actions
*/
public function getActionInstances(\CController $controller)
{
$controllerId = $controller->getId();
$module = $controller->getModule();
if (!is_object($module)) {
$module = \Yii::app();
}
$uniqueId = $this->getModuleUniqueId($module);
if (!isset($this->_data[$uniqueId])) {
$this->_data[$uniqueId] = array();
}
if (!isset($this->_data[$uniqueId]['controllers'])) {
$this->getControllerInstances($module);
}
if (!isset($this->_data[$uniqueId]['controllers'][$controllerId]['actions'])) {
$this->_data[$uniqueId]['controllers'][$controllerId]['actions'] = $this->createActionInstances($controller);
}
return $this->_data[$uniqueId]['controllers'][$controllerId]['actions'];
}