コード例 #1
0
function smarty_function_breadcrumbs($params, &$smarty)
{
    extract($params);
    if (empty($crumbs)) {
        $smarty->trigger_error("assign: missing 'crumbs' parameter");
        return;
    }
    if (empty($loc)) {
        $smarty->trigger_error("assign: missing 'loc' parameter");
        return;
    }
    switch ($type) {
        case 'fulltrail':
            print breadcrumb_buildHeadTitle($crumbs);
            break;
        case 'pagetitle':
            print breadcrumb_getTitle($crumbs, $loc);
            break;
        case 'desc':
            print breadcrumb_getDescription($crumbs, $loc);
            break;
        case 'trail':
        default:
            print breadcrumb_buildTrail($crumbs, $loc);
            break;
    }
}
コード例 #2
0
ファイル: breadcrumblib.php プロジェクト: linuxwhy/tiki-1
/**
 * @param $crumbs
 * @return bool|string
 */
function breadcrumb_buildHeadTitle($crumbs)
{
    global $prefs;
    if ($prefs['feature_breadcrumbs'] === 'y') {
        if (_is_assoc($crumbs)) {
            return false;
        }
        if (is_array($crumbs)) {
            $ret = array();
            foreach ($crumbs as $crumb) {
                if ($crumb->title !== $prefs['browsertitle']) {
                    $ret[] = breadcrumb_buildHeadTitle($crumb);
                }
            }
            return implode(" : ", $ret);
        } elseif ($prefs['site_title_breadcrumb'] == 'desc') {
            return $crumbs->description;
        } else {
            return htmlspecialchars($crumbs->title);
        }
    } else {
        if (is_array($crumbs)) {
            return $crumbs[count($crumbs) - 1]->title;
        } else {
            return $crumbs->title;
        }
    }
}
コード例 #3
0
ファイル: breadcrumblib.php プロジェクト: noikiy/owaspbwa
function breadcrumb_buildHeadTitle($crumbs)
{
    if (_is_assoc($crumbs)) {
        return false;
    }
    if (is_array($crumbs)) {
        $ret = array();
        foreach ($crumbs as $crumb) {
            $ret[] = breadcrumb_buildHeadTitle($crumb);
        }
        return implode(" : ", $ret);
    } else {
        return $crumbs->title;
    }
}
コード例 #4
0
function smarty_function_breadcrumbs($params, $smarty)
{
    global $prefs;
    extract($params);
    if (empty($crumbs)) {
        trigger_error("assign: missing 'crumbs' parameter");
        return;
    }
    if (empty($loc)) {
        trigger_error("assign: missing 'loc' parameter");
        return;
    }
    if ($type === 'pagetitle' && $prefs['site_title_breadcrumb'] === 'y') {
        $type = 'desc';
    }
    $text_to_display = '';
    switch ($type) {
        case 'invertfull':
            $text_to_display = breadcrumb_buildHeadTitle(array_reverse($crumbs));
            break;
        case 'fulltrail':
            $text_to_display = breadcrumb_buildHeadTitle($crumbs);
            break;
        case 'pagetitle':
            $text_to_display = breadcrumb_getTitle($crumbs, $loc);
            break;
        case 'desc':
            $text_to_display = breadcrumb_getDescription($crumbs, $loc);
            break;
        case 'trail':
        default:
            $text_to_display = breadcrumb_buildTrail($crumbs, $loc);
            break;
    }
    if (!empty($machine_translate)) {
        require_once 'lib/core/Multilingual/MachineTranslation/GoogleTranslateWrapper.php';
        $translator = new Multilingual_MachineTranslation_GoogleTranslateWrapper($source_lang, $target_lang);
        $text_to_display = $translator->translateText($text_to_display);
    }
    print $text_to_display;
}
コード例 #5
0
ファイル: function.breadcrumbs.php プロジェクト: rjsmelo/tiki
function smarty_function_breadcrumbs($params, $smarty)
{
    global $prefs;
    extract($params);
    if (empty($crumbs)) {
        trigger_error("assign: missing 'crumbs' parameter");
        return;
    }
    if (empty($loc)) {
        trigger_error("assign: missing 'loc' parameter");
        return;
    }
    if ($type === 'pagetitle' && $prefs['site_title_breadcrumb'] === 'y') {
        $type = 'desc';
    }
    $showLinks = empty($params['showLinks']) || $params['showLinks'] == 'y';
    $text_to_display = '';
    switch ($type) {
        case 'invertfull':
            $text_to_display = breadcrumb_buildHeadTitle(array_reverse($crumbs));
            break;
        case 'fulltrail':
            $text_to_display = breadcrumb_buildHeadTitle($crumbs);
            break;
        case 'pagetitle':
            $text_to_display = breadcrumb_getTitle($crumbs, $loc);
            break;
        case 'desc':
            $text_to_display = breadcrumb_getDescription($crumbs, $loc);
            break;
        case 'trail':
        default:
            $text_to_display = breadcrumb_buildTrail($crumbs, $loc, $showLinks);
            break;
    }
    return $text_to_display;
}
コード例 #6
0
    $parent_info = $dirlib->dir_get_category($_REQUEST['parent']);
    $smarty->assign('parent_info', $parent_info);
    $parent_name = $parent_info['name'];
}
$smarty->assign('parent_name', $parent_name);
$smarty->assign('parent', $_REQUEST['parent']);
$smarty->assign('addtocat', $_REQUEST['parent']);
$dirlib->dir_add_category_hit($_REQUEST['parent']);
// Now get the path to the parent category
$path = $dirlib->dir_get_category_path_browse($_REQUEST["parent"]);
$smarty->assign_by_ref('path', $path);
$crumbs[] = new Breadcrumb(tra('Directory'), '', 'tiki-directory_browse.php?parent=0', 'Directory', tra('How to use Directory'));
// Now append the path to the parent category
array_splice($crumbs, count($crumbs), 0, $dirlib->dir_build_breadcrumb_trail($_REQUEST["parent"]));
$smarty->assign('trail', $crumbs);
$headtitle = breadcrumb_buildHeadTitle($crumbs);
$smarty->assign_by_ref('headtitle', $headtitle);
// Now get the sub categories from this parent category
$categs = $dirlib->dir_list_categories($_REQUEST['parent'], 0, -1, 'name_asc', '');
$temp_max = count($categs['data']);
for ($i = 0; $i < $temp_max; $i++) {
    $categs['data'][$i]['subcats'] = array();
    if ($categs['data'][$i]['childrenType'] == 'c' && $categs['data'][$i]['viewableChildren'] > 0) {
        // Generate the subcategories with most hist as the subcategories to show.
        $subcats = $dirlib->dir_list_categories($categs['data'][$i]['categId'], 0, $categs['data'][$i]['viewableChildren'], 'hits_desc', '');
        $categs['data'][$i]['subcats'] = $subcats['data'];
    }
    if ($categs['data'][$i]['childrenType'] == 'd' && $categs['data'][$i]['viewableChildren'] > 0) {
        // Generate the subcategories with most hist as the subcategories to show.
        $categs['data'][$i]['subcats'] = array(array("name" => $categs['data'][$i]['description']));
    }
コード例 #7
0
ファイル: renderlib.php プロジェクト: linuxwhy/tiki-1
 private function setupBreadcrumbs()
 {
     global $prefs, $crumbs;
     if ($this->structureInfo && $this->structureInfo['page_alias'] != '') {
         $crumbpage = $this->structureInfo['page_alias'];
     } else {
         $crumbpage = $this->page;
     }
     //global $description;
     $crumbsLocal[] = new Breadcrumb(isset($this->info['prettyName']) ? $this->info['prettyName'] : $crumbpage, $this->info['description'], TikiLib::lib('wiki')->sefurl($this->page), '', '');
     $crumbs = array_merge($crumbs, $crumbsLocal);
     $headtitle = breadcrumb_buildHeadTitle($prefs['site_title_breadcrumb'] == 'invertfull' ? array_reverse($crumbsLocal) : $crumbsLocal);
     $this->smartyassign('headtitle', $headtitle);
     $this->smartyassign('trail', $crumbs);
 }
コード例 #8
0
                $admintitle = 'Login';
                //get_strings tra('Login')
                $description = 'User registration, login and authentication';
                //get_strings tra('User registration, login and authentication')
                $helpUrl = 'Login+Config';
                include_once 'tiki-admin_include_login.php';
            } else {
                if ($adminPage == 'wiki') {
                    $admintitle = tra('Wiki');
                    $description = tra('Wiki settings');
                    $helpUrl = 'Wiki+Config';
                    include_once 'tiki-admin_include_wiki.php';
                } else {
                    $helpUrl = '';
                }
            }
        }
    }
    $url = 'tiki-admin.php' . '?page=' . $adminPage;
    if (!$helpUrl) {
        $helpUrl = ucfirst($adminPage) . '+Config';
    }
    $helpDescription = "Help on {$admintitle} Config";
    //get_strings tra("Help on $admintitle Config")
} else {
    $smarty->assign('admintitle', 'Control Panels');
    $smarty->assign('description', 'Home Page for Administrators');
    $smarty->assign('headtitle', breadcrumb_buildHeadTitle($crumbs));
    $smarty->assign('description', $crumbs[0]->description);
    $email_test_body = tra("Congratulations!\n\nYour server can send emails.\n\n");
}
コード例 #9
0
ファイル: renderlib.php プロジェクト: railfuture/tiki-website
	private function setupBreadcrumbs() // {{{
	{
		global $prefs, $crumbs;

		if ($this->structureInfo && $this->structureInfo['page_alias'] != '') {
			$crumbpage = $this->structureInfo['page_alias'];
		} else {
			$crumbpage = $this->page;
		}
		//global $description;
		$crumbsLocal[] = new Breadcrumb(
						$crumbpage,
						$this->info['description'],
						'tiki-index.php?page='.urlencode($this->page),
						'',
						''
		);
		$crumbs = array_merge($crumbs, $crumbsLocal);

		$headtitle = breadcrumb_buildHeadTitle($prefs['site_title_breadcrumb'] == 'invertfull'? array_reverse($crumbsLocal): $crumbsLocal);
		$this->smartyassign('headtitle', $headtitle);
		$this->smartyassign('trail', $crumbs);
	} // }}}