Ejemplo n.º 1
0
 public function index()
 {
     if (isset($_SESSION[C('USER_AUTH_KEY')])) {
         //显示菜单项
         $menu = array();
         $model = M("AdminMenu");
         if (session("administrator")) {
             //echo 'dd';
         } else {
             //echo 'bb';
             $uid = getMemberId();
             $role = getRole($uid);
             //继续。。
             //获取用户
         }
         $list = $model->where('display=1')->order(array('fid' => 'asc', 'sort' => 'asc'))->select();
         $menu = fetchMenu($list, 0);
         $menu_html = displayMenu($menu, false);
         $this->assign('menu', $menu_html);
     }
     C('SHOW_RUN_TIME', false);
     // 运行时间显示
     C('SHOW_PAGE_TRACE', false);
     $this->display();
 }
Ejemplo n.º 2
0
/**
 * 递归处理菜单
 * @param $menu array 需要处理的菜单
 * @return array 处理完成
 * 
 */
function displayMenu($menu, $son = true)
{
    $html = '';
    if ($son) {
        $html .= "<ul>\n";
    } else {
        $html .= "<ul class=\"tree treeFolder expand\" onclick='kkk'>\n";
    }
    foreach ($menu as $value) {
        $target = "navTab";
        if ($value['dialog']) {
            $target = "dialog";
        }
        $url = __APP__ . $value['url'];
        if ($value['url'] != '/') {
            $html .= "<li>\n<a target=\"{$target}\" rel=\"ac_{$value['id']}\" href=\"{$url}\"> {$value['title']} </a>\n";
        } else {
            $html .= "<li>\n<a>{$value['title']} </a>\n";
        }
        if (count($value['menu'])) {
            $html .= displayMenu($value['menu']);
        }
        $html .= "</li>\n";
    }
    "";
    $html .= "</ul>\n";
    return $html;
}
Ejemplo n.º 3
0
?>
/images/puckcast-icon.png" alt="Puckcast" title="Puckcast" width="34" height="34" border="0" ></a>
												
			</div>
-->
			
		<!--END .header-->
		</div>
		
		<!-- BEGIN #primary-nav -->
		<div id="primary-nav-container">
        
        			<div id="primary-nav" class="rounded">
                    <div style="width:740px; float:left">
<?php 
displayMenu(1, 2);
?>
					</div>
					<div align="right" style="width:200px; float:right;padding-top:12px" class="header_login_btn_box">
<?php 
global $userdata;
get_currentuserinfo();
if (is_user_logged_in()) {
    echo "Hi <a href='/wp-admin/profile.php'>" . $userdata->user_login . "</a>\r\n\t\t\t\t\t\t\t\t / \r\n\t\t\t\t\t\t\t\t<a href='" . wp_logout_url(get_permalink()) . "'>Logout</a>";
} else {
    echo "<a href='/wp-login.php?redirect_to=" . urlencode(get_permalink()) . "'>Login</a> | \r\n\t\t\t\t\t\t\t\t\t<a href='/wp-login.php?action=register'>Sign Up</a>\r\n\t\t\t\t\t\t\t\t\t";
}
?>
						
					</div>
        </div>
