Пример #1
0
function render_file($name, $header = '<h2><a href="/docs/">Documentation</a>: $title</h2>')
{
    global $textile, $wiki_files, $wiki_files_canonical;
    $canonical_name = canonicalize_name($name);
    $key = array_search($canonical_name, $wiki_files_canonical);
    if ($key === FALSE) {
        return 'File not found.';
    }
    $filename = $wiki_files[$key];
    if (!file_exists($filename)) {
        return 'File not found!';
    }
    $file = file_get_contents($filename);
    $result = str_ireplace('$title', title_from_filename($filename), $header);
    if (substr($filename, -strlen('.textile')) == '.textile') {
        $result .= $textile->TextileThis($file);
    } else {
        if (substr($filename, -strlen('.md')) == '.md') {
            $result .= Markdown($file);
        } else {
            return 'No parser for file.';
        }
    }
    $result = render_links($result);
    return $result;
}
Пример #2
0
function render_page($template)
{
    global $dir_path, $theme_path, $header_links, $admin_links, $copyright, $start, $limit, $id, $type, $category;
    $template = file_get_contents($dir_path . $theme_path . "templates/" . $template);
    if (!isset($_SESSION['identity'])) {
        $admin_links = NULL;
    }
    if (@$type == "blog") {
        $item = render_single_blog($id);
    } else {
        $item = render_single_article($id);
    }
    $search = array('<$css_path$>', '<$image_path$>', '<$misc_path$>', '<$header_links$>', '<$admin_links$>', '<$blogs$>', '<$copyright$>', '<$item$>', '<$comments$>', '<$downloads$>', '<$links$>', '<$articles$>', '<$id$>', '<$type$>');
    $replace = array($dir_path . $theme_path . "stylesheets/", $dir_path . $theme_path . "images/", $dir_path . $theme_path . "misc/", $header_links, $admin_links, render_many_blogs($start, $limit, $blog), $copyright, $item, render_comments($id, $type), render_downloads($id, $category), render_links($id, $category), render_articles($id, $category), $id, $type);
    $template = str_replace($search, $replace, $template);
    print $template;
}
Пример #3
0
 *
 *
 * $Source: /cvs_backup/e107_0.8/e107_admin/includes/compact.php,v $
 * $Revision$
 * $Date$
 * $Author$
 */
if (!defined('e107_INIT')) {
    exit;
}
require_once e_HANDLER . "message_handler.php";
$emessage =& eMessage::getInstance();
$buts = "";
$text = "<div style='text-align:center'>\n\t<table style='" . ADMIN_WIDTH . "'>";
while (list($key, $funcinfo) = each($newarray)) {
    $buts .= render_links($funcinfo[0], $funcinfo[1], $funcinfo[2], $funcinfo[3], $funcinfo[5], 'default');
}
$text .= $buts;
$text_cat = '';
while ($td <= 5) {
    $text_cat .= "<td class='td' style='width:20%;' ></td>";
    $td++;
}
$td = 1;
$text .= "</tr></table></div>";
if ($buts != "") {
    $ns->tablerender(ADLAN_47 . " " . ADMINNAME, $emessage->render() . $text);
}
$text = "<div style='text-align:center'>\n\t<table style='" . ADMIN_WIDTH . "'>";
$text .= getPluginLinks(E_16_PLUGMANAGER, 'default');
$text .= "</tr>\n\t</table></div>";
Пример #4
0
<?php

/*
 * e107 website system
 *
 * Copyright (C) 2008-2009 e107 Inc (e107.org)
 * Released under the terms and conditions of the
 * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
 *
 *
 *
 * $Source: /cvs_backup/e107_0.8/e107_admin/includes/cascade.php,v $
 * $Revision$
 * $Date$
 * $Author$
 */
