View site details action
351250
public function viewAction(Site $site)
    {
        $requester = user_load($site->uid);
        if (!$requester) {
            $requester = drupal_anonymous_user();
        }

        $template = null;
        if ($site->template_id) {
            try {
                $template = $this->getSiteManager()->getStorage()->findOne($site->template_id);
                $template = l($template->title, 'admin/dashboard/site/' . $template->id);
            } catch (\Exception $e) {
                $template = '<span class="text-muted>' . t("Template does not exist anymore") . '</span>';
            }
        } else {
            $template = '';
        }

        $states = SiteState::getList();

        $uri = 'http://' . $site->http_host;

        $table = $this->createAdminTable('ucms_site_details', ['site' => $site])
            ->addHeader(t("Identification"))
            ->addRow(t("HTTP hostname"), l($uri, $uri))
            ->addRow(t("State"), t($states[$site->state]))
            ->addRow(t("Title"), check_plain($site->title))
            ->addRow(t("Created at"), format_date($site->ts_created->getTimestamp()))
            ->addRow(t("Lastest update"), format_date($site->ts_changed->getTimestamp()))
            ->addRow(t("Requester"), check_plain(format_username($requester)))
            ->addHeader(t("Description"))
            ->addRow(t("Description"), check_markup($site->title_admin))
            ->addRow(t("Replaces"), check_markup($site->replacement_of))
            ->addRow(t("HTTP redirections"), check_markup($site->http_redirects))
            ->addHeader(t("Display information"))
            ->addRow(t("Theme"), check_plain($site->theme))
            ->addRow(t("Is a template"), $site->is_template ? '<strong>' . t("yes") . '</strong>' : t("No"))
        ;

        if ($template) {
            $table->addRow(t("Site template"), $template);
        }

        $this->addArbitraryAttributesToTable($table, $site->getAttributes());

        return $table->render();
    }
705026
def show_detailed_monitoring(name=None, instance_id=None, call=None, quiet=False):
    '''
    
    '''
    if call != 'action':
        raise SaltCloudSystemExit(
            'The show_detailed_monitoring action must be called with -a or --action.'
        )
    location = get_location()
    if six.text_type(name).startswith('i-') and (len(name) == 10 or len(name) == 19):
        instance_id = name

    if not name and not instance_id:
        raise SaltCloudSystemExit(
            'The show_detailed_monitoring action must be provided with a name or instance\
 ID'
        )
    matched = _get_node(name=name, instance_id=instance_id, location=location)
    log.log(
        logging.DEBUG if quiet is True else logging.INFO,
        'Detailed Monitoring is %s for %s', matched['monitoring'], name
    )
    return matched['monitoring']
1222844
def show_actions(email, role):
    """"""
    if email:
        actions = ActionUsers.query.join(ActionUsers.user).filter(
            User.email.in_(email)
        ).all()
        for action in actions:
            click.secho('user:{0}:{1}:{2}:{3}'.format(
                action.user.email,
                action.action,
                '' if action.argument is None else action.argument,
                'deny' if action.exclude else 'allow',
            ), fg='red' if action.exclude else 'green')

    if role:
        actions = ActionRoles.query.filter(
            Role.name.in_(role)
        ).join(ActionRoles.role).all()
        for action in actions:
            click.secho('role:{0}:{1}:{2}:{3}'.format(
                action.role.name,
                action.action,
                '' if action.argument is None else action.argument,
                'deny' if action.exclude else 'allow',
            ), fg='red' if action.exclude else 'green')
662785
public function index()
    {
        $oUri     = Factory::service('Uri');
        $oEmailer = Factory::service('Emailer', 'nails/module-email');
        $sRef     = $oUri->segment(3);
        $sGuid    = $oUri->segment(4);
        $sHash    = $oUri->segment(5);

        // --------------------------------------------------------------------------

        //  Fetch the email
        if (is_numeric($sRef)) {
            $oEmail = $oEmailer->getById($sRef);
        } else {
            $oEmail = $oEmailer->getByRef($sRef);
        }

        if (!$oEmail || !$oEmailer->validateHash($oEmail->ref, $sGuid, $sHash)) {
            show404();
        }

        if (Environment::is(Environment::ENV_DEV)) {

            $oAsset = Factory::service('Asset');
            $oAsset->load('debugger.min.css', 'nails/module-email');

            Factory::service('View')
                ->setData([
                    'oEmail' => $oEmail,
                ])
                ->load([
                    'structure/header/blank',
                    'email/view',
                    'structure/footer/blank',
                ]);

        } else {
            $oOutput = Factory::service('Output');
            $oOutput->set_output($oEmail->body->html);
        }
    }