Ejemplo n.º 4
0
/**
* This function will allow plugins to support the use of custom autolinks
* in other site content. Plugins can now use this API when saving content
* and have the content checked for any autolinks before saving.
* The autolink would be like:  [story:20040101093000103 here]
*
* @param   string   $content   Content that should be parsed for autolinks
* @param    string  $namespace Optional Namespace or plugin name collecting tag info
* @param    string  $operation Optional Operation being performed
* @param   string   $plugin    Optional if you only want to parse using a specific plugin
*
*/
function PLG_replaceTags($content, $namespace = '', $operation = '', $plugin = '')
{
    global $_CONF, $_TABLES, $_BLOCK_TEMPLATE, $LANG32, $_AUTOTAGS, $mbMenu, $autoTagUsage;
    if (isset($_CONF['disable_autolinks']) && $_CONF['disable_autolinks'] == 1) {
        // autolinks are disabled - return $content unchanged
        return $content;
    }
    static $recursionCount = 0;
    if ($recursionCount > 5) {
        COM_errorLog("AutoTag infinite recursion detected on " . $namespace . " " . $operation);
        return $content;
    }
    $autolinkModules = PLG_collectTags();
    $autoTagUsage = PLG_autoTagPerms();
    if (!empty($namespace) && !empty($operation)) {
        $postFix = '.' . $namespace . '.' . $operation;
    } else {
        $postFix = '';
    }
    // For each supported module, scan the content looking for any AutoLink tags
    $tags = array();
    $contentlen = utf8_strlen($content);
    $content_lower = utf8_strtolower($content);
    foreach ($autolinkModules as $moduletag => $module) {
        $autotag_prefix = '[' . $moduletag . ':';
        $offset = 0;
        $prev_offset = 0;
        while ($offset < $contentlen) {
            $start_pos = utf8_strpos($content_lower, $autotag_prefix, $offset);
            if ($start_pos === false) {
                break;
            } else {
                $end_pos = utf8_strpos($content_lower, ']', $start_pos);
                $next_tag = utf8_strpos($content_lower, '[', $start_pos + 1);
                if ($end_pos > $start_pos and ($next_tag === false or $end_pos < $next_tag)) {
                    $taglength = $end_pos - $start_pos + 1;
                    $tag = utf8_substr($content, $start_pos, $taglength);
                    $parms = explode(' ', $tag);
                    // Extra test to see if autotag was entered with a space
                    // after the module name
                    if (utf8_substr($parms[0], -1) == ':') {
                        $startpos = utf8_strlen($parms[0]) + utf8_strlen($parms[1]) + 2;
                        $label = str_replace(']', '', utf8_substr($tag, $startpos));
                        $tagid = $parms[1];
                    } else {
                        $label = str_replace(']', '', utf8_substr($tag, utf8_strlen($parms[0]) + 1));
                        $parms = explode(':', $parms[0]);
                        if (count($parms) > 2) {
                            // whoops, there was a ':' in the tag id ...
                            array_shift($parms);
                            $tagid = implode(':', $parms);
                        } else {
                            $tagid = $parms[1];
                        }
                    }
                    $newtag = array('module' => $module, 'tag' => $moduletag, 'tagstr' => $tag, 'startpos' => $start_pos, 'length' => $taglength, 'parm1' => str_replace(']', '', $tagid), 'parm2' => $label);
                    $tags[] = $newtag;
                } else {
                    // Error: tags do not match - return with no changes
                    return $content . $LANG32[32];
                }
                $prev_offset = $offset;
                $offset = $end_pos;
            }
        }
    }
    // If we have found 1 or more AutoLink tag
    if (count($tags) > 0) {
        // Found the [tag] - Now process them all
        $recursionCount++;
        foreach ($tags as $autotag) {
            $permCheck = $autotag['tag'] . $postFix;
            if (empty($postFix) || !isset($autoTagUsage[$permCheck]) || $autoTagUsage[$permCheck] == 1) {
                $function = 'plugin_autotags_' . $autotag['module'];
                if ($autotag['module'] == 'glfusion' and (empty($plugin) or $plugin == 'glfusion')) {
                    $url = '';
                    $linktext = $autotag['parm2'];
                    if ($autotag['tag'] == 'story') {
                        $autotag['parm1'] = COM_applyFilter($autotag['parm1']);
                        $url = COM_buildUrl($_CONF['site_url'] . '/article.php?story=' . $autotag['parm1']);
                        if (empty($linktext)) {
                            $linktext = DB_getItem($_TABLES['stories'], 'title', "sid = '" . DB_escapeString($autotag['parm1']) . "'");
                        }
                    }
                    if (!empty($url)) {
                        $filelink = COM_createLink($linktext, $url);
                        $content = str_replace($autotag['tagstr'], $filelink, $content);
                    }
                    if ($autotag['tag'] == 'story_introtext') {
                        $url = '';
                        $linktext = '';
                        USES_lib_story();
                        if (isset($_USER['uid']) && $_USER['uid'] > 1) {
                            $result = DB_query("SELECT maxstories,tids,aids FROM {$_TABLES['userindex']} WHERE uid = {$_USER['uid']}");
                            $U = DB_fetchArray($result);
                        } else {
                            $U['maxstories'] = 0;
                            $U['aids'] = '';
                            $U['tids'] = '';
                        }
                        $sql = " (date <= NOW()) AND (draft_flag = 0)";
                        if (empty($topic)) {
                            $sql .= COM_getLangSQL('tid', 'AND', 's');
                        }
                        $sql .= COM_getPermSQL('AND', 0, 2, 's');
                        if (!empty($U['aids'])) {
                            $sql .= " AND s.uid NOT IN (" . str_replace(' ', ",", $U['aids']) . ") ";
                        }
                        if (!empty($U['tids'])) {
                            $sql .= " AND s.tid NOT IN ('" . str_replace(' ', "','", $U['tids']) . "') ";
                        }
                        $sql .= COM_getTopicSQL('AND', 0, 's') . ' ';
                        $userfields = 'u.uid, u.username, u.fullname';
                        $msql = "SELECT STRAIGHT_JOIN s.*, UNIX_TIMESTAMP(s.date) AS unixdate, " . 'UNIX_TIMESTAMP(s.expire) as expireunix, ' . $userfields . ", t.topic, t.imageurl " . "FROM {$_TABLES['stories']} AS s, {$_TABLES['users']} AS u, " . "{$_TABLES['topics']} AS t WHERE s.sid = '" . $autotag['parm1'] . "' AND (s.uid = u.uid) AND (s.tid = t.tid) AND" . $sql;
                        $result = DB_query($msql);
                        $nrows = DB_numRows($result);
                        if ($A = DB_fetchArray($result)) {
                            $story = new Story();
                            $story->loadFromArray($A);
                            $linktext = STORY_renderArticle($story, 'y');
                        }
                        $content = str_replace($autotag['tagstr'], $linktext, $content);
                    }
                    if ($autotag['tag'] == 'showblock') {
                        $blockName = COM_applyBasicFilter($autotag['parm1']);
                        $result = DB_query("SELECT * FROM {$_TABLES['blocks']} WHERE name = '" . DB_escapeString($blockName) . "'" . COM_getPermSQL('AND'));
                        if (DB_numRows($result) > 0) {
                            $skip = 0;
                            $B = DB_fetchArray($result);
                            $template = '';
                            $side = '';
                            $px = explode(' ', trim($autotag['parm2']));
                            if (is_array($px)) {
                                foreach ($px as $part) {
                                    if (substr($part, 0, 9) == 'template:') {
                                        $a = explode(':', $part);
                                        $template = $a[1];
                                        $skip++;
                                    } elseif (substr($part, 0, 5) == 'side:') {
                                        $a = explode(':', $part);
                                        $side = $a[1];
                                        $skip++;
                                        break;
                                    }
                                }
                                if ($skip != 0) {
                                    if (count($px) > $skip) {
                                        for ($i = 0; $i < $skip; $i++) {
                                            array_shift($px);
                                        }
                                        $caption = trim(implode(' ', $px));
                                    } else {
                                        $caption = '';
                                    }
                                }
                            }
                            if ($template != '') {
                                $_BLOCK_TEMPLATE[$blockName] = 'blockheader-' . $template . '.thtml,blockfooter-' . $template . '.thtml';
                            }
                            if ($side == 'left') {
                                $B['onleft'] = 1;
                            } else {
                                if ($side == 'right') {
                                    $B['onleft'] = 0;
                                }
                            }
                            $linktext = COM_formatBlock($B);
                            $content = str_replace($autotag['tagstr'], $linktext, $content);
                        } else {
                            $content = str_replace($autotag['tagstr'], '', $content);
                        }
                    }
                    if ($autotag['tag'] == 'menu') {
                        $menu = '';
                        $menuID = trim($autotag['parm1']);
                        $menuHTML = displayMenu($menuID);
                        $content = str_replace($autotag['tagstr'], $menuHTML, $content);
                    }
                    if (isset($_AUTOTAGS[$autotag['tag']])) {
                        $content = autotags_autotag('parse', $content, $autotag);
                    }
                } else {
                    if (function_exists($function) and (empty($plugin) or $plugin == $autotag['module'])) {
                        $content = $function('parse', $content, $autotag);
                    }
                }
            }
        }
        $recursionCount--;
    }
    return $content;
}
Ejemplo n.º 5
0
function uiSettings()
{
    global $cfg;
    // load global settings + overwrite per-user settings
    loadSettings();
    // display
    DisplayHead("Administration - UI Settings");
    // Admin Menu
    displayMenu();
    // Main Settings Section
    ?>
	<div align="center">
	<table width="100%" border="1" bordercolor="<?php 
    echo $cfg["table_admin_border"];
    ?>
" cellpadding="2" cellspacing="0" bgcolor="<?php 
    echo $cfg["table_data_bg"];
    ?>
">
	<tr><td bgcolor="<?php 
    echo $cfg["table_header_bg"];
    ?>
" background="themes/<?php 
    echo $cfg["theme"];
    ?>
/images/bar.gif">
	<img src="images/properties.png" width="18" height="13" border="0">&nbsp;&nbsp;<font class="title">UI Settings</font>
	</td></tr><tr><td align="center">

	<div align="center">

		 <table cellpadding="5" cellspacing="0" border="0" width="100%">
			<form name="theForm" action="admin.php?op=updateUiSettings" method="post">



		<tr><td colspan="2" align="center" bgcolor="<?php 
    echo $cfg["table_header_bg"];
    ?>
"><strong>Index-Page</strong></td></tr>

		<tr>
			<td align="left" width="350" valign="top"><strong>Select index-page</strong><br>
			Select the index-Page.
			</td>
			<td valign="top">
				<?php 
    printIndexPageSelectForm();
    ?>
			</td>
		</tr>

		<tr>
			<td align="left" width="350" valign="top"><strong>index-page settings</strong><br>
			Select the columns in transfer-list on index-Page.<br>(only for b4rt-index-page)
			</td>
			<td valign="top">
				<?php 
    printIndexPageSettingsForm();
    ?>
			</td>
		</tr>

		<tr>
			<td align="left" width="350" valign="top"><strong>Width</strong><br>
			Specify the width of the index-page. (780):
			</td>
			<td valign="bottom">
				<input name="ui_dim_main_w" type="Text" maxlength="5" value="<?php 
    echo $cfg["ui_dim_main_w"];
    ?>
" size="5">
			</td>
		</tr>
		<tr>
			<td align="left" width="350" valign="top"><strong>Display Links</strong><br>
			Display Links on the index-page. (true):
			</td>
			<td valign="bottom">
				<select name="ui_displaylinks">
						<option value="1">true</option>
						<option value="0" <?php 
    if (!$cfg["ui_displaylinks"]) {
        echo "selected";
    }
    ?>
>false</option>
				</select>
			</td>
		</tr>
		<tr>
			<td align="left" width="350" valign="top"><strong>Display Users</strong><br>
			Display Users on the index-page. (true):
			</td>
			<td valign="bottom">
				<select name="ui_displayusers">
						<option value="1">true</option>
						<option value="0" <?php 
    if (!$cfg["ui_displayusers"]) {
        echo "selected";
    }
    ?>
>false</option>
				</select>
			</td>
		</tr>
		<tr>
			<td align="left" width="350" valign="top"><strong>Select Drivespace-Bar</strong><br>
			Select Style of Drivespace-Bar on index-Page.
			</td>
			<td valign="top">
				<?php 
    printDrivespacebarSelectForm();
    ?>
			</td>
		</tr>
		<tr>
			<td align="left" width="350" valign="top"><strong>Show Server Stats</strong><br>
			Enable showing the server stats at the bottom:
			</td>
			<td valign="top">
				<select name="index_page_stats">
						<option value="1">true</option>
						<option value="0" <?php 
    if (!$cfg["index_page_stats"]) {
        echo "selected";
    }
    ?>
>false</option>
				</select>
			</td>
		</tr>

		<tr>
			<td align="left" width="350" valign="top"><strong>Show Server Load</strong><br>
			Enable showing the average server load over the last 15 minutes:
			</td>
			<td valign="top">
				<select name="show_server_load">
						<option value="1">true</option>
						<option value="0" <?php 
    if (!$cfg["show_server_load"]) {
        echo "selected";
    }
    ?>
>false</option>
				</select>
			</td>
		</tr>

		<tr>
			<td align="left" width="350" valign="top"><strong>Show Connections</strong><br>
			Enable showing the Sum of TCP-Connections:
			</td>
			<td valign="top">
				<select name="index_page_connections">
						<option value="1">true</option>
						<option value="0" <?php 
    if (!$cfg["index_page_connections"]) {
        echo "selected";
    }
    ?>
>false</option>
				</select>
			</td>
		</tr>

		<tr>
			<td align="left" width="350" valign="top"><strong>Use Refresh</strong><br>
			Use meta-refresh on index-page. (true):
			</td>
			<td valign="bottom">
				<select name="ui_indexrefresh">
						<option value="1">true</option>
						<option value="0" <?php 
    if (!$cfg["ui_indexrefresh"]) {
        echo "selected";
    }
    ?>
>false</option>
				</select>
			</td>
		</tr>
		<tr>
			<td align="left" width="350" valign="top"><strong>Page Refresh (in seconds)</strong><br>
			Number of seconds before the torrent list page refreshes:
			</td>
			<td valign="top">
				<input name="page_refresh" type="Text" maxlength="3" value="<?php 
    echo $cfg["page_refresh"];
    ?>
" size="3">
			</td>
		</tr>

		<tr>
			<td align="left" width="350" valign="top"><strong>Select Sort-Order</strong><br>
			Select default Sort-Order of transfers on index-Page.
			</td>
			<td valign="top">
				<?php 
    printSortOrderSettingsForm();
    ?>
			</td>
		</tr>
		<tr>
			<td align="left" width="350" valign="top"><strong>Enable sorttable</strong><br>
			Enable Client-Side sorting of Transfer-Table:
			</td>
			<td valign="top">
				<select name="enable_sorttable">
						<option value="1">true</option>
						<option value="0" <?php 
    if (!$cfg["enable_sorttable"]) {
        echo "selected";
    }
    ?>
>false</option>
				</select>
			</td>
		</tr>

		<tr>
			<td align="left" width="350" valign="top"><strong>Enable Good looking statistics</strong><br>
			Enable/Disable "Good looking statistics" :
			</td>
			<td valign="top">
				<select name="enable_goodlookstats">
						<option value="1">true</option>
						<option value="0" <?php 
    if (!$cfg["enable_goodlookstats"]) {
        echo "selected";
    }
    ?>
>false</option>
			   </select>
		   </td>
		</tr>

		<tr>
			<td align="left" width="350" valign="top"><strong>Good looking statistics settings</strong><br>
			Configure Settings of "Good looking statistics" :
			</td>
			<td valign="top">
			<?php 
    printGoodLookingStatsForm();
    ?>
			</td>
		</tr>

		<tr>
			<td align="left" width="350" valign="top"><strong>Enable Big bold drivespace warning</strong><br>
			Enable/Disable "Big bold drivespace warning" :
			</td>
			<td valign="top">
				<select name="enable_bigboldwarning">
						<option value="1">true</option>
						<option value="0" <?php 
    if (!$cfg["enable_bigboldwarning"]) {
        echo "selected";
    }
    ?>
>false</option>
				</select>
			</td>
		</tr>


		<tr><td colspan="2" align="center" bgcolor="<?php 
    echo $cfg["table_header_bg"];
    ?>
"><strong>Download-Details</strong></td></tr>
		<tr>
			<td align="left" width="350" valign="top"><strong>Width</strong><br>
			Specify the width of the details-popup. (450):
			</td>
			<td valign="bottom">
				<input name="ui_dim_details_w" type="Text" maxlength="5" value="<?php 
    echo $cfg["ui_dim_details_w"];
    ?>
" size="5">
			</td>
		</tr>
		<tr>
			<td align="left" width="350" valign="top"><strong>Height</strong><br>
			Specify the height of the details-popup. (290):
			</td>
			<td valign="bottom">
				<input name="ui_dim_details_h" type="Text" maxlength="5" value="<?php 
    echo $cfg["ui_dim_details_h"];
    ?>
" size="5">
			</td>
		</tr>


		<tr><td colspan="2" align="center" bgcolor="<?php 
    echo $cfg["table_header_bg"];
    ?>
"><strong>Misc</strong></td></tr>

		<tr>
			<td align="left" width="350" valign="top"><strong>Display TorrentFlux Link</strong><br>
			Display TorrentFlux Link at bottom of pages. (true):
			</td>
			<td valign="bottom">
				<select name="ui_displayfluxlink">
						<option value="1">true</option>
						<option value="0" <?php 
    if (!$cfg["ui_displayfluxlink"]) {
        echo "selected";
    }
    ?>
>false</option>
				</select>
			</td>
		</tr>

			<tr><td colspan="2"><hr noshade></td></tr>
			<tr>
				<td align="center" colspan="2">
				<input type="Submit" value="Update Settings">
				</td>
			</tr>
			</form>
		</table>
	</div>
</td></tr>
</table></div>
<?php 
    DisplayFoot(true, true);
}
Ejemplo n.º 6
0
/**
 * Displays the menu form fields.
 *
 * @param FolderParser $folderParser folderParser object
 * @param string $folderId folder id
 */
