function make_page_breadcrumbs($tree_index, $tree_full, $id_col, $title_col, $getname = "rownav")
{
    $_GET[$getname] = !empty($_GET[$getname]) && isnum($_GET[$getname]) ? $_GET[$getname] : 0;
    function breadcrumb_page_arrays($tree_index, $tree_full, $id_col, $title_col, $getname, $id)
    {
        $crumb =& $crumb;
        if (isset($tree_index[get_parent($tree_index, $id)])) {
            $_name = get_parent_array($tree_full, $id);
            $crumb = array('link' => isset($_name[$id_col]) ? clean_request($getname . "=" . $_name[$id_col], array("aid"), TRUE) : "", 'title' => isset($_name[$title_col]) ? \PHPFusion\QuantumFields::parse_label($_name[$title_col]) : "");
            if (get_parent($tree_index, $id) == 0) {
                return $crumb;
            }
            $crumb_1 = breadcrumb_page_arrays($tree_index, $tree_full, $id_col, $title_col, $getname, get_parent($tree_index, $id));
            if (!empty($crumb_1)) {
                $crumb = array_merge_recursive($crumb, $crumb_1);
            }
        }
        return $crumb;
    }
    // then we make a infinity recursive function to loop/break it out.
    $crumb = breadcrumb_page_arrays($tree_index, $tree_full, $id_col, $title_col, $getname, $_GET[$getname]);
    // then we sort in reverse.
    if (count($crumb['title']) > 1) {
        krsort($crumb['title']);
        krsort($crumb['link']);
    }
    if (count($crumb['title']) > 1) {
        foreach ($crumb['title'] as $i => $value) {
            add_breadcrumb(array('link' => $crumb['link'][$i], 'title' => $value));
            if ($i == count($crumb['title']) - 1) {
                OutputHandler::addToTitle($GLOBALS['locale']['global_200'] . $value);
                OutputHandler::addToMeta($value);
            }
        }
    } elseif (isset($crumb['title'])) {
        OutputHandler::addToTitle($GLOBALS['locale']['global_200'] . $crumb['title']);
        OutputHandler::addToMeta($crumb['title']);
        add_breadcrumb(array('link' => $crumb['link'], 'title' => $crumb['title']));
    }
}
Example #2
0
    $result = dbquery("UPDATE " . DB_USERS . " SET user_lastvisit=UNIX_TIMESTAMP(NOW()), user_ip='" . USER_IP . "', user_ip_type='" . USER_IP_TYPE . "' WHERE user_id='" . $userdata['user_id'] . "'");
}
$bootstrap_theme_css_src = '';
// Load bootstrap
if ($settings['bootstrap']) {
    define('BOOTSTRAPPED', TRUE);
    $bootstrap_theme_css_src = INCLUDES . "bootstrap/bootstrap.css";
    add_to_footer("<script type='text/javascript' src='" . INCLUDES . "bootstrap/bootstrap.min.js'></script>");
    add_to_footer("<script type='text/javascript' src='" . INCLUDES . "bootstrap/holder.js'></script>");
}
require_once THEMES . "templates/panels.php";
ob_start();
require_once ADMIN . "admin.php";
$admin = new \PHPFusion\Admin();
@(list($title) = dbarraynum(dbquery("SELECT admin_title FROM " . DB_ADMIN . " WHERE admin_link='" . FUSION_SELF . "'")));
\PHPFusion\OutputHandler::setTitle($GLOBALS['locale']['global_123'] . $GLOBALS['locale']['global_201'] . ($title ? $title . $GLOBALS['locale']['global_201'] : ""));
// Use infusion_db file to modify admin properties
$infusion_folder = makefilelist(INFUSIONS, ".|..|", "", "folders");
if (!empty($infusion_folder)) {
    foreach ($infusion_folder as $folder) {
        if (file_exists(INFUSIONS . $folder . "/infusion_db.php")) {
            require_once INFUSIONS . $folder . "/infusion_db.php";
        }
    }
}
// If the user is not logged in as admin then don't parse the administration page
// otherwise it could result in bypass of the admin password and one could do
// changes to the system settings without even being logged into Admin Panel.
// After relogin the user can simply click back in browser and their input will
// still be there so nothing is lost
if (!check_admin_pass('')) {
/**
 * Add javascript source code to the output
 *
 * @param string $tag
 */
function add_to_jquery($tag = "")
{
    OutputHandler::addToJQuery($tag);
}