class c_standard_path extends c_base_path {
public const PATH_SELF = '';
- protected const CSS_AS_SECTION = 'as-section';
- protected const CSS_AS_SECTION_HEADERS = 'as-section-headers';
- protected const CSS_AS_WRAPPER = 'as-wrapper';
+ protected const CSS_AS_BOLD = 'as-bold';
protected const CSS_AS_BREAK = 'as-break';
- protected const CSS_AS_TITLE = 'as-title';
- protected const CSS_AS_TEXT = 'as-text';
- protected const CSS_AS_TEXT_BLOCK = 'as-text-block';
- protected const CSS_AS_PARAGRAPH = 'as-paragraph';
- protected const CSS_AS_PARAGRAPH_BLOCK = 'as-paragraph-block';
- protected const CSS_AS_LINK_BLOCK = 'as-link_block';
- protected const CSS_AS_LINK_BLOCK_NAME = 'as-link_block-name';
- protected const CSS_AS_LINK_BLOCK_LINK = 'as-link_block-link';
- protected const CSS_AS_LINK_BLOCK_DESCRIPTION = 'as-link_block-description';
- protected const CSS_AS_HEADER = 'as-header';
- protected const CSS_AS_HEADER_TEXT = 'as-header-text';
- protected const CSS_AS_HEADERS = 'as-headers';
+ protected const CSS_AS_CITATION = 'as-citation';
+ protected const CSS_AS_CODE = 'as-code';
+ protected const CSS_AS_DELETE = 'as-delete';
protected const CSS_AS_FIELD_SET = 'as-field_set';
protected const CSS_AS_FIELD_SET_LEGEND = 'as-field_set-legend';
protected const CSS_AS_FIELD_SET_CONTENT = 'as-field_set-content';
protected const CSS_AS_FIELD_ROW = 'as-field_row';
protected const CSS_AS_FIELD_ROW_NAME = 'as-field_row-name';
protected const CSS_AS_FIELD_ROW_VALUE = 'as-field_row-value';
+ protected const CSS_AS_HEADER = 'as-header';
+ protected const CSS_AS_HEADER_TEXT = 'as-header-text';
+ protected const CSS_AS_HEADERS = 'as-headers';
+ protected const CSS_AS_INSERT = 'as-insert';
+ protected const CSS_AS_ITALICS = 'as-italics';
+ protected const CSS_AS_LINK_BLOCK = 'as-link_block';
+ protected const CSS_AS_LINK_BLOCK_NAME = 'as-link_block-name';
+ protected const CSS_AS_LINK_BLOCK_LINK = 'as-link_block-link';
+ protected const CSS_AS_LINK_BLOCK_DESCRIPTION = 'as-link_block-description';
+ protected const CSS_AS_MARK = 'as-mark';
+ protected const CSS_AS_PARAGRAPH = 'as-paragraph';
+ protected const CSS_AS_PARAGRAPH_BLOCK = 'as-paragraph-block';
+ protected const CSS_AS_PREFORMATTED = 'as-preformatted';
protected const CSS_AS_ROW = 'as-row';
protected const CSS_AS_ROW_EVEN = 'as-row-even';
protected const CSS_AS_ROW_ODD = 'as-row-odd';
protected const CSS_AS_ROW_VALUE = 'as-row-value';
+ protected const CSS_AS_SAMPLE = 'as-sample';
+ protected const CSS_AS_SCRIPT_SUB = 'as-script_sub';
+ protected const CSS_AS_SCRIPT_SUPER = 'as-script_super';
+ protected const CSS_AS_SECTION = 'as-section';
+ protected const CSS_AS_SECTION_HEADERS = 'as-section-headers';
protected const CSS_AS_SPACER = 'as-spacer';
protected const CSS_AS_TABLE = 'as-table';
protected const CSS_AS_TABLE_CAPTION = 'as-table-caption';
protected const CSS_AS_TABLE_ROW = 'as-table-row';
protected const CSS_AS_TABLE_CELL = 'as-table-cell';
protected const CSS_AS_TABLE_FOOTER = 'as-table-footer';
+ protected const CSS_AS_TITLE = 'as-title';
+ protected const CSS_AS_TEXT = 'as-text';
+ protected const CSS_AS_TEXT_BLOCK = 'as-text-block';
+ protected const CSS_AS_QUOTE_BLOCK = 'as-quote_block';
+ protected const CSS_AS_QUOTE_INLINE = 'as-quote_inline';
+ protected const CSS_AS_UNDERLINE = 'as-underline';
+ protected const CSS_AS_WRAPPER = 'as-wrapper';
protected const CSS_IS_JAVASCRIPT_ENABLED = 'javascript-enabled';
protected const CSS_IS_JAVASCRIPT_DISABLED = 'javascript-disabled';
+
protected const CSS_IS_CONTENT_TYPE = 'is-html_5';
protected const CSS_SYSTEM_PREFIX = 'system-';
if (isset($this->settings['standards_issue-use_p_tags']) && $this->settings['standards_issue-use_p_tags']) {
$this->text_type = c_base_markup_tag::TYPE_PARAGRAPH;
}
-
- $this->languages = $this->http->get_response_content_language()->get_value_exact();
- if (!is_array($this->languages)) {
- $this->languages = [];
+
+ $this->languages = $this->http->get_response_content_language()->get_value_exact();
+ if (!is_array($this->languages)) {
+ $this->languages = [];
+ }
+
+ $this->pr_get_language_alias();
+
+ return new c_base_return_true();
+ }
+
+ /**
+ * Get the breadcrumb for this path.
+ *
+ * The breadcrumb will be built by this function if it is not already built.
+ *
+ * @return c_base_menu_item|c_base_return_null
+ * The breadcrumb menu is returned on success.
+ * If not defined, then NULL is returned.
+ * NULL with the error bit set is returned on error.
+ */
+ public function get_breadcrumbs() {
+ if (!($this->breadcrumbs instanceof c_base_menu_item)) {
+ $this->pr_build_breadcrumbs();
+ }
+
+ if ($this->breadcrumbs instanceof c_base_menu_item) {
+ return clone($this->breadcrumbs);
+ }
+
+ return new c_base_return_null();
+ }
+
+ /**
+ * Return the current path parts after the specified path.
+ *
+ * This is intended for handling the path parts as arguments.
+ * Processed path arguments are stored on the classes arguments variable.
+ *
+ * No sanitization is performed on these arguments.
+ *
+ * @param string $path_after
+ * The string to parse.
+ *
+ * @return bool
+ * TRUE on success, FALSE otherwise.
+ * On error, arguments is assigned to an empty array.
+ */
+ protected function pr_process_path_arguments($path_after) {
+ $path = $this->http->get_request_uri_relative($this->settings['base_path'])->get_value_exact();
+ $path = preg_replace('@^' . $path_after . '(/|$)@i', '', $path);
+
+ if (mb_strlen($path) == 0) {
+ unset($path);
+ $this->arguments = [];
+ return FALSE;
+ }
+
+ $this->arguments = explode('/', $path);
+ unset($path);
+
+ return TRUE;
+ }
+
+ /**
+ * Build the breadcrumb.
+ *
+ * @return c_base_return_status
+ * TRUE on success, FALSE otherwise.
+ * FALSE with error bit set is returned on error.
+ */
+ protected function pr_build_breadcrumbs() {
+ if (!is_object($this->path_tree)) {
+ return new c_base_return_false();
+ }
+
+ $handler_settings = $this->path_tree->get_item_reset();
+ if ($handler_settings instanceof c_base_return_false) {
+ unset($handler_settings);
+ return new c_base_return_false();
+ }
+
+ $this->breadcrumbs = new c_base_menu_item();
+
+ // render the breadcrumbs for all appropriate paths as the default behavior.
+ // this does not include the last path tree item because that item should be this class.
+ $count = 0;
+ $total = $this->path_tree->get_items_count() - 1;
+ for (; $count < $total; $count++) {
+ if ($handler_settings instanceof c_base_return_false) {
+ $handler_settings = $this->path_tree->get_item_next();
+ continue;
+ }
+
+ $handler_settings = $handler_settings->get_value();
+
+ if (!isset($handler_settings['include_name']) || !is_string($handler_settings['include_name'])) {
+ $handler_settings = $this->path_tree->get_item_next();
+ continue;
+ }
+
+ if (!isset($handler_settings['include_directory']) || !is_string($handler_settings['include_directory'])) {
+ $handler_settings = $this->path_tree->get_item_next();
+ continue;
+ }
+
+ if (!isset($handler_settings['handler']) || !is_string($handler_settings['handler'])) {
+ $handler_settings = $this->path_tree->get_item_next();
+ continue;
+ }
+
+ require_once($handler_settings['include_directory'] . $handler_settings['include_name'] . static::SCRIPT_EXTENSION);
+
+
+ $handler = NULL;
+ if (is_string($this->language_alias)) {
+ @include_once($handler_settings['include_directory'] . $this->language_alias . '/' . $handler_settings['include_name'] . static::SCRIPT_EXTENSION);
+
+ $handler_class = $handler_settings['handler'] . '_' . $this->language_alias;
+ if (class_exists($handler_class)) {
+ $handler = new $handler_class();
+ }
+ unset($handler_class);
+ }
+
+ if (is_null($handler)) {
+ if (class_exists($handler_settings['handler'])) {
+ $handler = new $handler_settings['handler']();
+ }
+ else {
+ unset($handler);
+ $handler_settings = $this->path_tree->get_item_next();
+ continue;
+ }
+ }
+
+ $handler->set_parameters($this->http, $this->database, $this->session, $this->settings);
+ $breadcrumbs = $handler->get_breadcrumbs();
+ if ($breadcrumbs instanceof c_base_menu_item) {
+ $breadcrumbs = $breadcrumbs->get_items()->get_value_exact();
+ foreach ($breadcrumbs as $breadcrumb) {
+ $this->breadcrumbs->set_item($breadcrumb);
+ }
+ unset($breadcrumb);
+ }
+ unset($breadcrumbs);
+ unset($handler);
+ unset($handler_settings);
+
+ $handler_settings = $this->path_tree->get_item_next();
+ }
+ unset($count);
+ unset($total);
+
+ return new c_base_return_true();
+ }
+
+ /**
+ * Creates the standard section.
+ *
+ * @param array|null $headers
+ * An array of headers, whose keys are the header number and values are the header names.
+ * If NULL, then the headers are not assigned.
+ * @param array $arguments
+ * (optional) An array of arguments to convert into text.
+ * @param string|null $id
+ * (optional) An ID attribute to assign.
+ * If NULL, then this is not assigned.
+ * @param string|array||null $extra_class
+ * (optional) An additional css class to append to the wrapping block.
+ * May be an array of classes to append.
+ * If NULL, then this is not assigned.
+ *
+ * @return c_base_markup_tag
+ * The generated markup tag.
+ */
+ protected function pr_create_tag_section($headers = NULL, $arguments = [], $id = NULL, $extra_class = NULL) {
+ $classes = [$this->settings['base_css'] . static::CSS_AS_SECTION, static::CSS_AS_SECTION];
+ if (is_string($extra_class)) {
+ $classes[] = $extra_class;
+ }
+ elseif (is_array($extra_class)) {
+ foreach ($extra_class as $class) {
+ $classes[] = $class;
+ }
+ unset($class);
+ }
+
+ $tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_SECTION, $id, $classes);
+ unset($classes);
+
+ if (is_array($headers)) {
+ $header = $this->pr_create_tag_headers($headers, $arguments, NULL, static::CSS_AS_SECTION_HEADERS);
+ $tag->set_tag($header);
+ unset($header);
+ }
+
+ return $tag;
+ }
+
+ /**
+ * Creates the standard wrapper.
+ *
+ * @param string|null $id
+ * (optional) An ID attribute to assign.
+ * If NULL, then this is not assigned.
+ * @param string|null $extra_class
+ * (optional) An additional css class to append to the wrapping block.
+ * May be an array of classes to append.
+ * If NULL, then this is not assigned.
+ *
+ * @return c_base_markup_tag
+ * The generated markup tag.
+ */
+ protected function pr_create_tag_wrapper($id = NULL, $extra_class = NULL) {
+ $classes = [$this->settings['base_css'] . static::CSS_AS_WRAPPER, static::CSS_AS_WRAPPER];
+ if (is_string($extra_class)) {
+ $classes[] = $extra_class;
+ }
+ elseif (is_array($extra_class)) {
+ foreach ($extra_class as $class) {
+ $classes[] = $class;
+ }
+ unset($class);
+ }
+
+ return c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, $id, $classes);
+ }
+
+ /**
+ * Creates the standard break tag.
+ *
+ * @param string|null $id
+ * (optional) An ID attribute to assign.
+ * If NULL, then this is not assigned.
+ * @param string|null $extra_class
+ * (optional) An additional css class to append to the wrapping block.
+ * May be an array of classes to append.
+ * If NULL, then this is not assigned.
+ *
+ * @return c_base_markup_tag
+ * The generated markup tag.
+ */
+ protected function pr_create_tag_break($id = NULL, $extra_class = NULL) {
+ $classes = [$this->settings['base_css'] . static::CSS_AS_BREAK, static::CSS_AS_BREAK];
+ if (is_string($extra_class)) {
+ $classes[] = $extra_class;
+ }
+ elseif (is_array($extra_class)) {
+ foreach ($extra_class as $class) {
+ $classes[] = $class;
+ }
+ unset($class);
+ }
+
+ return c_theme_html::s_create_tag(c_base_markup_tag::TYPE_BREAK, $id, $classes);
+ }
+
+ /**
+ * Creates the standard text.
+ *
+ * @param int|string $text
+ * The text or the text code to use.
+ * @param array $arguments
+ * (optional) An array of arguments to convert into text.
+ * @param string|null $id
+ * (optional) An ID attribute to assign.
+ * If NULL, then this is not assigned.
+ * @param string|null $extra_class
+ * (optional) An additional css class to append to the wrapping block.
+ * May be an array of classes to append.
+ * If NULL, then this is not assigned.
+ *
+ * @return c_base_markup_tag
+ * The generated markup tag.
+ */
+ protected function pr_create_tag_text($text, $arguments = [], $id = NULL, $extra_class = NULL) {
+ $classes = [$this->settings['base_css'] . static::CSS_AS_TEXT, static::CSS_AS_TEXT];
+ if (is_string($extra_class)) {
+ $classes[] = $extra_class;
+ }
+ elseif (is_array($extra_class)) {
+ foreach ($extra_class as $class) {
+ $classes[] = $class;
+ }
+ unset($class);
+ }
+
+ if (is_int($text)) {
+ return c_theme_html::s_create_tag($this->text_type, $id, $classes, $this->pr_get_text($text, $arguments));
+ }
+
+ return c_theme_html::s_create_tag($this->text_type, $id, $classes, $text);
+ }
+
+ /**
+ * Creates the standard text, explicitly using span.
+ *
+ * @param int|string $text
+ * The text or the text code to use.
+ * @param array $arguments
+ * (optional) An array of arguments to convert into text.
+ * @param string|null $id
+ * (optional) An ID attribute to assign.
+ * If NULL, then this is not assigned.
+ * @param string|null $extra_class
+ * (optional) An additional css class to append to the wrapping block.
+ * May be an array of classes to append.
+ * If NULL, then this is not assigned.
+ *
+ * @return c_base_markup_tag
+ * The generated markup tag.
+ */
+ protected function pr_create_tag_text_span($text, $arguments = [], $id = NULL, $extra_class = NULL) {
+ $classes = [$this->settings['base_css'] . static::CSS_AS_TEXT, static::CSS_AS_TEXT];
+ if (is_string($extra_class)) {
+ $classes[] = $extra_class;
+ }
+ elseif (is_array($extra_class)) {
+ foreach ($extra_class as $class) {
+ $classes[] = $class;
+ }
+ unset($class);
+ }
+
+ if (is_int($text)) {
+ return c_theme_html::s_create_tag(c_base_markup_tag::TYPE_SPAN, $id, $classes, $this->pr_get_text($text, $arguments));
+ }
+
+ return c_theme_html::s_create_tag(c_base_markup_tag::TYPE_SPAN, $id, $classes, $text);
+ }
+
+ /**
+ * Creates the standard bold.
+ *
+ * @param int|string $text
+ * The text or the text code to use.
+ * @param array $arguments
+ * (optional) An array of arguments to convert into text.
+ * @param string|null $id
+ * (optional) An ID attribute to assign.
+ * If NULL, then this is not assigned.
+ * @param string|null $extra_class
+ * (optional) An additional css class to append to the wrapping block.
+ * May be an array of classes to append.
+ * If NULL, then this is not assigned.
+ *
+ * @return c_base_markup_tag
+ * The generated markup tag.
+ */
+ protected function pr_create_tag_bold($text, $arguments = [], $id = NULL, $extra_class = NULL) {
+ $classes = [$this->settings['base_css'] . static::CSS_AS_BOLD, static::CSS_AS_BOLD];
+ if (is_string($extra_class)) {
+ $classes[] = $extra_class;
+ }
+ elseif (is_array($extra_class)) {
+ foreach ($extra_class as $class) {
+ $classes[] = $class;
+ }
+ unset($class);
+ }
+
+ if (is_int($text)) {
+ return c_theme_html::s_create_tag(c_base_markup_tag::TYPE_BOLD, $id, $classes, $this->pr_get_text($text, $arguments));
+ }
+
+ return c_theme_html::s_create_tag(c_base_markup_tag::TYPE_BOLD, $id, $classes, $text);
+ }
+
+ /**
+ * Creates the standard italics.
+ *
+ * @param int|string $text
+ * The text or the text code to use.
+ * @param array $arguments
+ * (optional) An array of arguments to convert into text.
+ * @param string|null $id
+ * (optional) An ID attribute to assign.
+ * If NULL, then this is not assigned.
+ * @param string|null $extra_class
+ * (optional) An additional css class to append to the wrapping block.
+ * May be an array of classes to append.
+ * If NULL, then this is not assigned.
+ *
+ * @return c_base_markup_tag
+ * The generated markup tag.
+ */
+ protected function pr_create_tag_italics($text, $arguments = [], $id = NULL, $extra_class = NULL) {
+ $classes = [$this->settings['base_css'] . static::CSS_AS_ITALICS, static::CSS_AS_ITALICS];
+ if (is_string($extra_class)) {
+ $classes[] = $extra_class;
+ }
+ elseif (is_array($extra_class)) {
+ foreach ($extra_class as $class) {
+ $classes[] = $class;
+ }
+ unset($class);
+ }
+
+ if (is_int($text)) {
+ return c_theme_html::s_create_tag(c_base_markup_tag::TYPE_ITALICS, $id, $classes, $this->pr_get_text($text, $arguments));
+ }
+
+ return c_theme_html::s_create_tag(c_base_markup_tag::TYPE_ITALICS, $id, $classes, $text);
+ }
+
+ /**
+ * Creates the standard subscript.
+ *
+ * @param int|string $text
+ * The text or the text code to use.
+ * @param array $arguments
+ * (optional) An array of arguments to convert into text.
+ * @param string|null $id
+ * (optional) An ID attribute to assign.
+ * If NULL, then this is not assigned.
+ * @param string|null $extra_class
+ * (optional) An additional css class to append to the wrapping block.
+ * May be an array of classes to append.
+ * If NULL, then this is not assigned.
+ *
+ * @return c_base_markup_tag
+ * The generated markup tag.
+ */
+ protected function pr_create_tag_script_sub($text, $arguments = [], $id = NULL, $extra_class = NULL) {
+ $classes = [$this->settings['base_css'] . static::CSS_AS_SCRIPT_SUB, static::CSS_AS_SCRIPT_SUB];
+ if (is_string($extra_class)) {
+ $classes[] = $extra_class;
+ }
+ elseif (is_array($extra_class)) {
+ foreach ($extra_class as $class) {
+ $classes[] = $class;
+ }
+ unset($class);
+ }
+
+ if (is_int($text)) {
+ return c_theme_html::s_create_tag(c_base_markup_tag::TYPE_SUB_SCRIPT, $id, $classes, $this->pr_get_text($text, $arguments));
+ }
+
+ return c_theme_html::s_create_tag(c_base_markup_tag::TYPE_SUB_SCRIPT, $id, $classes, $text);
+ }
+
+ /**
+ * Creates the standard superscript.
+ *
+ * @param int|string $text
+ * The text or the text code to use.
+ * @param array $arguments
+ * (optional) An array of arguments to convert into text.
+ * @param string|null $id
+ * (optional) An ID attribute to assign.
+ * If NULL, then this is not assigned.
+ * @param string|null $extra_class
+ * (optional) An additional css class to append to the wrapping block.
+ * May be an array of classes to append.
+ * If NULL, then this is not assigned.
+ *
+ * @return c_base_markup_tag
+ * The generated markup tag.
+ */
+ protected function pr_create_tag_text_script_super($text, $arguments = [], $id = NULL, $extra_class = NULL) {
+ $classes = [$this->settings['base_css'] . static::CSS_AS_SCRIPT_SUPER, static::CSS_AS_SCRIPT_SUPER];
+ if (is_string($extra_class)) {
+ $classes[] = $extra_class;
+ }
+ elseif (is_array($extra_class)) {
+ foreach ($extra_class as $class) {
+ $classes[] = $class;
+ }
+ unset($class);
+ }
+
+ if (is_int($text)) {
+ return c_theme_html::s_create_tag(c_base_markup_tag::TYPE_SUPER_SCRIPT, $id, $classes, $this->pr_get_text($text, $arguments));
+ }
+
+ return c_theme_html::s_create_tag(c_base_markup_tag::TYPE_SUPER_SCRIPT, $id, $classes, $text);
+ }
+
+ /**
+ * Creates the standard inline quote.
+ *
+ * @param int|string $text
+ * The text or the text code to use.
+ * @param array $arguments
+ * (optional) An array of arguments to convert into text.
+ * @param string|null $id
+ * (optional) An ID attribute to assign.
+ * If NULL, then this is not assigned.
+ * @param string|null $extra_class
+ * (optional) An additional css class to append to the wrapping block.
+ * May be an array of classes to append.
+ * If NULL, then this is not assigned.
+ *
+ * @return c_base_markup_tag
+ * The generated markup tag.
+ */
+ protected function pr_create_tag_quote_inline($text, $arguments = [], $id = NULL, $extra_class = NULL) {
+ $classes = [$this->settings['base_css'] . static::CSS_AS_QUOTE_INLINE, static::CSS_AS_QUOTE_INLINE];
+ if (is_string($extra_class)) {
+ $classes[] = $extra_class;
+ }
+ elseif (is_array($extra_class)) {
+ foreach ($extra_class as $class) {
+ $classes[] = $class;
+ }
+ unset($class);
+ }
+
+ if (is_int($text)) {
+ return c_theme_html::s_create_tag(c_base_markup_tag::TYPE_QUOTE, $id, $classes, $this->pr_get_text($text, $arguments));
+ }
+
+ return c_theme_html::s_create_tag(c_base_markup_tag::TYPE_QUOTE, $id, $classes, $text);
+ }
+
+ /**
+ * Creates the standard underline.
+ *
+ * @param int|string $text
+ * The text or the text code to use.
+ * @param array $arguments
+ * (optional) An array of arguments to convert into text.
+ * @param string|null $id
+ * (optional) An ID attribute to assign.
+ * If NULL, then this is not assigned.
+ * @param string|null $extra_class
+ * (optional) An additional css class to append to the wrapping block.
+ * May be an array of classes to append.
+ * If NULL, then this is not assigned.
+ *
+ * @return c_base_markup_tag
+ * The generated markup tag.
+ */
+ protected function pr_create_tag_underline($text, $arguments = [], $id = NULL, $extra_class = NULL) {
+ $classes = [$this->settings['base_css'] . static::CSS_AS_UNDERLINE, static::CSS_AS_UNDERLINE];
+ if (is_string($extra_class)) {
+ $classes[] = $extra_class;
+ }
+ elseif (is_array($extra_class)) {
+ foreach ($extra_class as $class) {
+ $classes[] = $class;
+ }
+ unset($class);
+ }
+
+ if (is_int($text)) {
+ return c_theme_html::s_create_tag(c_base_markup_tag::TYPE_UNDERLINE, $id, $classes, $this->pr_get_text($text, $arguments));
+ }
+
+ return c_theme_html::s_create_tag(c_base_markup_tag::TYPE_UNDERLINE, $id, $classes, $text);
+ }
+
+ /**
+ * Creates the standard sample.
+ *
+ * @param int|string $text
+ * The text or the text code to use.
+ * @param array $arguments
+ * (optional) An array of arguments to convert into text.
+ * @param string|null $id
+ * (optional) An ID attribute to assign.
+ * If NULL, then this is not assigned.
+ * @param string|null $extra_class
+ * (optional) An additional css class to append to the wrapping block.
+ * May be an array of classes to append.
+ * If NULL, then this is not assigned.
+ *
+ * @return c_base_markup_tag
+ * The generated markup tag.
+ */
+ protected function pr_create_tag_sample($text, $arguments = [], $id = NULL, $extra_class = NULL) {
+ $classes = [$this->settings['base_css'] . static::CSS_AS_SAMPLE, static::CSS_AS_SAMPLE];
+ if (is_string($extra_class)) {
+ $classes[] = $extra_class;
+ }
+ elseif (is_array($extra_class)) {
+ foreach ($extra_class as $class) {
+ $classes[] = $class;
+ }
+ unset($class);
}
- $this->pr_get_language_alias();
+ if (is_int($text)) {
+ return c_theme_html::s_create_tag(c_base_markup_tag::TYPE_SAMPLE, $id, $classes, $this->pr_get_text($text, $arguments));
+ }
- return new c_base_return_true();
+ return c_theme_html::s_create_tag(c_base_markup_tag::TYPE_SAMPLE, $id, $classes, $text);
}
/**
- * Get the breadcrumb for this path.
+ * Creates the standard block quote.
*
- * The breadcrumb will be built by this function if it is not already built.
+ * @param int|string $text
+ * The text or the text code to use.
+ * @param array $arguments
+ * (optional) An array of arguments to convert into text.
+ * @param string|null $id
+ * (optional) An ID attribute to assign.
+ * If NULL, then this is not assigned.
+ * @param string|null $extra_class
+ * (optional) An additional css class to append to the wrapping block.
+ * May be an array of classes to append.
+ * If NULL, then this is not assigned.
*
- * @return c_base_menu_item|c_base_return_null
- * The breadcrumb menu is returned on success.
- * If not defined, then NULL is returned.
- * NULL with the error bit set is returned on error.
+ * @return c_base_markup_tag
+ * The generated markup tag.
*/
- public function get_breadcrumbs() {
- if (!($this->breadcrumbs instanceof c_base_menu_item)) {
- $this->pr_build_breadcrumbs();
+ protected function pr_create_tag_quote_block($text, $arguments = [], $id = NULL, $extra_class = NULL) {
+ $classes = [$this->settings['base_css'] . static::CSS_AS_QUOTE_BLOCK, static::CSS_AS_QUOTE_BLOCK];
+ if (is_string($extra_class)) {
+ $classes[] = $extra_class;
+ }
+ elseif (is_array($extra_class)) {
+ foreach ($extra_class as $class) {
+ $classes[] = $class;
+ }
+ unset($class);
}
- if ($this->breadcrumbs instanceof c_base_menu_item) {
- return clone($this->breadcrumbs);
+ if (is_int($text)) {
+ return c_theme_html::s_create_tag(c_base_markup_tag::TYPE_BLOCKQUOTE, $id, $classes, $this->pr_get_text($text, $arguments));
}
- return new c_base_return_null();
+ return c_theme_html::s_create_tag(c_base_markup_tag::TYPE_BLOCKQUOTE, $id, $classes, $text);
}
/**
- * Return the current path parts after the specified path.
- *
- * This is intended for handling the path parts as arguments.
- * Processed path arguments are stored on the classes arguments variable.
+ * Creates the standard citation.
*
- * No sanitization is performed on these arguments.
- *
- * @param string $path_after
- * The string to parse.
+ * @param int|string $text
+ * The text or the text code to use.
+ * @param array $arguments
+ * (optional) An array of arguments to convert into text.
+ * @param string|null $id
+ * (optional) An ID attribute to assign.
+ * If NULL, then this is not assigned.
+ * @param string|null $extra_class
+ * (optional) An additional css class to append to the wrapping block.
+ * May be an array of classes to append.
+ * If NULL, then this is not assigned.
*
- * @return bool
- * TRUE on success, FALSE otherwise.
- * On error, arguments is assigned to an empty array.
+ * @return c_base_markup_tag
+ * The generated markup tag.
*/
- protected function pr_process_path_arguments($path_after) {
- $path = $this->http->get_request_uri_relative($this->settings['base_path'])->get_value_exact();
- $path = preg_replace('@^' . $path_after . '(/|$)@i', '', $path);
-
- if (mb_strlen($path) == 0) {
- unset($path);
- $this->arguments = [];
- return FALSE;
+ protected function pr_create_tag_citation($text, $arguments = [], $id = NULL, $extra_class = NULL) {
+ $classes = [$this->settings['base_css'] . static::CSS_AS_CITATION, static::CSS_AS_CITATION];
+ if (is_string($extra_class)) {
+ $classes[] = $extra_class;
+ }
+ elseif (is_array($extra_class)) {
+ foreach ($extra_class as $class) {
+ $classes[] = $class;
+ }
+ unset($class);
}
- $this->arguments = explode('/', $path);
- unset($path);
+ if (is_int($text)) {
+ return c_theme_html::s_create_tag(c_base_markup_tag::TYPE_CITE, $id, $classes, $this->pr_get_text($text, $arguments));
+ }
- return TRUE;
+ return c_theme_html::s_create_tag(c_base_markup_tag::TYPE_CITE, $id, $classes, $text);
}
/**
- * Build the breadcrumb.
+ * Creates the standard code.
*
- * @return c_base_return_status
- * TRUE on success, FALSE otherwise.
- * FALSE with error bit set is returned on error.
+ * @param int|string $text
+ * The text or the text code to use.
+ * @param array $arguments
+ * (optional) An array of arguments to convert into text.
+ * @param string|null $id
+ * (optional) An ID attribute to assign.
+ * If NULL, then this is not assigned.
+ * @param string|null $extra_class
+ * (optional) An additional css class to append to the wrapping block.
+ * May be an array of classes to append.
+ * If NULL, then this is not assigned.
+ *
+ * @return c_base_markup_tag
+ * The generated markup tag.
*/
- protected function pr_build_breadcrumbs() {
- if (!is_object($this->path_tree)) {
- return new c_base_return_false();
- }
-
- $handler_settings = $this->path_tree->get_item_reset();
- if ($handler_settings instanceof c_base_return_false) {
- unset($handler_settings);
- return new c_base_return_false();
+ protected function pr_create_tag_code($text, $arguments = [], $id = NULL, $extra_class = NULL) {
+ $classes = [$this->settings['base_css'] . static::CSS_AS_CODE, static::CSS_AS_CODE];
+ if (is_string($extra_class)) {
+ $classes[] = $extra_class;
}
-
- $this->breadcrumbs = new c_base_menu_item();
-
- // render the breadcrumbs for all appropriate paths as the default behavior.
- // this does not include the last path tree item because that item should be this class.
- $count = 0;
- $total = $this->path_tree->get_items_count() - 1;
- for (; $count < $total; $count++) {
- if ($handler_settings instanceof c_base_return_false) {
- $handler_settings = $this->path_tree->get_item_next();
- continue;
- }
-
- $handler_settings = $handler_settings->get_value();
-
- if (!isset($handler_settings['include_name']) || !is_string($handler_settings['include_name'])) {
- $handler_settings = $this->path_tree->get_item_next();
- continue;
- }
-
- if (!isset($handler_settings['include_directory']) || !is_string($handler_settings['include_directory'])) {
- $handler_settings = $this->path_tree->get_item_next();
- continue;
- }
-
- if (!isset($handler_settings['handler']) || !is_string($handler_settings['handler'])) {
- $handler_settings = $this->path_tree->get_item_next();
- continue;
- }
-
- require_once($handler_settings['include_directory'] . $handler_settings['include_name'] . static::SCRIPT_EXTENSION);
-
-
- $handler = NULL;
- if (is_string($this->language_alias)) {
- @include_once($handler_settings['include_directory'] . $this->language_alias . '/' . $handler_settings['include_name'] . static::SCRIPT_EXTENSION);
-
- $handler_class = $handler_settings['handler'] . '_' . $this->language_alias;
- if (class_exists($handler_class)) {
- $handler = new $handler_class();
- }
- unset($handler_class);
- }
-
- if (is_null($handler)) {
- if (class_exists($handler_settings['handler'])) {
- $handler = new $handler_settings['handler']();
- }
- else {
- unset($handler);
- $handler_settings = $this->path_tree->get_item_next();
- continue;
- }
- }
-
- $handler->set_parameters($this->http, $this->database, $this->session, $this->settings);
- $breadcrumbs = $handler->get_breadcrumbs();
- if ($breadcrumbs instanceof c_base_menu_item) {
- $breadcrumbs = $breadcrumbs->get_items()->get_value_exact();
- foreach ($breadcrumbs as $breadcrumb) {
- $this->breadcrumbs->set_item($breadcrumb);
- }
- unset($breadcrumb);
+ elseif (is_array($extra_class)) {
+ foreach ($extra_class as $class) {
+ $classes[] = $class;
}
- unset($breadcrumbs);
- unset($handler);
- unset($handler_settings);
+ unset($class);
+ }
- $handler_settings = $this->path_tree->get_item_next();
+ if (is_int($text)) {
+ return c_theme_html::s_create_tag(c_base_markup_tag::TYPE_CODE, $id, $classes, $this->pr_get_text($text, $arguments));
}
- unset($count);
- unset($total);
- return new c_base_return_true();
+ return c_theme_html::s_create_tag(c_base_markup_tag::TYPE_CODE, $id, $classes, $text);
}
/**
- * Creates the standard section.
+ * Creates the standard delete.
*
- * @param array|null $headers
- * An array of headers, whose keys are the header number and values are the header names.
- * If NULL, then the headers are not assigned.
+ * @param int|string $text
+ * The text or the text code to use.
* @param array $arguments
* (optional) An array of arguments to convert into text.
* @param string|null $id
* (optional) An ID attribute to assign.
* If NULL, then this is not assigned.
- * @param string|array||null $extra_class
+ * @param string|null $extra_class
* (optional) An additional css class to append to the wrapping block.
* May be an array of classes to append.
* If NULL, then this is not assigned.
* @return c_base_markup_tag
* The generated markup tag.
*/
- protected function pr_create_tag_section($headers = NULL, $arguments = [], $id = NULL, $extra_class = NULL) {
- $classes = [$this->settings['base_css'] . static::CSS_AS_SECTION, static::CSS_AS_SECTION];
+ protected function pr_create_tag_delete($text, $arguments = [], $id = NULL, $extra_class = NULL) {
+ $classes = [$this->settings['base_css'] . static::CSS_AS_DELETE, static::CSS_AS_DELETE];
if (is_string($extra_class)) {
$classes[] = $extra_class;
}
unset($class);
}
- $tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_SECTION, $id, $classes);
- unset($classes);
-
- if (is_array($headers)) {
- $header = $this->pr_create_tag_headers($headers, $arguments, NULL, static::CSS_AS_SECTION_HEADERS);
- $tag->set_tag($header);
- unset($header);
+ if (is_int($text)) {
+ return c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DEL, $id, $classes, $this->pr_get_text($text, $arguments));
}
- return $tag;
+ return c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DEL, $id, $classes, $text);
}
/**
- * Creates the standard wrapper.
+ * Creates the standard insert.
*
+ * @param int|string $text
+ * The text or the text code to use.
+ * @param array $arguments
+ * (optional) An array of arguments to convert into text.
* @param string|null $id
* (optional) An ID attribute to assign.
* If NULL, then this is not assigned.
* @return c_base_markup_tag
* The generated markup tag.
*/
- protected function pr_create_tag_wrapper($id = NULL, $extra_class = NULL) {
- $classes = [$this->settings['base_css'] . static::CSS_AS_WRAPPER, static::CSS_AS_WRAPPER];
+ protected function pr_create_tag_insert($text, $arguments = [], $id = NULL, $extra_class = NULL) {
+ $classes = [$this->settings['base_css'] . static::CSS_AS_INSERT, static::CSS_AS_INSERT];
if (is_string($extra_class)) {
$classes[] = $extra_class;
}
unset($class);
}
- return c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, $id, $classes);
+ if (is_int($text)) {
+ return c_theme_html::s_create_tag(c_base_markup_tag::TYPE_INS, $id, $classes, $this->pr_get_text($text, $arguments));
+ }
+
+ return c_theme_html::s_create_tag(c_base_markup_tag::TYPE_INS, $id, $classes, $text);
}
/**
- * Creates the standard break tag.
+ * Creates the standard mark.
*
+ * @param int|string $text
+ * The text or the text code to use.
+ * @param array $arguments
+ * (optional) An array of arguments to convert into text.
* @param string|null $id
* (optional) An ID attribute to assign.
* If NULL, then this is not assigned.
* @return c_base_markup_tag
* The generated markup tag.
*/
- protected function pr_create_tag_break($id = NULL, $extra_class = NULL) {
- $classes = [$this->settings['base_css'] . static::CSS_AS_BREAK, static::CSS_AS_BREAK];
+ protected function pr_create_tag_mark($text, $arguments = [], $id = NULL, $extra_class = NULL) {
+ $classes = [$this->settings['base_css'] . static::CSS_AS_MARK, static::CSS_AS_MARK];
if (is_string($extra_class)) {
$classes[] = $extra_class;
}
unset($class);
}
- return c_theme_html::s_create_tag(c_base_markup_tag::TYPE_BREAK, $id, $classes);
+ if (is_int($text)) {
+ return c_theme_html::s_create_tag(c_base_markup_tag::TYPE_MARK, $id, $classes, $this->pr_get_text($text, $arguments));
+ }
+
+ return c_theme_html::s_create_tag(c_base_markup_tag::TYPE_MARK, $id, $classes, $text);
}
/**
- * Creates the standard text.
+ * Creates the standard preformatted.
*
* @param int|string $text
* The text or the text code to use.
* @return c_base_markup_tag
* The generated markup tag.
*/
- protected function pr_create_tag_text($text, $arguments = [], $id = NULL, $extra_class = NULL) {
- $classes = [$this->settings['base_css'] . static::CSS_AS_TEXT, static::CSS_AS_TEXT];
+ protected function pr_create_tag_preformatted($text, $arguments = [], $id = NULL, $extra_class = NULL) {
+ $classes = [$this->settings['base_css'] . static::CSS_AS_PREFORMATTED, static::CSS_AS_PREFORMATTED];
if (is_string($extra_class)) {
$classes[] = $extra_class;
}
}
if (is_int($text)) {
- return c_theme_html::s_create_tag($this->text_type, $id, $classes, $this->pr_get_text($text, $arguments));
+ return c_theme_html::s_create_tag(c_base_markup_tag::TYPE_PREFORMATTED, $id, $classes, $this->pr_get_text($text, $arguments));
}
- return c_theme_html::s_create_tag($this->text_type, $id, $classes, $text);
+ return c_theme_html::s_create_tag(c_base_markup_tag::TYPE_PREFORMATTED, $id, $classes, $text);
}
/**
return TRUE;
}
+
+ /**
+ * Provides a standard access check handler function.
+ *
+ * This is generally intended to be called by do_execute().
+ *
+ * @param c_base_path_executed &$executed
+ * The execution array for making changes to.
+ * Any detected errors are assigned to this.
+ * This often may have the output settings altered by this class implementation.
+ *
+ * @return bool
+ * FALSE on access granted, TRUE on access denied.
+ */
+ protected function pr_process_access_denied(&$executed) {
+ return FALSE;
+ }
}