function displayMenu($folderParser, $folderId)
{
    global $runSuites;
    $folder = $folderParser->getFolder($folderId);
    if (isset($folder['subfolders'])) {
        foreach ($folder['subfolders'] as $subId) {
            $subfolder = $folderParser->getFolder($subId);
            $dir = str_replace(ROOT_DIR, '', $folder);
            // set the display state:
            $display = 'none';
            $arrow = 'collapsed.png';
            foreach ($runSuites as $suiteId => $tests) {
                if (strstr($suiteId, $dir)) {
                    $display = 'block';
                    $arrow = 'expanded.png';
                    break;
                }
            }
            printf('<div class="groupName" onclick="toggleGroup(\'%s\')"><img id="arrow_%s" class="arrow" src="images/%s"/></span> %s</div>', $subId, $subId, $arrow, basename($subfolder['path']));
            printf('<div class="group" id="%s" style="display: %s">', $subId, $display);
            displayMenu($folderParser, $subId);
            printf('</div>');
        }
    }
    if (isset($folder['suites'])) {
        foreach ($folder['suites'] as $suiteId) {
            $suite = $folderParser->getSuite($suiteId);
            // suite name is the short file name (with suffix detached)
            $suiteName = str_replace(TEST_SUFFIX . '.php', '', basename($suite['path']));
            // checked state
            $checked = in_array($suiteId, $runSuites);
            // Main box:
            printf('<div class="suiteSelect"
				onclick="setCheckBox(\'%s\'); setCheckBoxes(\'%s\', document.getElementById(\'%s\').checked);"
				onmouseover="toggleTests(\'%s\', event, true);"
				onmouseout="toggleTests(\'%s\', event, false);"
				id="suiteSelect_%s"
				>', $suiteId, 'tests_' . $suiteId, $suiteId, $suiteId, $suiteId, $suiteId);
            // checkbox for suite
            printf('<input class="checkbox" onclick="this.checked = !this.checked;" type="checkbox" name="suite" id="%s" value="%s"%s/>', $suiteId, $suiteId, $checked ? ' checked="checked"' : '');
            printf('<span class="checkboxFront%s"></span>', $checked ? 'Set' : 'Unset');
            // arrow for toggling the suite tests box
            printf('<img id="%s" class="arrow_suite" src="" fleoscmouseover="toggleTests(\'%s\', event, true);" fleoscmouseout="toggleTests(\'%s\', event, false);"/>', 'arrow_' . $suiteId, $suiteId, $suiteId);
            printf('<span>');
            if (in_array($suiteId, $runSuites)) {
                printf('<a href="#a_%s">%s</a>', $suiteId, $suiteName);
            } else {
                echo $suiteName;
            }
            echo '</span>';
            echo '</div>';
            // Display the suite tests box:
            // Set height and width of the tests box
            $height = count($suite['tests']) * 17 + 43;
            $width = max(maxLength($suite['tests']) * 8, 175);
            // tests box
            printf('<div id="%s" class="testSelectClosed" style="width: ' . $width . 'px; height: ' . $height . 'px;" onmouseout="toggleTests(\'%s\', event, false);">', 'tests_' . $suiteId, $suiteId);
            foreach ($suite['tests'] as $test) {
                $testId = $suiteId . '@' . $test;
                // used the '@' string as delimiter
                // test box
                printf('<div class="testSelect" onclick="setCheckBox(\'%s\'); setCheckBoxSuite(\'%s\');">', $testId, $suiteId);
                // checkbox for test
                printf('<input class="checkbox" onclick="this.checked = !this.checked;" type="checkbox" name="runSuites[%s][]" id="%s" value="%s"%s/>', $suiteId, $testId, $test, $checked ? ' checked="checked"' : '');
                printf('<span class="checkboxFront%s"></span>', $checked ? 'Set' : 'Unset');
                echo $test;
                echo '</div>';
            }
            // buttons for select and clear all
            printf('<p style="text-align: center;"><input class="button" style="width: 80px;" type="button" onclick="toggleAllTests(%s,%s);" value="%s"/>', "'{$suiteId}'", "false", CLEAR_ALL_LABEL);
            echo '&nbsp;';
            printf('<input class="button" style="width: 80px;" type="button" onclick="toggleAllTests(%s,%s);" value="%s"/></p>', "'{$suiteId}'", "true", SELECT_ALL_LABEL);
            echo '&nbsp;';
            echo '</div>';
        }
    }
    // buttons for select and clear all
    printf('<p><input class="button" style="width: 80px;" type="button" onclick="setCheckBoxes(%s,%s)" value="%s"/>', "'{$folderId}'", "false", CLEAR_ALL_LABEL);
    echo '&nbsp;';
    printf('<input class="button" style="width: 80px;" type="button" onclick="setCheckBoxes(%s,%s)" value="%s"/></p>', "'{$folderId}'", "true", SELECT_ALL_LABEL);
    echo '&nbsp;';
}
Ejemplo n.º 7
0
<script>
	ad_tile=ad_tile+1;
	document.write('\<SCRIPT language=\"JavaScript1.1\" SRC=\"http:\/\/ad.ca.doubleclick.net\/N3081\/adj\/'+ad_adsite+ad_path+';'+ad_loc.leaderboard+ad_sz.leaderboard+'tile='+ad_tile+';'+ad_dcopt.leaderboard+ad_nk+ad_pr+ad_ck+ad_sck+ad_page+ad_cnt+ad_kv+ad_kw+ad_ord+'?\">\<\/SCRIPT>');
</script>
<noscript>
	<a TARGET="_top" HREF="http://ad.ca.doubleclick.net/N3081/jump/mg_habsio.com/noscript;loc=theTop;loc=top;sz=468x60,728x90;tile=1;dcopt=ist;ord=47159745?">
	<IMG ALIGN="TOP" BORDER="0" VSPACE="0" HSPACE="0" WIDTH="468" HEIGHT="60" SRC="http://ad.ca.doubleclick.net/N3081/ad/mg_habsio.com/noscript;loc=theTop;loc=top;sz=468x60,728x90;tile=1;dcopt=ist;ord=47159745?"></a>
</noscript><!-- End of leaderboard -->
</div>
			
		<!--END .header-->
		</div>
		
		<!-- BEGIN #primary-nav -->
		<div id="primary-nav-container">
        
        			<div id="primary-nav" class="rounded">
                    <div style="width:740px; float:left">
<?php 
displayMenu(2, 2);
?>
					</div>
            <div align="right" style="width:200px; float:left;;padding-top:12px"><a href="http://www.montrealgazette.com" target="_blank"><img src="/wp-content/themes/deadline/images/gazette-logo.png" alt="The Montreal Gazette" border="0" /></a>
            	</div>
        </div>
		</div>
		<!-- END #primary-nav -->
		<!--BEGIN #content -->
		<div id="content-container">
		<div id="content" class="clearfix">
	
Ejemplo n.º 8
0
function searchSettings()
{
    global $cfg;
    include_once "AliasFile.php";
    include_once "RunningTorrent.php";
    include_once "searchEngines/SearchEngineBase.php";
    DisplayHead("Administration - Search Settings");
    // Admin Menu
    displayMenu();
    // Main Settings Section
    echo "<div align=\"center\">";
    echo "<table width=\"100%\" border=1 bordercolor=\"" . $cfg["table_admin_border"] . "\" cellpadding=\"2\" cellspacing=\"0\" bgcolor=\"" . $cfg["table_data_bg"] . "\">";
    echo "<tr><td bgcolor=\"" . $cfg["table_header_bg"] . "\" background=\"themes/" . $cfg["theme"] . "/images/bar.gif\">";
    echo "<img src=\"images/properties.png\" width=18 height=13 border=0>&nbsp;&nbsp;<font class=\"title\">Search Settings</font>";
    echo "</td></tr><tr><td align=\"center\">";
    ?>
    <div align="center">

        <table cellpadding="5" cellspacing="0" border="0" width="100%">
        <form name="theForm" action="admin.php?op=searchSettings" method="post">
        <tr>
            <td align="right" width="350" valign="top"><strong>Select Search Engine</strong><br>
            </td>
            <td valign="top">
<?php 
    $searchEngine = getRequestVar('searchEngine');
    if (empty($searchEngine)) {
        $searchEngine = $cfg["searchEngine"];
    }
    echo buildSearchEngineDDL($searchEngine, true);
    ?>
            </td>
        </tr>
        </form>
        </table>

        <table cellpadding="0" cellspacing="0" border="0" width="100%">
        <tr><td>
<?php 
    if (is_file('searchEngines/' . $searchEngine . 'Engine.php')) {
        include_once 'searchEngines/' . $searchEngine . 'Engine.php';
        $sEngine = new SearchEngine(serialize($cfg));
        if ($sEngine->initialized) {
            echo "<table width=\"100%\" border=1 bordercolor=\"" . $cfg["table_admin_border"] . "\" cellpadding=\"2\" cellspacing=\"0\" bgcolor=\"" . $cfg["table_data_bg"] . "\"><tr>";
            echo "<td bgcolor=\"" . $cfg["table_header_bg"] . "\" background=\"themes/" . $cfg["theme"] . "/images/bar.gif\"><img src=\"images/properties.png\" width=18 height=13 border=0>&nbsp;&nbsp;<font class=\"title\">" . $sEngine->mainTitle . " Search Settings</font></td>";
            echo "</tr></table></td>";
            echo "<form name=\"theSearchEngineSettings\" action=\"admin.php?op=updateSearchSettings\" method=\"post\">\n";
            echo "<input type=\"hidden\" name=\"searchEngine\" value=\"" . $searchEngine . "\">";
            ?>
            </td>
        </tr>
        <tr>
            <td>

        <table cellpadding="5" cellspacing="0" border="0" width="100%">
        <tr>
            <td align="left" width="350" valign="top"><strong>Search Engine URL:</strong></td>
            <td valign="top">
                <?php 
            echo "<a href=\"http://" . $sEngine->mainURL . "\" target=\"_blank\">" . $sEngine->mainTitle . "</a>";
            ?>
            </td>
        </tr>
        <tr>
            <td align="left" width="350" valign="top"><strong>Search Module Author:</strong></td>
            <td valign="top">
                <?php 
            echo $sEngine->author;
            ?>
            </td>
        </tr>
        <tr>
            <td align="left" width="350" valign="top"><strong>Version:</strong></td>
            <td valign="top">
                <?php 
            echo $sEngine->version;
            ?>
            </td>
        </tr>
<?php 
            if (strlen($sEngine->updateURL) > 0) {
                ?>
        <tr>
            <td align="left" width="350" valign="top"><strong>Update Location:</strong></td>
            <td valign="top">
                <?php 
                echo "<a href=\"" . $sEngine->updateURL . "\" target=\"_blank\">Check for Update</a>";
                ?>
            </td>
        </tr>
<?php 
            }
            if (!$sEngine->catFilterName == '') {
                ?>
        <tr>
            <td align="left" width="350" valign="top"><strong>Search Filter:</strong><br>
            Select the items that you DO NOT want to show in the torrent search:
            </td>
            <td valign="top">
<?php 
                echo "<select multiple name=\"" . $sEngine->catFilterName . "[]\" size=\"8\" STYLE=\"width: 125px\">";
                echo "<option value=\"-1\">[NO FILTER]</option>";
                foreach ($sEngine->getMainCategories(false) as $mainId => $mainName) {
                    echo "<option value=\"" . $mainId . "\" ";
                    if (@in_array($mainId, $sEngine->catFilter)) {
                        echo " selected";
                    }
                    echo ">" . $mainName . "</option>";
                }
                echo "</select>";
                echo "            </td>\n";
                echo "        </tr>\n";
            }
        }
    }
    echo "        </table>\n";
    echo "         </td></tr></table>";
    echo "        <br>\n";
    echo "        <input type=\"Submit\" value=\"Update Settings\">";
    echo "        </form>\n";
    echo "    </div>\n";
    echo "    <br>\n";
    echo "</td></tr>";
    echo "</table></div>";
    DisplayFoot();
}
Ejemplo n.º 9
0
    ?>
</a>
    </li>
    <li class="menuReload">
        <a href="#menuReload"><?php 
    echo RESET_TESTER_LABEL;
    ?>
</a>
    </li>
</ul>
<!-- Main menu and form -->
<div id="menu">
<form id="menuForm" method="post" action="./">
<?php 
    if ($folderParser->getRootFolderId() !== 0) {
        displayMenu($folderParser, $folderParser->getRootFolderId());
    } else {
        echo 'No tests found. Please check out your config file.<br /><br />';
    }
    ?>
<input type="hidden" name="keepOpen" id="keepOpen" value="<?php 
    echo $keepOpen;
    ?>
"/>
<input type="hidden" name="coverage" id="coverage" value="false" />
<input type="hidden" name="reset" id="reset" value="false" />
<div>
    <input class="button" style="width: 80px;" type="button" name="action" id="submitForm" value="<?php 
    echo RUN_SELECTED_LABEL;
    ?>
" onclick="runTests()" />
Ejemplo n.º 10
0
                d.appendChild(a.canvas);
                container.appendChild(d);
                a.canvas.style.marginTop = (150 - a.fullHeight) / 2 + 'px';
                a.canvas.style.marginLeft = (150 - a.fullWidth) / 2 + 'px';
                a.play();
        }

    </script> 
    
    <div id="animation" ></div>
        <div class="content_container">
            <div class="container_12 content_highlight">
                <!--Left Menu Section -->
                <div class="grid_4">
                    <?php 
