root/trunk/admin/plugin.php

Revision 1731, 1.7 KB (checked in by jeena, 6 months ago)

Jlog does not need cookies to work in the admincenter anymore

Line 
1<?php
2 include_once('.'.DIRECTORY_SEPARATOR.'auth.php');
3 define("JLOG_ADMIN", true);
4 require_once('..'.DIRECTORY_SEPARATOR.'scripts'.DIRECTORY_SEPARATOR.'prepend.inc.php');
5 require(JLOG_BASEPATH.'admin'.DIRECTORY_SEPARATOR.'blog.func.php');
6
7  $get = strip($_GET);
8  $c['main'] = output_admin_menu();
9
10    if(empty($get['jplug'])) {
11
12        $handle = "";
13        $file = "";
14        $plugindirectory = JLOG_BASEPATH.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR;
15
16        if(is_dir($plugindirectory)) {
17            $handle = opendir($plugindirectory);
18            while( false !== ( $file = readdir ($handle) ) ) {
19                if(substr($file, -10) === '.jplug.php') {
20                    $pluginName = substr($file, 0, -10);
21                    $availablePlugins .= "  <li><a href='".add_session_id_to_url("?jplug=".$pluginName)."'>".$pluginName."</a></li>\n";
22                }
23            }
24            closedir($handle);
25
26            if(!empty($availablePlugins)) {
27                $availablePlugins = " <ul>\n".$availablePlugins." </ul>\n";
28                $title = $l['admin']['plugins_headline'];
29            }
30
31            else {
32                $availablePlugins = "<p>".$l['admin']['plugins_not_avaliable']."</p>";
33                $title = $l['admin']['plugins_h_not_avaliable'];
34            }
35
36        }
37    }
38    else {
39        $title = $get['jplug'];
40        $availablePlugins = "<p>".$l['admin']['plugin_no_content']."</p>";
41    }
42
43
44
45  $c['meta']['title'] =  $title;
46  $c['main'] .= "<h2>".$title."</h2>\n";
47
48  $c['main'] .= $plugins->callHook('adminContent', $availablePlugins);
49
50
51require(JLOG_BASEPATH.'scripts'.DIRECTORY_SEPARATOR.'do_template.php');
52echo $body;
53?>
Note: See TracBrowser for help on using the browser.