Render admin notices.

@since 160524 WP notices.
@see <http://jas.xyz/1Tuh3aI>
186509
public function onAllAdminNotices()
    {
        if (!($notices = $this->get())) {
            return; // Nothing to do.
        }
        $time = time(); // The current time.

        foreach ($notices as $_key => &$_notice) {
            # Catch invalid/corrupted notices.

            if (!is_string($_key) || !is_array($_notice)) {
                unset($notices[$_key]);
                continue; // Ignore.
            }
            # Normalize the notice.

            $_notice = $this->normalize($_notice);

            # Initialize a few variables.

            $_markup           = '';
            $_current_user_can = false;
            $_is_applicable    = false;

            $_class = $this->App::CORE_CONTAINER_SLUG.'-menu-page-area';
            $_class .= ' -notice';
            $_class .= ' notice';

            $_style   = $_notice['style'];
            $_dismiss = ''; // Default; n/a.

            # Check for empty markup.

            if (!($_markup = $_notice['markup'])) {
                unset($notices[$_key]);
                continue; // Ignore.
            }
            # If transient, wipe after a single pass.

            if ($_notice['is_transient']) {
                unset($notices[$_key]);
            }
            # Has notice become too old; i.e., lingering?

            if ($_notice['_insertion_time'] < $this->outdated_notice_time
                && /* Not intentially delayed. */ $_notice['delay_until_time'] < $time) {
                unset($notices[$_key]); // Ancient history after this pass.
            }
            # Check conditions; i.e., is notice applicable?

            if (!$this->currentUserCan($_notice)) {
                continue; // Do not display.
            } elseif (!$this->isApplicableContext($_notice)) {
                continue; // Do not display.
            } elseif (!$this->isApplicablePage($_notice)) {
                continue; // Do not display.
            } elseif ($_notice['delay_until_time'] > $time) {
                continue; // Do not display.
            } elseif ($_notice['recurs_every'] && $_notice['_last_recur_dismiss_time']
                && $_notice['_last_recur_dismiss_time'] + $_notice['recurs_every'] > $time) {
                continue; // Do not display; not time to recur yet, based on last time.
            }
            # If `is_applicable` is a closure, check it's return value also.

            if ($this->c::isSerialized($_notice['is_applicable'])) {
                try { // Maybe catch exceptions here.
                    $_is_applicable = $this->c::unserializeClosure($_notice['is_applicable']);
                    $_is_applicable = $_is_applicable($this->App); // Should return (bool) or `null`.
                    $_is_applicable = $_is_applicable === null ? $_is_applicable : (bool) $_is_applicable;

                    // NOTE: A special return value of `null` indicates the notice
                    // is no longer applicable (at all) and should be dequeued entirely.

                    if ($_is_applicable === null) {
                        unset($notices[$_key]);
                        continue; // Ignore.
                    } elseif (!$_is_applicable) {
                        continue; // Do not display.
                    }
                } catch (\Throwable $Throwable) {
                    unset($notices[$_key]); // Avoid repeats.

                    if ($this->App->Config->©debug['©enable']) {
                        throw $Throwable;
                    }
                    continue; // Ignore.
                }
            }
            # If `markup` is a closure, call upon the closure now.

            if ($this->c::isSerialized($_notice['markup'])) {
                try { // Maybe catch exceptions here.
                    $_markup = $this->c::unserializeClosure($_notice['markup']);
                    $_markup = (string) $_markup($this->App); // Should return a string.

                    // NOTE: A special return value (empty) indicates the notice
                    // is no longer applicable (at all) and should be dequeued entirely.

                    if (!$_markup) {
                        unset($notices[$_key]);
                        continue; // Ignore.
                    }
                } catch (\Throwable $Throwable) {
                    unset($notices[$_key]); // Avoid repeats.

                    if ($this->App->Config->©debug['©enable']) {
                        throw $Throwable;
                    }
                    continue; // Ignore.
                }
            }
            # Setup notice classes for CSS in WP core.

            switch ($_notice['type']) {
                case 'info':
                    $_class .= ' notice-info';
                    break; // Blue coloration.

                case 'success':
                    $_class .= ' notice-success';
                    break; // Green coloration.

                case 'warning':
                    $_class .= ' notice-warning';
                    break; // Orange/yellow coloration.

                case 'error':
                    $_class .= ' notice-error';
                    break; // Red coloration.

                default: // Default (info).
                    $_class .= ' notice-info';
            }
            // Create dismiss icon if applicable.

            if ($_notice['is_persistent'] && $_notice['is_dismissable']) {
                // $_class .= ' is-dismissible';
                // We use a different approach for dismissals.

                $_style .= ' padding-right:38px; position:relative;';
                $_dismiss = '<a class="notice-dismiss" style="text-decoration:none;" href="'.esc_attr($this->dismissUrl($_key)).'">'.
                                '<span class="screen-reader-text">'.__('Dismiss this notice.', 'wp-sharks-core').'</span>'.
                            '</a>';
            }
            # Make sure markup is wrapped in a block-level tag so margins will exist.

            $_markup = $this->c::mbTrim($_markup); // Before checking.
            if (!preg_match('/^\<(?:p|div|form|h[1-6]|ul|ol)[\s>]/ui', $_markup)) {
                $_markup = '<p>'.$_markup.'</p>'; // Add `<p>` tag.
            }
            # Display notice `<div>` with the markup and a possible dismiss icon.

            echo '<div class="'.esc_attr($_class).'" style="'.esc_attr($_style).'">'.
                    $_markup.$_dismiss.// Possible dismiss icon.
                 '</div>';

            # Notice seen. Handle queue state logic now.

            if ($_notice['is_persistent']) {
                continue; // Persistent; do nothing.
                // See {@link dismiss()} for recurring + persistent notice handling.
                // A recurring + persistent notice is counted/updated when it's dismissed.
                // If it's not dismissable, then it simply remains until dequeued manually.
            } elseif ($_notice['recurs_every']) {
                ++$_notice['_recurrences']; // Update counter.

                if ($_notice['_recurrences'] < $_notice['recurs_times']) {
                    $_notice['_last_recur_dismiss_time'] = $time;
                } else {
                    unset($notices[$_key]); // Dequeue.
                }
            } else {
                unset($notices[$_key]); // Dequeue.
            }
        } // unset($_key, $_notice, $_markup, $_current_user_can, $_is_applicable, $_class, $_style, $_dismiss);

        $this->update($notices);
    }