if (!defined('e107_INIT')) {
    exit;
}
require_once e_HANDLER . "message_handler.php";
$emessage =& eMessage::getInstance();
$text = "<div style='text-align:center'>\n\t<table class='fborder' style='" . ADMIN_WIDTH . "'>";
while (list($key, $funcinfo) = each($newarray)) {
    $text .= render_links($funcinfo[0], $funcinfo[1], $funcinfo[2], $funcinfo[3], $funcinfo[5], 'adminb');
}
$text .= "<tr>\n\t<td class='fcaption' colspan='5'>\n\t" . ADLAN_CL_7 . "\n\t</td>\n\t</tr>";
$text .= getPluginLinks(E_16_PLUGMANAGER, 'adminb');
$text .= "</table></div>";
$ns->tablerender(ADLAN_47 . " " . ADMINNAME, $emessage->render() . $text);
Пример #5
0
                    $eplug_name = $tp->toHTML($readFile['name'], FALSE, "defs, emotes_off");
                    $eplug_conffile = $readFile['administration']['configFile'];
                    $eplug_icon_small = $plugin_path . '/' . $readFile['administration']['iconSmall'];
                    $eplug_icon = $plugin_path . '/' . $readFile['administration']['icon'];
                    $eplug_caption = $readFile['administration']['caption'];
                } elseif (is_readable(e_PLUGIN . $plugin_path . "/plugin.php")) {
                    include e_PLUGIN . $plugin_path . "/plugin.php";
                }
                if ($eplug_conffile) {
                    $eplug_name = $tp->toHTML($eplug_name, FALSE, "defs, emotes_off");
                    $plugin_icon = $eplug_icon_small ? "<img src='" . e_PLUGIN . $eplug_icon_small . "' alt='" . $eplug_caption . "' class='icon S16' />" : E_16_PLUGIN;
                    $plugin_array[ucfirst($eplug_name)] = array('link' => e_PLUGIN . $plugin_path . "/" . $eplug_conffile, 'title' => $eplug_name, 'caption' => $eplug_caption, 'perms' => "P" . $plugin_id, 'icon' => $plugin_icon);
                    $text_check = TRUE;
                }
                unset($eplug_conffile, $eplug_name, $eplug_caption, $eplug_icon_small);
            }
        }
        ksort($plugin_array, SORT_STRING);
        foreach ($plugin_array as $plug_key => $plug_value) {
            $text_cat .= render_links($plug_value['link'], $plug_value['title'], $plug_value['caption'], $plug_value['perms'], $plug_value['icon'], 'default');
        }
    }
    $text_cat .= render_clean();
    $text_cat .= "</table>\n\t\t</td></tr>";
    if ($text_check) {
        $text .= $text_cat;
    }
}
$text .= "</table></div>";
$ns->tablerender(ADLAN_47 . " " . ADMINNAME, $emessage->render() . $text);
echo admin_info();
Пример #6
0
 */