578718
def navigation(self):
        """"""
        return self.on_site().filter(
            status=self.model.PUBLISHED).filter(parent__isnull=True)
605029
def display(self) -> typing.Union[None, report.Report]:
        """"""
        return (
            self._project.current_step.report
            if self._project and self._project.current_step else
            None
        )
380260
public function aboutAction()
    {
        $this->initHtml();

        $this->html->h3()->sprintf($this->_('About %s'), $this->project->getName());
        $this->html->pInfo(\MUtil_Html_Raw::raw($this->project->getLongDescription($this->locale->getLanguage())));
        $this->html->append($this->_getOrganizationsList());
    }
944499
public function listAction()
	{
		$this->denyAccessUnlessGranted('ROLE_ADMIN', null, 'Unable to access this page !');
		
		$postManager = $this->get('asf_document.post.manager');
		
		// Define DataGrid Source
		$source = new Entity($postManager->getClassName());
		
		// Get datagrid
		$grid = $this->get('grid');
		$grid instanceof Grid;
		$grid->setSource($source);
		$tableAlias = $source->getTableAlias();
		$postClassName = $postManager->getShortClassName();
		
		$source->manipulateQuery(function($query) use ($tableAlias, $postClassName) {
			$query instanceof QueryBuilder;
			
			// Get all original version of each posts
			$query2 = $query->getEntityManager()->createQueryBuilder();
			$query2->select('post.id')
				->from($postClassName, 'post')
				->where('post.original IS NULL');
			$result = $query2->getQuery()->getResult();
			
			// Search versions for each original posts
			if (count($result)) {
				$ids = array();
				foreach($result as $original) {
					$qb = $query->getEntityManager()->createQueryBuilder();
					$qb->select('p')->from($postClassName, 'p')
						->where('p.original=:original_id')
						->orderBy('p.createdAt', 'DESC')
						->setParameter('original_id', $original['id']);
					$r = $qb->getQuery()->setMaxResults(1)->getResult();
					
					if ( count($r) ) {
						$ids[] = $r[0]->getId();
					} else {
						$ids[] = $original['id'];
					}
				}
				
				// Create query for datagird
				$query->add('where', $query->expr()->in($tableAlias.'.id', $ids));
			}
			
			if ( count($query->getDQLPart('orderBy')) == 0) {
				$query->orderBy($tableAlias.'.createdAt', 'DESC');
			}
		});
		
		// Grid Columns configuration
		$this->get('event_dispatcher')->dispatch(DocumentEvents::POST_GRID_CONFIG, new PostGridEvent($grid, $source));
		
		$grid->getColumn('id')->setVisible(false);
		$grid->getColumn('title')->setTitle($this->get('translator')->trans('Post title', array(), 'asf_document'));
		$grid->getColumn('content')->setVisible(false);
		$grid->getColumn('slug')->setTitle($this->get('translator')->trans('Slug', array(), 'asf_document'));
		$grid->getColumn('state')->setTitle($this->get('translator')->trans('State', array(), 'asf_document'))
			->setFilterType('select')->setSelectFrom('values')->setOperatorsVisible(false)
			->setDefaultOperator('eq')->setValues(array(
				DocumentModel::STATE_DRAFT => $this->get('translator')->trans('Draft', array(), 'asf_document'),
				DocumentModel::STATE_WAITING => $this->get('translator')->trans('Waiting', array(), 'asf_document'),
				DocumentModel::STATE_PUBLISHED => $this->get('translator')->trans('Published', array(), 'asf_document')
			));
		$grid->getColumn('createdAt')->setTitle($this->get('translator')->trans('Created at', array(), 'asf_document'));
		$grid->getColumn('updatedAt')->setTitle($this->get('translator')->trans('Updated at', array(), 'asf_document'));
		
		$edit_action = new RowAction('btn_edit', 'asf_document_post_edit');
		$edit_action->setRouteParameters(array('id'));
		$grid->addRowAction($edit_action);
		
		$delete_action = new RowAction('btn_delete', 'asf_document_post_delete', true);
		$delete_action->setRouteParameters(array('id'))
			->setConfirmMessage($this->get('translator')->trans('Do you want to delete this post?', array(), 'asf_document'));
		$grid->addRowAction($delete_action);
		
		$grid->setNoDataMessage($this->get('translator')->trans('No post was found.', array(), 'asf_document'));
		
		return $grid->getGridResponse('ASFDocumentBundle:Post:list.html.twig', array('grid' => $grid));
	}