1363441
public function renderRows()
    {
        // precache template chunks
        $this->precacheTemplate();

        // extend CompleteLister renderRows method
        parent::renderRows();

        // if we have at least one data row rendered, then remove not_found message
        if ($this->total_rows) {
            $this->template->del('not_found');
        } elseif ($this->no_records_message) {
            $this->template->del('header');
            $this->template->set('not_found_message', $this->no_records_message);
        }
    }
657534
public function render()
    {
        $output = [];

        foreach ($this->meta as $element) {
            $output[] = '<meta';
            foreach ($element as $key => $value) {
                $output[] = sprintf(' %s="%s"', $key, $value);
            }
            $output[] = ">\n";
        }

        $output = apply_filters('novusopress_meta_output', implode('', $output));

        echo $output;
    }
781731
function adminRender()
    {
        if (UserRights($this->access))
        {
            $result = '';
            if (arg('update'))
            {
                $this->update();
            }
            elseif (arg('action'))
            {
                switch (arg('action'))
                {
                    case 'up':
                        $this->moveUp();
                        break;
                    case 'down':
                        $this->moveDown();
                        break;
                    case 'create':
                        $result = $this->create();
                        break;
                    case 'insert':
                        $this->insert();
                        break;
                    case 'move':
                        $result = $this->move();
                        break;
                    case 'delete':
                        $this->delete();
                        break;
                }
            }
            elseif (isset(Eresus_CMS::getLegacyKernel()->request['arg']['id']))
            {
                $result = $this->edit(arg('id', 'int'));
            }
            else
            {
                $result = $this->sectionIndex();
            }
            return $result;
        }
        else
        {
            return '';
        }
    }