if (!defined('e107_INIT')) {
    exit;
}
require_once e_HANDLER . "message_handler.php";
$emessage =& eMessage::getInstance();
if ($_GET['mode'] == "e_advanced") {
    $pref['adminstyle'] = "classis";
    save_prefs();
    Header("Location:" . e_ADMIN . "admin.php");
}
$buts = "";
$text = "<div style='text-align:center;vertical-align:middle'><br /><br />\n\t<table style='" . ADMIN_WIDTH . ";margin-top:auto;margin-bottom:auto' >";
//	$newarray[28] = array(e_ADMIN."plugin.php", ADLAN_98, ADLAN_99, "Z", 2, E_16_PLUGMANAGER, E_32_PLUGMANAGER);
$selection = array(22, 12, 17, 25, 5, 19, 7, 23, 28, 26);
// $selection = array(21,11,17,24,5,19,7,27,28,25);
foreach ($selection as $id) {
    $buts .= render_links($newarray[$id][0], $newarray[$id][1], $newarray[$id][2], $newarray[$id][3], $newarray[$id][6], 'beginner');
}
$text .= $buts;
$text .= render_clean();
$text .= "\n</table><br /></div>";
$text .= "<div class='smalltext' style='text-align:center'>" . ADLAN_144 . " <a href='" . e_SELF . "?mode=e_advanced' >" . ADLAN_145 . "</a>&nbsp;&nbsp;</div>";
if ($buts != '') {
    $ns->tablerender(ADLAN_47 . " " . ADMINNAME, $emessage->render() . $text);
}
$text = "<div style='text-align:center'>\n\t<table style='" . ADMIN_WIDTH . "'>";
$text .= getPluginLinks(E_32_PLUGMANAGER, "classis");
$text .= render_clean();
$text .= "</table></div>";
$ns->tablerender(ADLAN_CL_7, $text);
Пример #7
0
}
//TODO LANs throughout.
// ---------------------- Start Panel --------------------------------
$text = "<div >";
if (getperms('0') && !vartrue($user_pref['core-infopanel-mye107'])) {
    $user_pref['core-infopanel-mye107'] = $pref['core-infopanel-default'];
}
$iconlist = array_merge($array_functions_assoc, getPluginLinks(E_16_PLUGMANAGER, "array"));
$text .= "\n\t<form method='post' action='" . e_SELF . "?" . e_QUERY . "'>";
$tp->parseTemplate("{SETSTYLE=core-infopanel}");
// Personalized Panel
$mainPanel = "\n\t<div id='core-infopanel_mye107' >\n\t\t<div>\n\t\t\t<div class='left' style='padding:32px'>";
// Rendering the saved configuration.
foreach ($iconlist as $key => $val) {
    if (!vartrue($user_pref['core-infopanel-mye107']) || in_array($key, $user_pref['core-infopanel-mye107'])) {
        $mainPanel .= render_links($val['link'], $val['title'], $val['caption'], $val['perms'], $val['icon_32'], "div-icon-only");
    }
}
$mainPanel .= "<div class='clear'>&nbsp;</div>\n             </div>\n         </div>\n\t\t</div>";
$text .= $ns->tablerender(ucwords(USERNAME) . "'s Control Panel", $mainPanel, "core-infopanel_mye107", true);
//  ------------------------------- e107 News --------------------------------
$panelRSS = "\n\t";
// TODO Load with Ajax
/*
$xml = e107::getXml();
 $vars = $xml->loadXMLfile('http://www.e107.org/e107_plugins/rss_menu/rss.php?1.2', true, true);
 $text .= print_r($vars,TRUE);
*/
$panelRSS .= "\n    RSS News feed from e107.org goes here.\n\n\t";
/*
Пример #8
0
Файл: render.php Проект: rjha/sc
<?php

include 'sc-app.inc';
include APP_WEB_DIR . '/inc/header.inc';
use com\indigloo\sc\Util as AppUtil;
use com\indigloo\sc\redis;
use com\indigloo\mysql as MySQL;
set_error_handler('webgloo_error_handler');
set_exception_handler('offline_exception_handler');
$pageSize = 10;
$baseURI = "/home";
$totals = array(0, 7, 10, 17, 20, 24);
foreach ($totals as $total) {
    render_links($total);
}
function render_links($total)
{
    global $baseURI;
    global $pageSize;
    for ($j = 1; $j <= 10; $j++) {
        $qparams = array("gpage" => $j, "gpa" => $j * $pageSize);
        $paginator = new \com\indigloo\ui\Pagination($qparams, $pageSize);
        $paginator->setBaseConvert(false);
        $paginator->setMaxPageNo(4);
        $start = ($j - 1) * $pageSize;
        $end = $start + $pageSize;
        $end = $end > $total ? $total : $end;
        $gNumRecords = $end - $start;
        printf(" \n\n Total (%d) page-%d \t start-%d end-%d \t gNumRecords %d \n ", $total, $j, $start, $end, $gNumRecords);
        $paginator->render($baseURI, $start, $end, $gNumRecords);
        printf("  \n ---------------- \n");
Пример #9
0
 * Released under the terms and conditions of the
 * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
 *
 *
 *
 * $Source: /cvs_backup/e107_0.8/e107_admin/includes/classis.php,v $
 * $Revision$
 * $Date$
 * $Author$
 */
