Displays a Bootstrap alert "Warning".

@param array $args The arguments.
@return string Returns the Bootstrap alert "Warning".
558300
public function bootstrapAlertWarningFunction(array $args = []) {
        return $this->bootstrapAlert(ArrayHelper::get($args, "content"), ArrayHelper::get($args, "dismissible"), "alert-" . BootstrapInterface::BOOTSTRAP_WARNING);
    }
1022341
public function bootstrapButtonSuccessFunction(array $args = []) {
        return $this->bootstrapButton(ButtonFactory::parseSuccessButton($args), ArrayHelper::get($args, "icon"));
    }
239217
public function bootstrapAlertSuccessFunction(array $args = []) {
        return $this->bootstrapAlert(ArrayHelper::get($args, "content"), ArrayHelper::get($args, "dismissible"), "alert-" . BootstrapInterface::BOOTSTRAP_SUCCESS);
    }
903005
public function bootstrapGridPushFunction(array $args = []) {
        return $this->bootstrapGrid(ArrayHelper::get($args, "lgPush"), ArrayHelper::get($args, "mdPush"), ArrayHelper::get($args, "smPush"), ArrayHelper::get($args, "xsPush"), ArrayHelper::get($args, "recopyPush", false), "push");
    }
113251
public static function printVars(...$args): string
    {
        $string = '';

        foreach ($args as $arg) {
            $string .= print_r($arg, 1) . PHP_EOL;
        }

        return preg_replace("/Array\n\s+\(/", 'Array (', $string);
    }
1346734
protected function parseArgs($args)
    {
        if (!is_array($args)) {
            return $args;
        }

        $this->silent = in_array('--silent', $args);
        if ($this->silent) {
            $args = array_values(array_diff($args, ['--silent']));
        }

        return $args;
    }
1219151
public function parse(array $args = []) : string
    {
        $strAux = $this->str;
        $params = $this->getParameters();

        foreach ($args as $argKey => $argValue) {
            if (in_array($argKey, $params)) {
                $strAux = str_replace("{{$argKey}}", $argValue, $strAux);
            }
        }

        return $strAux;
    }
1038200
public static function debug(array $args)
    {
        $label = '<div ondblclick="this.remove()" title="Double click to remove" style="cursor:pointer; position: relative; z-index: 999999; margin-top: 10px; box-shadow: 1px 1px 5px #ccc; font-family: Arial; background-color: rgba(255, 255, 0, 0.9); border: 1px dotted orange; padding: 5px 10px">';
        $label .= '<div style="border-bottom: 1px solid #eeeeee;  padding-bottom: 5px; margin-bottom: 5px; color: #666; font-size: 12px">Debug called from file: <strong>' . self::getCallingFileName(
            ) . '</strong> at line <strong>' . self::getCallingFileLine() . '</strong></div>';

        foreach ($args as $value) {
            if (is_bool($value)) {
                if (!$value) {
                    $value = '<span style="color: blue">FALSE</span>';
                } else {
                    $value = '<span style="color: blue">TRUE</span>';
                }
            }

            if (is_null($value)) {
                $value = '<span style="color: blue">NULL</span>';
            }

            if (is_string($value)) {
                if (!$value) {
                    $value = '<span style="color: blue">(empty string))</span>';
                }
            }

            $label .= '<pre>' . print_r($value, true) . '</pre>';
        }
        $label .= '</div>';

        return $label;
    }
945496
public function main(array $args = array()) {
        $publicMethods = $this->getPublicMethods();
        if (!array_key_exists(0, $args)) {
            if (in_array('help', $publicMethods)) {
                $args[0] = 'help';
            } else {
                Garp_Cli::errorOut(
                    "No method selected. Available methods: \n " .
                    implode("\n ", $publicMethods)
                );
                return false;
            }
        }

        $methodName = $args[0];
        if (!in_array($methodName, $publicMethods)) {
            Garp_Cli::errorOut('Unknown command \'' . $methodName . '\'');
            return false;
        }
        unset($args[0]);
        $args = $this->_remapArguments($args);
        if (!$this->_validateArguments($methodName, $args)) {
            // Note, _validateArguments also provides the CLI feedback
            return false;
        }
        $result = call_user_func_array(array($this, $methodName), array($args));
        return $result;
    }
