Exemplo n.º 1
0
Arquivo: index.php Projeto: rair/yacs
        if ($file == 'index.php') {
            continue;
        }
        if ($file == 'behavior.php') {
            continue;
        }
        if ($file == 'behaviors.php') {
            continue;
        }
        if (!preg_match('/(.*)\\.php$/i', $file, $matches)) {
            continue;
        }
        $behaviors[] = $matches[1];
    }
    Safe::closedir($dir);
    if (@count($behaviors)) {
        natsort($behaviors);
        foreach ($behaviors as $behavior) {
            $context['text'] .= '<li>' . $behavior . "</li>\n";
        }
    }
}
$context['text'] .= '</ul>';
// how to use behaviors
if (Surfer::is_associate()) {
    $context['text'] .= '<p>' . sprintf(i18n::s('For example, if you want to apply the behavior <code>foo</code>, go to the %s , and select a target section, or add a new one.'), Skin::build_link('sections/', i18n::s('site map'), 'shortcut')) . '</p>' . '<p>' . i18n::s('In the form used to edit the section, type the keyword <code>foo</code> in the behavior field, then save changes.') . '</p>';
}
// referrals, if any
$context['components']['referrals'] =& Skin::build_referrals('behaviors/index.php');
// render the skin
render_skin();
Exemplo n.º 2
0
Arquivo: view.php Projeto: rair/yacs
        $label = sprintf(i18n::s('This server is allowed to submit monitoring requests (<code>monitor.ping</code>) at %s'), Skin::build_link('services/index.php#xml-rpc', i18n::s('the XML-RPC interface'), 'shortcut'));
    } else {
        $label = i18n::s('This server is not allowed to submit monitoring requests.');
    }
    $text .= '<p>' . $label . "</p>\n";
    // a section for the description
    if ($item['description']) {
        // display the full text
        $text .= Skin::build_block(i18n::s('Server description'), 'subtitle');
        // show the description
        $text .= Skin::build_block($item['description'], 'description');
    }
    $context['text'] .= $text;
    // insert anchor suffix
    if (is_object($anchor)) {
        $context['text'] .= $anchor->get_suffix();
    }
    // test links
    if ($item['submit_feed'] == 'Y') {
        $context['page_tools'][] = Skin::build_link(Servers::get_url($id, 'test'), i18n::s('Test feed'));
    }
    // commands for associates
    if (Surfer::is_associate()) {
        $context['page_tools'][] = Skin::build_link(Servers::get_url($id, 'edit'), i18n::s('Edit'));
        $context['page_tools'][] = Skin::build_link(Servers::get_url($id, 'delete'), i18n::s('Delete'));
    }
    // referrals, if any
    $context['components']['referrals'] =& Skin::build_referrals(Servers::get_url($item['id']));
}
// render the skin
render_skin();
Exemplo n.º 3
0
Arquivo: index.php Projeto: rair/yacs
        // query the database and layout that stuff
        if (!($text = Comments::list_threads_by_date($offset, THREADS_PER_PAGE, $layout))) {
            $context['text'] .= '<p>' . i18n::s('No comment has been transmitted.') . '</p>';
        }
        // we have an array to format
        if (is_array($text)) {
            $text =& Skin::build_list($text, 'rows');
        }
        // cache, whatever changes, for 1 minute
        Cache::put($cache_id, $text, 'stable', 60);
    }
    $context['text'] .= $text;
}
// page tools
if (Surfer::is_associate()) {
    $context['page_tools'][] = Skin::build_link('comments/check.php', i18n::s('Maintenance'), 'basic');
}
// page extra information
$cache_id = 'comments/index.php#extra';
if (!($text = Cache::get($cache_id))) {
    // side bar with the list of most recent pages
    if ($items =& Articles::list_by('publication', 0, COMPACT_LIST_SIZE, 'compact')) {
        $text =& Skin::build_box(i18n::s('Recent pages'), Skin::build_list($items, 'compact'), 'boxes');
    }
    Cache::put($cache_id, $text, 'articles');
}
$context['components']['boxes'] = $text;
// referrals, if any
$context['components']['referrals'] = Skin::build_referrals('comments/index.php');
// render the skin
render_skin();
Exemplo n.º 4
0
Arquivo: view.php Projeto: rair/yacs
    $context['page_title'] = i18n::s('Documentation:') . ' ' . $script;
} else {
    $context['page_title'] = i18n::s('View PHP documentation');
}
// no script has been provided -- help web crawlers
if (!$script) {
    Safe::header('Status: 404 Not Found', TRUE, 404);
    Logger::error(i18n::s('No script has been provided'));
    // the script has to be there
} elseif (!$row) {
    Safe::header('Status: 404 Not Found', TRUE, 404);
    Logger::error(i18n::s('Script does not exist'));
    // display script content
} else {
    $context['text'] = Codes::beautify($row['content']);
    // referrals, if any
    $context['components']['referrals'] =& Skin::build_referrals(Scripts::get_url($script));
    // update the menu bar
    if ($script != 'todo' && $script != 'authors' && $script != 'testers' && $script != 'licenses') {
        // browsing is safe
        $context['page_tools'][] = Skin::build_link(Scripts::get_url($script, 'browse'), i18n::s('Browse the source of this script'));
        // protect from spammers and robots
        if (Surfer::is_logged()) {
            $context['page_tools'][] = Skin::build_link(Scripts::get_url($script, 'fetch'), i18n::s('Fetch the script file'));
        }
    }
    // back to the index
    $context['page_tools'][] = Skin::build_link('scripts/', i18n::s('Server software'));
}
// render the skin
render_skin();
Exemplo n.º 5
0
Arquivo: cloud.php Projeto: rair/yacs
if (!($text = Cache::get($cache_id))) {
    // query the database and layout that stuff
    if (!($text =& Members::list_categories_by_count_for_anchor(NULL, 0, 200, 'cloud'))) {
        $text = '<p>' . i18n::s('No item has been found.') . '</p>';
    }
    // we have an array to format
    if (is_array($text)) {
        $text =& Skin::build_list($text, '2-columns');
    }
    // make a box
    if ($text) {
        $text =& Skin::build_box('', $text, 'header1', 'categories');
    }
    // cache this to speed subsequent queries
    Cache::put($cache_id, $text, 'categories');
}
$context['text'] .= $text;
// display extra information
$cache_id = 'categories/cloud.php#extra';
if (!($text = Cache::get($cache_id))) {
    // add an extra box with helpful links
    $links = array('sections/' => i18n::s('Site map'), 'search.php' => i18n::s('Search'), 'help/' => i18n::s('Help index'), 'query.php' => i18n::s('Contact'));
    $text .= Skin::build_box(i18n::s('See also'), Skin::build_list($links, 'compact'), 'boxes') . "\n";
    // save for later use
    Cache::put($cache_id, $text, 'articles');
}
$context['components']['boxes'] = $text;
// referrals, if any
$context['components']['referrals'] =& Skin::build_referrals('categories/cloud.php');
// render the skin
render_skin();
Exemplo n.º 6
0
Arquivo: view.php Projeto: rair/yacs
         if (Categories::allow_assign($item, $anchor)) {
             $items = array_merge($items, array(Categories::get_url('article:' . $item['id'], 'select') => i18n::s('Assign categories')));
         }
         // actually render the html for the section
         if (is_array($box['bar'])) {
             $box['text'] .= Skin::build_list($box['bar'], 'menu_bar');
         }
         if (is_array($items)) {
             $box['text'] .= Skin::build_list($items, 'compact');
         }
         if ($box['text']) {
             $context['components']['categories'] = Skin::build_box(i18n::s('See also'), $box['text'], 'categories', 'categories');
         }
     }
     // referrals, if any
     $context['components']['referrals'] =& Skin::build_referrals(Articles::get_permalink($item));
 }
 //
 // the main part of the page
 //
 $context['page_description'] = '';
 // filter description, if necessary
 if (is_object($overlay)) {
     $description = $overlay->get_text('description', $item);
 } else {
     $description = $item['description'];
 }
 // the beautified description, which is the actual page body
 if ($description) {
     // use adequate label
     if (is_object($overlay) && ($label = $overlay->get_label('description'))) {
Exemplo n.º 7
0
Arquivo: day.php Projeto: rair/yacs
            // robots cannot navigate
            if (!Surfer::is_crawler()) {
                // previous day
                $previous = gmstrftime('%Y/%m/%d', gmmktime(0, 0, 0, $month, $day - 1, $year));
                // next day
                $next = gmstrftime('%Y/%m/%d', gmmktime(0, 0, 0, $month, $day + 1, $year));
                // neighbours
                $neighbours = array(Dates::get_url($previous, 'day'), Skin::build_date($previous, 'standalone'), Dates::get_url($next, 'day'), Skin::build_date($next, 'standalone'), Dates::get_url($year . '/' . $month, 'month'), Dates::get_month_label($year . '/' . $month));
                // links to display previous and next days
                $text .= Skin::neighbours($neighbours, 'slideshow');
            }
            // cache, whatever change, for 1 minute
            Cache::put($cache_id, $text, 'stable', 60);
        }
        // in the main panel
        $context['text'] .= $text;
    }
}
// side bar with the list of most recent pages
$cache_id = 'dates/day.php#extra';
if (!($text = Cache::get($cache_id))) {
    if ($items =& Articles::list_by('publication', 0, COMPACT_LIST_SIZE, 'compact')) {
        $text =& Skin::build_box(i18n::s('Recent pages'), Skin::build_list($items, 'compact'), 'boxes');
    }
    Cache::put($cache_id, $text, 'articles');
}
$context['components']['boxes'] = $text;
// referrals, if any
$context['components']['referrals'] = Skin::build_referrals('dates/day.php/' . $target);
// render the skin
render_skin();
Exemplo n.º 8
0
Arquivo: index.php Projeto: rair/yacs
        if ($file == 'index.php') {
            continue;
        }
        if ($file == 'overlay.php') {
            continue;
        }
        if (preg_match('/hook\\.php$/i', $file)) {
            continue;
        }
        if (!preg_match('/(.*)\\.php$/i', $file, $matches)) {
            continue;
        }
        $overlays[] = $matches[1];
    }
    Safe::closedir($dir);
    if (@count($overlays)) {
        natsort($overlays);
        foreach ($overlays as $overlay) {
            $context['text'] .= '<li>' . $overlay . "</li>\n";
        }
    }
}
$context['text'] .= '</ul>';
// how to use overlays
if (Surfer::is_associate()) {
    $context['text'] .= '<p>' . sprintf(i18n::s('For example, if you want to apply the overlay <code>foo</code>, go to the %s, and select a target section, or add one.'), Skin::build_link('sections/', i18n::s('site map'), 'shortcut')) . '</p>' . '<p>' . i18n::s('In the form used to edit the section, type the keyword <code>foo</code> in the overlay field, then save changes.') . '</p>';
}
// referrals, if any
$context['components']['referrals'] =& Skin::build_referrals('overlays/index.php');
// render the skin
render_skin();
Exemplo n.º 9
0
Arquivo: year.php Projeto: rair/yacs
            // neighbours
            $neighbours = array(Dates::get_url($previous, 'year'), $previous, Dates::get_url($next, 'year'), $next, NULL, NULL);
            // links to display previous and next years
            $text .= Skin::neighbours($neighbours, 'slideshow');
        }
        // one calendar per month
        for ($index = 1; $index <= 12; $index++) {
            // items for this month
            $items =& Dates::list_for_month($year, $index, 'links');
            // draw all months - force empty months
            $text .= Dates::build_months($items, TRUE, TRUE, TRUE, FALSE, $year, $index);
        }
        // cache, whatever change, for 5 minutes
        Cache::put($cache_id, $text, 'stable', 300);
    }
    $context['text'] .= $text;
}
// page extra content
$cache_id = 'dates/year.php#extra';
if (!($text = Cache::get($cache_id))) {
    // side bar with the list of most recent pages
    if ($items =& Articles::list_by('publication', 0, COMPACT_LIST_SIZE, 'compact')) {
        $text =& Skin::build_box(i18n::s('Recent pages'), Skin::build_list($items, 'compact'), 'boxes');
    }
    Cache::put($cache_id, $text, 'articles');
}
$context['components']['boxes'] = $text;
// referrals, if any
$context['components']['referrals'] = Skin::build_referrals('dates/year.php/' . $year);
// render the skin
render_skin();
Exemplo n.º 10
0
Arquivo: index.php Projeto: rair/yacs
        if ($file[0] == '.' || is_dir($context['path_to_root'] . 'authenticators/' . $file)) {
            continue;
        }
        if ($file == 'index.php') {
            continue;
        }
        if (preg_match('/hook\\.php$/i', $file)) {
            continue;
        }
        if (!preg_match('/(.*)\\.php$/i', $file, $matches)) {
            continue;
        }
        $authenticators[] = $matches[1];
    }
    Safe::closedir($dir);
    if (@count($authenticators)) {
        natsort($authenticators);
        foreach ($authenticators as $authenticator) {
            $context['text'] .= '<li>' . $authenticator . "</li>\n";
        }
    }
}
$context['text'] .= '</ul>';
// how to use authenticators
if (Surfer::is_associate()) {
    $context['text'] .= '<p>' . sprintf(i18n::s('For example, if you want to apply the authenticator <code>foo</code>, put that keyword in the %s.'), Skin::build_link('users/configure.php', i18n::s('configuration panel for users'), 'shortcut')) . '</p>';
}
// referrals, if any
$context['components']['referrals'] =& Skin::build_referrals('users/authenticators/index.php');
// render the skin
render_skin();