Displays admin notices.

@since 1.3.0

@return void
510234
public static function displayNotices()
    {
        if ($notices = get_option('staticwp_deferred_admin_notices')) {
            foreach ($notices as $notice) {
                $message = $notice;
                $type = 'updated';

                if (is_array($notice)) {
                    $message = isset($notice['message']) ? $notice['message'] : '';
                    $type = isset($notice['type']) ? $notice['type'] : $type;
                }

                echo '<div class="' . $type . '"><p>' . $message . '</p></div>';
            }
            delete_option('staticwp_deferred_admin_notices');
        }
    }
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();
    }
331314
public function Index() {
      $this->Permission('Garden.Messages.Manage');
      $this->AddSideMenu('dashboard/message');
      $this->AddJsFile('jquery.autogrow.js');
      $this->AddJsFile('jquery.tablednd.js');
      $this->AddJsFile('jquery-ui.js');
      $this->AddJsFile('messages.js');
      $this->Title(T('Messages'));
         
      // Load all messages from the db
      $this->MessageData = $this->MessageModel->Get('Sort');
      $this->Render();
   }
874518
protected function view_notices($title, $notices) {
        global $CFG;

        $o = '';

        $header = new assign_header($this->get_instance(),
                                    $this->get_context(),
                                    $this->show_intro(),
                                    $this->get_course_module()->id,
                                    $title);
        $o .= $this->get_renderer()->render($header);

        foreach ($notices as $notice) {
            $o .= $this->get_renderer()->notification($notice);
        }

        $url = new moodle_url('/mod/assign/view.php', array('id'=>$this->get_course_module()->id, 'action'=>'view'));
        $o .= $this->get_renderer()->continue_button($url);

        $o .= $this->view_footer();

        return $o;
    }
1274185
public function index()
    {
        if (!userHasPermission('admin:email:email:browse')) {
            unauthorised();
        }

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

        $oEmailer = Factory::service('Emailer', 'nails/module-email');

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

        //  Set method info
        $this->data['page']->title = 'Message Archive';

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

        //  Get pagination and search/sort variables
        $sPrefix    = $oEmailer->getTableAlias();
        $iPage      = $this->input->get('page') ? $this->input->get('page') : 0;
        $iPerPage   = $this->input->get('perPage') ? $this->input->get('perPage') : 50;
        $sSortOn    = $this->input->get('sortOn') ? $this->input->get('sortOn') : $sPrefix . '.sent';
        $sSortOrder = $this->input->get('sortOrder') ? $this->input->get('sortOrder') : 'desc';
        $sKeywords  = $this->input->get('keywords') ? $this->input->get('keywords') : '';

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

        //  Define the sortable columns
        $aSortColumns = [
            $sPrefix . '.sent' => 'Sent Date',
        ];

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

        $aTypeOptions = ['All email types'];
        $aEmailTypes  = $oEmailer->getTypes();
        foreach ($aEmailTypes as $oType) {
            $aTypeOptions[$oType->slug] = $oType->name;
        }

        $aCbFilters = [];
        $aDdFilters = [
            Helper::searchFilterObject(
                $sPrefix . '.type',
                'Type',
                $aTypeOptions
            ),
        ];

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

        //  Define the $data variable for the queries
        $aData = [
            'sort'      => [
                [$sSortOn, $sSortOrder],
            ],
            'keywords'  => $sKeywords,
            'ddFilters' => $aDdFilters,
        ];

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

        //  Get the items for the page
        $totalRows            = $oEmailer->countAll($aData);
        $this->data['aEmails'] = $oEmailer->getAll($iPage, $iPerPage, $aData);

        //  Set Search and Pagination objects for the view
        $this->data['oSearch']     = Helper::searchObject(
            true,
            $aSortColumns,
            $sSortOn,
            $sSortOrder,
            $iPerPage,
            $sKeywords,
            $aCbFilters,
            $aDdFilters
        );
        $this->data['oPagination'] = Helper::paginationObject($iPage, $iPerPage, $totalRows);

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

        Helper::loadView('index');
    }
1234809
protected function add_grade_notices() {
        if (has_capability('mod/assign:grade', $this->get_context()) && get_config('assign', 'has_rescaled_null_grades_' . $this->get_instance()->id)) {
            $link = new \moodle_url('/mod/assign/view.php', array('id' => $this->get_course_module()->id, 'action' => 'fixrescalednullgrades'));
            \core\notification::warning(get_string('fixrescalednullgrades', 'mod_assign', ['link' => $link->out()]));
        }
    }