597880
public function notice($value, ...$args) {
        return call_user_func_array(
            [__CLASS__, 'event'],
            array_merge([self::NOTICE, $value], $args)
        );
    }
41852
public function url( array $args = []) {
        $url = get_comments_link( $this->post_ID );
        if ( $args ) {
            $url = add_query_arg( $args, $url );
        }

        return $url;
    }
664829
private function build($alert = array())
    {
        $str = '';
        $alert = \array_merge(array(
            'alert'         => '',
            'dismissible'   => true,
            'class'         => 'danger',        // success info warning danger
            'framework'     => 'bootstrap',
        ), $alert);
        $alert['class'] = 'alert-'.$alert['class'];
        if ($alert['framework'] == 'bootstrap') {
            if ($alert['dismissible']) {
                $str .= '<div class="alert alert-dismissible '.$alert['class'].'" role="alert">'
                    .'<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>'
                    .$alert['alert']
                    .'</div>';
            } else {
                $str .= '<div class="alert '.$alert['class'].'" role="alert">'.$alert['alert'].'</div>';
            }
        } else {
            $str .= '<div class="alert '.$alert['class'].'">'.$alert['alert'].'</div>';
        }
        return $str;
    }
1036520
public function alert(&$route, &$args) {
		if (isset($args[0])) {
			$order_id = $args[0];
		} else {
			$order_id = 0;
		}

		if (isset($args[1])) {
			$order_status_id = $args[1];
		} else {
			$order_status_id = 0;
		}

		if (isset($args[2])) {
			$comment = $args[2];
		} else {
			$comment = '';
		}

		if (isset($args[3])) {
			$notify = $args[3];
		} else {
			$notify = '';
		}

		$order_info = $this->model_checkout_order->getOrder($order_id);

		if ($order_info && !$order_info['order_status_id'] && $order_status_id && in_array('order', (array)$this->config->get('config_mail_alert'))) {
			$this->load->language('mail/order_alert');

			// HTML Mail
			$data['text_received'] = $this->language->get('text_received');
			$data['text_order_id'] = $this->language->get('text_order_id');
			$data['text_date_added'] = $this->language->get('text_date_added');
			$data['text_order_status'] = $this->language->get('text_order_status');
			$data['text_product'] = $this->language->get('text_product');
			$data['text_total'] = $this->language->get('text_total');
			$data['text_comment'] = $this->language->get('text_comment');

			$data['order_id'] = $order_info['order_id'];
			$data['date_added'] = date($this->language->get('date_format_short'), strtotime($order_info['date_added']));

			$order_status_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "order_status WHERE order_status_id = '" . (int)$order_status_id . "' AND language_id = '" . (int)$this->config->get('config_language_id') . "'");

			if ($order_status_query->num_rows) {
				$data['order_status'] = $order_status_query->row['name'];
			} else {
				$data['order_status'] = '';
			}

			$data['store_url'] = $this->config->get('config_url');
			$data['store'] = html_entity_decode($this->config->get('config_name'), ENT_QUOTES, 'UTF-8');

			$this->load->model('tool/image');

			if (is_file(DIR_IMAGE . html_entity_decode($this->config->get('config_logo'), ENT_QUOTES, 'UTF-8'))) {
				$data['logo'] = $this->model_tool_image->resize(html_entity_decode($this->config->get('config_logo'), ENT_QUOTES, 'UTF-8'), $this->config->get('theme_default_image_location_width'), $this->config->get('theme_default_image_cart_height'));
			} else {
				$data['logo'] = '';
			}

			$this->load->model('tool/upload');

			$data['products'] = array();

			$order_products = $this->model_checkout_order->getOrderProducts($order_id);

			foreach ($order_products as $order_product) {
				$option_data = array();

				$order_options = $this->model_checkout_order->getOrderOptions($order_info['order_id'], $order_product['order_product_id']);

				foreach ($order_options as $order_option) {
					if ($order_option['type'] != 'file') {
						$value = $order_option['value'];
					} else {
						$upload_info = $this->model_tool_upload->getUploadByCode($order_option['value']);

						if ($upload_info) {
							$value = $upload_info['name'];
						} else {
							$value = '';
						}
					}

					$option_data[] = array(
						'name'  => $order_option['name'],
						'value' => (utf8_strlen($value) > 20 ? utf8_substr($value, 0, 20) . '..' : $value)
					);
				}

				$data['products'][] = array(
					'name'     => $order_product['name'],
					'model'    => $order_product['model'],
					'quantity' => $order_product['quantity'],
					'option'   => $option_data,
					'total'    => html_entity_decode($this->currency->format($order_product['total'] + ($this->config->get('config_tax') ? ($order_product['tax'] * $order_product['quantity']) : 0), $order_info['currency_code'], $order_info['currency_value']), ENT_NOQUOTES, 'UTF-8')
				);
			}

			$data['vouchers'] = array();

			$order_vouchers = $this->model_checkout_order->getOrderVouchers($order_id);

			foreach ($order_vouchers as $order_voucher) {
				$data['vouchers'][] = array(
					'description' => $order_voucher['description'],
					'amount'      => html_entity_decode($this->currency->format($order_voucher['amount'], $order_info['currency_code'], $order_info['currency_value']), ENT_NOQUOTES, 'UTF-8')
				);
			}

			$data['totals'] = array();

			$order_totals = $this->model_checkout_order->getOrderTotals($order_id);

			foreach ($order_totals as $order_total) {
				$data['totals'][] = array(
					'title' => $order_total['title'],
					'value' => html_entity_decode($this->currency->format($order_total['value'], $order_info['currency_code'], $order_info['currency_value']), ENT_NOQUOTES, 'UTF-8')
				);
			}

			$data['comment'] = strip_tags($order_info['comment']);

			$mail = new Mail($this->config->get('config_mail_engine'));
			$mail->parameter = $this->config->get('config_mail_parameter');
			$mail->smtp_hostname = $this->config->get('config_mail_smtp_hostname');
			$mail->smtp_username = $this->config->get('config_mail_smtp_username');
			$mail->smtp_password = html_entity_decode($this->config->get('config_mail_smtp_password'), ENT_QUOTES, 'UTF-8');
			$mail->smtp_port = $this->config->get('config_mail_smtp_port');
			$mail->smtp_timeout = $this->config->get('config_mail_smtp_timeout');

			$mail->setTo($this->config->get('config_email'));
			$mail->setFrom($this->config->get('config_email'));
			$mail->setSender(html_entity_decode($order_info['store_name'], ENT_QUOTES, 'UTF-8'));
			$mail->setSubject(html_entity_decode(sprintf($this->language->get('text_subject'), $this->config->get('config_name'), $order_info['order_id']), ENT_QUOTES, 'UTF-8'));
			$mail->setText($this->load->view('mail/order_alert', $data));
			$mail->send();

			// Send to additional alert emails
			$emails = explode(',', $this->config->get('config_mail_alert_email'));

			foreach ($emails as $email) {
				if ($email && filter_var($email, FILTER_VALIDATE_EMAIL)) {
					$mail->setTo($email);
					$mail->send();
				}
			}
		}
	}
