ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
index.php File Reference

Go to the source code of this file.

Functions

 draw_shell ()
 

Variables

PHP $shell = array()
 
 $base = '../'
 
 $shell ['title2'] = 'Examples'
 
 $shell ['link2'] = '../'
 
 $shell ['donate'] = ob_get_contents()
 

Function Documentation

◆ draw_shell()

draw_shell ( )

Definition at line 27 of file index.php.

27 {
28 global $shell, $base;
29
30?><!DOCTYPE html>
31<html lang="en">
32<head>
33 <meta http-equiv="content-type" content="text/html; charset=utf-8">
34 <title>Ben Alman &raquo; <?= $shell['title1'] ?><? if ( $shell['title2'] ) { print ' &raquo; ' . $shell['title2']; } ?><? if ( $shell['title3'] ) { print ' &raquo; ' . $shell['title3']; } ?></title>
35 <script type="text/javascript" src="<?= $base ?>../shared/ba-debug.js"></script>
36 <?
37 if ( $shell['jquery'] ) {
38 ?><script type="text/javascript" src="<?= $base ?>../shared/<?= $shell['jquery'] ?>"></script><?
39 }
40
41 ?><script type="text/javascript" src="<?= $base ?>../shared/SyntaxHighlighter/scripts/shCore.js"></script><?
42
43 if ( $shell['shBrush'] ) {
44 foreach ( $shell['shBrush'] as $brush ) {
45 ?><script type="text/javascript" src="<?= $base ?>../shared/SyntaxHighlighter/scripts/shBrush<?= $brush ?>.js"></script><?
46 }
47 }
48 ?>
49 <link rel="stylesheet" type="text/css" href="<?= $base ?>../shared/SyntaxHighlighter/styles/shCore.css">
50 <link rel="stylesheet" type="text/css" href="<?= $base ?>../shared/SyntaxHighlighter/styles/shThemeDefault.css">
51 <link rel="stylesheet" type="text/css" href="<?= $base ?>index.css">
52
53<?= $shell['html_head'] ?>
54
55</head>
56<body>
57
58<div id="page">
59 <div id="header">
60 <h1>
61 <a href="http://benalman.com/" class="title"><b>Ben</b> Alman</a>
62 <?
63 $i = 1;
64 while ( $shell["title$i"] ) {
65 print ' &raquo; ';
66 if ( $shell["link$i"] ) {
67 print '<a href="' . $shell["link$i"] . '">' . $shell["title$i"] . '</a>';
68 } else {
69 print $shell["title$i"];
70 }
71 $i++;
72 }
73 ?>
74 </h1>
75 <?
76 $i = 2;
77 while ( $shell["h$i"] ) {
78 print "<h$i>" . $shell["h$i"] . "</h$i>";
79 $i++;
80 }
81 ?>
82 <?= $shell['html_header'] ?>
83 </div>
84 <div id="content">
85 <?= $shell['html_body'] ?>
86 </div>
87 <div id="footer">
88 <p>
89 If console output is mentioned, but your browser has no console, this example is using <a href="http://benalman.com/projects/javascript-debug-console-log/">JavaScript Debug</a>. Click this bookmarklet: <a href="javascript:if(!window.firebug){window.firebug=document.createElement(&quot;script&quot;);firebug.setAttribute(&quot;src&quot;,&quot;http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js&quot;);document.body.appendChild(firebug);(function(){if(window.firebug.version){firebug.init()}else{setTimeout(arguments.callee)}})();void (firebug);if(window.debug&&debug.setCallback){(function(){if(window.firebug&&window.firebug.version){debug.setCallback(function(b){var a=Array.prototype.slice.call(arguments,1);firebug.d.console.cmd[b].apply(window,a)},true)}else{setTimeout(arguments.callee,100)}})()}};">Debug + Firebug Lite</a> to add the Firebug lite console to the current page. Syntax highlighting is handled by <a href="http://alexgorbatchev.com/">SyntaxHighlighter</a>.
90 </p>
91 <p>
92 All original code is Copyright &copy; 2010 "Cowboy" Ben Alman and dual licensed under the MIT and GPL licenses. View the <a href="http://benalman.com/about/license/">license page</a> for more details.
93 </p>
94 </div>
95</div>
96
97</body>
98</html><?
99
100}
101
102if ( count( get_included_files() ) == 2 ) {
103 $shell['link2'] = '';
104
105 $shell['h2'] = 'Select an example:';
106 $shell['h3'] = '';
107
108 $shell['html_body'] = '';
109
110 $files = scandir( '.' );
111 foreach ( $files as $file ) {
112 if ( $file != '.' && $file != '..' && file_exists( "$file/index.php" ) ) {
113 $file_contents = file_get_contents( "$file/index.php" );
114 $title = preg_replace( '/^.*\$shell\[\'title3\'\]\s*=\s*"(.*?)";.*$/s', '$1', $file_contents );
115 $title = $title == $file_contents ? $file : stripcslashes( $title );
116 $shell['html_body'] .= "<a href=\"$file/\">$title</a><br>";
117 }
118 }
119
120 $base = '';
121 draw_shell();
122}
if(! $in) print
add()
Definition: add.php:2
$shell['title3']
Definition: index.php:5
draw_shell()
Definition: index.php:27
$base
Definition: index.php:4
$i
Definition: metadata.php:24
more()
Definition: more.php:2
static http()
Fetches the global http state from ILIAS.
has(string $class_name)

References $base, $i, $shell, add(), ILIAS\GlobalScreen\has(), ILIAS\FileDelivery\http(), more(), and print.

+ Here is the call graph for this function:

Variable Documentation

◆ $base

◆ $shell [1/4]

PHP $shell = array()

Definition at line 3 of file index.php.

◆ $shell [2/4]

$shell[ 'donate'] = ob_get_contents()

Definition at line 24 of file index.php.

◆ $shell [3/4]

$shell[ 'link2'] = '../'

Definition at line 7 of file index.php.

◆ $shell [4/4]

$shell[ 'title2'] = 'Examples'

Definition at line 6 of file index.php.