本文整理汇总了PHP中ControllerSecurityUtil::resolveCanCurrentUserAccessModule方法的典型用法代码示例。如果您正苦于以下问题:PHP ControllerSecurityUtil::resolveCanCurrentUserAccessModule方法的具体用法?PHP ControllerSecurityUtil::resolveCanCurrentUserAccessModule怎么用?PHP ControllerSecurityUtil::resolveCanCurrentUserAccessModule使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ControllerSecurityUtil
的用法示例。
在下文中一共展示了ControllerSecurityUtil::resolveCanCurrentUserAccessModule方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderContent
public function renderContent()
{
$accessContent = $this->resolveContentIfCurrentUserCanAccessChartByModule('OpportunitiesModule', 'OpportunitiesModulePluralLabel');
if ($accessContent != null) {
return $accessContent;
}
$chartDataProviderType = $this->getChartDataProviderType();
$chartDataProvider = ChartDataProviderFactory::createByType($chartDataProviderType);
ControllerSecurityUtil::resolveCanCurrentUserAccessModule($chartDataProvider->getModel()->getModuleClassName(), true);
$chartData = $chartDataProvider->getChartData();
Yii::import('ext.amcharts.AmChartMaker');
$amChart = new AmChartMaker();
$amChart->data = $chartData;
$amChart->id = $this->uniqueLayoutId;
$amChart->type = $this->resolveViewAndMetadataValueByName('type');
$amChart->addSerialGraph('value', 'column');
$amChart->xAxisName = $chartDataProvider->getXAxisName();
$amChart->yAxisName = $chartDataProvider->getYAxisName();
$amChart->yAxisUnitContent = Yii::app()->locale->getCurrencySymbol(Yii::app()->currencyHelper->getCodeForCurrentUserForDisplay());
$javascript = $amChart->javascriptChart();
Yii::app()->getClientScript()->registerScript(__CLASS__ . '#' . $this->uniqueLayoutId, $javascript);
$cClipWidget = new CClipWidget();
$cClipWidget->beginClip("Chart");
$cClipWidget->widget('application.core.widgets.AmChart', array('id' => $this->uniqueLayoutId));
$cClipWidget->endClip();
return $cClipWidget->getController()->clips['Chart'];
}
示例2: actionDetails
public function actionDetails($id, $runReport = false)
{
$savedReport = SavedReport::getById((int) $id);
ControllerSecurityUtil::resolveCanCurrentUserAccessModule($savedReport->moduleClassName);
ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel($savedReport, true);
$report = SavedReportToReportAdapter::makeReportBySavedReport($savedReport);
$portlet = Portlet::getById(intval($_GET['portletId']));
$portlet->params = array('controllerId' => 'default', 'relationModuleId' => $this->getModule()->getId(), 'relationModel' => $report, 'redirectUrl' => Yii::app()->request->getRequestUri(), 'dataProvider' => $this->getDataProvider($report, $report->getId(), (bool) $runReport));
$portletView = $portlet->getView();
if (!RightsUtil::canUserAccessModule($portletView::getModuleClassName(), Yii::app()->user->userModel)) {
$messageView = new AccessFailureView();
$view = new AccessFailurePageView($messageView);
echo $view->render();
Yii::app()->end(0, false);
}
$view = new AjaxPageView($portletView);
echo $view->render();
}
示例3: actionExport
public function actionExport($id, $stickySearchKey = null)
{
assert('$stickySearchKey == null || is_string($stickySearchKey)');
$savedReport = SavedReport::getById((int) $id);
ControllerSecurityUtil::resolveCanCurrentUserAccessModule($savedReport->moduleClassName);
ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel($savedReport);
$report = SavedReportToReportAdapter::makeReportBySavedReport($savedReport);
$dataProvider = $this->getDataProviderForExport($report, $report->getId(), false);
$totalItems = intval($dataProvider->calculateTotalItemCount());
$data = array();
if ($totalItems > 0) {
if ($totalItems <= ExportModule::$asynchronousThreshold) {
// Output csv file directly to user browser
if ($dataProvider) {
$reportToExportAdapter = ReportToExportAdapterFactory::createReportToExportAdapter($report, $dataProvider);
$headerData = $reportToExportAdapter->getHeaderData();
$data = $reportToExportAdapter->getData();
}
// Output data
if (count($data)) {
$fileName = $this->getModule()->getName() . ".csv";
ExportItemToCsvFileUtil::export($data, $headerData, $fileName, true);
} else {
Yii::app()->user->setFlash('notification', Zurmo::t('ZurmoModule', 'There is no data to export.'));
}
} else {
if ($dataProvider) {
$serializedData = ExportUtil::getSerializedDataForExport($dataProvider);
}
// Create background job
$exportItem = new ExportItem();
$exportItem->isCompleted = 0;
$exportItem->exportFileType = 'csv';
$exportItem->exportFileName = $this->getModule()->getName();
$exportItem->modelClassName = 'SavedReport';
$exportItem->serializedData = $serializedData;
$exportItem->save();
$exportItem->forget();
Yii::app()->user->setFlash('notification', Zurmo::t('ZurmoModule', 'A large amount of data has been requested for export. You will receive ' . 'a notification with the download link when the export is complete.'));
}
} else {
Yii::app()->user->setFlash('notification', Zurmo::t('ZurmoModule', 'There is no data to export.'));
}
$this->redirect(array($this->getId() . '/index'));
}
示例4: actionDelete
public function actionDelete($id)
{
$savedWorkflow = SavedWorkflow::GetById(intval($id));
ControllerSecurityUtil::resolveCanCurrentUserAccessModule($savedWorkflow->moduleClassName);
ControllerSecurityUtil::resolveAccessCanCurrentUserDeleteModel($savedWorkflow);
$savedWorkflow->delete();
$this->redirect(array($this->getId() . '/index'));
}
示例5: actionExportpdf
public function actionExportpdf($id, $stickySearchKey = null)
{
assert('$stickySearchKey == null || is_string($stickySearchKey)');
$savedReport = SavedReport::getById((int) $id);
ControllerSecurityUtil::resolveCanCurrentUserAccessModule($savedReport->moduleClassName);
ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel($savedReport);
$report = SavedReportToReportAdapter::makeReportBySavedReport($savedReport);
$dataProvider = $this->getDataProviderForExport($report, $report->getId(), false);
$totalItems = intval($dataProvider->calculateTotalItemCount());
$data = array();
if ($totalItems > 0) {
$reportToExportAdapter = ReportToExportAdapterFactory::createReportToExportAdapter($report, $dataProvider);
$headerData = $reportToExportAdapter->getHeaderData();
$data = $reportToExportAdapter->getData();
$mPDF1 = Yii::app()->ePdf->mpdf('utf-8', 'Letter');
$pdfdata = '<table border="1" style="border-collapse:collapse;" cellpadding="0" cellspacing="1"><tbody><tr>';
foreach ($headerData as $key => $value) {
$pdfdata .= '<td>' . $value . '</td>';
}
$pdfdata .= '</tr>';
foreach ($data as $key => $value) {
$pdfdata .= '<tr>';
foreach ($value as $key1 => $value1) {
$pdfdata .= '<td>' . $value1 . '</td>';
}
$pdfdata .= '</tr>';
}
$pdfdata .= '</tbody></table>';
$mPDF1->WriteHTML($pdfdata);
$mPDF1->Output($this->getModule()->getName() . '.pdf', 'D');
} else {
Yii::app()->user->setFlash('notification', Zurmo::t('ZurmoModule', 'There is no data to export.'));
}
$this->redirect(array($this->getId() . '/index'));
}