Beispiel #1
0
function TaggerSetup()
{
    global $TaggerGroups;
    global $FmtPV;
    if ($TaggerGroups) {
        foreach ($TaggerGroups as $tagname => $catgroup) {
            $FmtPV['$' . $tagname . 'Linked'] = "TaggerLinksVar(\$pn, '{$tagname}', '{$catgroup}', 'LinkedTitle')";
            $FmtPV['$' . $tagname . 'LinkedName'] = "TaggerLinksVar(\$pn, '{$tagname}', '{$catgroup}', 'LinkedName')";
            $FmtPV['$' . $tagname . 'Name'] = "TaggerLinksVar(\$pn, '{$tagname}', '{$catgroup}', 'Name')";
        }
        // markup to insert the links
        $tags = array_keys($TaggerGroups);
        $tagpat = implode('|', $tags);
        if (function_exists('Markup_e')) {
            # added by Petko Yotov
            Markup_e("tagger", '<directives', '/^(\\(:)?(' . $tagpat . '):(.*?)(:\\))?$/', "TaggerLinks(\$pagename, \$m[1], \$m[2], \$m[3], \$m[4])");
            // deal with the "hidden" PTVs
            Markup_e('textvar:', '<split', '/\\(:(\\w[-\\w]*):((?!\\)).*?):\\)/s', "TaggerHiddenVars(\$pagename, \$m[1], \$m[2])");
        } else {
            Markup("tagger", '<directives', '/^(\\(:)?(' . $tagpat . '):(.*?)(:\\))?$/e', "TaggerLinks(\$pagename, '\$1', '\$2', '\$3', '\$4')");
            // deal with the "hidden" PTVs
            Markup('textvar:', '<split', '/\\(:(\\w[-\\w]*):((?!\\)).*?):\\)/se', "TaggerHiddenVars(\$pagename, '\$1', '\$2')");
        }
        // hidden Tagger PTVs get hidden after link-processing
        Markup('textvar:ol', ">links", '/^\\(:\\w[-\\w]*:.*?:\\)$/', '');
    }
}
Beispiel #2
0
  PHSC(stripmagic(@$_REQUEST['q']), ENT_NOQUOTES)));
XLSDV('en', array(
  'SearchFor' => 'Results of search for <em>$Needle</em>:',
  'SearchFound' => 
    '$MatchCount pages found out of $MatchSearched pages searched.'));

SDV($PageListArgPattern, '((?:\\$:?)?\\w+)[:=]');

Markup_e('pagelist', 'directives',
  '/\\(:pagelist(\\s+.*?)?:\\)/i',
  "FmtPageList('\$MatchList', \$pagename, array('o' => \$m[1].' '))");
Markup_e('searchbox', 'directives',
  '/\\(:searchbox(\\s.*?)?:\\)/',
  "SearchBox(\$pagename, ParseArgs(\$m[1], '$PageListArgPattern'))");
Markup_e('searchresults', 'directives',
  '/\\(:searchresults(\\s+.*?)?:\\)/i',
  "FmtPageList(\$GLOBALS['SearchResultsFmt'], \$pagename, 
       array('req' => 1, 'request'=>1, 'o' => \$m[1]))");

SDV($SaveAttrPatterns['/\\(:(searchresults|pagelist)(\\s+.*?)?:\\)/i'], ' ');

SDV($HandleActions['search'], 'HandleSearchA');
SDV($HandleAuth['search'], 'read');
SDV($ActionTitleFmt['search'], '| $[Search Results]');