if (!defined('e107_INIT')) {
    exit;
}
require_once e_HANDLER . "message_handler.php";
$emessage =& eMessage::getInstance();
$buts = "";
while (list($key, $funcinfo) = each($newarray)) {
    $buts .= render_links($funcinfo[0], $funcinfo[1], $funcinfo[2], $funcinfo[3], $funcinfo[6], "classis");
}
if ($buts != "") {
    $text = "<div style='text-align:center'>\n\t\t\t<table style='" . ADMIN_WIDTH . "'>";
    $text .= $buts;
    $text .= render_clean();
    $text .= "</table></div>";
    $ns->tablerender(ADLAN_47 . " " . ADMINNAME, $emessage->render() . $text);
}
$text = "<div style='text-align:center'>\n\t<table style='" . ADMIN_WIDTH . "'>";
$text .= getPluginLinks(E_32_PLUGMANAGER, "classis");
$text .= render_clean();
$text .= "</table></div>";
$ns->tablerender(ADLAN_CL_7, $text);
Пример #10
0
    exit;
}
$mes = e107::getMessage();
$text = "<div style='text-align:center'>\n\t   \t<div class='admintabs' id='tab-container'>\n\t\t\t<ul class='e-tabs' id='core-emote-tabs'>";
foreach ($admin_cat['id'] as $cat_key => $cat_id) {
    // $text .= "<li id='tab-main_".$cat_key."' ><span style='white-space:nowrap'><img class='icon S16' src='".$admin_cat['img'][$cat_key]."' alt='' style='margin-right:3px' /><a href='#core-main_".$cat_key."'>".$admin_cat['title'][$cat_key]."</a></span></li>";
    $text .= "<li id='tab-main_" . $cat_key . "' ><a href='#core-main_" . $cat_key . "'>" . $admin_cat['title'][$cat_key] . "</a></li>";
}
$text .= "</ul>";
foreach ($admin_cat['id'] as $cat_key => $cat_id) {
    $text_check = FALSE;
    $text_cat = "<div class='adminform' id='core-main_" . $cat_key . "'>\n\t<div style='border:1px solid silver;margin:10px'>\n\t<div class='main_caption bevel'><b>" . $admin_cat['title'][$cat_key] . "</b></div>\n\t<table style='width:100%'>";
    if ($cat_key != 5) {
        foreach ($newarray as $key => $funcinfo) {
            if ($funcinfo[4] == $cat_key) {
                $text_rend = render_links($funcinfo[0], $funcinfo[1], $funcinfo[2], $funcinfo[3], $funcinfo[6], 'classis');
                if ($text_rend) {
                    $text_check = TRUE;
                }
                $text_cat .= $text_rend;
            }
        }
    } else {
        $text_rend = getPluginLinks(E_32_PLUGMANAGER, "classis");
        if ($text_rend) {
            $text_check = TRUE;
        }
        $text_cat .= $text_rend;
    }
    $text_cat .= render_clean();
    $text_cat .= "</table></div>\n\t</div>";
Пример #11
0
function getPluginLinks($iconSize = E_16_PLUGMANAGER, $linkStyle = 'adminb')
{
    global $sql, $tp;
    $plug_id = array();
    $plugin_array = array();
    e107::getDb()->db_Select("plugin", "*", "plugin_installflag = 1");
    // Grab plugin IDs.
    while ($row = e107::getDb()->db_Fetch()) {
        $pth = $row['plugin_path'];
        $plug_id[$pth] = $row['plugin_id'];
    }
    $pref = e107::getConfig('core')->getPref();
    $text = render_links(e_ADMIN . "plugin.php", ADLAN_98, ADLAN_99, "Z", $iconSize, $linkStyle);
    $plugs = e107::getObject('e107plugin');
    foreach ($pref['plug_installed'] as $plug => $vers) {
        $plugs->parse_plugin($plug);
        $plugin_path = $plug;
        $name = $plugs->plug_vars['@attributes']['name'];
        /*		echo "<h1>".$name." ($plug)</h1>";
        		print_a($plugs->plug_vars);*/
        foreach ($plugs->plug_vars['adminLinks']['link'] as $tag) {
            if (varset($tag['@attributes']['primary']) != 'true') {
                continue;
            }
            loadLanFiles($plugin_path, 'admin');
            $att = $tag['@attributes'];
            $eplug_name = $tp->toHTML($name, FALSE, "defs, emotes_off");
            $eplug_conffile = $att['url'];
            $eplug_icon_small = $plugin_path . '/' . $att['iconSmall'];
            $eplug_icon = $plugin_path . '/' . $att['icon'];
            $eplug_caption = str_replace("'", '', $tp->toHTML($att['description'], FALSE, 'defs, emotes_off'));
            if (varset($eplug_conffile)) {
                $eplug_name = $tp->toHTML($eplug_name, FALSE, "defs, emotes_off");
                $plugin_icon = $eplug_icon_small ? "<img class='icon S16' src='" . e_PLUGIN . $eplug_icon_small . "' alt=''  />" : E_16_PLUGIN;
                $plugin_icon_32 = $eplug_icon ? "<img class='icon S32' src='" . e_PLUGIN . $eplug_icon . "' alt=''  />" : E_32_PLUGIN;
                $plugin_array['p-' . $plugin_path] = array('link' => e_PLUGIN . $plugin_path . "/" . $eplug_conffile, 'title' => $eplug_name, 'caption' => $eplug_caption, 'perms' => "P" . $plug_id[$plugin_path], 'icon' => $plugin_icon, 'icon_32' => $plugin_icon_32);
            }
        }
    }
    //	print_a($plugs->plug_vars['adminLinks']['link']);
    /*	echo "hello there";
    
     	$xml = e107::getXml();
    	$xml->filter = array('@attributes' => FALSE,'description'=>FALSE,'administration' => FALSE);	// .. and they're all going to need the same filter
    
    	if ($sql->db_Select("plugin", "*", "plugin_installflag=1"))
    	{
    		while ($row = $sql->db_Fetch())
    		{
    			extract($row);		//  plugin_id int(10) unsigned NOT NULL auto_increment,
    								//	plugin_name varchar(100) NOT NULL default '',
    								//	plugin_version varchar(10) NOT NULL default '',
    								//	plugin_path varchar(100) NOT NULL default '',
    								//	plugin_installflag tinyint(1) unsigned NOT NULL default '0',
    								//	plugin_addons text NOT NULL,
    
    			if (is_readable(e_PLUGIN.$plugin_path."/plugin.xml"))
    			{
    				$readFile = $xml->loadXMLfile(e_PLUGIN.$plugin_path.'/plugin.xml', true, true);
    				if ($readFile === FALSE)
    				{
    					echo 'Error in file: '.e_PLUGIN.$plugin_path.'/plugin.xml'.'<br />';
    				}
    				else
    				{
    					loadLanFiles($plugin_path, 'admin');
    					$eplug_name 		= $tp->toHTML($readFile['@attributes']['name'],FALSE,"defs, emotes_off");
    					$eplug_conffile 	= $readFile['administration']['configFile'];
    					$eplug_icon_small 	= $plugin_path.'/'.$readFile['administration']['iconSmall'];
    					$eplug_icon 		= $plugin_path.'/'.$readFile['administration']['icon'];
    					$eplug_caption 		= str_replace("'", '', $tp->toHTML($readFile['description'], FALSE, 'defs, emotes_off'));
    				}
    			}
    			elseif (is_readable(e_PLUGIN.$plugin_path."/plugin.php"))
    			{
    				include(e_PLUGIN.$plugin_path."/plugin.php");
    			}
    			if (varset($eplug_conffile))
    			{
    				$eplug_name = $tp->toHTML($eplug_name,FALSE,"defs, emotes_off");
    				$plugin_icon = $eplug_icon_small ? "<img class='icon S16' src='".e_PLUGIN.$eplug_icon_small."' alt=''  />" : E_16_PLUGIN;
    				$plugin_icon_32 = $eplug_icon ? "<img class='icon S32' src='".e_PLUGIN.$eplug_icon."' alt=''  />" : E_32_PLUGIN;
    
    				$plugin_array['p-'.$plugin_path] = array('link' => e_PLUGIN.$plugin_path."/".$eplug_conffile, 'title' => $eplug_name, 'caption' => $eplug_caption, 'perms' => "P".$plugin_id, 'icon' => $plugin_icon, 'icon_32' => $plugin_icon_32);
    			}
    			unset($eplug_conffile, $eplug_name, $eplug_caption, $eplug_icon_small);
    		}
    	}
    	else
    	{
    		$plugin_array = array();	
    	}
    */
    ksort($plugin_array, SORT_STRING);
    // To FIX, without changing the current key format, sort by 'title'
    if ($linkStyle == "array") {
        return $plugin_array;
    }
    foreach ($plugin_array as $plug_key => $plug_value) {
        $the_icon = $iconSize == E_16_PLUGMANAGER ? $plug_value['icon'] : $plug_value['icon_32'];
        $text .= render_links($plug_value['link'], $plug_value['title'], $plug_value['caption'], $plug_value['perms'], $the_icon, $linkStyle);
    }
    return $text;
}
Пример #12
0
//  echo "<tr><td width='10%'>类型:</td><td>" . implode(',', get_types($dbc, $name, $id)) . "</td></tr>";
$s = array();
foreach ($names as $name_property) {
    $query = "select * from graph where (subject ='" . PREFIX . $id . "' or  subject ='" . $file_id . "' ) and property = '{$name_property}'";
    $result = mysqli_query($dbc, $query) or die('Error querying database2.');
    while ($row = mysqli_fetch_array($result)) {
        $value = $row[value];
        $s[] = render_value($dbc, $db_name, $value, false);
    }
}
if (count($s) != 0) {
    echo "<tr><td width='30%'>相关术语:</td><td>";
    echo implode(', ', $s);
    echo "</td></tr>";
}
render_links($dbc, $db_name, PREFIX . $id, '30%');
render_rlinks($dbc, $db_name, PREFIX . $id, '30%');
foreach ($values_in_graph as $property => $value) {
    //echo "<p><strong>$property</strong>$value</p>";
    echo "<tr><td width='10%'>" . $property . ":</td><td>";
    echo $value;
    echo "</td></tr>";
}
?>
                </tbody>
            </table>

        </div>
    </div>

</div>