1339449
private function load_notices() {
        $notices = get_option( 'wp_easy_notify_' . $this->prefix, array() );
        $this->notices = $notices;

        $active = get_option( 'wp_easy_notify_active_' . $this->prefix, array() );
        $this->active = $active;
    }
505052
private function renderResult(Result $result)
    {
        if ($result->hasNotices()) {
            /** @var Notice $notice */
            foreach ($result->getNotices() as $notice) {
                if (!empty($notice->getTitle())) {
                    $this->outputLine('<b>%s</b>: %s', [$notice->getTitle(), $notice->render()]);
                } else {
                    $this->outputLine($notice->render());
                }
            }
        }

        if ($result->hasErrors()) {
            /** @var Error $error */
            foreach ($result->getErrors() as $error) {
                $this->outputLine('<error>ERROR: %s</error>', [$error->render()]);
            }
        }
        if ($result->hasWarnings()) {
            /** @var Warning $warning */
            foreach ($result->getWarnings() as $warning) {
                if (!empty($warning->getTitle())) {
                    $this->outputLine('<b>%s</b>: <comment>%s</comment>', [$warning->getTitle(), $warning->render()]);
                } else {
                    $this->outputLine('<comment>%s</comment>', [$warning->render()]);
                }
            }
        }
        if (!$result->hasErrors() && !$result->hasWarnings()) {
            $this->outputLine('<success>OK</success>');
        }
    }
888269
public function render_help() {
		$field_data    = Carbon_Breadcrumb_Admin_Settings::get_field_data();
		$original_name = str_replace( 'carbon_breadcrumbs_', '', $this->get_id() );
		$help          = ! empty( $field_data[ $original_name ]['help'] ) ? $field_data[ $original_name ]['help'] : '';
		if ( ! $help ) {
			return;
		}
		?>
		<p class="description"><?php echo esc_html( $help ); ?></p>
		<?php
	}
948092
public function render(){
        $this->event->trigger("onInit", $this);
        EventMaster::trigger_static("connectorInit",$this);

        if (!$this->as_string)
            $this->parse_request();
        $this->set_relation();

        if ($this->live_update !== false && $this->updating!==false) {
                $this->live_update->get_updates();
        } else {
            if ($this->editing){
                if (($this->action_mode == "links") && isset($this->options["links"])) {
                    $this->options["links"]->save();
                } else {
                    $dp = new $this->names["data_class"]($this,$this->config,$this->request);
                    $dp->process($this->config,$this->request);
                }
            } else {
                if (!$this->access->check("read")){
                    LogMaster::log("Access control: read operation blocked");
                    echo "Access denied";
                    die();
                }
                $wrap = new SortInterface($this->request);
                $this->apply_sorts($wrap);
                $this->event->trigger("beforeSort",$wrap);
                $wrap->store();

                $wrap = new FilterInterface($this->request);
                $this->apply_filters($wrap);
                $this->event->trigger("beforeFilter",$wrap);
                $wrap->store();

                if ($this->model && method_exists($this->model, "get")){
                    $this->sql = new ArrayDBDataWrapper();
                    $result = new ArrayQueryWrapper(call_user_func(array($this->model, "get"), $this->request));
                    $out = $this->output_as_xml($result);
                } else {
                    $out = $this->output_as_xml($this->get_resource());

                    if ($out !== null) return $out;
                }

            }
        }
        $this->end_run();
    }
403476
public function renderServer(): void
	{
		$this->addBreadcrumbLink('dockbar.info.server');
		$this->template->refresh = $this->refresh;
		$this->template->system = $this->app->info->system;
		$this->template->fileSystem = $this->app->info->fileSystem;
		$this->template->hardware = $this->app->info->hardware;
		$this->template->memory = $this->app->info->memory;
		$this->template->network = $this->app->info->network;
	}
1229112
public function renderDataRow()
    {
        $this->formatRow();

        $this->template->appendHTML(
            $this->container_tag,
            $this->rowRender($this->row_t)
        );
    }
