コード例 #1
0
ファイル: edit.php プロジェクト: hatasu/appdroid
function i18n_customfields_list_pages_json()
{
    if (function_exists('find_i18n_url') && class_exists('I18nNavigationFrontend')) {
        $slug = isset($_GET['id']) ? $_GET['id'] : (isset($_GET['newid']) ? $_GET['newid'] : '');
        $pos = strpos($slug, '_');
        $lang = $pos !== false ? substr($slug, $pos + 1) : null;
        $structure = I18nNavigationFrontend::getPageStructure(null, false, null, $lang);
        $pages = array();
        $nbsp = html_entity_decode(' ', ENT_QUOTES, 'UTF-8');
        $lfloor = html_entity_decode('⌊', ENT_QUOTES, 'UTF-8');
        foreach ($structure as $page) {
            $text = ($page['level'] > 0 ? str_repeat($nbsp, 5 * $page['level'] - 2) . $lfloor . $nbsp : '') . cl($page['title']);
            $link = find_i18n_url($page['url'], $page['parent'], $lang ? $lang : return_i18n_default_language());
            $pages[] = array($text, $link);
        }
        return json_encode($pages);
    } else {
        return list_pages_json();
    }
}
コード例 #2
0
function get_i18n_breadcrumbs($slug)
{
    require_once GSPLUGINPATH . 'i18n_navigation/frontend.class.php';
    I18nNavigationFrontend::outputBreadcrumbs($slug);
}
コード例 #3
0
 public function outputChildren()
 {
     if (isset($this->item['children']) && count($this->item['children']) > 0) {
         echo I18nNavigationFrontend::getMenuHTMLImpl($this->item['children'], $this->showTitles, $this->component);
     }
 }
コード例 #4
0
ファイル: editorinit.php プロジェクト: Vin985/clqweb
<?php

if (function_exists('find_i18n_url')) {
    $slug = isset($_GET['id']) ? $_GET['id'] : (isset($_GET['newid']) ? $_GET['newid'] : '');
    $pos = strpos($slug, '_');
    $lang = $pos !== false ? substr($slug, $pos + 1) : null;
    $structure = I18nNavigationFrontend::getPageStructure(null, false, null, $lang);
    $pages = array();
    $nbsp = html_entity_decode('&nbsp;', ENT_QUOTES, 'UTF-8');
    $lfloor = html_entity_decode('&lfloor;', ENT_QUOTES, 'UTF-8');
    foreach ($structure as $page) {
        $text = ($page['level'] > 0 ? str_repeat($nbsp, 5 * $page['level'] - 2) . $lfloor . $nbsp : '') . cl($page['title']);
        $link = find_i18n_url($page['url'], $page['parent'], '(' . ($lang ? $lang : return_i18n_default_language()) . ')');
        $pages[] = array($text, $link);
    }
    ?>
<script type="text/javascript">
  //<![CDATA[
  // modify existing Link dialog
  CKEDITOR.on( 'dialogDefinition', function( ev ) {
    if ((ev.editor != editor) || (ev.data.name != 'link')) return;

    var definition = ev.data.definition;
    var infoTab = definition.getContents('info');
    
    for (var i=0; i<infoTab.elements.length; i++) {
      var element = infoTab.elements[i];
      if ('id' in element && element.id == 'localPageOptions') {
        element.children[0].items = <?php 
    echo json_encode($pages);
    ?>