909252
public function bootstrapHeading5Function(array $args = []) {
        return $this->bootstrapHeading(5, ArrayHelper::get($args, "content"), ArrayHelper::get($args, "description"), ArrayHelper::get($args, "class"));
    }
210895
private static function formatArgsForExpression(array $args)
    {
        $mapping = [];
        foreach ($args as $name => $config) {
            $mapping[] = \sprintf('%s: "%s"', $name, $config['type']);
        }

        return \sprintf('arguments({%s}, args)', \implode(', ', $mapping));
    }
1291354
public function warning($value, ...$args) {
        return call_user_func_array(
            [__CLASS__, 'event'],
            array_merge([self::WARNING, $value], $args)
        );
    }
305230
public function run($args)
    {
        //expecting cradle install cradle/address
        // @codeCoverageIgnoreStart
        if (count($args) < 3) {
            CommandLine::error(self::ERROR_ARGUMENT_COUNT);
        }
        // @codeCoverageIgnoreEnd

        //parse the data
        $data = CommandLine::parseArgs(array_slice($args, 3));

        $bootstrap = $this->cwd . '/.cradle.php';

        //if no bootstrap
        if (!file_exists($bootstrap)) {
            //look for bootstrap=./path/to/bootstrap.php
            //look for bootstrap=path/to/bootstrap.php
            //look for bootstrap=/path/to/bootstrap.php
            // @codeCoverageIgnoreStart
            if (!isset($data['bootstrap'])) {
                CommandLine::error(self::ERROR_BOOTSTRAP_FLAG);
            }
            // @codeCoverageIgnoreEnd

            $bootstrap = $data['bootstrap'];

            if (strpos($bootstrap, './') === 0) {
                $bootstrap = substr($bootstrap, 2);
            }

            if (strpos($bootstrap, '/') !== 0) {
                $bootstrap = $this->cwd . '/' . $bootstrap;
            }

            // @codeCoverageIgnoreStart
            if (!file_exists($bootstrap)) {
                CommandLine::error(sprintf(self::ERROR_BOOTSTRAP_404, $bootstrap));
            }
            // @codeCoverageIgnoreEnd
        }

        $cradle = cradle();
        require_once($bootstrap);

        try {
            $cradle->package($args[1]);
        } catch (Exception $e) {
            //it means that the package wasn't registered
            $cradle->register($args[1]);
        }

        //Setup a default error handler
        // @codeCoverageIgnoreStart
        $cradle->error(function ($request, $response, $error) {
            CommandLine::error($error->getMessage() . PHP_EOL . $error->getTraceAsString());
        });
        // @codeCoverageIgnoreEnd

        //prepare data
        if (isset($data['__json'])) {
            $json = $data['__json'];
            unset($data['__json']);

            $data = array_merge(json_decode($json, true), $data);
        }

        if (isset($data['__json64'])) {
            $base64 = $data['__json64'];
            unset($data['__json64']);

            $json = base64_decode($base64);
            $data = array_merge(json_decode($json, true), $data);
        }

        if (isset($data['__query'])) {
            $query = $data['__query'];
            unset($data['__query']);

            parse_str($query, $query);

            $data = array_merge($query, $data);
        }

        //case for root packages
        if (strpos($args[1], '/') === 0) {
            $args[1] = substr($args[1], 1);
        }

        list($author, $package) = explode('/', $args[1], 2);

        $event = $author . '-' . $package . '-' . $args[2];

        //set the the request and response
        $request = $cradle->getRequest();
        $response = $cradle->getResponse();

        $request->setStage($data);

        //see HttpTrait->render() for similar implementation
        //if prepared returned false
        if (!$cradle->prepare()) {
            //dont do anything else
            return $this;
        }

        if ($response->getStatus() == EventHandler::STATUS_OK) {
            $continue = $cradle
                ->trigger($event, $request, $response)
                ->getEventHandler()
                ->getMeta();

            if (!$continue) {
                return $this;
            }
        }

        if (!$response->hasContent() && $response->hasJson()) {
            $json = json_encode($response->get('json'));
            $response->setContent($json);
        }

        if ($response->hasContent()) {
            CommandLine::output($response->getContent());
        } else {
            CommandLine::info(sprintf(self::SUCCESS_MESSAGE, $args[2]));
        }

        //the connection is already closed
        //also remember there are no more sessions
        $cradle->shutdown();
    }