876727
public function index()
    {
        $this->breadcrumb->onSystemInformations();
        publish('logger', 'scripts.reports');
        $data = $this->serverAdapter->verify();
        return view('antares/logger::admin.system.index', $data);
    }
1104074
private function show_plugin_update_notices() {
		add_action( 'in_plugin_update_message-' . $this->app->define->plugin_base_name, function ( $data, $r ) {
			$new_version = $r->new_version;
			$url         = $this->app->utility->array_get( $data, 'PluginURI' );
			$notices     = $this->get_upgrade_notices( $new_version, $url );
			if ( ! empty( $notices ) ) {
				$this->get_view( 'admin/include/upgrade', [
					'notices' => $notices,
				], true );
			}
		}, 10, 2 );
	}
868362
public function addadminmenu(){
		$rules=array(
			(object)array(
				'com' => 'admin',
				'position' => 'adminmenu',
				'segments' => array('view'=>'adminmenu')
				),
			(object)array(
				'com' => 'admin',
				'position' => 'userpanel',
				'segments' => array('view'=>'userpanel','uid')
				),
				);
		$this->rules=array_merge($this->rules,$rules);
		}
576475
protected function _view_alerts() {
		$msgs = RD::get_once(NULL, array(), FALSE);

		if(count($msgs))
			return View::factory('RD/alerts', array('messages' => $msgs))->render();
		else if(RD::has_messages())
		{
			return View::factory('RD/alerts', array('messages' => RD::get_current(null, $this->_dump_all_alerts)))->render();
		}
		else
			return '';
	}
285043
public function message_admins($notice) {

        $site = get_site();

        $subject = get_string('emailsubject', 'antivirus', format_string($site->fullname));
        $admins = get_admins();
        foreach ($admins as $admin) {
            $eventdata = new \core\message\message();
            $eventdata->courseid          = SITEID;
            $eventdata->component         = 'moodle';
            $eventdata->name              = 'errors';
            $eventdata->userfrom          = get_admin();
            $eventdata->userto            = $admin;
            $eventdata->subject           = $subject;
            $eventdata->fullmessage       = $notice;
            $eventdata->fullmessageformat = FORMAT_PLAIN;
            $eventdata->fullmessagehtml   = '';
            $eventdata->smallmessage      = '';
            message_send($eventdata);
        }
    }
155251
public function index()
    {
        $this->authorize(DashboardPolicy::PERMISSION_STATS);

        $this->setTitle(trans('blog::dashboard.titles.statistics'));

        return $this->view('admin.dashboard');
    }
357199
protected function maybeEnqueueNotices()
    {
        if (($is_install = !$this->history['first_time'])) {
            $notice_template_file = 's-core/admin/notices/on-install.php';
        } else { // Reinstalling (notify about update).
            $notice_template_file = 's-core/admin/notices/on-reinstall.php';
        }
        $notice_Template = $this->c::getTemplate($notice_template_file);
        $notice_markup   = $notice_Template->parse(['history' => $this->history]);
        $this->s::enqueueNotice($notice_markup, ['type' => 'success', 'is_transient' => $is_install]);

        if ($this->App->Parent && $this->App->Parent->is_core) {
            $this->App->Parent->s::maybeRequestLicenseKeyViaNotice($this->App->Config->©brand['©slug']);
        }
    }
