addBreadCrumb($link); } /** * Get breadcrumbs * * @return array Keys of elements: title, link */ function get_breadcrumbs() { return BreadCrumbs::getInstance()->toArray(); } function catFullPath($cat_id, $cat_tbl, $col_id, $col_parent, $col_title) { $tmp_id = $cat_id; $cat_list = []; while ($tmp_id > 0) { $result = dbquery("SELECT ".$col_id.", ".$col_parent.", ".$col_title." FROM ".$cat_tbl." WHERE ".$col_id."='".$tmp_id."'"); if (dbrows($result)) { $data = dbarray($result); $cat_item = ['id' => $data[$col_id], 'parent' => $data[$col_parent], 'title' => $data[$col_title]]; $cat_list[] = $cat_item; $tmp_id = $data[$col_parent]; } else { return FALSE; } } return array_reverse($cat_list); }