Create status icon or link.

@param   int $status
@param   array $url
@param   string $icon
@return  null|string
5107
public function status($status = 0, array $url = [], $icon = 'circle')
    {
        $class = (int) $status === 1 ? 'ck-green' : 'ck-red';
        if (count($url) === 0) {
            return $this->icon($icon, ['class' => $class]);
        }

        return $this->link(null, 'javascript:void(0);', [
            'icon'     => $icon,
            'class'    => $class,
            'data-url' => $this->Url->build($url)
        ]);
    }
438244
public function setIcon( $icon = null ) {
		if ( $this->iconName !== null ) {
			$this->icon->removeClasses( [ 'oo-ui-icon-' . $this->iconName ] );
		}
		if ( $icon !== null ) {
			$this->icon->addClasses( [ 'oo-ui-icon-' . $icon ] );
		}

		$this->iconName = $icon;
		$this->toggleClasses( [ 'oo-ui-iconElement' ], (bool)$this->iconName );
		$this->icon->toggleClasses( [ 'oo-ui-iconElement-noIcon' ], !$this->iconName );

		return $this;
	}
1237007
public function redirect($url = ':self', $status = 302)
    {
        $scheme = parse_url($url, PHP_URL_SCHEME);
        if (isset($scheme)) {
            return parent::redirect($url, $status);
        }
        if ($url === ':self') {
            $app = \Slim\Slim::getInstance();
            $url = $app->request->getResourceUri();
        }
        $url = \Bono\Helper\URL::site($url);

        return parent::redirect($url, $status);
    }