987052
public function indexAction()
    {
        $page = $this->getEvent()
            ->getRouteMatch()
            ->getParam('page');

        $revision = $this->getEvent()
            ->getRouteMatch()
            ->getParam('revision', null);

        return $this->getCmsResponse(
            $this->currentSite,
            $page,
            $revision
        );
    }
1190920
public function indexAction()
    {
        if ($this->util->getMaintenanceLock()->isLocked()) {
            $this->addSnippet($this->maintenanceModeSnippets);
            return;
        }

        // Make sure to return to the forward screen
        $this->currentUser->setSurveyReturn();

        $request = $this->getRequest();
        $tracker = $this->loader->getTracker();
        $form    = $tracker->getAskTokenForm(array(
            'displayOrder' => array('element', 'description', 'errors'),
            'labelWidthFactor' => 0.8
            ));

        if ($request->isPost() && $form->isValid($request->getParams())) {
            $this->_forward('forward');
            return;
        }

        $form->populate($request->getParams());
        $this->displayTokenForm($form);
    }
1024260
def user_view_events(self) -> List[str]:
        """"""
        return [event_type for event_type, event in self.items if event.get_event_action()
                == event_actions.VIEWED]
524320
public function listAction()
    {
        $user = $this->getUser();
        $repository = $this->get('ekyna_user.address.repository');

        $addresses = $repository->findByUser($user);

        return $this->render('EkynaUserBundle:Address:list.html.twig', [
            'addresses' => $addresses
        ]);
    }
1332592
public function index() {        
        $action = Filter::post('action');        
        if($action == 'update' && Filter::checkCsrf()) $this->update();
        
        Theme::theme(new AdministrationTheme)->init(Globals::getTree());        
        $ctrl = new PageController();
        $ctrl
            ->restrictAccess(Auth::isAdmin())
            ->setPageTitle($this->module->getTitle());

        $view_bag = new ViewBag();
        $view_bag->set('title', $ctrl->getPageTitle());
        $view_bag->set('module', $this->module);
        
        ViewFactory::make('AdminConfig', $this, $ctrl, $view_bag)->render();
    }
179343
public function display($info = null, $details = null, $origin = null, $time = null)
    {
        if (!$this->hasCommand()) {
            return;
        }

        // Build handle
        $comment = $this->getTree().$this->getFork();

        // Add details
        if ($info) {
            $comment .= ' <info>'.$info.'</info>';
        }
        if ($details) {
            $comment .= ' <comment>('.$details.')</comment>';
        }
        if ($origin) {
            $comment .= ' fired by <info>'.$origin.'</info>';
        }
        if ($time) {
            $comment .= ' [~'.$time.'s]';
        }

        $this->command->writeln($comment);
    }
1317100
public function indexAction()
    {
        /** @var Response $response */
        $response = $this->getResponse();

        $headers = new Headers();

        $headers->addHeaders(
            [
                'cache-control' => 'no-store, no-cache, must-revalidate',
                'content-type' => 'application/javascript',
                'pragma' => 'no-cache',
            ]
        );

        $response->setHeaders(
            $headers
        );

        $isAllowed = $this->cmsPermissionChecks->siteAdminCheck($this->siteService->getCurrentSite());

        if (!$isAllowed) {
            $response->setContent(
                '// rcmBlockConfigs not available'
            );

            return $response;
        }

        $content = $this->rendererAvailableBlocksJs->__invoke();

        $response->setContent(
            $content
        );

        return $response;
    }
