Location: PHPKode > projects > Aukyla Document Management System > doc/html/a00240.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    <title>Aukyla PHP Framework</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="StyleSheet" href="auton.css" type="text/css" media="screen">
  </head>

  <body>
    <div id="mainmenu">
      <a href="http://www.auton.nl/" class="home">Home</a>
    </div>
    <div id="submenu">
      <a class="logo" href="http://www.auton.nl/"></a>

      <div class="head">Ads</div>
      <a href="http://sourceforge.net/"><img src="http://sourceforge.net/sflogo.php?group_id=116358&amp;type=1" alt="SourceForge.net Logo" style="padding: 2px 4px; width: 88px; height: 31px; border: 0px"></a>
      <a href="http://getfirefox.com/" title="Get Firefox - The Browser, Reloaded."><img src="http://www.mozilla.org/products/firefox/buttons/getfirefox_small.png" alt="Get Firefox" style="width: 110px; height: 32px; border: 0px"></a>
    </div>
    <div id="main">
<!-- Generated by Doxygen 1.3.9.1 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a></div>
<div class="nav">
<a class="el" href="dir_000000.html">base</a></div>
<h1>Windows.php</h1><div class="fragment"><pre class="fragment">00001 &lt;?php
00002 <span class="comment">/*</span>
00003 <span class="comment">     Windows.php, provides classes for managing multiple windows</span>
00004 <span class="comment">     Copyright (C) 2005 Arend van Beelen, Auton Rijnsburg</span>
00005 <span class="comment"></span>
00006 <span class="comment">     This program is free software; you can redistribute it and/or modify it</span>
00007 <span class="comment">     under the terms of the GNU General Public License as published by the Free</span>
00008 <span class="comment">     Software Foundation; either version 2 of the License, or (at your option)</span>
00009 <span class="comment">     any later version.</span>
00010 <span class="comment"></span>
00011 <span class="comment">     This program is distributed in the hope that it will be useful, but WITHOUT</span>
00012 <span class="comment">     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or</span>
00013 <span class="comment">     FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for</span>
00014 <span class="comment">     more details.</span>
00015 <span class="comment"></span>
00016 <span class="comment">     You should have received a copy of the GNU General Public License along</span>
00017 <span class="comment">     with this program; if not, write to the Free Software Foundation, Inc.,</span>
00018 <span class="comment">     59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</span>
00019 <span class="comment"></span>
00020 <span class="comment">     For any questions, comments or whatever, you may mail me at: hide@address.com</span>
00021 <span class="comment">*/</span>
00022 
00023 require_once('<a class="code" href="a00092.html">Config</a>.php');
00024 require_once('Constants.php');
00025 require_once('<a class="code" href="a00099.html">Decoration</a>.php');
00026 require_once('GUI.php');
00027 require_once('<a class="code" href="a00119.html">Locale</a>.php');
00028 require_once('<a class="code" href="a00134.html">Output</a>.php');
00029 require_once('Widgets.php');
00030 
<a name="l00044"></a><a class="code" href="a00168.html">00044</a> <span class="keyword">class </span><a class="code" href="a00168.html">WindowManager</a> <span class="keyword">extends</span> <a class="code" href="a00143.html">RootContainer</a>
00045 {
00046 
<a name="l00052"></a><a class="code" href="a00168.html#e0">00052</a>         <span class="keyword">public</span> <span class="keyword">static</span> function <a class="code" href="a00168.html#e0">instance</a>()
00053         {
00054                 <span class="keywordflow">if</span>(self::$instance == null)
00055                 {
00056                         self::$instance = <span class="keyword">new</span> <a class="code" href="a00168.html">WindowManager</a>();
00057                 }
00058 
00059                 <span class="keywordflow">return</span> self::$instance;
00060         }
00061 
<a name="l00070"></a><a class="code" href="a00168.html#a0">00070</a>         <span class="keyword">public</span> function <a class="code" href="a00168.html#a0">__construct</a>()
00071         {
00072                 <span class="keywordflow">if</span>(self::$instance != null)
00073                 {
00074                         die('There can be only one <a class="code" href="a00168.html#e0">instance</a> of <a class="code" href="a00168.html">WindowManager</a>!');
00075                 }
00076 
00077                 parent::__construct();
00078 
00079                 $this-&gt;metaTags = '';
00080                 $this-&gt;requestedWindow = <a class="code" href="a00092.html#e2">Config::request</a>('<a class="code" href="a00168.html#a1">window</a>');
00081         }
00082 
<a name="l00089"></a><a class="code" href="a00168.html#a1">00089</a>         <span class="keyword">public</span> function <a class="code" href="a00168.html#a1">window</a>()
00090         {
00091                 <span class="keywordflow">return</span> $this-&gt;requestedWindow;
00092         }
00093 
<a name="l00097"></a><a class="code" href="a00168.html#a2">00097</a>         <span class="keyword">public</span> function <a class="code" href="a00168.html#a2">show</a>()
00098         {
00099                 <span class="keywordflow">if</span>($this-&gt;requestedWindow != '')
00100                 {
00101                         foreach($this-&gt;children as $child)
00102                         {
00103                                 <span class="keywordflow">if</span>($child-&gt;id() == $this-&gt;requestedWindow)
00104                                 {
00105                                         $child-&gt;show();
00106                                         <span class="keywordflow">return</span>;
00107                                 }
00108                         }
00109 
00110                         die(i18n('The requested <a class="code" href="a00168.html#a1">window</a> does not exist.'));
00111                 }
00112 
00113                 <a class="code" href="a00125.html#e0">MainWindow::instance</a>()-&gt;show();
00114         }
00115 
<a name="l00116"></a><a class="code" href="a00168.html#p0">00116</a>         <span class="keyword">protected</span> $children;
00117 
00118         <span class="keyword">private</span> <span class="keyword">static</span> $instance = null;
00119         <span class="keyword">private</span> $requestedWindow;
00120 }
00121 
00127 <span class="keyword">class </span>Stylesheet
00128 {
00129         function __construct($css, $media = 'screen')
00130         {
00131                 $this-&gt;css = $css;
00132                 $this-&gt;media = $media;
00133         }
00134 
00135         <span class="keyword">public</span> $css;
00136         <span class="keyword">public</span> $media;
00137 }
00138 
<a name="l00150"></a><a class="code" href="a00167.html">00150</a> <span class="keyword">class </span><a class="code" href="a00167.html">Window</a> <span class="keyword">extends</span> <a class="code" href="a00143.html">RootContainer</a>
00151 {
<a name="l00161"></a><a class="code" href="a00167.html#a0">00161</a>         <span class="keyword">public</span> function <a class="code" href="a00167.html#a0">__construct</a>($parent, $<span class="keywordtype">id</span>, $title = '')
00162         {
00163                 parent::__construct($<span class="keywordtype">id</span>);
00164                 <span class="keywordflow">if</span>($parent !== null)
00165                 {
00166                         $parent-&gt;addWidget($<span class="keyword">this</span>);
00167                 }
00168 
00169                 $this-&gt;windowTag = 'window';
00170 
00171                 $this-&gt;javaScriptHeaders = <span class="keyword">new</span> <a class="code" href="a00143.html">RootContainer</a>();
00172                 $this-&gt;menus = array();
00173                 $this-&gt;stylesheets = array();
00174                 $this-&gt;<a class="code" href="a00167.html#a1">title</a> = $title;
00175         }
00176 
<a name="l00184"></a><a class="code" href="a00167.html#a1">00184</a>         <span class="keyword">public</span> function <a class="code" href="a00167.html#a1">title</a>()
00185         {
00186                 <span class="keywordflow">return</span> $this-&gt;title;
00187         }
00188 
<a name="l00196"></a><a class="code" href="a00167.html#a2">00196</a>         <span class="keyword">public</span> function <a class="code" href="a00167.html#a2">setTitle</a>($title)
00197         {
00198                 $this-&gt;<a class="code" href="a00167.html#a1">title</a> = $title;
00199         }
00200 
<a name="l00208"></a><a class="code" href="a00167.html#a3">00208</a>         <span class="keyword">public</span> function <a class="code" href="a00167.html#a3">shortcutIcon</a>()
00209         {
00210                 <span class="keywordflow">return</span> $this-&gt;shortcutIcon;
00211         }
00212 
<a name="l00222"></a><a class="code" href="a00167.html#a4">00222</a>         <span class="keyword">public</span> function <a class="code" href="a00167.html#a4">setShortcutIcon</a>($shortcutIcon)
00223         {
00224                 $this-&gt;<a class="code" href="a00167.html#a3">shortcutIcon</a> = $shortcutIcon;
00225         }
00226 
<a name="l00238"></a><a class="code" href="a00167.html#a5">00238</a>         <span class="keyword">public</span> function <a class="code" href="a00167.html#a5">addStylesheet</a>($css, $media = 'screen')
00239         {
00240                 $this-&gt;stylesheets[] = <span class="keyword">new</span> Stylesheet($css, $media);
00241         }
00242 
<a name="l00246"></a><a class="code" href="a00167.html#a6">00246</a>         <span class="keyword">public</span> function <a class="code" href="a00167.html#a6">addJavaScriptReference</a>($url, $<span class="keywordtype">id</span> = '')
00247         {
00248                 $this-&gt;<a class="code" href="a00167.html#a7">addExternalJavaScript</a>($url, $<span class="keywordtype">id</span>);
00249         }
00250 
<a name="l00259"></a><a class="code" href="a00167.html#a7">00259</a>         <span class="keyword">public</span> function <a class="code" href="a00167.html#a7">addExternalJavaScript</a>($url, $<span class="keywordtype">id</span> = '')
00260         {
00261                 $externalScript = <span class="keyword">new</span> <a class="code" href="a00104.html">ExternalJavaScript</a>($this-&gt;javaScriptHeaders, $url);
00262                 <span class="keywordflow">if</span>($id != '')
00263                 {
00264                         $externalScript-&gt;setId($<span class="keywordtype">id</span>);
00265                 }
00266         }
00267 
<a name="l00271"></a><a class="code" href="a00167.html#a8">00271</a>         <span class="keyword">public</span> function <a class="code" href="a00167.html#a8">addJavaScriptBlock</a>($code, $<span class="keywordtype">id</span> = '')
00272         {
00273                 $this-&gt;<a class="code" href="a00167.html#a9">addJavaScript</a>($code, $<span class="keywordtype">id</span>);
00274         }
00275 
<a name="l00284"></a><a class="code" href="a00167.html#a9">00284</a>         <span class="keyword">public</span> function <a class="code" href="a00167.html#a9">addJavaScript</a>($code, $<span class="keywordtype">id</span> = '')
00285         {
00286                 $script = <span class="keyword">new</span> <a class="code" href="a00115.html">JavaScript</a>($this-&gt;javaScriptHeaders, $code);
00287                 <span class="keywordflow">if</span>($id != '')
00288                 {
00289                         $script-&gt;setId($<span class="keywordtype">id</span>);
00290                 }
00291         }
00292 
<a name="l00303"></a><a class="code" href="a00167.html#a10">00303</a>         <span class="keyword">public</span> function <a class="code" href="a00167.html#a10">registerMenu</a>(<a class="code" href="a00126.html">Menu</a> $menu)
00304         {
00305                 $this-&gt;menus[] = $menu;
00306         }
00307 
<a name="l00318"></a><a class="code" href="a00167.html#a11">00318</a>         <span class="keyword">public</span> function <a class="code" href="a00167.html#a11">mainMenu</a>()
00319         {
00320                 <span class="keywordflow">if</span>(<span class="keyword">sizeof</span>($this-&gt;menus) == 0)
00321                 {
00322                         <span class="keywordflow">return</span> null;
00323                 }
00324 
00325                 <span class="keywordflow">return</span> $this-&gt;menus[0];
00326         }
00327 
<a name="l00338"></a><a class="code" href="a00167.html#a12">00338</a>         <span class="keyword">public</span> function <a class="code" href="a00167.html#a12">menu</a>($<span class="keywordtype">id</span>)
00339         {
00340                 foreach($this-&gt;menus as $<a class="code" href="a00167.html#a12">menu</a>)
00341                 {
00342                         <span class="keywordflow">if</span>($menu-&gt;id() == $id)
00343                         {
00344                                 <span class="keywordflow">return</span> $menu;
00345                         }
00346                 }
00347 
00348                 <span class="keywordflow">return</span> null;
00349         }
00350 
<a name="l00351"></a><a class="code" href="a00167.html#a13">00351</a>         <span class="keyword">public</span> function <a class="code" href="a00167.html#a13">show</a>()
00352         {
00353                 $theme = <a class="code" href="a00099.html#e0">Decoration::theme</a>();
00354                 $frontend = <a class="code" href="a00092.html#e0">Config::globals</a>('frontend');
00355                 <span class="keywordflow">if</span>(file_exists(AUKYLA_DIR.<span class="stringliteral">"/htdocs/resources/plugins/Frontends/$frontend/themes/$theme.css"</span>))
00356                 {
00357                         $theme = <span class="stringliteral">"plugins/Frontends/$frontend/themes/$theme.css"</span>;
00358                 }
00359                 <span class="keywordflow">else</span> <span class="keywordflow">if</span>(file_exists(AUKYLA_DIR.<span class="stringliteral">"/htdocs/resources/base/themes/$theme.css"</span>))
00360                 {
00361                         $theme = <span class="stringliteral">"base/themes/$theme.css"</span>;
00362                 }
00363                 <span class="keywordflow">else</span>
00364                 {
00365                         $theme = '';
00366                 }
00367 
00368                 <a class="code" href="a00134.html#e5">Output::write</a>(<span class="stringliteral">"&lt;{$this-&gt;windowTag} xmlns=\"http://www.auton.nl/aukyla/output/1.0\"&gt;"</span>.
00369                               '&lt;metadata&gt;'.
00370                               <span class="stringliteral">"&lt;caption&gt;{$this-&gt;title}&lt;/caption&gt;"</span>);
00371                 <span class="keywordflow">if</span>(isset($this-&gt;shortcutIcon))
00372                 {
00373                         <a class="code" href="a00134.html#e5">Output::write</a>(<span class="stringliteral">"&lt;link rel=\"shortcut icon\" href=\"{$this-&gt;shortcutIcon}\" type=\"image/png\" /&gt;"</span>);
00374                 }
00375                 <a class="code" href="a00134.html#e5">Output::write</a>($theme == '' ? '' : <span class="stringliteral">"&lt;link rel=\"stylesheet\" href=\"resources/$theme\" media=\"screen\" type=\"text/css\" /&gt;"</span>);
00376                 foreach($this-&gt;stylesheets as $stylesheet)
00377                 {
00378                         <a class="code" href="a00134.html#e5">Output::write</a>(<span class="stringliteral">"&lt;link rel=\"stylesheet\" href=\"{$stylesheet-&gt;css}\" media=\"{$stylesheet-&gt;media}\" type=\"text/css\" /&gt;"</span>);
00379                 }
00380                 $this-&gt;javaScriptHeaders-&gt;show();
00381                 <a class="code" href="a00134.html#e5">Output::write</a>($this-&gt;metaTags.
00382                               '&lt;/metadata&gt;'.
00383                               '&lt;content'.$this-&gt;parentProperties().<span class="charliteral">'&gt;'</span>);
00384                 parent::show();
00385                 <a class="code" href="a00134.html#e5">Output::write</a>('&lt;/content&gt;'.
00386                               <span class="stringliteral">"&lt;/{$this-&gt;windowTag}&gt;"</span>);
00387         }
00388 
<a name="l00392"></a><a class="code" href="a00167.html#p0">00392</a>         <span class="keyword">protected</span> $metaTags;
00393 
<a name="l00398"></a><a class="code" href="a00167.html#p1">00398</a>         <span class="keyword">protected</span> $windowTag;
00399 
00400         <span class="keyword">private</span> $javaScriptHeaders;
00401         <span class="keyword">private</span> $language;
00402         <span class="keyword">private</span> $menus;
00403         <span class="keyword">private</span> $shortcutIcon;
00404         <span class="keyword">private</span> $stylesheets;
00405         <span class="keyword">private</span> $title;
00406 }
00407 
00408 ?&gt;
</pre></div>    </div>
  </body>
</html>
Return current item: Aukyla Document Management System