SDVA($PageListFilters, array(
  'PageListCache' => 80,
  'PageListProtect' => 90,
  'PageListSources' => 100,
  'PageListPasswords' => 120,
  'PageListIf' => 140,
  'PageListTermsTargets' => 160,
Beispiel #3
0
    $opt = ParseArgs($args);
    // expect link, class
    // TODO: test for options
    // TODO: handle alt params
    // TODO: handle rel=nofollow per pmwiki settings
    // what about other PmWiki shortcut-type things?
    // like... [[PmWiki/basic editing|+]]%apply=link class="btn"%
    $target = $opt['link'];
    $text = $opt['text'] ? $opt['text'] : $target;
    // if text not provided, default to the link
    $class = $opt['class'];
    $l = '<a href="%s" class="%s">%s</a>';
    $linkf = sprintf($l, $target, $class, $text);
    return $linkf;
}
Markup_e('icon', 'inline', '/\\(:icon(\\s+.*?)?:\\)/i', "BootstrapIcon(\$m[1])");
function BootstrapIcon($args)
{
    $icon = sprintf('<i class=%s ></i>', $args);
    return Keep($icon);
}
# if (:noleft:) markup is present, mainbody will be span12
# otherwise, default to span9 (ie sidebar is span3)
if (!isset($BodySpan)) {
    $BodySpan = "span9";
}
Markup('noleft', 'directives', '/\\(:noleft:\\)/i', "HideLeftBoot()");
# SetTmplDisplay() is a core pmwiki function defined in pmwiki.php
function HideLeftBoot()
{
    global $BodySpan;
Beispiel #4
0
$Conditions['expr'] = 'CondExpr($pagename, $condname, $condparm)';
$Conditions['('] = 'CondExpr($pagename, $condname, $condparm)';
$Conditions['['] = 'CondExpr($pagename, $condname, $condparm)';

$MarkupTable['_begin']['seq'] = 'B';
$MarkupTable['_end']['seq'] = 'E';
Markup('fulltext','>_begin');
Markup('split','>fulltext',"\n",
  '$RedoMarkupLine=1; return explode("\n",$x);');
Markup('directives','>split');
Markup('inline','>directives');
Markup('links','>inline');
Markup('block','>links');
Markup('style','>block');
Markup_e('closeall', '_begin',
  '/^\\(:closeall:\\)$/',
  "'<:block>' . MarkupClose()");

$ImgExtPattern="\\.(?:gif|jpg|jpeg|png|GIF|JPG|JPEG|PNG)";
$ImgTagFmt="<img src='\$LinkUrl' alt='\$LinkAlt' title='\$LinkAlt' />";

$BlockMarkups = array(
  'block' => array('','','',0),
  'ul' => array('<ul><li>','</li><li>','</li></ul>',1),
  'dl' => array('<dl>','</dd>','</dd></dl>',1),
  'ol' => array('<ol><li>','</li><li>','</li></ol>',1),
  'p' => array('<p>','','</p>',0),
  'indent' => 
     array("<div class='indent'>","</div><div class='indent'>",'</div>',1),
  'outdent' => 
     array("<div class='outdent'>","</div><div class='outdent'>",'</div>',1),
Beispiel #5
0
    This file is part of PmWiki; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published
    by the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.  See pmwiki.php for full details.

    This script provides special handling for WikiWords that are
    preceded by a $, treating them as PmWiki variables to be looked up
    in the variable documentation pages if such documentation exists.
    The $VarPagesFmt variable contains a list of pages to be searched
    to build an index of the variable documentation.  This index is 
    generated only once per browse request, and then only when needed.
*/
SDV($VarPagesFmt, array('$[PmWiki.Variables]'));
Markup_e('varlink', '<wikilink', "/\\\$({$WikiWordPattern})\\b/", "Keep(VarLink(\$pagename,\$m[1],'\$'.\$m[1]))");
Markup('vardef', '<links', "/^:\\\$({$WikiWordPattern}):/", ':[[#$1]]$$1:');
Markup_e('varindex', 'directives', '/\\(:varindex:\\)/i', "Keep(VarIndexList(\$pagename))");
$HTMLStylesFmt['vardoc'] = "a.varlink { text-decoration:none; }\n";
function VarLink($pagename, $tgt, $txt)
{
    global $VarIndex, $FmtV, $VarLinkMissingFmt, $VarLinkExistsFmt;
    SDV($VarLinkMissingFmt, '$LinkText');
    SDV($VarLinkExistsFmt, "<a class='varlink' href='\$LinkUrl'><code class='varlink'>\$LinkText</code></a>");
    VarIndexLoad($pagename);
    $FmtV['$LinkText'] = str_replace('$', '&#36;', $txt);
    $FmtV['$LinkUrl'] = @$VarIndex[$tgt]['url'];
    if (@(!$VarIndex[$tgt]['url'])) {
        return FmtPageName($VarLinkMissingFmt, $pagename);
    }
    return FmtPageName($VarLinkExistsFmt, $pagename);
}
function VarIndexLoad($pagename)
Beispiel #6
0
$FmtPV['$WikiTitle'] = '$GLOBALS["WikiTitle"]';
$FmtPV['$WikiTag'] = '$GLOBALS["WikiTag"]';
# Move any (:noleft:) or SetTmplDisplay('PageLeftFmt', 0); directives to variables for access in jScript.
$FmtPV['$LeftColumn'] = "\$GLOBALS['TmplDisplay']['PageLeftFmt']";
Markup_e('noleft', 'directives', '/\\(:noleft:\\)/i', "SetTmplDisplay('PageLeftFmt',0)");
$FmtPV['$RightColumn'] = "\$GLOBALS['TmplDisplay']['PageRightFmt']";
Markup_e('noright', 'directives', '/\\(:noright:\\)/i', "SetTmplDisplay('PageRightFmt',0)");
$FmtPV['$ActionBar'] = "\$GLOBALS['TmplDisplay']['PageActionFmt']";
Markup_e('noaction', 'directives', '/\\(:noaction:\\)/i', "SetTmplDisplay('PageActionFmt',0)");
$FmtPV['$TabsBar'] = "\$GLOBALS['TmplDisplay']['PageTabsFmt']";
Markup_e('notabs', 'directives', '/\\(:notabs:\\)/i', "SetTmplDisplay('PageTabsFmt',0)");
$FmtPV['$SearchBar'] = "\$GLOBALS['TmplDisplay']['PageSearchFmt']";
Markup_e('nosearch', 'directives', '/\\(:nosearch:\\)/i', "SetTmplDisplay('PageSearchFmt',0)");
$FmtPV['$TitleGroup'] = "\$GLOBALS['TmplDisplay']['PageTitleGroupFmt']";
Markup_e('notitlegroup', 'directives', '/\\(:notitlegroup:\\)/i', "SetTmplDisplay('PageTitleGroupFmt',0)");
Markup_e('notitle', 'directives', '/\\(:notitle:\\)/i', "SetTmplDisplay('PageTitleFmt',0); SetTmplDisplay('PageTitleGroupFmt',0)");
Markup('fieldset', 'inline', '/\\(:fieldset:\\)/i', "<fieldset>");
Markup('fieldsetend', 'inline', '/\\(:fieldsetend:\\)/i', "</fieldset>");
# Override pmwiki styles otherwise they will override styles declared in css
global $HTMLStylesFmt;
$HTMLStylesFmt['pmwiki'] = '';
# Add a custom page storage location
global $WikiLibDirs;
$PageStorePath = dirname(__FILE__) . "/wikilib.d/{\$FullName}";
$where = count($WikiLibDirs);
if ($where > 1) {
    $where--;
}
array_splice($WikiLibDirs, $where, 0, array(new PageStore($PageStorePath)));
# ----------------------------------------
# - Standard Skin Functions
Beispiel #7
0
}
/*  Copyright 2007-2014 Patrick R. Michaud (pmichaud@pobox.com)
    This file is part of PmWiki; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published
    by the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.  See pmwiki.php for full details.

    This script adds Creole v0.4 markup (http://www.wikicreole.org/)
    to PmWiki.  To activate this script, simply add the following into
    a local customization file:

        include_once('scripts/creole.php');

*/
## **strong**
Markup('**', 'inline', '/^\\*\\*(?>(.+?)\\*\\*)(?!\\S)|(?<!^)\\*\\*(.+?)\\*\\*/', '<strong>$1$2</strong>');
## //emphasized//
Markup('//', 'inline', '/(?<!http:|https:|ftp:)\\/\\/(.*?)\\/\\//', '<em>$1</em>');
## == Headings ==
Markup_e('^=', 'block', '/^(={1,6})\\s?(.*?)(\\s*=*\\s*)$/', "'<:block,1><h'.strlen(\$m[1]).'>'.\$m[2].'</h'.strlen(\$m[1]).'>'");
## Line breaks
Markup('\\\\', 'inline', '/\\\\\\\\/', '<br />');
## Preformatted
Markup_e('^{{{', '[=', "/^\\{\\{\\{\n(.*?\n)\\}\\}\\}[^\\S\n]*\n/sm", "Keep('<pre class=\"escaped\">'.\$m[1].'</pre>')");
Markup_e('{{{', '>{{{', '/\\{\\{\\{(.*?)\\}\\}\\}/s', "Keep('<code class=\"escaped\">'.\$m[1].'</code>')");
## Tables
Markup_e('|-table', '>^||', '/^\\|(.*)$/', "FormatTableRow(\$m[0], '\\|')");
## Images
Markup_e('{{', 'inline', '/\\{\\{(?>(\\L))([^|\\]]*)(?:\\|\\s*(.*?)\\s*)?\\}\\}/', "Keep(\$GLOBALS['LinkFunctions'][\$m[1]](\$pagename, \$m[1], \$m[2], \$m[3],\n     \$m[1].\$m[2], \$GLOBALS['ImgTagFmt']),'L')");
## GUIButtons
SDVA($GUIButtons, array('em' => array(100, "//", "//", '$[Emphasized]', '$GUIButtonDirUrlFmt/em.gif"$[Emphasized (italic)]"', '$[ak_em]'), 'strong' => array(110, "**", "**", '$[Strong]', '$GUIButtonDirUrlFmt/strong.gif"$[Strong (bold)]"', '$[ak_strong]'), 'h2' => array(400, '\\n== ', ' ==\\n', '$[Heading]', '$GUIButtonDirUrlFmt/h.gif"$[Heading]"')));
Beispiel #8
0
                           "<caption>{$opt['caption']}</caption>");
  $class = preg_replace('/[^-\\s\\w]+/', ' ', @$opt['class']);
  if (strpos($class, 'horiz') !== false) 
    { $sep = ''; $pretext = $MarkupWordwrapFunction($text, 40); } 
  else 
    { $sep = '</tr><tr>'; $pretext = $MarkupWordwrapFunction($text, 75); }
  return Keep(@"<table class='markup $class' align='center'>$caption
      <tr><td class='markup1' valign='top'><$MarkupWrapTag>$pretext</$MarkupWrapTag></td>$sep<td 
        class='markup2' valign='top'>$html</td></tr></table>");
}

Markup_e('markup', '<[=',
  "/\\(:markup(\\s+([^\n]*?))?:\\)[^\\S\n]*\\[([=@])(.*?)\\3\\]/si",
  "MarkupMarkup(\$pagename, \$m[4], \$m[2])");
Markup_e('markupend', '>markup',
  "/\\(:markup(\\s+([^\n]*?))?:\\)[^\\S\n]*\n(.*?)\\(:markupend:\\)/si",
  "MarkupMarkup(\$pagename, \$m[3], \$m[1])");

SDV($HTMLStylesFmt['markup'], "
  table.markup { border:2px dotted #ccf; width:90%; }
  td.markup1, td.markup2 { padding-left:10px; padding-right:10px; }
  table.vert td.markup1 { border-bottom:1px solid #ccf; }
  table.horiz td.markup1 { width:23em; border-right:1px solid #ccf; }
  table.markup caption { text-align:left; }
  div.faq p, div.faq pre { margin-left:2em; }
  div.faq p.question { margin:1em 0 0.75em 0; font-weight:bold; }
  div.faqtoc div.faq * { display:none; }
  div.faqtoc div.faq p.question 
    { display:block; font-weight:normal; margin:0.5em 0 0.5em 20px; line-height:normal; }
  div.faqtoc div.faq p.question * { display:inline; }
  ");
   (:bdropdown title=Groups <other params> :)

   where title is the setting for the dropdown group, and <other params> are standard pagelist parameters

   NOTE: proper display requires the containing list (ul or ol) to have the class "nav" applied
         this must be applied to the first item on the list, if it is not the dropdown
         AFAIK, this cannot be done programmatically from within this markup code

   NOTE: use of multiple link= targets requires the PageListMultiTargets recipe
         http://www.pmwiki.org/wiki/Cookbook/PageListMultiTargets
         currently this is included via config.php
         Should include it here w/in recipe

   Inspired by code from https://github.com/tamouse/pmwiki-bootstrap-skin/blob/dropdowns/bootstrap.php
*/
Markup_e("bdropdown", ">links", "/\\(:bdropdown\\s*(.*?)\\s*:\\)/", "BDropdownMenu(\$m[1])");
/* NOTE: the "B" prefix is temporary, as previous markup uses the same names (without "B" prefix)
         Once that code is removed, this should be updated to remove the "B"
*/
function BDropdownMenu($inp)
{
    $defaults = array('title' => 'Dropdown');
    $args = array_merge($defaults, ParseArgs($inp));
    // $inline_code_begin = "<li class='dropdown'><a href='#' class='dropdown-toggle' data-toggle='dropdown'>".$args['title']."<b class='caret'></b></a><ul class='dropdown-menu'>";
    $inline_code_begin = "<li class='dropdown'><a href='#' class='dropdown-toggle' data-toggle='dropdown'>" . $args['title'];
    $inline_code_begin .= "<b class='caret'></b></a><ul class='dropdown-menu'>";
    // if we're using MakePageList, we have to pass ALL the opts along...
    // in this case, named $args
    $group_list = BGetWikiPages($args);
    $formatted_list = BBuildGroupList($group_list);
    $inline_code_end = "</ul></li>";
Beispiel #10
0
$FmtPV['$BreadCrumb'] = 'ClusterSlice($pn, "separator=\'' . $ClusterBreadCrumbSeparator . '\' return=links")';
$FmtPV['$BreadCrumbTitle'] = 'ClusterSlice($pn, "separator=\'' . $ClusterBreadCrumbSeparator . '\' return=links title=true space=true ")';
$FmtPV['$BreadCrumbNoTitle'] = 'ClusterSlice($pn, "separator=\'' . $ClusterBreadCrumbSeparator . '\' return=links title=false space=false ")';
# Grouptitle PVs
$FmtPV['$GroupTitle'] = 'ClusterSlice($pn, "start=-1 name=false return=names title=true space=false")';
$FmtPV['$GroupTitlespaced'] = 'ClusterSlice($pn, "start=-1 name=false return=names title=true space=true")';
# Subpage PVs
$FmtPV['$ClusterSideBar'] = 'ClusterPageName($group, "SideBar", $name)';
$FmtPV['$ClusterRightBar'] = 'ClusterPageName($group, "RightBar", $name)';
/* ================================================================
 * Markup and directives
 */
# Markup for link shortcuts
if (function_exists('Markup_e')) {
    # added by Petko Yotov
    Markup_e('[[cluster', '<links', '/\\[\\[(-|[\\*\\^]+)(.*?)\\]\\]/', "ClusterLinks(\$pagename, \$m[1], \$m[2])");
    Markup('clusterslice', 'directives', '/\\(:clusterslice\\s*(.*?):\\)/i', "ClusterSlice(\$pagename, \$m[1])");
} else {
    Markup('[[cluster', '<links', '/\\[\\[(-|[\\*\\^]+)(.*?)\\]\\]/e', "ClusterLinks(\$pagename, '\$1', PSS('\$2'))");
    Markup('clusterslice', 'directives', '/\\(:clusterslice\\s*(.*?):\\)/ei', "ClusterSlice(\$pagename, PSS('\$1'))");
}
/* ================================================================
 * Search Patterns
 * If using name-based clustering, hide the name-based special pages
 */
if ($ClusterEnableNameClustering) {
    $SearchPatterns['normal']['clustername1'] = '!\\' . $ClusterSeparator . 'Group(Print)?(Header|Footer|Attributes)$!';
    $SearchPatterns['normal']['clustername2'] = '!\\' . $ClusterSeparator . '(Side|Right|Menu)Bar$!';
}
/* ================================================================
 * Set up clustered configurations
Beispiel #11
0
$FmtPV['$bi_PagePrev'] = $bi_CurrentPage > 0 ? $bi_CurrentPage - 1 : 0;
$FmtPV['$bi_EntryStart'] = ($bi_CurrentPage - 1) * $bi_EntryCount + 1;
$FmtPV['$bi_EntryEnd'] = $FmtPV['$bi_EntryStart'] + $bi_EntryCount - 1;
// ----------------------------------------
// - Markup
function bi_blogitMU_Handler($m)
{
    $func = 'blogitMU_' . $m[1];
    return $func($m[2], $m[3]);
}
if (function_exists('Markup_e')) {
    //PmWiki 2.2.58+ / PHP5
    Markup_e('blogit', 'fulltext', '/\\(:blogit (list|cleantext)\\s?(.*?):\\)(.*?)\\(:blogitend:\\)/si', "bi_blogitMU_Handler(\$m)");
    //need to use an interim handler
    Markup_e('blogit-skin', 'fulltext', '/\\(:blogit-skin ' . '(date|intro|author|tags|edit|newentry|delete|commentcount|date|commentauthor|commentapprove|commentdelete|commentedit|commentreply|commentblock|commenttext|commentid)' . '\\s?(.*?):\\)(.*?)\\(:blogit-skinend:\\)/si', "blogitSkinMU(\$m[1], \$m[2], \$m[3])");
    Markup_e('includesection', '>if', '/\\(:includesection\\s+(\\S.*?):\\)/i', "PRR(bi_includeSection(\$GLOBALS['bi_Pagename'], \$m[1].' '.\$GLOBALS['bi_TemplateList']))");
} else {
    //PmWiki 2.2.58-, pre PHP5
    Markup('blogit', 'fulltext', '/\\(:blogit (list|cleantext)\\s?(.*?):\\)(.*?)\\(:blogitend:\\)/esi', "blogitMU_\$1(PSS('\$2'), PSS('\$3'))");
    Markup('blogit-skin', 'fulltext', '/\\(:blogit-skin ' . '(date|intro|author|tags|edit|newentry|delete|commentcount|date|commentauthor|commentapprove|commentdelete|commentedit|commentreply|commentblock|commenttext|commentid)' . '\\s?(.*?):\\)(.*?)\\(:blogit-skinend:\\)/esi', "blogitSkinMU('\$1', PSS('\$2'), PSS('\$3'))");
    Markup('includesection', '>if', '/\\(:includesection\\s+(\\S.*?):\\)/ei', "PRR(bi_includeSection(\$GLOBALS['bi_Pagename'], PSS('\$1 '.\$GLOBALS['bi_TemplateList'])))");
}
$SaveAttrPatterns['/\\(:includesection\\s.*?:\\)/i'] = ' ';
//prevents include sections becoming part of page targets list
if (IsEnabled($EnableGUIButtons) && $FmtPV['$bi_Mode'] != 'ajax') {
    if ($action == 'bi_be' || $action == 'bi_ne' || $action == 'pmform' && $_REQUEST['target'] == 'blogit-entry') {
        include_once $bi_Paths['guiedit'];
    }
    //PmWiki only includes this automatically if action=edit.
} else {
    Markup('e_guibuttons', 'directives', '/\\(:e_guibuttons:\\)/', '');
Beispiel #12
0
    
    displays the pmwiki feed in long layout and  the top 5 lines 
    (:RSS http://www.pmichaud.com/wiki/Pm/AllRecentChanges?action=rss long 5 :)
    displays the pmwiki feed in short layout and  all lines in the feed
    (:RSS http://www.pmichaud.com/wiki/Pm/AllRecentChanges?action=rss short -1 :)
    Copyright 2006-2011 Anomen (ludek_h@seznam.cz)
    Copyright 2005 http://www.brambring.nl
    Copyright 2005 http://mypage.iu.edu/~mweiner/index.html
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published
    by the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
*/
$RecipeInfo['RSSDisplay']['Version'] = '2016-01-14';
if (function_exists('Markup_e')) {
    Markup_e('rssdisplay', 'fulltext', '/\\(:RSS\\s*(.*?)\\s*:\\)/', "MagpieRSS(\$m[1])");
} else {
    Markup('rssdisplay', 'fulltext', '/\\(:RSS\\s*(.*?)\\s*:\\)/e', "MagpieRSS('\$1')");
}
SDV($MagpieDir, "{$FarmD}/cookbook/magpie");
SDV($MagpieDebug, false);
SDV($MagpieEnableCache, false);
SDV($MagpieCacheAge, 2 * 60 * 60);
SDV($MagpieCacheDir, "{$FarmD}/cache");
SDV($MagpieFetchTimeout, 15);
SDV($MagpieGzip, true);
SDV($MagpieProxy, '');
SDV($MagpieDefaultItems, 30);
SDV($MagpieDefaultShowHeader, true);
SDV($MagpieDefaultShowDate, false);
SDV($MagpieDefaultShowContent, true);
Beispiel #13
0
if (!defined('PmWiki')) {
    exit;
}
/* PmWiki PhotoGallery skin
 *
 * Examples at: http://pmwiki.com/Cookbook/PhotoGallery and http://solidgone.com/Skins/
 * License: Copyright (c)2016 David Gilbert. This work is licensed under a [[http://creativecommons.org/licenses/by-sa/4.0/ | Creative Commons Attribution-Share Alike 4.0 International]] License. Please retain the links in the footer.
 */
global $FmtPV;
$FmtPV['$SkinName'] = '"PhotoGallery"';
$FmtPV['$SkinVersion'] = '"0.4.1"';
$FmtPV['$SkinDate'] = '"20160225"';
## Move any (:noleft:) or SetTmplDisplay('PageLeftFmt', 0); directives to variables for access in jScript.
$FmtPV['$TabsBar'] = "\$GLOBALS['TmplDisplay']['PageTabsFmt']";
Markup_e('notabs', 'directives', '/\\(:notabs:\\)/i', "SetTmplDisplay('PageTabsFmt',0)");
Markup_e('album', 'inline', "/\\(:album\\s*(.*?):\\)/s", "Keep(album(\$m[1]))");
# ----------------------------------------
# - Standard Skin Setup
# ----------------------------------------
$FmtPV['$WikiTitle'] = '$GLOBALS["WikiTitle"]';
# Define a link stye for new page links
global $LinkPageCreateFmt;
SDV($LinkPageCreateFmt, "<a class='createlinktext' href='\$PageUrl?action=edit'>\$LinkText</a>");
# Default color scheme
global $SkinColor, $ValidSkinColors;
if (!is_array($ValidSkinColors)) {
    $ValidSkinColors = array();
}
array_push($ValidSkinColors, 'red', 'blue', 'orange', 'yellow', 'green', 'lightblue');
if (isset($_GET['color']) && in_array($_GET['color'], $ValidSkinColors)) {
    $SkinColor = $_GET['color'];
Beispiel #14
0
/*
    This script adds support for gps coordinates conversion and displaying at maps
    - add (:geo [args] coords :) tag functionality

    Copyright 2006-2016 Anomen (ludek_h@seznam.cz)
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published
    by the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    
    TODO:
    * GPX export (see sourceblock for howto)
*/
$RecipeInfo['Geobox']['Version'] = '2016-10-12';
if (function_exists('Markup_e')) {
    Markup_e('geo', 'fulltext', '/\\(:geo\\s+((?:[dmsDMS,.]+:\\s+)?(?:[a-z]+=\\S+\\s+)*)?(.*?)\\s*:\\)/', "geobox_maps(strtolower(\$m[1]),\$m[2])");
} else {
    Markup('geo', 'fulltext', '/\\(:geo\\s+((?:[dmsDMS,.]+:\\s+)?(?:[a-z]+=\\S+\\s+)*)?(.*?)\\s*:\\)/e', "geobox_maps(strtolower('\$1'),'\$2')");
}
SDV($GeoBoxDefaultFormat, 'dm');
SDVA($GeoBoxLinks, array('maps.google.com' => 'http://maps.google.com/?q=$N%20$E', 'mapy.cz' => 'https://www.mapy.cz/?st=search&fr=$N+$E', 'geocaching.com/maps' => 'http://www.geocaching.com/map/default.aspx?lat=$N&amp;lng=$E', 'geocaching.com/near' => 'http://www.geocaching.com/seek/nearest.aspx?lat=$N&amp;lng=$E&amp;f=1'));
function geobox_asint($m, $index)
{
    $res = 0;
    if (isset($m[$index])) {
        $res = strtr($m[$index], ',', '.');
    }
    return $res;
}
function geobox_p()
{
Beispiel #15
0
## The section below handles specialized EditForm pages.
## We don't bother to load it if we're not editing.

if ($action != 'edit') return;

SDV($PageEditForm, '$SiteGroup.EditForm');
SDV($PageEditFmt, '$EditForm');
if (@$_REQUEST['editform']) {
  $PageEditForm=$_REQUEST['editform'];
  $PageEditFmt='$EditForm';
}
$Conditions['e_preview'] = '(boolean)$_REQUEST["preview"]';

# (:e_preview:) displays the preview of formatted text.
Markup_e('e_preview', 'directives',
  '/^\\(:e_preview:\\)/',
  "isset(\$GLOBALS['FmtV']['\$PreviewText']) ? Keep(\$GLOBALS['FmtV']['\$PreviewText']): ''");

# If we didn't load guiedit.php, then set (:e_guibuttons:) to
# simply be empty.
Markup('e_guibuttons', 'directives', '/\\(:e_guibuttons:\\)/', '');

# Prevent (:e_preview:) and (:e_guibuttons:) from 
# participating in text rendering step.
SDV($SaveAttrPatterns['/\\(:e_(preview|guibuttons):\\)/'], ' ');

SDVA($InputTags['e_form'], array(
  ':html' => "<form action='{\$PageUrl}?action=edit' method='post'
    \$InputFormArgs><input type='hidden' name='action' value='edit' 
    /><input type='hidden' name='n' value='{\$FullName}' 
    /><input type='hidden' name='basetime' value='\$EditBaseTime' 
Beispiel #16
0
                * inserted own function call in array $EditFunctions before 'ReplaceOnSave'

  May 11, 2004 - Working Beta.  Still a few improvements to be made, but
                 the script is ready for public testing.  Please feel
         free to email me your comments/suggestions.  Thanks!
  May 8, 2004  - Alpha release.  Not released to public.

  * Configuration *
  There aren't (yet) any configuration variables for this script.    */
//----------------------------------------------------------------------
## [[hidden-email:target]]
Markup_e('hidden-email', '<links', "/\\[\\[hidden-email:([^\\s{$UrlExcludeChars}]*)\\s*\\]\\]({$SuffixPattern})/", "eProtectDecode(\$m[1],'')");
## [[hidden-email:target | text]]
Markup_e('hidden-email|', '<hidden-email', "/\\[\\[hidden-email:([^\\s{$UrlExcludeChars}]*)\\s*\\|\\s*(.*?)\\s*\\]\\]({$SuffixPattern})/", "eProtectDecode(\$m[1],\$m[2])");
## [[ text -> hidden-email:target]]
Markup_e('-hidden-email', '<hidden-email', "/\\[\\[(.*?)\\s*-+&gt;\\s*hidden-email:([^\\s{$UrlExcludeChars}]*)\\s*\\]\\]({$SuffixPattern})/", "eProtectDecode(\$m[2],\$m[1])");
## Add own function in array $EditFunctions before ReplaceOnSave, so it is called, when saving is performed.
array_splice($EditFunctions, array_search('ReplaceOnSave', $EditFunctions), 1, array('eProtectEncode', 'ReplaceOnSave'));
## Add decoding script to Header
$HTMLHeaderFmt['eProtect'] = "\n<script type='text/JavaScript'>\n<!--\nNix={map:null,convert:function(a){Nix.init();var s='';for(i=0;i<a.length;i++){var b=a.charAt(i);s+=((b>='A'&&b<='Z')||(b>='a'&&b<='z')?Nix.map[b]:b);}return s;},init:function(){if(Nix.map!=null)return;var map=new Array();var s='abcdefghijklmnopqrstuvwxyz';for(i=0;i<s.length;i++)map[s.charAt(i)]=s.charAt((i+13)%26);for(i=0;i<s.length;i++)map[s.charAt(i).toUpperCase()]=s.charAt((i+13)%26).toUpperCase();Nix.map=map;},decode:function(a){document.write(Nix.convert(a));}}\n//-->\n</script>\n";
//----------------------------------------------------------------------
function eProtectStrRecode($s)
{
    /* str_rot13, extended to recode digits and @#. */
    //----------------------------------------------------------------------
    return strtr($s, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', 'nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM');
}
//----------------------------------------------------------------------
function eProtectDecode($CompressedEmailAddress, $AlternateText)
{
    //----------------------------------------------------------------------
Beispiel #17
0
                  '$GUIButtonDirUrlFmt/extlink.gif"$[Link to external page]"'),
  'big'      => array(300, "'+", "+'", '$[Big text]',
                  '$GUIButtonDirUrlFmt/big.gif"$[Big text]"'),
  'small'    => array(310, "'-", "-'", '$[Small text]',
                  '$GUIButtonDirUrlFmt/small.gif"$[Small text]"'),
  'sup'      => array(320, "'^", "^'", '$[Superscript]',
                  '$GUIButtonDirUrlFmt/sup.gif"$[Superscript]"'),
  'sub'      => array(330, "'_", "_'", '$[Subscript]',
                  '$GUIButtonDirUrlFmt/sub.gif"$[Subscript]"'),
  'h2'       => array(400, '\\n!! ', '\\n', '$[Heading]',
                  '$GUIButtonDirUrlFmt/h.gif"$[Heading]"'),
  'center'   => array(410, '%center%', '', '',
                  '$GUIButtonDirUrlFmt/center.gif"$[Center]"')));

Markup_e('e_guibuttons', 'directives',
  '/\\(:e_guibuttons:\\)/',
  "Keep(FmtPageName(GUIButtonCode(\$pagename), \$pagename))");

function GUIButtonCode($pagename) {
  global $GUIButtons;
  $cmpfn = create_function('$a,$b', 'return $a[0]-$b[0];');
  usort($GUIButtons, $cmpfn);
  $out = "<script type='text/javascript'><!--\n";
  foreach ($GUIButtons as $k => $g) {
    if (!$g) continue;
    @list($when, $mopen, $mclose, $mtext, $tag, $mkey) = $g;
    if ($tag{0} == '<') { 
        $out .= "document.write(\"$tag\");\n";
        continue; 
    }
    if (preg_match('/^(.*\\.(gif|jpg|png))("([^"]+)")?$/', $tag, $m)) {
Beispiel #18
0
    exit;
}
/*
    CachedNumberOfArticles script adds support for printing number of pages in wiki
    - add (:numberofarticles:) tag functionality
    - this version uses WikiDir->ls() to obtin number of articles

    Copyright 2006-2011 Anomen (ludek_h@seznam.cz)
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published
    by the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
*/
$RecipeInfo['CachedNumberOfArticles']['Version'] = '2016-01-13';
if (function_exists('Markup_e')) {
    Markup_e('numberofarticles', 'inline', '/\\(:numberofarticles(\\s+refresh)?\\s*:\\)/', "Keep(getNumArticles(\$m[1]))");
} else {
    Markup('numberofarticles', 'inline', '/\\(:numberofarticles(\\s+refresh)?\\s*:\\)/e', "Keep(getNumArticles('\$1'))");
}
$NOAFile = "{$WorkDir}/.noa";
function refreshNumArticles()
{
    global $NOAFile;
    global $WikiDir;
    $count = count($WikiDir->ls());
    $f = fopen($NOAFile, 'w');
    fwrite($f, $count);
    fclose($f);
    return "<!--fresh-->{$count}\n";
}
function getNumArticles($refresh)
Beispiel #19
0
  'ULbadtype' => '\'$upext\' is not an allowed file extension',
  'ULtoobig' => 'file is larger than maximum allowed by webserver',
  'ULtoobigext' => 'file is larger than allowed maximum of $upmax
     bytes for \'$upext\' files',
  'ULpartial' => 'incomplete file received',
  'ULnofile' => 'no file uploaded',
  'ULexists' => 'file with that name already exists',
  'ULpquota' => 'group quota exceeded',
  'ULtquota' => 'upload quota exceeded'));
SDV($PageAttributes['passwdupload'],'$[Set new upload password:]');
SDV($DefaultPasswords['upload'],'*');
SDV($AuthCascade['upload'], 'read');
SDV($FmtPV['$PasswdUpload'], 'PasswdVar($pn, "upload")');

Markup_e('attachlist', 'directives',
  '/\\(:attachlist\\s*(.*?):\\)/i',
  "Keep('<ul>'.FmtUploadList('$pagename',\$m[1]).'</ul>')");
SDV($GUIButtons['attach'], array(220, 'Attach:', '', '$[file.ext]',
  '$GUIButtonDirUrlFmt/attach.gif"$[Attach file]"'));
SDV($LinkFunctions['Attach:'], 'LinkUpload');
SDV($IMap['Attach:'], '$1');
SDVA($HandleActions, array('upload' => 'HandleUpload',
  'postupload' => 'HandlePostUpload',
  'download' => 'HandleDownload'));
SDVA($HandleAuth, array('upload' => 'upload',
  'download' => 'read'));
SDV($HandleAuth['postupload'], $HandleAuth['upload']);
SDV($UploadVerifyFunction, 'UploadVerifyBasic');

function MakeUploadName($pagename,$x) {
  global $UploadNameChars, $MakeUploadNamePatterns;
Beispiel #20
0
                $attr .= " valign='top'";
            }
            if (!@$MarkupFrame[0]['closeall']['table']) {
                $MarkupFrame[0]['closeall']['table'] = "</td></tr></table>";
                $out .= "<table {$tattr}><tr><td {$attr}>";
            } else {
                if ($name == 'cellnr') {
                    $out .= "</td></tr><tr><td {$attr}>";
                } else {
                    $out .= "</td><td {$attr}>";
                }
            }
        }
        return $out;
    }
    Markup_e('table', '<block', '/^\\(:(table|cell|cellnr|tableend|div|divend)(\\s.*?)?:\\)/i', "TCells(\$m[1],\$m[2])");
}
## Transitions from 2.1.7
if (@$Transition['version'] < 2001007) {
    SDVA($Transition, array('vspace' => 1));
}
## vspace:
##   This restores PmWiki's use of <p class='vspace'></p> to mark
##   vertical space in the output.
if (@$Transition['vspace']) {
    $HTMLVSpace = "<p class='vspace'></p>";
}
## Transitions from 2.1.beta15
if (@$Transition['version'] < 2000915) {
    SDVA($Transition, array('fplbygroup' => 1));
}
Beispiel #21
0
$FmtPV['$WikiTitle'] = '$GLOBALS["WikiTitle"]';
$FmtPV['$WikiTag'] = '$GLOBALS["WikiTag"]';
# Move any (:noleft:) or SetTmplDisplay('PageLeftFmt', 0); directives to variables for access in jScript.
$FmtPV['$LeftColumn'] = "\$GLOBALS['TmplDisplay']['PageLeftFmt']";
Markup_e('noleft', 'directives', '/\\(:noleft:\\)/i', "SetTmplDisplay('PageLeftFmt',0)");
$FmtPV['$RightColumn'] = "\$GLOBALS['TmplDisplay']['PageRightFmt']";
Markup_e('noright', 'directives', '/\\(:noright:\\)/i', "SetTmplDisplay('PageRightFmt',0)");
$FmtPV['$ActionBar'] = "\$GLOBALS['TmplDisplay']['PageActionFmt']";
Markup_e('noaction', 'directives', '/\\(:noaction:\\)/i', "SetTmplDisplay('PageActionFmt',0)");
$FmtPV['$TabsBar'] = "\$GLOBALS['TmplDisplay']['PageTabsFmt']";
Markup_e('notabs', 'directives', '/\\(:notabs:\\)/i', "SetTmplDisplay('PageTabsFmt',0)");
$FmtPV['$SearchBar'] = "\$GLOBALS['TmplDisplay']['PageSearchFmt']";
Markup_e('nosearch', 'directives', '/\\(:nosearch:\\)/i', "SetTmplDisplay('PageSearchFmt',0)");
$FmtPV['$TitleGroup'] = "\$GLOBALS['TmplDisplay']['PageTitleGroupFmt']";
Markup_e('notitlegroup', 'directives', '/\\(:notitlegroup:\\)/i', "SetTmplDisplay('PageTitleGroupFmt',0)");
Markup_e('notitle', 'directives', '/\\(:notitle:\\)/i', "dg_NoTitle()");
Markup('fieldset', 'inline', '/\\(:fieldset:\\)/i', "<fieldset>");
Markup('fieldsetend', 'inline', '/\\(:fieldsetend:\\)/i', "</fieldset>");
# Override pmwiki styles otherwise they will override styles declared in css
global $HTMLStylesFmt;
$HTMLStylesFmt['pmwiki'] = '';
# Add a custom page storage location
global $WikiLibDirs;
$PageStorePath = dirname(__FILE__) . "/wikilib.d/{\$FullName}";
$where = count($WikiLibDirs);
if ($where > 1) {
    $where--;
}
array_splice($WikiLibDirs, $where, 0, array(new PageStore($PageStorePath)));
# ----------------------------------------
# - Standard Skin Functions
Beispiel #22
0
		'authkey'		=> '',				//
		'debug'			=> false,			//
		'cachedir' 		=> '',				// location of the cache directory. Default is [directory of this file].'/cache'. NO trailing /
		'cachelife' 	=> '7200'			// default is '7200' (2 hours): set to '0' to disable the cache

    To use this recipe, simply copy it into the cookbook/ directory, and
    add the following line to a local customization:

        include_once("$FarmD/cookbook/pmgallery.php");
*/
$RecipeInfo['pmGallery']['Version'] = '0.3.3';
$RecipeInfo['pmGallery']['Date'] = '2016-02-25';
/**
* Code executed on include
*/
Markup_e('pmgallery', 'inline', "/\\(:pmgallery\\s*(.*?):\\)/s", "Keep(pmGallery(\$m[1]))");
preg_match('!^(.*)(\\.|/)!', $GLOBALS['pagename'], $m);
$pmGroup = $m[1];
// Specifying $pmGallery['virtualgroups'] allows us to prevent "Page not found..." error message showing up
if (!empty($pmGallery['virtualgroups'])) {
    // group names prefixed with '+' will have group-footers auto-created
    $autogroup = in_array('+' . $pmGroup, $pmGallery['virtualgroups']);
    if ($autogroup || in_array($pmGroup, $pmGallery['virtualgroups'])) {
        // prevent "Page not found..." error message showing up in pmGallery groups
        //PageNotFound file doesn't need to exist!
        SDV($GLOBALS['DefaultPageTextFmt'], '(:include {$Group}.pmPageNotFound:)');
        if ($autogroup) {
            $n = $pmGroup . '.GroupFooter';
            if (!PageExists($n) && $n != $GLOBALS['pagename']) {
                ## Add a custom page storage location
                $GLOBALS['PageStorePath'] = dirname(__FILE__) . "/wikilib.d/{\$FullName}";
Beispiel #23
0
}
/*  Copyright 2004-2015 Patrick R. Michaud (pmichaud@pobox.com)
    This file is part of PmWiki; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published
    by the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.  See pmwiki.php for full details.
    
    Script maintained by Petko YOTOV www.pmwiki.org/petko
*/
SDV($WikiStylePattern, '%%|%[A-Za-z][-,=:#\\w\\s\'"().]*%');
## %% markup
Markup('%%', 'style', '%', 'return ApplyStyles($x);');
## %define=...% markup on a line by itself
Markup_e('%define=', '>split', "/^(?=%define=)((?:{$WikiStylePattern})\\s*)+\$/", "PZZ(ApplyStyles(\$m[0]))");
## restore links before applying styles
Markup_e('restorelinks', '<%%', "/{$KeepToken}(\\d+L){$KeepToken}/", '$GLOBALS[\'KPV\'][$m[1]]');
# define PmWiki's standard/default wikistyles
if (IsEnabled($EnableStdWikiStyles, 1)) {
    ## standard colors
    foreach (array('black', 'white', 'red', 'yellow', 'blue', 'gray', 'silver', 'maroon', 'green', 'navy', 'purple', 'fuchsia', 'olive', 'lime', 'teal', 'aqua', 'orange') as $c) {
        SDV($WikiStyle[$c]['color'], $c);
    }
    SDV($WikiStyle['grey']['color'], 'gray');
    ## %newwin% style opens links in a new window
    SDV($WikiStyle['newwin']['target'], '_blank');
    ## %comment% style turns markup into a comment via display:none css
    SDV($WikiStyle['comment']['display'], 'none');
    ## display, margin, padding, and border css properties
    $WikiStyleCSS[] = 'float|clear|display|(margin|padding|border)(-(left|right|top|bottom))?';
    $WikiStyleCSS[] = 'white-space';
    $WikiStyleCSS[] = '((min|max)-)?(width|height)';
Beispiel #24
0
    << PrevPage | TrailPage | NextPage >> on output.  TrailPage should
    contain either a bullet or number list defining the sequence of pages
    in the "trail".

    The ^|TrailPage|^ markup uses the depth of the bullets to display
    the ancestry of the TrailPage to the current one.  The <|TrailPage|> 
    markup is like <<|TrailPage|>> except that "< PrevPage |" and 
    "| NextPage >" are omitted if at the beginning or end of the 
    trail respectively.  Thanks to John Rankin for contributing these
    markups and the original suggestion for WikiTrails.
    
    Script maintained by Petko YOTOV www.pmwiki.org/petko
*/
Markup_e('<<|', '<links', '/&lt;&lt;\\|([^|]+|\\[\\[(.+?)\\]\\])\\|&gt;&gt;/', "PRR(MakeTrailStop(\$pagename,\$m[1]))");
Markup_e('<|', '><<|', '/&lt;\\|([^|]+|\\[\\[(.+?)\\]\\])\\|&gt;/', "PRR(MakeTrailStopB(\$pagename,\$m[1]))");
Markup_e('^|', '<links', '/\\^\\|([^|]+|\\[\\[(.+?)\\]\\])\\|\\^/', "PRR(MakeTrailPath(\$pagename,\$m[1]))");
SDVA($SaveAttrPatterns, array('/<<\\|([^|]+|\\[\\[(.+?)\\]\\])\\|>>/' => '$1', '/<\\|([^|]+|\\[\\[(.+?)\\]\\])\\|>/' => '$1', '/\\^\\|([^|]+|\\[\\[(.+?)\\]\\])\\|\\^/' => '$1'));
$Conditions['ontrail'] = 'CondOnTrail($pagename, $condparm)';
function CondOnTrail($pagename, $condparm)
{
    @(list($trailname, $pn) = preg_split('/\\s+/', $condparm, 2));
    $trail = ReadTrail($pagename, $trailname);
    if (!$trail) {
        return false;
    }
    $pn = $pn > '' ? MakePageName($pagename, $pn) : $pagename;
    foreach ($trail as $t) {
        if ($t['pagename'] == $pn) {
            return true;
        }
    }
Beispiel #25
0
    The expression arguments are parsed using ParseArgs(), and the
    result of this parsing is available through the $argp array:

        ##  expressions like {(myfunc fmt=foo output=bar)}
        $MarkupExpr['myfunc'] = 'myfunc($argp["fmt"], $argp["output"])';
   
    Finally, if the code in $MarkupExpr contains '$params', then
    it is executed directly without any preprocessing into arguments,
    and $params contains the entire argument string.  Note that $params
    may contain escaped values representing quoted arguments and
    results of other expressions; these values may be un-escaped
    by using "preg_replace($rpat, $rrep, $params)".
*/
Markup_e('{(', '>{$var}',
  '/\\{(\\(\\w+\\b.*?\\))\\}/',
  "MarkupExpression(\$pagename, \$m[1])");

SDVA($MarkupExpr, array(
  'substr' => 'call_user_func_array("substr", $args)',
  'strlen' => 'strlen($args[0])',
  'ftime' => 'ME_ftime(@$args[0], @$args[1], $argp)',
  'rand'   => '($args) ? rand($args[0], $args[1]) : rand()',
  'ucfirst' => 'ucfirst($args[0])',
  'ucwords' => 'ucwords($args[0])',
  'tolower' => 'strtolower($args[0])',
  'toupper' => 'strtoupper($args[0])',
  'asspaced' => '$GLOBALS["AsSpacedFunction"]($args[0])',
  'pagename' => 'MakePageName($pagename, PPRE($rpat, $rrep, $params))',
));
Beispiel #26
0
>>galleria<<
* Attach:DAW/tangocrash.jpg"Some caption"
* Attach:DAW/walcheturm_freeman.jpg"Some other caption"
>><<
*/
$RecipeInfo['Galleria']['Version'] = '0.6.0';
$RecipeInfo['Galleria']['Date'] = '2016-02-25';
// You can pass more options to galleria, either from config.php, or from the galleria markup. see http://galleria.aino.se/docs/1.2/options/
SDVA($galleria, array('list' => '.galleria', 'width' => '500', 'height' => '500'));
// if your pages are locked, or you trust editors, set this true to allow unsafe options to be specified from markup. Otherwise unsafe options can be specified only from config.php
SDV($galleria_safe_mode, true);
SDVA($galleria_unsafe_options, array('dataConfig', 'extend'));
#galleria.js expects these options to be functions, and thus NOT quoted when passed into galleria(). Potentially unsafe.
SDV($galleria_fn, 'galleria');
#Advanced use only. Set if you need to override the basic galleria javascript call.
Markup_e('galleria', 'inline', "/\\(:galleria\\s*(.*?):\\)/s", "Keep({$galleria_fn}(\$m[1]))");
SDVA($HTMLHeaderFmt, array('jquery' => '<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>', 'galleria-js' => '<script src="' . $PubDirUrl . '/galleria/galleria-1.4.2.min.js"></script>', 'galleria-theme' => '<script type="text/javascript">Galleria.loadTheme("' . $PubDirUrl . '/galleria/themes/classic/galleria.classic.min.js");</script>'));
function galleria($args = false)
{
    global $galleria, $galleria_unsafe_options, $galleria_safe_mode;
    $args = ParseArgs($args);
    unset($args['#']);
    if ($galleria_safe_mode) {
        #remove unsafe options from markup args -- only allow from config.php
        foreach ($galleria_unsafe_options as $v) {
            unset($args[$v]);
        }
    }
    $o = array_merge($galleria, $args);
    return '
<script type="text/javascript">
Beispiel #27
0
    of 'PmWiki' in a page is treated as a WikiWord.  If you want to
    restore 'PmWiki' to be treated like other WikiWords, uncomment the
    line below.
        unset($WikiWordCount['PmWiki']);

    If you want to disable WikiWords matching a pattern, you can use
    something like the following.  Note that the first argument has to
    be different for each call to Markup().  The example below disables
    WikiWord links like COM1, COM2, COM1234, etc.
        Markup('COM\d+', '<wikilink', '/\\bCOM\\d+/', "Keep('$0')");
    
    Script maintained by Petko YOTOV www.pmwiki.org/petko
*/
SDV($LinkWikiWords, 1);
## bare wikilinks
Markup_e('wikilink', '>urllink', "/\\b(?<![#&])({$GroupPattern}([\\/.]))?({$WikiWordPattern})/", "Keep('<span class=\\'wikiword\\'>'.WikiLink(\$pagename,\$m[0]).'</span>',\n        'L')");
function WikiLink($pagename, $word)
{
    global $LinkWikiWords, $WikiWordCount, $SpaceWikiWords, $AsSpacedFunction, $MarkupFrame, $WikiWordCountMax;
    if (!$LinkWikiWords || $WikiWordCount[$word] < 0) {
        return $word;
    }
    $text = $SpaceWikiWords ? $AsSpacedFunction($word) : $word;
    $text = preg_replace('!.*/!', '', $text);
    if (!isset($MarkupFrame[0]['wwcount'][$word])) {
        $MarkupFrame[0]['wwcount'][$word] = $WikiWordCountMax;
    }
    if ($MarkupFrame[0]['wwcount'][$word]-- < 1) {
        return $text;
    }
    return MakeLink($pagename, $word, $text);
Beispiel #28
0
    #  $UrlLinkFmt =  "<span class='urllink'><a class='urllink' href='\$LinkUrl' rel='nofollow'>\$LinkText</a></span>";
}
# Right bar handling -- WARNING: this is un-maintained code
if ($SkinPartFmt['rightbardisabled']) {
    SetTmplDisplay('PageRightFmt', 0);
} else {
    global $Now, $RightBarClass;
    SDV($RightbarCookieExpires, $Now + 60 * 60 * 24 * 365);
    # cookie expire time defaults to 1 year
    SDV($DefaultRightBar, 'narrow');
    $PageRightBarList = array('0' => 'rb-none', 'off' => 'rb-none', 'on' => 'rb-narrow', '1' => 'rb-narrow', 'narrow' => 'rb-narrow', '2' => 'rb-normal', 'normal' => 'rb-normal', '3' => 'rb-wide', 'wide' => 'rb-wide');
    if (isset($_COOKIE['setrb'])) {
        $rb = $_COOKIE['setrb'];
    }
    if (isset($_GET['setrb'])) {
        $rb = $_GET['setrb'];
        setcookie('setrb', $rb, $RightbarCookieExpires, '/');
    }
    if (isset($_GET['rb'])) {
        $rb = $_GET['rb'];
    }
    $RightBarClass = isset($PageRightBarList[$rb]) ? $PageRightBarList[$rb] : $PageRightBarList[$DefaultRightBar];
    global $action;
    if (function_exists('Markup_e')) {
        Markup_e('noright', 'directives', '/\\(:noright:\\)/', "SetTmplDisplay('PageRightFmt', 0)");
        Markup_e('showright', 'directives', '/\\(:showright:\\)/', $action != 'browse' ? "" : "SetTmplDisplay('PageRightFmt', 1)");
    } else {
        Markup('noright', 'directives', '/\\(:noright:\\)/e', "SetTmplDisplay('PageRightFmt', 0)");
        Markup('showright', 'directives', '/\\(:showright:\\)/e', $action != 'browse' ? "" : "SetTmplDisplay('PageRightFmt', 1)");
    }
}