311036
public function index()
    {
        Piwik::checkUserIsNotAnonymous();
        Piwik::checkUserHasSomeAdminAccess();

        $view = new View('@UsersManager/index');

        $IdSitesAdmin = Request::processRequest('SitesManager.getSitesIdWithAdminAccess');
        $idSiteSelected = 1;

        if (count($IdSitesAdmin) > 0) {
            $defaultWebsiteId = $IdSitesAdmin[0];
            $idSiteSelected = $this->idSite ?: $defaultWebsiteId;
        }

        if (!Piwik::isUserHasAdminAccess($idSiteSelected) && count($IdSitesAdmin) > 0) {
            // make sure to show a website where user actually has admin access
            $idSiteSelected = $IdSitesAdmin[0];
        }

        $defaultReportSiteName = Site::getNameFor($idSiteSelected);

        $view->idSiteSelected = $idSiteSelected;
        $view->defaultReportSiteName = $defaultReportSiteName;
        $view->currentUserRole = Piwik::hasUserSuperUserAccess() ? 'superuser' : 'admin';
        $view->accessLevels = [
            ['key' => 'noaccess', 'value' => Piwik::translate('UsersManager_PrivNone')],
            ['key' => 'view', 'value' => Piwik::translate('UsersManager_PrivView')],
            ['key' => 'write', 'value' => Piwik::translate('UsersManager_PrivWrite')],
            ['key' => 'admin', 'value' => Piwik::translate('UsersManager_PrivAdmin')],
            ['key' => 'superuser', 'value' => Piwik::translate('Installation_SuperUser'), 'disabled' => true],
        ];
        $view->filterAccessLevels = [
            ['key' => '', 'value' => Piwik::translate('UsersManager_ShowAll')],
            ['key' => 'noaccess', 'value' => Piwik::translate('UsersManager_PrivNone')],
            ['key' => 'some', 'value' => Piwik::translate('UsersManager_AtLeastView')],
            ['key' => 'view', 'value' => Piwik::translate('UsersManager_PrivView')],
            ['key' => 'write', 'value' => Piwik::translate('UsersManager_PrivWrite')],
            ['key' => 'admin', 'value' => Piwik::translate('UsersManager_PrivAdmin')],
            ['key' => 'superuser', 'value' => Piwik::translate('Installation_SuperUser')],
        ];

        $capabilities = Request::processRequest('UsersManager.getAvailableCapabilities', [], []);
        foreach ($capabilities as $capability) {
            $capabilityEntry = [
                'key' => $capability['id'], 'value' => $capability['category'] . ': ' . $capability['name'],
            ];
            $view->accessLevels[] = $capabilityEntry;
            $view->filterAccessLevels[] = $capabilityEntry;
        }

        $this->setBasicVariablesView($view);

        return $view->render();
    }
395086
public function actionDetail() 
	{
		if(Yii::app()->request->isPostRequest) {
			$id = trim($_POST['id']);
			
			$model = OmmuPages::model()->findByPk($id);
			
			if($model != null) {
				$page_url = Utility::getProtocol().'://'.Yii::app()->request->serverName.Yii::app()->request->baseUrl;
				$page_path = 'public/page';
					
				if($model->media && file_exists($page_path.'/'.$model->media))
					$image_url_path = $page_url.'/'.$page_path.'/'.$model->media;
				
				$return = array(
					'success' => '1',
					'id' => $model->page_id,
					'title' => $model->title->message,
					'description' => $model->desc != 0 ? Utility::softDecode($model->description->message) : '-',
					'quote' => $model->quote != 0 ? $model->quote_r->message : '-',
					'media_image' => $image_url_path ? $image_url_path : '-',
					'media_show' => $model->media_show == 0 ? 'hide' : 'show',
					'media_type' => $model->media_show != 0 ? (($model->media_type == 0 || $model->media_type == 1) ? 'large' : 'medium') : '-',
					'creation_date' => strtotime($model->creation_date),
				);
				
			} else {
				$return = array(
					'success' => '0',
					'error' => 'NULL',
					'message' => Yii::t('phrase', 'error, halaman tidak ditemukan'),
				);
			}
			$this->_sendResponse(200, CJSON::encode($this->renderJson($return)));
			
		} else 
			$this->redirect(Yii::app()->createUrl('site/index'));
	}