<!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&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 Page</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="pages.html">Related Pages</a></div>
<div class="nav">
<a class="el" href="dir_000000.html">base</a></div>
<h1>Views.php</h1><div class="fragment"><pre class="fragment">00001 <?php
00002 <span class="comment">/*</span>
00003 <span class="comment"> Views.php, provides classes for working with multiple views</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('GUI.php');
00024 require_once('<a class="code" href="a00119.html">Locale</a>.php');
00025 require_once('<a class="code" href="a00122.html">Login</a>.php');
00026 require_once('Widgets.php');
00027 require_once('Windows.php');
00028
<a name="l00044"></a><a class="code" href="a00165.html">00044</a> <span class="keyword">class </span><a class="code" href="a00165.html">ViewContainer</a> <span class="keyword">extends</span> <a class="code" href="a00096.html">Container</a>
00045 {
<a name="l00056"></a><a class="code" href="a00165.html#a0">00056</a> <span class="keyword">public</span> function <a class="code" href="a00165.html#a0">__construct</a>(<a class="code" href="a00096.html">Container</a> $parent, $<span class="keywordtype">id</span> = 'view')
00057 {
00058 parent::__construct($parent);
00059
00060 <span class="keywordflow">if</span>(<a class="code" href="a00092.html#e2">Config::request</a>(<span class="stringliteral">"{$id}_cancel"</span>) != '' &&
00061 <a class="code" href="a00092.html#e2">Config::request</a>('button') == i18n('Cancel'))
00062 {
00063 $this->view = <a class="code" href="a00092.html#e2">Config::request</a>(<span class="stringliteral">"{$id}_cancel"</span>);
00064 <a class="code" href="a00122.html#e7">Login::setSessionVariable</a>($<span class="keywordtype">id</span>, $this->view);
00065 }
00066 elseif(Config::request($<span class="keywordtype">id</span>) != '')
00067 {
00068 $this->view = <a class="code" href="a00092.html#e2">Config::request</a>($<span class="keywordtype">id</span>);
00069 <a class="code" href="a00122.html#e7">Login::setSessionVariable</a>($<span class="keywordtype">id</span>, $this->view);
00070 }
00071 <span class="keywordflow">else</span>
00072 {
00073 $this->view = <a class="code" href="a00122.html#e8">Login::sessionVariable</a>($<span class="keywordtype">id</span>);
00074 }
00075 }
00076
<a name="l00082"></a><a class="code" href="a00165.html#a1">00082</a> <span class="keyword">public</span> function <a class="code" href="a00165.html#a1">view</a>()
00083 {
00084 <span class="keywordflow">return</span> $this->view;
00085 }
00086
<a name="l00092"></a><a class="code" href="a00165.html#a2">00092</a> <span class="keyword">public</span> function <a class="code" href="a00165.html#a2">setView</a>($view)
00093 {
00094 $this-><a class="code" href="a00165.html#a1">view</a> = $view;
00095 }
00096
<a name="l00097"></a><a class="code" href="a00165.html#a3">00097</a> <span class="keyword">public</span> function <a class="code" href="a00165.html#a3">show</a>()
00098 {
00099 $windowManager = <a class="code" href="a00168.html#e0">WindowManager::instance</a>();
00100
00101 $defaultView = null;
00102 foreach($this->children as $child)
00103 {
00104 <span class="keywordflow">if</span>($child->id() == $this->view)
00105 {
00106 $child->show();
00107 <span class="keywordflow">return</span>;
00108 }
00109 <span class="keywordflow">if</span>($child->id() == '<span class="keywordflow">default</span>')
00110 {
00111 $defaultView = $child;
00112 }
00113 }
00114
00115 <span class="keywordflow">if</span>($defaultView == null)
00116 {
00117 <span class="keyword">new</span> <a class="code" href="a00136.html">Paragraph</a>($<span class="keyword">this</span>, i18n('The requested <a class="code" href="a00165.html#a1">view</a> could not be found.'));
00118 parent::show();
00119 }
00120 <span class="keywordflow">else</span>
00121 {
00122 $defaultView->show();
00123 }
00124 }
00125
<a name="l00126"></a><a class="code" href="a00165.html#p0">00126</a> <span class="keyword">protected</span> $children;
00127
00128 <span class="keyword">private</span> $view;
00129 }
00130
<a name="l00140"></a><a class="code" href="a00164.html">00140</a> <span class="keyword">class </span><a class="code" href="a00164.html">View</a> <span class="keyword">extends</span> <a class="code" href="a00096.html">Container</a>
00141 {
<a name="l00151"></a><a class="code" href="a00164.html#a0">00151</a> <span class="keyword">public</span> function <a class="code" href="a00164.html#a0">__construct</a>(<a class="code" href="a00165.html">ViewContainer</a> $parent, $<span class="keywordtype">id</span> = '<span class="keywordflow">default</span>')
00152 {
00153 parent::__construct($parent, $<span class="keywordtype">id</span>);
00154 }
00155 }
00156
00157 ?>
</pre></div> </div>
</body>
</html>