546218
public function render()
    {
        parent::render();

        $soxId = $this->getEditObjectId();
        if ($soxId != "-1" && isset($soxId)) {
            // load object
            $oNewsletter = oxNew(\OxidEsales\Eshop\Application\Model\Newsletter::class);
            $oNewsletter->load($soxId);
            $this->_aViewData["edit"] = $oNewsletter;

            // user
            $sUserID = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable("auth");

            // assign values to the newsletter and show it
            $oNewsletter->prepare($sUserID, \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('bl_perfLoadAktion'));

            $this->_aViewData["previewhtml"] = $oNewsletter->getHtmlText();
            $this->_aViewData["previewtext"] = $oNewsletter->getPlainText();
        }

        return "newsletter_preview.tpl";
    }
1022831
private function print_notification( $notice ) {
        do_action( 'easy_notifications_before_notice', $notice ); 

        echo '<div class="updated '.$notice['type'].'">
            ' . $notice['content'] . ' 

            <a href="#" class="dismiss-notice" 
            data-namespace="' . $this->prefix . '" 
            data-noticeid="' . $notice['id'] . '"
            >Dismiss Notification</a>
            </div>';

        do_action( 'easy_notifications_after_notice', $notice );
    }
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');
        }
    }
861079
public function render()
    {
        if ($this->report->fireEvent("OnBeforeWidgetRender", $this)) {
            $type=str_replace('\\', '/', get_class($this));
            echo "<krwidget widget-name='$this->name' widget-type='$type'"
                .($this->themeCssClass?" class='$this->themeCssClass'":"").">";
            $this->onRender();
            echo "</krwidget>";
        }
        $this->report->fireEvent("OnWidgetRender", $this);
    }
349141
public function admin_notices() {
		$afterKeyAdded = get_option( $this->option );

		if ( empty( $afterKeyAdded ) ) {
			return;
		}

		switch( $afterKeyAdded ) {
			case 'success':
				echo '<div class="notice notice-success is-dismissible bglib-key-added"><p>' .
					esc_html( 'Your new BoldGrid Connect Key has been successfully added!', 'boldgrid-library' ) .
					'</p></div>';
				break;
			case 'fail':
				echo '<div class="notice notice-error is-dismissible bglib-key-added"><p>' .
					esc_html( 'An unknown error occurred adding your new BoldGrid Connect Key.', 'boldgrid-library' ) .
					'</p></div>';
				break;
		}

		delete_option( $this->option );
	}
475265
public function adminRender()
    {
        global $locale;

        $xml = new DOMDocument('1.0', 'UTF-8');
        $xml->load(Eresus_CMS::getLegacyKernel()->froot . 'core/about.xml');

        $data = array();

        /* @var DOMElement $product */
        $product = $xml->getElementsByTagName('product')->item(0);
        $data['product'] = array();
        $data['product']['title'] = $product->getAttribute('title');
        $data['product']['version'] = $product->getAttribute('version');

        $data['product']['copyrights'] = array();
        $copyrights = $product->getElementsByTagName('copyright');
        for ($i = 0; $i < $copyrights->length; $i++)
        {
            /* @var DOMElement $copyright */
            $copyright = $copyrights->item($i);
            $data['product']['copyrights'] []= array(
                'year' => $copyright->getAttribute('year'),
                'owner' => $copyright->getAttribute('owner'),
                'url' => $copyright->getAttribute('url'),
            );
        }

        $license = $xml->getElementsByTagName('license')->item(0);
        $data['license'] = array();
        $data['license']['text'] = $license->getElementsByTagName($locale['lang'])->item(0)->textContent;

        /** @var TAdminUI $page */
        $page = Eresus_Kernel::app()->getPage();
        $tmpl = $page->getUITheme()->getTemplate('misc/about.html');
        $html = $tmpl->compile($data);

        return $html;
    }
482398
public function render_email_address() {
		$placeholder = get_bloginfo( 'admin_email' );
		$current = $this->options->email_address;
		$value = $placeholder === $current ? '' : $current;

		echo $this->template->render( // WPCS: XSS OK.
			'options/email-address.php',
			compact( 'placeholder', 'value' )
		);
	}