Example #1
0
function plugin_ls2_convert()
{
    global $vars;
    if (!isset($vars['page'])) {
        return '';
    }
    $params = array('link' => FALSE, 'title' => FALSE, 'include' => FALSE, 'reverse' => FALSE, 'compact' => PLUGIN_LS2_LIST_COMPACT, '_args' => array(), '_done' => FALSE);
    $args = func_get_args();
    $prefix = '';
    if (!empty($args)) {
        $prefix = array_shift($args);
    }
    if ($prefix == '') {
        $prefix = strip_bracket($vars['page']) . '/';
    }
    foreach ($args as $arg) {
        plugin_ls2_check_arg($arg, $params);
    }
    $title = !empty($params['_args']) ? join(',', $params['_args']) : str_replace('$1', htmlsc($prefix), T_("List of pages which begin with ' \$1'"));
    // Auto
    if (!$params['link']) {
        return '<div class="list_pages">' . plugin_ls2_show_lists($prefix, $params) . '</div>';
    }
    $tmp = array();
    if (isset($params['title'])) {
        $tmp[] = 'title=1';
    }
    if (isset($params['include'])) {
        $tmp[] = 'include=1';
    }
    return '<p><a href="' . get_cmd_uri('ls2', $prefix) . join('&amp;', $tmp) . '">' . $title . '</a></p>' . "\n";
}
Example #2
0
function plugin_ls2_convert()
{
    global $script, $vars, $_ls2_msg_title;
    $params = array('link' => FALSE, 'title' => FALSE, 'include' => FALSE, 'reverse' => FALSE, 'compact' => PLUGIN_LS2_LIST_COMPACT, '_args' => array(), '_done' => FALSE);
    $args = array();
    $prefix = '';
    if (func_num_args()) {
        $args = func_get_args();
        $prefix = array_shift($args);
    }
    if ($prefix == '') {
        $prefix = strip_bracket($vars['page']) . '/';
    }
    foreach ($args as $arg) {
        plugin_ls2_check_arg($arg, $params);
    }
    $title = !empty($params['_args']) ? join(',', $params['_args']) : str_replace('$1', htmlsc($prefix), $_ls2_msg_title);
    // Auto
    if (!$params['link']) {
        return plugin_ls2_show_lists($prefix, $params);
    }
    $tmp = array();
    $tmp[] = 'plugin=ls2&amp;prefix=' . rawurlencode($prefix);
    if (isset($params['title'])) {
        $tmp[] = 'title=1';
    }
    if (isset($params['include'])) {
        $tmp[] = 'include=1';
    }
    return '<p><a href="' . $script . '?' . join('&amp;', $tmp) . '">' . $title . '</a></p>' . "\n";
}