displayMenu($config);
?>
                </div>

                <!--Center Content Section -->
                <div class="grid_8">
                    <!--Content Login Section -->
                    <div class="login">
                        <?php 
displayLogin($config);
?>
                        <div class="clear"></div>
                    </div> 

                    <div class="divider"></div>
Ejemplo n.º 11
0
/**
* Returns the site footer
*
* This loads the proper templates, does variable substitution and returns the
* HTML for the site footer.
*
* @param   boolean     $rightblock     Whether or not to show blocks on right hand side default is no
* @param   array       $custom         An array defining custom function to be used to format Rightblocks
* @see function COM_siteHeader
* @return   string  Formated HTML containing site footer and optionally right blocks
*
*/
function COM_siteFooter($rightblock = -1, $custom = '')
{
    global $_CONF, $_TABLES, $_USER, $LANG01, $LANG12, $LANG_BUTTONS, $LANG_DIRECTION, $_IMAGE_TYPE, $topic, $_COM_VERBOSE, $_PAGE_TIMER, $theme_what, $theme_pagetitle, $theme_headercode, $theme_layout, $_LOGO, $uiStyles;
    COM_hit();
    if (isset($blockInterface['right'])) {
        $currentURL = COM_getCurrentURL();
        if (strpos($currentURL, $_CONF['site_admin_url']) === 0) {
            if ($blockInterface['right']['location'] == 'right' || $blockInterface['right']['location'] == 'left') {
                $rightblocks = -1;
            }
        }
    }
    $function = $_USER['theme'] . '_siteFooter';
    if (function_exists($function)) {
        return $function($rightblock, $custom);
    }
    $dt = new Date('now', $_USER['tzid']);
    $what = $theme_what;
    $pagetitle = $theme_pagetitle;
    $themecode = $theme_headercode;
    // Grab any content that was cached by the system
    $content = ob_get_contents();
    ob_end_clean();
    $theme = new Template($_CONF['path_layout']);
    $theme->set_file(array('header' => 'header.thtml', 'footer' => 'footer.thtml', 'leftblocks' => 'leftblocks.thtml', 'rightblocks' => 'rightblocks.thtml'));
    $theme->set_var('num_search_results', $_CONF['num_search_results']);
    // get topic if not on home page
    if (!isset($_GET['topic'])) {
        if (isset($_GET['story'])) {
            $sid = COM_applyFilter($_GET['story']);
        } elseif (isset($_GET['sid'])) {
            $sid = COM_applyFilter($_GET['sid']);
        } elseif (isset($_POST['story'])) {
            $sid = COM_applyFilter($_POST['story']);
        }
        if (empty($sid) && $_CONF['url_rewrite'] && strpos($_SERVER['PHP_SELF'], 'article.php') !== false) {
            COM_setArgNames(array('story', 'mode'));
            $sid = COM_applyFilter(COM_getArgument('story'));
        }
        if (!empty($sid)) {
            $topic = DB_getItem($_TABLES['stories'], 'tid', "sid='" . DB_escapeString($sid) . "'");
        }
    } else {
        $topic = COM_applyFilter($_GET['topic']);
    }
    $loggedInUser = !COM_isAnonUser();
    $theme->set_var('site_name', $_CONF['site_name']);
    $theme->set_var('background_image', $_CONF['layout_url'] . '/images/bg.' . $_IMAGE_TYPE);
    $theme->set_var('site_mail', "mailto:{$_CONF['site_mail']}");
    if ($_LOGO['display_site_slogan']) {
        $theme->set_var('site_slogan', $_CONF['site_slogan']);
    }
    $msg = $LANG01[67] . ' ' . $_CONF['site_name'];
    if (!empty($_USER['username']) && !COM_isAnonUser()) {
        $msg .= ', ' . COM_getDisplayName($_USER['uid'], $_USER['username'], $_USER['fullname']);
    }
    $curtime = $dt->format($dt->getUserFormat(), true);
    $theme->set_var('welcome_msg', $msg);
    $theme->set_var('datetime', $curtime);
    if ($_LOGO['use_graphic_logo'] == 1 && file_exists($_CONF['path_html'] . '/images/' . $_LOGO['logo_name'])) {
        $L = new Template($_CONF['path_layout']);
        $L->set_file(array('logo' => 'logo-graphic.thtml'));
        $imgInfo = @getimagesize($_CONF['path_html'] . '/images/' . $_LOGO['logo_name']);
        $dimension = $imgInfo[3];
        $L->set_var('site_name', $_CONF['site_name']);
        $site_logo = $_CONF['site_url'] . '/images/' . $_LOGO['logo_name'];
        $L->set_var('site_logo', $site_logo);
        $L->set_var('dimension', $dimension);
        if ($imgInfo[1] != 100) {
            $delta = 100 - $imgInfo[1];
            $newMargin = $delta;
            $L->set_var('delta', 'style="padding-top:' . $newMargin . 'px;"');
        } else {
            $L->set_var('delta', '');
        }
        if ($_LOGO['display_site_slogan']) {
            $L->set_var('site_slogan', $_CONF['site_slogan']);
        }
        $L->parse('output', 'logo');
        $theme->set_var('logo_block', $L->finish($L->get_var('output')));
    } else {
        if ($_LOGO['use_graphic_logo'] == 0) {
            $L = new Template($_CONF['path_layout']);
            $L->set_file(array('logo' => 'logo-text.thtml'));
            $L->set_var('site_name', $_CONF['site_name']);
            if ($_LOGO['display_site_slogan']) {
                $L->set_var('site_slogan', $_CONF['site_slogan']);
            }
            $L->parse('output', 'logo');
            $theme->set_var('logo_block', $L->finish($L->get_var('output')));
        } else {
            $theme->set_var('logo_block', '');
        }
    }
    $theme->set_var('site_logo', $_CONF['layout_url'] . '/images/logo.' . $_IMAGE_TYPE);
    $theme->set_var(array('lang_login' => $LANG01[58], 'lang_myaccount' => $LANG01[48], 'lang_logout' => $LANG01[35], 'lang_newuser' => $LANG12[3]));
    $menu_navigation = displayMenu('navigation');
    $menu_footer = displayMenu('footer');
    $menu_header = displayMenu('header');
    $theme->set_var(array('menu_navigation' => $menu_navigation, 'menu_footer' => $menu_footer, 'menu_header' => $menu_header, 'st_hmenu' => $menu_navigation, 'st_footer_menu' => $menu_footer, 'st_header_menu' => $menu_header));
    $lblocks = '';
    /* Check if an array has been passed that includes the name of a plugin
     * function or custom function
     * This can be used to take control over what blocks are then displayed
     */
    if (is_array($what)) {
        $function = $what[0];
        if (function_exists($function)) {
            $lblocks = $function($what[1], 'left');
        } else {
            $lblocks = COM_showBlocks('left', $topic);
        }
    } else {
        if ($what != 'none') {
            // Now show any blocks -- need to get the topic if not on home page
            $lblocks = COM_showBlocks('left', $topic);
        }
    }
    /* Now build footer */
    if (empty($lblocks)) {
        $theme->set_var('left_blocks', '');
        $theme->set_var('glfusion_blocks', '');
    } else {
        $theme->set_var('glfusion_blocks', $lblocks);
    }
    // Do variable assignments
    $theme->set_var('site_mail', "mailto:{$_CONF['site_mail']}");
    $theme->set_var('site_slogan', $_CONF['site_slogan']);
    $rdf = substr_replace($_CONF['rdf_file'], $_CONF['site_url'], 0, strlen($_CONF['path_html']) - 1) . LB;
    $theme->set_var('rdf_file', $rdf);
    $theme->set_var('rss_url', $rdf);
    $year = date('Y');
    $copyrightyear = $year;
    if (!empty($_CONF['copyrightyear'])) {
        if ($year == $_CONF['copyrightyear']) {
            $copyrightyear = $_CONF['copyrightyear'];
        } else {
            $copyrightyear = $_CONF['copyrightyear'] . " - " . $year;
        }
    }
    $theme->set_var('copyright_notice', $LANG01[93] . ' &copy; ' . $copyrightyear . ' ' . $_CONF['site_name'] . '&nbsp;&nbsp;&bull;&nbsp;&nbsp;' . $LANG01[94]);
    $theme->set_var('copyright_msg', $LANG01[93] . ' &copy; ' . $copyrightyear . ' ' . $_CONF['site_name']);
    $theme->set_var('current_year', $year);
    $theme->set_var('lang_copyright', $LANG01[93]);
    $theme->set_var('trademark_msg', $LANG01[94]);
    $theme->set_var('powered_by', $LANG01[95]);
    $theme->set_var('glfusion_url', 'http://www.glfusion.org/');
    $theme->set_var('glfusion_version', GVERSION);
    $theme->set_var('direction', empty($LANG_DIRECTION) ? 'ltr' : $LANG_DIRECTION);
    /* Check if an array has been passed that includes the name of a plugin
     * function or custom function.
     * This can be used to take control over what blocks are then displayed
     */
    if (is_array($custom)) {
        $function = $custom['0'];
        if (function_exists($function)) {
            $rblocks = $function($custom['1'], 'right');
        }
    } elseif ($rightblock == 1 || $_CONF['show_right_blocks'] == 1) {
        $rblocks = '';
        $rblocks = COM_showBlocks('right', $topic);
        if (empty($rblocks)) {
            $theme->set_var('glfusion_rblocks', '');
            $theme->set_var('right_blocks', '');
            if (empty($lblocks)) {
                // using full_content
                $theme->set_var('centercolumn', $uiStyles['full_content']['content_class']);
            } else {
                // using left_content
                $theme->set_var('centercolumn', $uiStyles['left_content']['content_class']);
                $theme->set_var('footercolumn-l', $uiStyles['left_content']['left_class']);
            }
        } else {
            $theme->set_var('glfusion_rblocks', $rblocks);
            if (empty($lblocks)) {
                // using content_right
                $theme->set_var('centercolumn', $uiStyles['content_right']['content_class']);
                $theme->set_var('footercolumn-r', $uiStyles['content_right']['right_class']);
            } else {
                // using left_content_right
                $theme->set_var('centercolumn', $uiStyles['left_content_right']['content_class']);
                $theme->set_var('footercolumn-l', $uiStyles['left_content_right']['left_class']);
                $theme->set_var('footercolumn-r', $uiStyles['left_content_right']['right_class']);
            }
        }
    } else {
        $theme->set_var('glfusion_rblocks', '');
        $theme->set_var('right_blocks', '');
        if (empty($lblocks)) {
            // using full content
            $theme->set_var('centercolumn', $uiStyles['full_content']['content_class']);
        } else {
            // using left_content
            $theme->set_var('centercolumn', $uiStyles['left_content']['content_class']);
            $theme->set_var('footercolumn-l', $uiStyles['left_content']['left_class']);
        }
    }
    if (!empty($lblocks)) {
        $theme->parse('left_blocks', 'leftblocks', true);
        $theme->set_var('glfusion_blocks', '');
    }
    if (!empty($rblocks)) {
        $theme->parse('right_blocks', 'rightblocks', true);
        $theme->set_var('glfusion_rblocks', '');
    }
    $exectime = $_PAGE_TIMER->stopTimer();
    $exectext = $LANG01[91] . ' ' . $exectime . ' ' . $LANG01[92];
    $theme->set_var('execution_time', $exectime);
    $theme->set_var('execution_textandtime', $exectext);
    $theme->set_var('content', $content);
    // grab header data from outputHandler
    $outputHandle = outputHandler::getInstance();
    $theme->set_var(array('meta-header' => $outputHandle->renderHeader('meta'), 'css-header' => $outputHandle->renderHeader('style'), 'js-header' => $outputHandle->renderHeader('script'), 'raw-header' => $outputHandle->renderHeader('raw')));
    if (SESS_isSet('glfusion.infoblock')) {
        $msgArray = @unserialize(SESS_getVar('glfusion.infoblock'));
        $msgTxt = COM_showMessageText($msgArray['msg'], '', $persist = false, $msgArray['type']);
        $theme->set_var('info_block', $msgTxt);
        SESS_unSet('glfusion.infoblock');
    }
    // Call to plugins to set template variables in the footer
    PLG_templateSetVars('header', $theme);
    PLG_templateSetVars('footer', $theme);
    // Actually parse the template and make variable substitutions
    $theme->parse('index_footer', 'footer');
    $tmp = $theme->finish($theme->parse('index_header', 'header'));
    echo $tmp;
    // send the header.thtml
    $retval = $theme->finish($theme->get_var('index_footer'));
    _js_out();
    _css_out();
    return $retval;
}
Ejemplo n.º 12
0
}
function displayReceipt()
{
    global $type, $size, $pizzaPrices;
    $price = $pizzaPrices[$type][$size];
    $tax = 0.0975 * (double) $price;
    $total = (double) $price + (double) $tax;
    $output = "<h1 >Thank you. Here is your receipt.</h1>\r\n                <table class='center'>\r\n                  <tr><td>\r\n                    <table>\r\n                    <tr><td class='center'>Kind of pizza</td><td class='center'>{$type}</td></tr>\r\n                    <tr><td class='center'>Size</td><td class='center'>{$size}</td></tr>\r\n                    <tr><td class='center'>Price</td><td class='center'>\$ " . number_format($price, 2, '.', ',') . "</td></tr>\r\n                    <tr><td class='center'>Tax</td><td class='center'>\$ " . number_format($tax, 2, '.', ',') . "</td></tr>\r\n                    <tr><td class='center'>Total</td><td class='center'>\$ " . number_format($total, 2, '.', ',') . "</td></tr>\r\n                    </table>\r\n                  </td></tr>\r\n                </table></br>\r\n                <form id='myform' method='POST' >\r\n                <h1><button type='submit' name='done'>Click to Pay Bill</button></h1>\r\n                </form>";
    print $output;
}
if (!isset($_SESSION["placeAnOrder"])) {
    $placeAnOrder = true;
    $_SESSION["placeAnOrder"] = $placeAnOrder;
    setPizzaArray();
    $_SESSION["pizzaPrices"] = $pizzaPrices;
    displayMenu();
    printOrderForm();
} else {
    if ($_SESSION["placeAnOrder"]) {
        global $type, $size;
        $pizzaPrices = $_SESSION["pizzaPrices"];
        $type = $_REQUEST["type"];
        $size = $_REQUEST["size"];
        displayReceipt();
        $placeAnOrder = false;
        $_SESSION["placeAnOrder"] = $placeAnOrder;
    } else {
        echo <<<HERE
                <h1>Thank you for your order!!</h1>
                <h3>Please refresh to continue.</h3>
HERE;
Ejemplo n.º 13
0
}
if (isset($header)) {
    if ($header) {
        ?>
<div data-role="header" data-theme="a">
<div data-role="controlgroup" data-type="horizontal" class="ui-btn-right" >
<?php 
        echo loginAnchor(null, null, null, null, $register);
        ?>
 </div>
<h1><?php 
        echo $heading;
        ?>
</h1>
<?php 
        echo displayMenu();
        ?>
</div>
<?php 
    } else {
        ?>

<center>
<h1><?php 
        echo $heading;
        ?>
</h1>
</center>
<?php 
    }
} else {
Ejemplo n.º 14
0
$html .= '<span class="title">Insalata Piccolo</span><br />' . "\n";
$html .= '<span class="descrip">Fresh Garden Salad</span>';
$html .= '</p>';
$html .= '<a href="#menuTitle" class="top">back to menu &uarr;</a>' . "\n";
$html .= '</div>' . "\n";
$html .= '<div class="menuContent" id="speciale">' . "\n";
$html .= '<h5>Piccolo Speciale</h5>' . "\n";
$html .= '<p>';
$html .= '<span class="title">Blackboard Selection</span><br />' . "\n";
$html .= '<span class="descrip">Check out our blackboard for the Chef\'s specials.</span>';
$html .= '</p>';
$html .= '<a href="#menuTitle" class="top">back to menu &uarr;</a>' . "\n";
$html .= '</div>';
$html .= '<div class="menuContent" id="pasta">' . "\n";
$html .= '<h5>Pasta</h5>' . "\n";
$html .= displayMenu($pasta);
$html .= '</div>';
$html .= '<div class="menuContent" id="dolci">' . "\n";
$html .= '<h5>Dolci</h5>' . "\n";
$html .= '<p>';
$html .= '<span class="title">Blackboard Selection</span><br />' . "\n";
$html .= '<span class="descrip">Check out our blackboard for dessert specials.</span>';
$html .= '</p>';
$html .= '<a href="#menuTitle" class="top">back to menu &uarr;</a>' . "\n";
$html .= '</div>';
$html .= '<div class="menuContent" id="bevande">' . "\n";
$html .= '<h5>Bevande</h5>' . "\n";
$html .= displayDrinks($bevande);
$html .= '</div>';
$html .= '<div class="menuContent" id="vino">' . "\n";
$html .= '<h5>Vino</h5>' . "\n";
Ejemplo n.º 15
0
/**
 * Processes loading of this sample code through a web browser.
 *
 * @return void
 */
function runWWWVersion()
{
    session_start();
    // Note that all calls to endHTML() below end script execution!
    // Check to make sure that the user has set a password.
    $p = LOGIN_PASSWORD;
    if (empty($p)) {
        startHTML(false);
        displayPasswordNotSetNotice();
        endHTML();
    }
    // Grab any login credentials that might be waiting in the request
    if (!empty($_POST['password'])) {
        if ($_POST['password'] == LOGIN_PASSWORD) {
            $_SESSION['authenticated'] = 'true';
        } else {
            // Invalid password. Stop and display a login screen.
            startHTML(false);
            requestUserLogin("Incorrect password.");
            endHTML();
        }
    }
    // If the user isn't authenticated, display a login screen
    if (!isset($_SESSION['authenticated'])) {
        startHTML(false);
        requestUserLogin();
        endHTML();
    }
    // Try to login. If login fails, log the user out and display an
    // error message.
    try {
        $client = getClientLoginHttpClient(GAPPS_USERNAME . '@' . GAPPS_DOMAIN, GAPPS_PASSWORD);
        $gapps = new Zend_Gdata_Gapps($client, GAPPS_DOMAIN);
    } catch (Zend_Gdata_App_AuthException $e) {
        session_destroy();
        startHTML(false);
        displayAuthenticationFailedNotice();
        endHTML();
    }
    // Success! We're logged in.
    // First we check for commands that can be submitted either though
    // POST or GET (they don't make any changes).
    if (!empty($_REQUEST['command'])) {
        switch ($_REQUEST['command']) {
            case 'retrieveUser':
                startHTML();
                retrieveUser($gapps, true, $_REQUEST['user']);
                endHTML(true);
            case 'retrieveAllUsers':
                startHTML();
                retrieveAllUsers($gapps, true);
                endHTML(true);
            case 'retrieveNickname':
                startHTML();
                retrieveNickname($gapps, true, $_REQUEST['nickname']);
                endHTML(true);
            case 'retrieveNicknames':
                startHTML();
                retrieveNicknames($gapps, true, $_REQUEST['user']);
                endHTML(true);
            case 'retrieveAllNicknames':
                startHTML();
                retrieveAllNicknames($gapps, true);
                endHTML(true);
            case 'retrieveEmailLists':
                startHTML();
                retrieveEmailLists($gapps, true, $_REQUEST['recipient']);
                endHTML(true);
            case 'retrieveAllEmailLists':
                startHTML();
                retrieveAllEmailLists($gapps, true);
                endHTML(true);
            case 'retrieveAllRecipients':
                startHTML();
                retrieveAllRecipients($gapps, true, $_REQUEST['emailList']);
                endHTML(true);
        }
    }
    // Now we handle the potentially destructive commands, which have to
    // be submitted by POST only.
    if (!empty($_POST['command'])) {
        switch ($_POST['command']) {
            case 'createUser':
                startHTML();
                createUser($gapps, true, $_POST['user'], $_POST['givenName'], $_POST['familyName'], $_POST['pass']);
                endHTML(true);
            case 'updateUserName':
                startHTML();
                updateUserName($gapps, true, $_POST['user'], $_POST['givenName'], $_POST['familyName']);
                endHTML(true);
            case 'updateUserPassword':
                startHTML();
                updateUserPassword($gapps, true, $_POST['user'], $_POST['pass']);
                endHTML(true);
            case 'setUserSuspended':
                if ($_POST['mode'] == 'suspend') {
                    startHTML();
                    suspendUser($gapps, true, $_POST['user']);
                    endHTML(true);
                } elseif ($_POST['mode'] == 'restore') {
                    startHTML();
                    restoreUser($gapps, true, $_POST['user']);
                    endHTML(true);
                } else {
                    header('HTTP/1.1 400 Bad Request');
                    startHTML();
                    echo "<h2>Invalid mode.</h2>\n";
                    echo "<p>Please check your request and try again.</p>";
                    endHTML(true);
                }
            case 'setUserAdmin':
                if ($_POST['mode'] == 'issue') {
                    startHTML();
                    giveUserAdminRights($gapps, true, $_POST['user']);
                    endHTML(true);
                } elseif ($_POST['mode'] == 'revoke') {
                    startHTML();
                    revokeUserAdminRights($gapps, true, $_POST['user']);
                    endHTML(true);
                } else {
                    header('HTTP/1.1 400 Bad Request');
                    startHTML();
                    echo "<h2>Invalid mode.</h2>\n";
                    echo "<p>Please check your request and try again.</p>";
                    endHTML(true);
                }
            case 'setForceChangePassword':
                if ($_POST['mode'] == 'set') {
                    startHTML();
                    setUserMustChangePassword($gapps, true, $_POST['user']);
                    endHTML(true);
                } elseif ($_POST['mode'] == 'clear') {
                    startHTML();
                    clearUserMustChangePassword($gapps, true, $_POST['user']);
                    endHTML(true);
                } else {
                    header('HTTP/1.1 400 Bad Request');
                    startHTML();
                    echo "<h2>Invalid mode.</h2>\n";
                    echo "<p>Please check your request and try again.</p>";
                    endHTML(true);
                }
            case 'deleteUser':
                startHTML();
                deleteUser($gapps, true, $_POST['user']);
                endHTML(true);
            case 'createNickname':
                startHTML();
                createNickname($gapps, true, $_POST['user'], $_POST['nickname']);
                endHTML(true);
            case 'deleteNickname':
                startHTML();
                deleteNickname($gapps, true, $_POST['nickname']);
                endHTML(true);
            case 'createEmailList':
                startHTML();
                createEmailList($gapps, true, $_POST['emailList']);
                endHTML(true);
            case 'deleteEmailList':
                startHTML();
                deleteEmailList($gapps, true, $_POST['emailList']);
                endHTML(true);
            case 'modifySubscription':
                if ($_POST['mode'] == 'subscribe') {
                    startHTML();
                    addRecipientToEmailList($gapps, true, $_POST['recipient'], $_POST['emailList']);
                    endHTML(true);
                } elseif ($_POST['mode'] == 'unsubscribe') {
                    startHTML();
                    removeRecipientFromEmailList($gapps, true, $_POST['recipient'], $_POST['emailList']);
                    endHTML(true);
                } else {
                    header('HTTP/1.1 400 Bad Request');
                    startHTML();
                    echo "<h2>Invalid mode.</h2>\n";
                    echo "<p>Please check your request and try again.</p>";
                    endHTML(true);
                }
        }
    }
    // Check for an invalid command. If so, display an error and exit.
    if (!empty($_REQUEST['command'])) {
        header('HTTP/1.1 400 Bad Request');
        startHTML();
        echo "<h2>Invalid command.</h2>\n";
        echo "<p>Please check your request and try again.</p>";
        endHTML(true);
    }
    // If a menu parameter is available, display a submenu.
    if (!empty($_REQUEST['menu'])) {
        switch ($_REQUEST['menu']) {
            case 'user':
                startHTML();
                displayUserMenu();
                endHTML();
            case 'nickname':
                startHTML();
                displayNicknameMenu();
                endHTML();
            case 'emailList':
                startHTML();
                displayEmailListMenu();
                endHTML();
            case 'logout':
                startHTML(false);
                logout();
                endHTML();
            default:
                header('HTTP/1.1 400 Bad Request');
                startHTML();
                echo "<h2>Invalid menu selection.</h2>\n";
                echo "<p>Please check your request and try again.</p>";
                endHTML(true);
        }
    }
    // If we get this far, that means there's nothing to do. Display
    // the main menu.
    // If no command was issued and no menu was selected, display the
    // main menu.
    startHTML();
    displayMenu();
    endHTML();
}
Ejemplo n.º 16
0
/**
 * Processes loading of this sample code through a web browser.
 */
function runWWWVersion()
{
    session_start();

    // Note that all calls to endHTML() below end script execution!

    global $_SESSION, $_GET;
    if (!isset($_SESSION['docsSampleSessionToken']) && !isset($_GET['token'])) {
        requestUserLogin('Please login to your Google Account.');
    } else {
        $client = getAuthSubHttpClient();
        $docs = new Zend_Gdata_Docs($client);

        // First we check for commands that can be submitted either though
        // POST or GET (they don't make any changes).
        if (!empty($_REQUEST['command'])) {
            switch ($_REQUEST['command']) {
                case 'retrieveAllDocuments':
                    startHTML();
                    retrieveAllDocuments($docs, true);
                    endHTML(true);
                case 'retrieveWPDocs':
                    startHTML();
                    retrieveWPDocs($docs, true);
                    endHTML(true);
                case 'retrieveSpreadsheets':
                    startHTML();
                    retrieveSpreadsheets($docs, true);
                    endHTML(true);
                case 'fullTextSearch':
                    startHTML();
                    fullTextSearch($docs, true, $_REQUEST['query']);
                    endHTML(true);
                    
            }
        }
    
        // Now we handle the potentially destructive commands, which have to
        // be submitted by POST only.
        if (!empty($_POST['command'])) {
            switch ($_POST['command']) {
                case 'uploadDocument':
                    startHTML();
                    uploadDocument($docs, true, 
                        $_FILES['uploadedFile']['name'], 
                        $_FILES['uploadedFile']['tmp_name']);
                    endHTML(true);
                case 'modifySubscription':
                    if ($_POST['mode'] == 'subscribe') {
                        startHTML();
                        endHTML(true);
                    } elseif ($_POST['mode'] == 'unsubscribe') {
                        startHTML();
                        endHTML(true);
                    } else {
                        header('HTTP/1.1 400 Bad Request');
                        startHTML();
                        echo "<h2>Invalid mode.</h2>\n";
                        echo "<p>Please check your request and try again.</p>";
                        endHTML(true);
                    }
            }
        }
    
        // Check for an invalid command. If so, display an error and exit.
        if (!empty($_REQUEST['command'])) {
            header('HTTP/1.1 400 Bad Request');
            startHTML();
            echo "<h2>Invalid command.</h2>\n";
            echo "<p>Please check your request and try again.</p>";
            endHTML(true);
        }
        // If a menu parameter is available, display a submenu.
    
        if (!empty($_REQUEST['menu'])) {
            switch ($_REQUEST['menu']) {
                case 'list':
                    startHTML();
                    displayListMenu();
                    endHTML();
                case 'query':
                    startHTML();
                    displayQueryMenu();
                    endHTML();
                case 'upload':
                    startHTML();
                    displayUploadMenu();
                    endHTML();
                case 'logout':
                    startHTML(false);
                    logout();
                    endHTML();
                default:
                    header('HTTP/1.1 400 Bad Request');
                    startHTML();
                    echo "<h2>Invalid menu selection.</h2>\n";
                    echo "<p>Please check your request and try again.</p>";
                    endHTML(true);
            }
        }
        // If we get this far, that means there's nothing to do. Display
        // the main menu.
        // If no command was issued and no menu was selected, display the
        // main menu.
        startHTML();
        displayMenu();
        endHTML();
    }
}
Ejemplo n.º 17
0
function phpblock_getMenu($arg1, $arg2)
{
    return displayMenu($arg2);
}
Ejemplo n.º 18
0
/**
 * Processes loading of this sample code through a web browser.  Uses AuthSub
 * authentication and outputs a list of a user's albums if succesfully
 * authenticated.
 *
 * @return void
 */
function processPageLoad()
{
    global $_SESSION, $_GET;
    if (!isset($_SESSION['sessionToken']) && !isset($_GET['token'])) {
        requestUserLogin('Please login to your Google Account.');
    } else {
        $client = getAuthSubHttpClient();
        if (!empty($_REQUEST['command'])) {
            switch ($_REQUEST['command']) {
                case 'retrieveSelf':
                    outputUserFeed($client, "default");
                    break;
                case 'retrieveUser':
                    outputUserFeed($client, $_REQUEST['user']);
                    break;
                case 'retrieveAlbumFeed':
                    outputAlbumFeed($client, $_REQUEST['user'], $_REQUEST['album']);
                    break;
                case 'retrievePhotoFeed':
                    outputPhotoFeed($client, $_REQUEST['user'], $_REQUEST['album'], $_REQUEST['photo']);
                    break;
            }
        }
        // Now we handle the potentially destructive commands, which have to
        // be submitted by POST only.
        if (!empty($_POST['command'])) {
            switch ($_POST['command']) {
                case 'addPhoto':
                    addPhoto($client, $_POST['user'], $_POST['album'], $_FILES['photo']);
                    break;
                case 'deletePhoto':
                    deletePhoto($client, $_POST['user'], $_POST['album'], $_POST['photo']);
                    break;
                case 'addAlbum':
                    addAlbum($client, $_POST['user'], $_POST['name']);
                    break;
                case 'deleteAlbum':
                    deleteAlbum($client, $_POST['user'], $_POST['album']);
                    break;
                case 'addComment':
                    addComment($client, $_POST['user'], $_POST['album'], $_POST['photo'], $_POST['comment']);
                    break;
                case 'addTag':
                    addTag($client, $_POST['user'], $_POST['album'], $_POST['photo'], $_POST['tag']);
                    break;
                case 'deleteComment':
                    deleteComment($client, $_POST['user'], $_POST['album'], $_POST['photo'], $_POST['comment']);
                    break;
                case 'deleteTag':
                    deleteTag($client, $_POST['user'], $_POST['album'], $_POST['photo'], $_POST['tag']);
                    break;
                default:
                    break;
            }
        }
        // If a menu parameter is available, display a submenu.
        if (!empty($_REQUEST['menu'])) {
            switch ($_REQUEST['menu']) {
                case 'user':
                    displayUserMenu();
                    break;
                case 'photo':
                    displayPhotoMenu();
                    break;
                case 'album':
                    displayAlbumMenu();
                    break;
                case 'logout':
                    logout();
                    break;
                default:
                    header('HTTP/1.1 400 Bad Request');
                    echo "<h2>Invalid menu selection.</h2>\n";
                    echo "<p>Please check your request and try again.</p>";
            }
        }
        if (empty($_REQUEST['menu']) && empty($_REQUEST['command'])) {
            displayMenu();
        }
    }
}
Ejemplo n.º 19
0
    ?>
                    </p>
                  <?php 
}
?>
                </div>
            </div>
            <?php 
if (isset($_SESSION['user'])) {
    ?>
            <!-- le sous menu quand il est connecter -->
            <div class="row">
                <div class="col-md-12">
                    <ul class="menu nav nav-pills " role="tablist">
                        <?php 
    displayMenu($base, $menus, "profil");
    ?>
                    </ul>
                  <?php 
}
?>
                </div>
            </div>
        </div>
    </header>

    <!-- Le fil d'arriane des pages -->
    <div class="container">
      <div class="row">
        <div class="col-md-12">
          <ol class="breadcrumb">