470009
public function adminScreen() {
		$searches = Search::getSearches();

		if ( isset( $_POST['search_pattern'] ) && ! wp_verify_nonce( $_POST['pressbooks-search-and-replace-nonce'], 'search' ) ) {
			return;
		}

		$search_pattern = '';
		$replace_pattern = '';

		if ( isset( $_POST['search_pattern'] ) ) {
			$search_pattern = stripslashes( $_POST['search_pattern'] );
		}

		if ( isset( $_POST['replace_pattern'] ) ) {
			$replace_pattern = stripslashes( $_POST['replace_pattern'] );
		}

		$search_pattern  = str_replace( "\'", "'", $search_pattern );
		$replace_pattern = str_replace( "\'", "'", $replace_pattern );
		$orderby = 'asc';

		if ( isset( $_POST['orderby'] ) && 'desc' === $_POST['orderby'] ) {
			$orderby = 'desc';
		}

		$limit = isset( $_POST['limit'] ) ? intval( $_POST['limit'] ) : 0;

		$offset = 0;

		$source = isset( $_POST['source'] ) ? stripslashes( $_POST['source'] ) : '';

		if ( Search::validSearch( $source ) && ( isset( $_POST['search'] ) || isset( $_POST['replace'] ) || isset( $_POST['replace_and_save'] ) ) ) {

			/** @var \Pressbooks\Modules\SearchAndReplace\Search $searcher */
			$searcher = new $source;

			// Enable regex mode
			$enabled = ( defined( 'PB_ENABLE_REGEX_SEARCHREPLACE' ) && PB_ENABLE_REGEX_SEARCHREPLACE ) || is_super_admin();
			$searcher->regex = $enabled && ! empty( $_POST['regex'] );

			// Make sure no one sneaks in with a replace
			if ( ! current_user_can( 'administrator' ) ) {
				unset( $_POST['replace'] );
				unset( $_POST['replace_and_save'] );
				$_POST['search'] = 'search';
			}
			$results = [];
			if ( isset( $_POST['search'] ) ) {
				$results = $searcher->searchForPattern( $search_pattern, $limit, $offset, $orderby );
			} elseif ( isset( $_POST['replace'] ) ) {
				$results = $searcher->searchAndReplace( $search_pattern, $replace_pattern, $limit, $offset, $orderby );
			} elseif ( isset( $_POST['replace_and_save'] ) ) {
				$results = $searcher->searchAndReplace( $search_pattern, $replace_pattern, $limit, $offset, $orderby, true );
			}
			if ( ! is_array( $results ) ) {
				$this->renderError( $results );
			} elseif ( isset( $_POST['replace_and_save'] ) ) {
				?>
				<div class="updated" id="message" role="status" onclick="this.parentNode.removeChild (this)">
					<p><?php printf( _n( '%d occurrence replaced.', '%d occurrences replaced.', count( $results ) ), count( $results ) ); ?></p>
				</div>
				<?php
			}
			$this->render(
				'search', [
					'search' => $search_pattern,
					'replace' => $replace_pattern,
					'searches' => $searches,
					'source' => $source,
				]
			);
			if ( is_array( $results ) && ! isset( $_POST['replace_and_save'] ) ) {
				$this->render(
					'results', [
						'search' => $searcher,
						'results' => $results,
					]
				);
			}
		} else {
			$this->render(
				'search', [
					'search' => $search_pattern,
					'replace' => $replace_pattern,
					'searches' => $searches,
					'source' => $source,
				]
			);
		}
	}
854061
public function admin_init(){
        if( !AjaxBase::is_ajax() && current_user_can('manage_options') ){
            if( !empty($this->classes) ){
                $rewrites = '';
                foreach( $this->classes as $class_name ){
                   $rewrites .= $this->get_prefix($class_name);
                }
                $rewrites = md5($rewrites);
                if( get_option('rewrite_rules') && $this->rewrite_md5 != $rewrites ){
                    flush_rewrite_rules();
                    $last_updated = current_time('timestamp');
                    update_option($this->option_name, $last_updated);
                    update_option($this->rewrite_md5_name, $rewrites);
                    $message = sprintf($this->__('Rewrite rules updated. Last modified date is %s'), date_i18n(get_option('date_format').' '.get_option('time_format'), $last_updated));
                    add_action('admin_notices', function() use ($message){
                        printf('<div class="updated"><p>%s</p></div>', $message);
                    });
                }
            }
        }
    }
788854
public function display()
    {
        if (!$this->visible) {
            return;
        }

        parent::display();

        // add a hidden field so we can check if this list was submitted on
        // the process step
        $this->getForm()->addHiddenField($this->id . '_submitted', 1);

        if (count($this->pages) === 1) {
            $this->displaySinglePage(reset($this->pages));
        } else {
            $table = new SwatHtmlTag('table');
            $table->id = $this->id;
            $table->class = 'swat-radio-note-book';
            $table->open();

            echo '<tbody>';

            $count = 0;
            foreach ($this->pages as $page) {
                if (!$page->visible) {
                    continue;
                }

                $count++;

                $this->displayPage($page, $count);
            }

            echo '</tbody>';

            $table->close();

            Swat::displayInlineJavaScript($this->getInlineJavaScript());
        }
    }
160134
public function display()
    {
        if (!$this->visible) {
            return;
        }

        parent::display();

        $count = count($this);
        $i = 1;

        $container_tag = $this->getContainerTag();
        $container_tag->open();

        foreach ($this->entries as $entry) {
            // display separator
            if ($i > 1) {
                echo SwatString::minimizeEntities($this->separator);
            }

            // link all entries or link all but the last entry
            $link = $this->link_last_entry || $i < $count;

            $this->displayEntry($entry, $link, $i === 1);

            $i++;
        }

        $container_tag->close();
    }