321096
public function redirect($url, $statusCode = 302) {
		$this->setStatusCode($statusCode)
			->setHeader('Location', $url)
			->setBody(sprintf('<!DOCTYPE html>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="1;url=%1$s">
<title>Redirecting to %1$s</title>
Redirecting to <a href="%1$s">%1$s</a>', htmlspecialchars($url, ENT_QUOTES, 'UTF-8')));

		return $this;
	}
1064116
function fetch_remote_icon_url() {
            $info = $this->fetch_module_info();

            return ( $this->is_api_result_object( $info, 'icon' ) && is_string( $info->icon ) ) ?
                $info->icon :
                '';
        }
983877
def set_icon(self, icon_url):
        
        log = logging.getLogger(self.cls_logger + '.set_icon')
        if not isinstance(icon_url, basestring):
            msg = 'icon_url arg must be a string'
            log.error(msg)
            raise ValueError(msg)
        self.payload['icon_url'] = icon_url
        log.debug('Set Icon URL to: {u}'.format(u=icon_url))
600615
public function redirect($url, $status = null)
    {
        $this->withHeader('Location', (string)$url);

        if (is_null($status) && $this->getStatusCode() === HttpMessage::HTTP_OK) {
            $status = 302;
        }
    }
512491
function menu_icon( $icon = "dashicons-admin-page" ) {

        if ( is_string( $icon ) && stripos( $icon, "dashicons" ) !== false ) {

            $this->options["menu_icon"] = $icon;

        } else {

            // Set a default menu icon
            $this->options["menu_icon"] = "dashicons-admin-page";
        }
    }
680910
public function render(Icon $icon)
    {
        $jsonBuilder = $this->getJsonBuilder()
            ->setValue('[url]', $icon->getUrl());

        if ($icon->hasAnchor()) {
            $jsonBuilder->setValue('[anchor]', $icon->getAnchor()->getVariable(), false);
        }

        if ($icon->hasOrigin()) {
            $jsonBuilder->setValue('[origin]', $icon->getOrigin()->getVariable(), false);
        }

        if ($icon->hasScaledSize()) {
            $jsonBuilder->setValue('[scaledSize]', $icon->getScaledSize()->getVariable(), false);
        }

        if ($icon->hasSize()) {
            $jsonBuilder->setValue('[size]', $icon->getScaledSize()->getVariable(), false);
        }

        return $this->getFormatter()->renderObjectAssignment($icon, $jsonBuilder->build());
    }
637446
public function setIcon(?string $icon): self
    {
        if (null === $icon) {
            $this->icon = $this->iconType = null;

            return $this;
        }

        if (':' === \mb_substr($icon, 0, 1) && ':' === \mb_substr($icon, \mb_strlen($icon) - 1, 1)) {
            $this->iconType = self::ICON_TYPE_EMOJI;
        } else {
            $this->iconType = self::ICON_TYPE_URL;
        }

        $this->icon = $icon;

        return $this;
    }
564903
public function status($value, $url = [])
    {
        $icon = $value == true ? 'check' : 'times';
        $contextual = $value == true ? 'success' : 'danger';
        return $this->label('', $contextual, ['icon' => $icon]);
    }
403007
protected function renderButton($label, $icon, $url)
	{
		$button = $this->button;
		$button['icon'] = $icon;
		$button['url'] = $url;
		$button['label'] = $label;
		$button['class'] = 'booster.widgets.TbButton';
		$widget = Yii::createComponent($button);
		$widget->init();
		$widget->run();
	}
261165
public static function activeStatus($active, array $options = [], $withIcon = true)
    {
        // TODO: Refactor the options to a dedicated config file.
        $classes      = Arr::get($options, 'classes', [
            'enabled'  => 'label label-success',
            'disabled' => 'label label-default',
        ]);
        $translations = Arr::get($options, 'trans', [
            'enabled'  => 'core::statuses.enabled',
            'disabled' => 'core::statuses.disabled',
        ]);
        $icons = Arr::get($options, 'icons', [
            'enabled'  => 'fa fa-fw fa-check',
            'disabled' => 'fa fa-fw fa-ban',
        ]);

        $key        = $active ? 'enabled' : 'disabled';
        $attributes = ['class' => $classes[$key]];

        return $withIcon
            ? static::generateWithIcon(ucfirst(trans($translations[$key])), $icons[$key], $attributes)
            : static::generate(ucfirst(trans($translations[$key])), $attributes);
    }
172140
public static function createRedirect($url, $statusCode = Response::HTTP_FOUND, array $headers = [])
    {
        $view = static::create(null, $statusCode, $headers);
        $view->setLocation($url);

        return $view;
    }
452849
public function icon() {
		$url = $this->_stub['website'];
		if (!$url) {
			return null;
		}

		$pieces = parse_url($url);
		$url = $pieces['host'];

		$icon = 'http://www.google.com/s2/favicons?domain=';
		$icon .= $url;

		$context = stream_context_create(
			['http' => ['header' => 'Connection: close']]);
		// E.g. http://www.google.com/s2/favicons?domain=xyz.com
		$file = file_get_contents($icon, false, $context);
		if ($file === false) {
			return null;
		}
		// TODO: transform into 16x16 png
		return $file;
	}
1343746
public function setFavicon($url, $rel = 'shortcut icon', $type = 'image/x-icon')
    {
        return $this->addTagToGroup('favicon', '<link rel=":rel" href=":url" type=":type" />', [
            ':url'  => e($url),
            ':rel'  => e($rel),
            ':type' => e($type),
        ]);
    }
152161
public function iconTag($icon = null, $options = []) {
		$icon = mb_strtolower((string)$icon);
		$dataStr = serialize(compact('icon', 'options')) . '_' . $this->_currUIlang;
		$cachePath = 'iconTag.' . md5($dataStr);
		$cached = Cache::read($cachePath, CAKE_THEME_CACHE_KEY_HELPERS);
		if (!empty($cached)) {
			return $cached;
		}

		$result = '';
		if (empty($options)) {
			$options = [];
		} elseif (!is_array($options)) {
			$options = [$options];
		}

		$iconClass = $this->_getClassForElement($icon);
		if (empty($iconClass)) {
			return $result;
		}

		$options['class'] = $iconClass;
		$result = $this->Html->tag('span', '', $options);
		Cache::write($cachePath, $result, CAKE_THEME_CACHE_KEY_HELPERS);

		return $result;
	}