This provides breadcrumbs 'at feet' instead of 'behind feet'.
The idea is that the breadcrumbs will show the current path as well as the path history (based on site structure, not browser/navigation history).
Plan on having the login handler provide (and possibly conditionally so) the path of the current page instead of the login page.
The login handler will show up on different pages than just 'u/login'.
Those pages should display their breadcrumb path instead of the login path (unless otherwise hidden).
One possible method is to pass the parent handler's path to the child path.
$item_text = $item->get_text()->get_value_exact();
$item_uri = $item->get_uri()->get_value();
+
if (is_string($item_uri) || is_array($item_uri)) {
// @fixme: handle if $item_uri is an array.
$tag = $this->pr_create_html_add_menu_item_link($item_text, $settings['base_path'] . $item_uri);
* This listens on: /u/login
*/
class c_standard_path_user_login extends c_standard_path {
+ protected const PATH_SELF = 'u/login';
protected const USER_PUBLIC = 'u_standard_public';
/**
}
/**
+ * Implementation of pr_build_breadcrumbs().
+ */
+ protected function pr_build_breadcrumbs() {
+ $result = parent::pr_build_breadcrumbs();
+ if ($result instanceof c_base_return_false) {
+ unset($result);
+ return new c_base_return_false();
+ }
+ unset($result);
+
+ // @todo: using $this->path_tree->get_item_end(), get the current path and render the breadcrumb based on that path instead of this path.
+ // consider adding this with additional customization, because it may be desired for some paths to remain hidden until logged in.
+
+ if (!($this->breadcrumbs instanceof c_base_menu_item)) {
+ $this->breadcrumbs = new c_base_menu_item();
+ }
+
+ $item = $this->pr_create_breadcrumbs_item($this->pr_get_text(12), self::PATH_SELF);
+ $this->breadcrumbs->set_item($item);
+ unset($item);
+
+ return new c_base_return_true();
+ }
+
+ /**
* Validate and Perform the login.
*
* @param c_base_http &$http
}
/**
+ * Implementation of pr_build_breadcrumbs().
+ */
+ protected function pr_build_breadcrumbs() {
+ $result = parent::pr_build_breadcrumbs();
+ if ($result instanceof c_base_return_false) {
+ unset($result);
+ return new c_base_return_false();
+ }
+ unset($result);
+
+ if (!($this->breadcrumbs instanceof c_base_menu_item)) {
+ $this->breadcrumbs = new c_base_menu_item();
+ }
+
+ $item = $this->pr_create_breadcrumbs_item($this->pr_get_text(0), self::PATH_SELF);
+ $this->breadcrumbs->set_item($item);
+ unset($item);
+
+ return new c_base_return_true();
+ }
+
+ /**
* Logout of the session.
*
* @param c_base_http &$http
}
/**
+ * Implementation of pr_build_breadcrumbs().
+ */
+ protected function pr_build_breadcrumbs() {
+ $result = parent::pr_build_breadcrumbs();
+ if ($result instanceof c_base_return_false) {
+ unset($result);
+ return new c_base_return_false();
+ }
+ unset($result);
+
+ if (!($this->breadcrumbs instanceof c_base_menu_item)) {
+ $this->breadcrumbs = new c_base_menu_item();
+ }
+
+ $item = $this->pr_create_breadcrumbs_item($this->pr_get_text(0), self::PATH_SELF);
+ $this->breadcrumbs->set_item($item);
+ unset($item);
+
+ return new c_base_return_true();
+ }
+
+ /**
* Implementation of pr_create_html_add_header_link_canonical().
*/
protected function pr_create_html_add_header_link_canonical() {
}
/**
+ * Implementation of pr_build_breadcrumbs().
+ */
+ protected function pr_build_breadcrumbs() {
+ $result = parent::pr_build_breadcrumbs();
+ if ($result instanceof c_base_return_false) {
+ unset($result);
+ return new c_base_return_false();
+ }
+ unset($result);
+
+ if (!($this->breadcrumbs instanceof c_base_menu_item)) {
+ $this->breadcrumbs = new c_base_menu_item();
+ }
+
+ $item = $this->pr_create_breadcrumbs_item($this->pr_get_text(0), self::PATH_SELF);
+ $this->breadcrumbs->set_item($item);
+ unset($item);
+
+ return new c_base_return_true();
+ }
+
+ /**
* Implementation of pr_create_html_add_header_link_canonical().
*/
protected function pr_create_html_add_header_link_canonical() {
}
/**
+ * Implementation of pr_build_breadcrumbs().
+ */
+ protected function pr_build_breadcrumbs() {
+ $result = parent::pr_build_breadcrumbs();
+ if ($result instanceof c_base_return_false) {
+ unset($result);
+ return new c_base_return_false();
+ }
+ unset($result);
+
+ if (!($this->breadcrumbs instanceof c_base_menu_item)) {
+ $this->breadcrumbs = new c_base_menu_item();
+ }
+
+ $item = $this->pr_create_breadcrumbs_item($this->pr_get_text(0), self::PATH_SELF);
+ $this->breadcrumbs->set_item($item);
+ unset($item);
+
+ return new c_base_return_true();
+ }
+
+ /**
* Implementation of pr_create_html_add_header_link_canonical().
*/
protected function pr_create_html_add_header_link_canonical() {
}
/**
+ * Implementation of pr_build_breadcrumbs().
+ */
+ protected function pr_build_breadcrumbs() {
+ $result = parent::pr_build_breadcrumbs();
+ if ($result instanceof c_base_return_false) {
+ unset($result);
+ return new c_base_return_false();
+ }
+ unset($result);
+
+ if (!($this->breadcrumbs instanceof c_base_menu_item)) {
+ $this->breadcrumbs = new c_base_menu_item();
+ }
+
+ $item = $this->pr_create_breadcrumbs_item($this->pr_get_text(0), self::PATH_SELF);
+ $this->breadcrumbs->set_item($item);
+ unset($item);
+
+ return new c_base_return_true();
+ }
+
+ /**
* Implementation of pr_create_html_add_header_link_canonical().
*/
protected function pr_create_html_add_header_link_canonical() {
}
/**
+ * Implementation of pr_build_breadcrumbs().
+ */
+ protected function pr_build_breadcrumbs() {
+ $result = parent::pr_build_breadcrumbs();
+ if ($result instanceof c_base_return_false) {
+ unset($result);
+ return new c_base_return_false();
+ }
+ unset($result);
+
+ if (!($this->breadcrumbs instanceof c_base_menu_item)) {
+ $this->breadcrumbs = new c_base_menu_item();
+ }
+
+ $item = $this->pr_create_breadcrumbs_item($this->pr_get_text(0), self::PATH_SELF);
+ $this->breadcrumbs->set_item($item);
+ unset($item);
+
+ return new c_base_return_true();
+ }
+
+ /**
* Implementation of pr_create_html_add_header_link_canonical().
*/
protected function pr_create_html_add_header_link_canonical() {
}
/**
+ * Implementation of pr_build_breadcrumbs().
+ */
+ protected function pr_build_breadcrumbs() {
+ $result = parent::pr_build_breadcrumbs();
+ if ($result instanceof c_base_return_false) {
+ unset($result);
+ return new c_base_return_false();
+ }
+ unset($result);
+
+ if (!($this->breadcrumbs instanceof c_base_menu_item)) {
+ $this->breadcrumbs = new c_base_menu_item();
+ }
+
+ $item = $this->pr_create_breadcrumbs_item($this->pr_get_text(0), self::PATH_SELF);
+ $this->breadcrumbs->set_item($item);
+ unset($item);
+
+ return new c_base_return_true();
+ }
+
+ /**
* Implementation of pr_create_html_add_header_link_canonical().
*/
protected function pr_create_html_add_header_link_canonical() {