Esempio n. 1
0
function printPageListWithNavAlt($prevtext, $nexttext, $nextprev = true, $class = NULL, $id = "pagelist")
{
    echo "<div" . ($id ? " id=\"{$id}\"" : "") . " class=\"{$class}\">";
    $total = getTotalPages();
    $current = getCurrentPage();
    echo "\n<ul class=\"{$class}\"><li>[</li>";
    for ($i = 1; $i <= $total; $i++) {
        echo "\n  <li" . ($i == $current ? " class=\"current\"" : "") . ">";
        printLinkHTML(getPageURL($i), $i, "Page {$i}" . ($i == $current ? " (Current Page)" : ""));
        echo "</li>";
    }
    echo "\n<li>]</li>";
    if ($nextprev) {
        echo "\n  <li class=\"prev\">";
        printPrevPageURL($prevtext, "Previous Page");
        echo "</li>";
    }
    echo "\n<li></li>";
    if ($nextprev) {
        echo "\n  <li class=\"next\">";
        printNextPageURL($nexttext, "Next Page");
        echo "</li>";
    }
    echo "\n</ul>";
    echo "\n</div>\n";
}
Esempio n. 2
0
/**
 * Add a page to the Sitemap and start adding the children
 */
function addWebsite($startNode, &$map)
{
    global $c, $variations;
    $childs = createDBCArray("sitemap", "MENU_ID", "PARENT_ID=" . $startNode . " AND VERSION=10 AND DELETED=0");
    for ($i = 0; $i < count($childs); $i++) {
        for ($j = 0; $j < count($variations); $j++) {
            if (!isMenuExpired($childs[$i], $variations[$j])) {
                $url = $c["livehost"] . $c["livedocroot"] . getPageURL($childs[$i], $variations[$j]);
                $map->AddURL($url);
            }
            addWebsite($childs[$i], $map);
        }
    }
}
Esempio n. 3
0
        if ($imagePage = isImagePage()) {
            ?>
 					<div id="flash">
 					<p align=center><font color=#663300><?php 
            echo gettext('For the best viewing experience') . ' ';
            ?>
<a href="http://www.macromedia.com/go/getflashplayer/"><?php 
            echo gettext('get Adobe Flash.');
            ?>
</a></p>
 					<p align="center"><a href="
 					<?php 
            if ($imagePage) {
                $url = html_encode(getPageURL(getTotalPages(true)));
            } else {
                $url = html_encode(getPageURL(getCurrentPage()));
            }
            if (substr($url, -1, 1) == '/') {
                $url = substr($url, 0, strlen($url) - 1);
            }
            echo $url = $url . (MOD_REWRITE ? "?" : "&amp;") . 'noflash';
            ?>
">
 					View gallery without Flash</a>.</p>
 					</div> <!-- flash -->
 					<?php 
            $flash_url = "index.php?p=search" . html_encode(getSearchParams()) . "&amp;format=xml";
            ?>
 					<script type="text/javascript">
 						// <!-- <![CDATA[
						var fo = new SWFObject("<?php 
Esempio n. 4
0
        $iw = NULL;
        $ih = 89;
        $ch = 89;
        $cw = 67;
    }
    echo "\n<li class=\"thumb\"><span><em style=\"background-image:url(" . htmlspecialchars($_zp_current_image->getCustomImage(NULL, $iw, $ih, $cw, $ch, NULL, NULL, true)) . '); "><a href="' . htmlspecialchars(getImageLinkURL()) . '" title="' . getAnnotatedImageTitle() . '" style="background:#fff;">"' . getImageTitle() . '"</a></em></span></li>';
}
if (!is_null($lastImage) && $lastImage < getNumImages()) {
    $np = getCurrentPage() + 1;
    ?>
			<li class="thumb"><span class="forward"><em style="background-image:url('<?php 
    echo $_zp_themeroot;
    ?>
/images/moreslide_next.gif');">
			<a href="<?php 
    echo htmlspecialchars(getPageURL($np, $np));
    ?>
" style="background:#fff;"><?php 
    echo gettext('Next page');
    ?>
</a></em></span></li>
		<?php 
}
?>
	</ul>

	<div class="galleryinfo">
		<p>Feed for this album: <?php 
printRSSLink('Album', '', '', '', true, 'i');
?>
</p>
Esempio n. 5
0
 function characterData($parser, $data)
 {
     global $data_row;
     global $currentTag;
     global $check2;
     global $title_row;
     global $w;
     global $postGisQueryFieldLink;
     global $postGisQueryLinkTarget;
     global $postGisQueryContentLink;
     global $postGisQueryDataPrefix;
     global $postGisQueryLinkStyle;
     global $postGisGetPlanUrl;
     global $postGisQueryReference;
     global $postGisQueryCustomFunction;
     global $table_title;
     global $postGisQueryUrlEncode;
     global $gid;
     global $the_geom;
     global $iLangID;
     global $postgisObject;
     if ($currentTag == "GID") {
         $gid = $data;
     }
     if ($check2 == true && ($currentTag != "GID" && $currentTag != "FID")) {
         if ($postGisQueryCustomFunction[$table_title][$currentTag]) {
             $data = altValue($data);
         }
         if ($postGisQueryReference[$table_title][$currentTag]) {
             $__array = explode(",", $postGisQueryReference[$table_title][$currentTag]);
             $data = $postgisObject->referenceTableLookup($__array[0], $__array[1], $__array[2], $data);
         }
         if ($postGisQueryFieldLink[$table_title][$currentTag] == "" && $postGisQueryContentLink[$table_title] != $currentTag && $postGisGetPlanUrl[$table_title] != $currentTag && $postGisQueryUrlEncode[$table_title][$currentTag] == "") {
             $data_row = $data_row . "<td class='output-table-cell'>" . $data . "</td>";
         }
         if ($postGisQueryFieldLink[$table_title][$currentTag] != "" && $postGisGetPlanUrl[$table_title] != true) {
             $data_row = $data_row . "<td class='output-table-cell'><a " . $postGisQueryLinkStyle[$table_title] . " " . $postGisQueryLinkTarget[$table_title] . " href='" . $postGisQueryFieldLink[$table_title][$currentTag] . "?table=" . $table_title . "&gid=" . $gid . "'>" . $data . "</a></td>";
         }
         if ($postGisQueryContentLink[$table_title] == $currentTag && $postGisGetPlanUrl[$table_title] != $currentTag) {
             $newData = "<a " . $postGisQueryLinkStyle[$table_title] . " href='" . $postGisQueryDataPrefix[$table_title] . urldecode($data) . "' " . $postGisQueryLinkTarget[$table_title] . ">" . urldecode($data) . "</a>";
             $data = $newData;
             $data_row = $data_row . "<td class='output-table-cell'>" . $data . "</td>";
             //echo "<script>alert(\"$newData\");</script>";
         }
         if ($postGisQueryUrlEncode[$table_title][$currentTag] && $postGisQueryContentLink[$table_title] != $currentTag) {
             $newData = urldecode($data);
             $data = $newData;
             $data_row = $data_row . "<td class='output-table-cell'>" . $data . "</td>";
         }
         if ($postGisGetPlanUrl[$table_title] == $currentTag && $postGisGetPlanUrl[$table_title] != "") {
             $arrContentInfo = getPlanContentInfoByKeyValue($data);
             $newData = "<a " . $postGisQueryLinkStyle[$table_title] . " href='" . getPageURL($arrContentInfo["IPAGEID"], $iLangID) . "' " . $postGisQueryLinkTarget[$table_title] . ">{$data}</a>";
             $data = $newData;
             $data_row = $data_row . "<td class='output-table-cell'>" . $data . "</td>";
         }
         $check2 = false;
     }
 }
Esempio n. 6
0
			<div id="flash">
					<p align="center">
			<font color=#663300><?php 
                echo gettext('For the best viewing experience') . ' ';
                ?>
<a href="http://www.macromedia.com/go/getflashplayer/"><?php 
                echo gettext('Get Adobe Flash.');
                ?>
</a></font>
			</p>
						<p align="center">
 						<?php 
                if ($imagePage) {
                    $url = htmlspecialchars(getPageURL(getTotalPages(true)));
                } else {
                    $url = htmlspecialchars(getPageURL(getCurrentPage()));
                }
                printLinkWithQuery($url, 'noflash', gettext('View Gallery Without Flash'));
                echo "</p>";
                $flash_url = htmlspecialchars(getAlbumLinkURL());
                if (substr($flash_url, -1, 1) == '/') {
                    $flash_url = substr($flash_url, 0, -1);
                }
                $flash_url = $flash_url . (getOption("mod_rewrite") ? "?" : "&amp;") . "format=xml";
                ?>
 						<script type="text/javascript">
									var fo = new SWFObject("<?php 
                echo $_zp_themeroot;
                ?>
/simpleviewer.swf", "viewer", "100%", "100%", "7", "<?php 
                echo $backgroundColor;
	// synchronize.... because new feature
	if (countRows("sitepage_names", "SPID", "SPID = $spid AND VARIATION_ID = $variation") < 1) {
		$sql = "INSERT INTO sitepage_names (SPID, VARIATION_ID) VALUES ($spid, $variation)";

		$query = new query($db, $sql);
		$query->free();
	}

	$menuPanel->add($switchbar);
	$menuPanel->add(new Cell('clc', '', 3, 600,10));
	$menuPanel->add(new SubTitle("st", $lang->get("sp_menuprops"), 3));
	$menuPanel->add(new Cell('clc', '', 3, 600,10));
	$menuPanel->add(new TextInput($lang->get("sp_menuname"), "sitepage_names", "NAME", "VARIATION_ID = $variation AND SPID = $spid", "type:text,size:128,width:300", ""));
	$menuPanel->add(new TextInput($lang->get("sp_menudescription", "Page Description (for sitemap...)"), "sitepage_names","HELP", "VARIATION_ID = $variation AND SPID = $spid", "type:textarea,size:5,width:400", ""));
	$menuPanel->add(new Label('lbl', $lang->get('url', 'URL'), 'standard',1));
	$uri = getPageURL($menuID, $variation);
	if (file_exists($c["livepath"].$uri)) {
		$menuPanel->add(new Label('lbl', '<a href="'.$c["host"].$c["livedocroot"].$uri.'" target="_blank">'.$c["host"].$c["livedocroot"].$uri.'</a>', 'standardlight',2));
	} else {		
		$menuPanel->add(new Label('lbl', $c["host"].$c["livedocroot"].$uri, 'standardlight',2));		
	}
	
	if ($aclf->checkAccessToFunction("DIRECT_URL")) {		
		$menuPanel->add(new Cell('clc', '', 3, 600,10));
		$menuPanel->add(new SubTitle("st", $lang->get("sp_menudirecttitle", "Define optional Path on server for direct access"), 3));
		$menuPanel->add(new Cell('clc', '', 3, 600,10));
		$durl = new TextInput($lang->get("sp_menudirect", "Direct url on Live Server"), "sitepage_names", "DIRECT_URL", "VARIATION_ID=$variation AND VERSION=0 AND SPID = " . $spid, "type:text,size:64;width:300", "UNIQUE");
		$durl->setFilter("VERSION=0");
		$menuPanel->add($durl);
	}
Esempio n. 8
0
        $iw = NULL;
        $ih = 89;
        $ch = 89;
        $cw = 67;
    }
    echo "\n<li class=\"thumb\"><span><em style=\"background-image:url(" . html_encode($_zp_current_image->getCustomImage(NULL, $iw, $ih, $cw, $ch, NULL, NULL, true)) . '); "><a href="' . html_encode(getImageLinkURL()) . '" title="' . getAnnotatedImageTitle() . '" style="background:#fff;">"' . getImageTitle() . '"</a></em></span></li>';
}
if (!is_null($lastImage) && $lastImage < getNumImages()) {
    $np = getCurrentPage() + 1;
    ?>
			<li class="thumb"><span class="forward"><em style="background-image:url('<?php 
    echo $_zp_themeroot;
    ?>
/images/moreslide_next.gif');">
			<a href="<?php 
    echo html_encode(getPageURL($np, $np));
    ?>
" style="background:#fff;"><?php 
    echo gettext('Next page');
    ?>
</a></em></span></li>
		<?php 
}
?>
	</ul>

	<div class="galleryinfo">
		<?php 
$params = $_zp_current_search->getSearchParams();
if (!empty($params)) {
    if ($results != "0") {
Esempio n. 9
0
        ?>
" ><span class="next"></span></a>
			<?php 
    } else {
        ?>
				<span class="next-disabled"></span>		
			<?php 
    }
}
?>
		</div>
	</div>
</div>

<div id="credit"><?php 
printRSSLink('News', '', 'News RSS', '', false);
?>
 | <a href="<?php 
echo getCustomPageURL("archive");
?>
">Archives</a> | <a href="<?php 
echo getPageURL('credits');
?>
">Credits</a> | Powered by <a href="http://www.zenphoto.org" title="A simpler web photo album">zenphoto</a></div>

<?php 
zp_apply_filter('theme_body_close');
?>
</body>
</html>
/**
 * Prints the url to a specific zenpage page
 *
 * @param string $linktext Text for the URL
 * @param string $titlelink page to include in URL
 * @param string $prev text to insert before the URL
 * @param string $next text to follow the URL
 * @param string $class optional class
 */
function printPageURL($linktext = NULL, $titlelink = NULL, $prev = '', $next = '', $class = NULL)
{
    if (!is_null($class)) {
        $class = 'class="' . $class . '"';
    }
    if (is_null($linktext)) {
        $linktext = getPageTitle();
    }
    echo $prev . "<a href=\"" . html_encode(getPageURL($titlelink)) . "\" {$class} title=\"" . html_encode($linktext) . "\">" . html_encode($linktext) . "</a>" . $next;
}
Esempio n. 11
0
/**
 * @deprecated
 * @since 1.4.6
 */
function getPageLinkURL($titlelink = '')
{
    deprecated_functions::notify(gettext('use getPageURL()'));
    return getPageURL($titlelink);
}
Esempio n. 12
0
	/**
	 * Clear the page with URL-Path
	 * 
	 * @param integer SitepageId of the page
	 * @param integer VariationId of the page
	 */
	function clearURLPage($spid, $variation) {
		global $c;

		$menuId = getDBCell("sitepage", "MENU_ID", "SPID=".$spid);
	    $short = getPageURL($menuId, $variation);
		if (substr($short, 0, 1) == "/")
			$short = substr($short, 1);

		$allDir = $c["livepath"];
		// ensure that path exists
		$directories = explode("/", $short);

		if (count($directories) > 0) {
			for ($i = 0; $i < count($directories); $i++) {
				$thisDir = $directories[$i];

				if ($thisDir != "") {
					$allDir = $allDir . $thisDir . "/";
				}
			}

			// delete old index file 
			if (file_exists($allDir . "index.php")) {
				nxDelete ($allDir, "index.php");
			}

			// create new index-file...
			global $c;
			$index = '<html>';
			$index .= '<head>';
			$index .= '<title>Page does not exist</title>';
			$index .= '<meta name="generator" content="N/X WCMS">';
			$index .= '</head>';
			$index .= '<body text="#000000" bgcolor="#FFFFFF" link="#FF0000" alink="#FF0000" vlink="#FF0000">';
			$index .= '<center>';
			$index .= '<font face="VERDANA" size="2">';
			$index .= 'The URL you entered is not available at present.<br>';
			$index .= 'Please try again later or go to <a href="' . $c["livedocroot"] . '">Startpage</a>.';
			$index .= '</font>';
			$index .= '</center>';
			$index .= '</body>';
			$index .= '</html>';

			// write to disk 
			$index_file = @fopen($allDir . "index.php", "w");
			@fwrite($index_file, $index);
			@fclose ($index_file);
		}	
	}
/**
 * Prints a full page navigation including previous and next page links with a list of all pages in between.
 *
 * @param string $prevtext Insert here the linktext like 'previous page'
 * @param string $nexttext Insert here the linktext like 'next page'
 * @param bool $oneImagePage set to true if there is only one image page as, for instance, in flash themes
 * @param string $nextprev set to true to get the 'next' and 'prev' links printed
 * @param string $class Insert here the CSS-class name you want to style the link with (default is "pagelist")
 * @param string $id Insert here the CSS-ID name if you want to style the link with this
 * @param bool $firstlast Add links to the first and last pages of you gallery
 * @param int $navlen Number of navigation links to show (0 for all pages). Works best if the number is odd.
 */
function printPageListWithNav($prevtext, $nexttext, $oneImagePage = false, $nextprev = true, $class = 'pagelist', $id = NULL, $firstlast = true, $navlen = 9)
{
    $total = getTotalPages($oneImagePage);
    $current = getCurrentPage();
    if ($total < 2) {
        $class .= ' disabled_nav';
    }
    if ($navlen == 0) {
        $navlen = $total;
    }
    $extralinks = 2;
    if ($firstlast) {
        $extralinks = $extralinks + 2;
    }
    $len = floor(($navlen - $extralinks) / 2);
    $j = max(round($extralinks / 2), min($current - $len - (2 - round($extralinks / 2)), $total - $navlen + $extralinks - 1));
    $ilim = min($total, max($navlen - round($extralinks / 2), $current + floor($len)));
    $k1 = round(($j - 2) / 2) + 1;
    $k2 = $total - round(($total - $ilim) / 2);
    echo "<div" . ($id ? " id=\"{$id}\"" : "") . " class=\"{$class}\">\n";
    echo "<ul class=\"{$class}\">\n";
    if ($nextprev) {
        echo "<li class=\"prev\">";
        printPrevPageLink($prevtext, gettext("Previous Page"));
        echo "</li>\n";
    }
    if ($firstlast) {
        echo '<li class="' . ($current == 1 ? 'current' : 'first') . '">';
        if ($current == 1) {
            echo '1';
        } else {
            printLink(getPageURL(1, $total), 1, gettext("Page 1"));
        }
        echo "</li>\n";
        if ($j > 2) {
            echo "<li>";
            printLink(getPageURL($k1, $total), $j - 1 > 2 ? '...' : $k1, sprintf(ngettext('Page %u', 'Page %u', $k1), $k1));
            echo "</li>\n";
        }
    }
    for ($i = $j; $i <= $ilim; $i++) {
        echo "<li" . ($i == $current ? " class=\"current\"" : "") . ">";
        if ($i == $current) {
            $title = sprintf(ngettext('Page %1$u (Current Page)', 'Page %1$u (Current Page)', $i), $i);
            echo $i;
        } else {
            $title = sprintf(ngettext('Page %1$u', 'Page %1$u', $i), $i);
            printLink(getPageURL($i, $total), $i, $title);
        }
        echo "</li>\n";
    }
    if ($i < $total) {
        echo "<li>";
        printLink(getPageURL($k2, $total), $total - $i > 1 ? '...' : $k2, sprintf(ngettext('Page %u', 'Page %u', $k2), $k2));
        echo "</li>\n";
    }
    if ($firstlast && $i <= $total) {
        echo "\n  <li class=\"last\">";
        if ($current == $total) {
            echo $total;
        } else {
            printLink(getPageURL($total, $total), $total, sprintf(ngettext('Page {%u}', 'Page {%u}', $total), $total));
        }
        echo "</li>";
    }
    if ($nextprev) {
        echo "<li class=\"next\">";
        printNextPageLink($nexttext, gettext("Next Page"));
        echo "</li>\n";
    }
    echo "</ul>\n";
    echo "</div>\n";
}
Esempio n. 14
0
	/**
	 * returns the uri for this menu-item
	 * @param array additional parameters, use: array('varname1'=>'value1', 'varname2'=>'value2'), the routine encodes the values with rawurlencode (RFC 1738), using array('value1','value2') results in '&var0=value1&var1=value2'
	 * @return string uri for menu-item.
	 */
	function getLink($addparas = null) {
		global $c;

		$sessionid = $addparas[$c["sessionidname"]];
		$sessionid = ($sessionid != "") ? $sessionid : value($c["sessionidname"], "NOSPACES");
		$linkadd = ($sessionid != "" && $sessionid != "0") ? ('&' . $c["sessionidname"] . '=' . $sessionid) : "";

		if (is_array($addparas)) {
			foreach ($addparas as $key => $value) {
				if ($key != $c["sessionidname"])
					$linkadd .= '&' . ((is_int($key)) ? 'var' . $key : $key) . '=' . rawurlencode($value);
			}
		}
				
		
		if ($this->level == 10) { // Live-Version			
			$cached = getDBCell("sitemap", "IS_CACHED", "MENU_ID = $this->menuId");

			if (!$c["classicurls"]) {
			  return $c["docroothtml"].getPageURL($this->menuId, $this->variation);
			} else {
				if ($c["renderstatichtml"] && ($cached == 1)) {
					$spname = getSPNameUrlSafe($this->pageId);
					$link_uri = $c["cachedocroot"] . $spname . "_" . $this->pageId . "_v" . $this->variation . ".html";

					return ($link_uri);
				} else {
					$template = $this->getTemplate();
					$link_uri = $c["docroothtml"] . $template . "?page=" . $this->pageId . "&v=" . $this->variation;
					return ($link_uri . $linkadd);
				}
			}
		} else { // Development- (Template-) Version
			$template = $this->getTemplate();
			$link_uri = $c["devdocroot"] . $template . "?page=" . $this->pageId . "&v=" . $this->variation;
			return ($link_uri . $linkadd);
		}
	}
Esempio n. 15
0
 function displayDefaultCategories()
 {
     $categories = modApiFunc("Catalog", "getSubcategoriesFullListWithParent", 1, false);
     $_Cat_Info = new CCategoryInfo(1);
     // Category Info get for Home Category
     $countOfSubCategory = $_Cat_Info->getCategoryTagValue('subcategoriesnumber') + 1;
     //Count total number of item in the subcategory of Home category
     $slicedcats = array_slice($categories, 0, $countOfSubCategory);
     $count = count($categories);
     $value = "";
     foreach ($slicedcats as $category) {
         if ($category['level'] == 0 || $category['level'] == 1) {
             $catid = $category["id"];
             $catmainlink = getCategoryLink($catid);
             $cathomelink = getPageURL('Categories {1}');
             $value .= "<li>";
             if ($catid == 1) {
                 $value .= "<a href='{$cathomelink}' class='parent'><span>" . $category['name'] . "</span></a>\n\t\t\t\t\t    <div><ul>";
             } else {
                 $value .= "<a href='{$catmainlink}' class='parent'><span>" . $category['name'] . "</span></a>\n\t\t\t\t\t    <div><ul>";
             }
             if (modApiFunc("Catalog", "hasOnlineSubcategories", $category['id']) && $category['level'] > 0) {
                 $value .= $this->defaultsubcatlevel($category['id'], 1);
                 // Looping for subcategories
             }
             $value .= "</ul></div></li>";
         }
     }
     return $value;
 }
<?php

session_start();
if (!isset($_SESSION["username"])) {
    $isRememberedLogin = "";
    //Test for remember me cookie
    if (isset($_COOKIE['sg_timesheetUN'], $_COOKIE['sg_timesheetPW'])) {
        $username = $_COOKIE['sg_timesheetUN'];
        //Look for username row
        $result = preparedStmt("SELECT username, password, level, enabled, salt FROM users WHERE username=?", array("s", $username));
        $userData = $result ? $result[0] : 0;
        if ($userData) {
            if ($userData['enabled']) {
                $cookieHash = hash('sha256', $userData['password'] . "{" . $userData['salt'] . "}");
                //Hash of pw hash+salt
                if ($cookieHash == $_COOKIE['sg_timesheetPW']) {
                    $isRememberedLogin = true;
                    createUserSession($username, $userData['level']);
                }
            }
        }
    }
    if (!$isRememberedLogin) {
        $_SESSION["deniedURL"] = getPageURL();
        header("Location:login_page.php");
        exit;
    }
}
/**
 * Prints a full page navigation including previous and next page links with a list of all pages in between.
 *
 * @param string $prevtext Insert here the linktext like 'previous page'
 * @param string $nexttext Insert here the linktext like 'next page'
 * @param bool $oneImagePage set to true if there is only one image page as, for instance, in flash themes
 * @param string $nextprev set to true to get the 'next' and 'prev' links printed
 * @param string $class Insert here the CSS-class name you want to style the link with (default is "pagelist")
 * @param string $id Insert here the CSS-ID name if you want to style the link with this
 */
function printPageListWithNav($prevtext, $nexttext, $oneImagePage = false, $nextprev = true, $class = 'pagelist', $id = NULL)
{
    $total = getTotalPages($oneImagePage);
    if ($total < 2) {
        $class .= ' disabled_nav';
    }
    echo "<div" . ($id ? " id=\"{$id}\"" : "") . " class=\"{$class}\">";
    $current = getCurrentPage();
    echo "\n<ul class=\"{$class}\">";
    if ($nextprev) {
        echo "\n  <li class=\"prev\">";
        printPrevPageLink($prevtext, gettext("Previous Page"));
        echo "</li>";
    }
    $j = max(1, min($current - 3, $total - 6));
    if ($j != 1) {
        echo "\n <li>";
        printLink(getPageURL($k = max($j - 4, 1), $total), '...', "Page {$k}");
        echo '</li>';
    }
    for ($i = $j; $i <= min($total, $j + 6); $i++) {
        echo "\n  <li" . ($i == $current ? " class=\"current\"" : "") . ">";
        printLink(getPageURL($i, $total), $i, "Page {$i}" . ($i == $current ? ' ' . gettext("(Current Page)") : ""));
        echo "</li>";
    }
    if ($i <= $total) {
        echo "\n <li>";
        printLink(getPageURL($k = min($j + 10, $total), $total), '...', "Page {$k}");
        echo '</li>';
    }
    if ($nextprev) {
        echo "\n  <li class=\"next\">";
        printNextPageLink($nexttext, gettext("Next Page"));
        echo "</li>";
    }
    echo "\n</ul>";
    echo "\n</div>\n";
}
Esempio n. 18
0
 function jpcacheFilename($spid, $variation)
 {                        
     global $c;
 	$menu = getDBCell("sitepage", "MENU_ID", "SPID=".$spid);
 	$varkey = 'GET=N;';
 	$name = $c['livedocroot'].getPageURL($menu, $variation).'/index.php';    	
 	$key = md5($name.$varkey);
     return $key;
 }
Esempio n. 19
0
     $parameters[2]->Value = "12/31/2003";
     $parameters[3] = new ParameterValue();
     $parameters[3]->Name = "ProductSubcategory";
     $parameters[3]->Value = "2";
     $rs->SetExecutionParameters2($parameters);
 }
 $renderAsHTML = new RenderAsHTML();
 //The ReplcementRoot option of HTML rendering extension is used to
 //redirect all calls to reporting serice server to this php file.
 //The StreamRoot option of HTML rendering extension used instruct
 //HTML rendering extension about how to construct the URLs to images in the
 //report.
 //Please refer description of Sort2, Render2 and RenderStream API in
 //the userguide (./../../../docs/User Guide.html) for more details
 //about these options.
 $renderAsHTML->ReplacementRoot = getPageURL();
 $renderAsHTML->StreamRoot = './images/';
 $result_html = $rs->Render2($renderAsHTML, PageCountModeEnum::$Actual, $Extension, $MimeType, $Encoding, $Warnings, $StreamIds);
 foreach ($StreamIds as $StreamId) {
     $renderAsHTML->StreamRoot = null;
     $result_png = $rs->RenderStream($renderAsHTML, $StreamId, $Encoding, $MimeType);
     if (!($handle = fopen("./images/" . $StreamId, 'wb'))) {
         echo "Cannot open file for writing output";
         exit;
     }
     if (fwrite($handle, $result_png) === FALSE) {
         echo "Cannot write to file";
         exit;
     }
     fclose($handle);
 }
Esempio n. 20
0
	function listVM(keyword, sort){
		sort = sort || "label";

		$("#vm-list").html("");
		$(".progress").show();

		$.post("?q=list-vm.json", {keyword: keyword, sort: sort }, function(data){
			$(".progress").hide();

			if(!data.length){
				$("#vm-list").html(\'<p class="red">' . THERE_ARE_NO_RESULTS_FOUND . '</p>\');
				return;
			}

			$.each(data, function(i, item){
				var li = $("<li />").html(\'<span></span><ul><li style="width:18px;"><img src="images/icons/\' + item.status + \'.png" class="icon" /></li><li style="width:18px;display:none;"><div class="loading" style="margin:10px 0 0 0;"></div><li><li style="width:295px;" onclick="window.location.href=\\\'?q=view-vm&id=\' + item.id + \'&ref=' . rawurlencode(getPageURL()) . '\\\';">\' + item.label + \'</li><li style="width:40px;"><span class="\' + item.vz + \'">\' + item.vz + \'</span></li><li><button class="boot">' . BOOT . '</button> <button class="reboot">' . REBOOT . '</button> <button class="shutdown">' . SHUTDOWN . '</button></li><li style="display:none;"><div class="loading" style="margin:10px 0 0 100px;"></div><li></ul><div style="clear:both;"></div>\').attr("data-field", item.id);

				$("#vm-list").append(li);

				li.find(".icon").click(function(){
					var img = $(this);
					var p = img.parent();
					var n = p.next();

					p.hide();
					n.show();

					$.post("?q=status.json", {id: item.id}, function(data){
						$(img).attr("src", "images/icons/" + data.status + ".png");
						p.show();
						n.hide();
Esempio n. 21
0
	/**
	 * Get the nice URL of an channel-article
	 *
	 * @param integer $articleId
	 * @param integer $v - VariationId		
	 */
	function getArticleURL($articleId, $v) {
	  global $lang;
	  $cat = getDBCell('channel_articles', 'CH_CAT_ID', "ARTICLE_ID = ".$articleId);	  
	  $name = getDBCell('channel_articles', 'TITLE', "ARTICLE_ID = ".$articleId);	  
	  $catname = getDBCell('channel_categories', 'NAME', 'CH_CAT_ID='.$cat);
	  $spid = getDBCell('channel_categories', 'PAGE_ID', 'CH_CAT_ID='.$cat);
	  if ($spid != "") {
	    $spid = getDBCell("state_translation", "OUT_ID", "IN_ID=$spid AND LEVEL=10");
	    if ($spid != "") {
	      $menuId = getDBCell('sitepage', 'MENU_ID', 'SPID='.$spid);
	      $result = getPageURL($menuId, $v);
	      $result.='/'.makeURLSave($catname);
	      $result.='/'.makeURLSave($name);
	    } else {
	    	$result = $lang->get('url_disp_later', 'The URL will be displayed after the linked template was launched.');
	    }
	  }
	  return $result;		
	}
Esempio n. 22
0
function orderingUrlSuffix()
{
    $PHP_SELF = getPageURL();
    $PHP_SELF = trim($PHP_SELF, "&");
    if ($PHP_SELF[strlen($PHP_SELF) - 1] != '?') {
        $PHP_SELF .= strstr($PHP_SELF, '?') ? "&" : "?";
    }
    $pattern = '/so=(\\w+)&/i';
    $orderingUrlSuffix = preg_replace($pattern, "", $PHP_SELF);
    $pattern = '/sb=(\\w+)&/i';
    $orderingUrlSuffix = preg_replace($pattern, "", $orderingUrlSuffix);
    return $orderingUrlSuffix;
}
Esempio n. 23
0
 static function printNavigation($prevtext, $nexttext, $oneImagePage = false, $navlen = 7, $firstlast = true)
 {
     $total = getTotalPages($oneImagePage);
     $current = getCurrentPage();
     if ($total < 2) {
         $class .= ' disabled_nav';
     }
     if ($navlen == 0) {
         $navlen = $total;
     }
     $extralinks = 2;
     if ($firstlast) {
         $extralinks += 2;
     }
     $len = floor(($navlen - $extralinks) / 2);
     $j = max(round($extralinks / 2), min($current - $len - (2 - round($extralinks / 2)), $total - $navlen + $extralinks - 1));
     $ilim = min($total, max($navlen - round($extralinks / 2), $current + floor($len)));
     $k1 = round(($j - 2) / 2) + 1;
     $k2 = $total - round(($total - $ilim) / 2);
     if ($firstlast) {
         echo '<div class="nav-cell ' . ($current == 1 ? 'current' : 'first') . '">';
         echo "<span class='valign'>";
         printLink(getPageURL(1, $total), 1, "Page 1");
         echo "</span></div>\n";
         if ($j > 2) {
             echo '<div class="nav-cell">';
             echo "<span class='valign'>";
             printLink(getPageURL($k1, $total), $j - 1 > 2 ? '...' : $k1, "Page {$k1}");
             echo "</span></div>\n";
         }
     }
     for ($i = $j; $i <= $ilim; $i++) {
         echo '<div class="nav-cell' . ($i == $current ? " current" : "") . '">';
         echo "<span class='valign'>";
         printLink(getPageURL($i, $total), $i, "Page {$i}" . ($i == $current ? ' ' . gettext("(Current Page)") : ""));
         echo "</span></div>\n";
     }
     if ($i < $total) {
         echo '<div class="nav-cell">';
         echo "<span class='valign'>";
         printLink(getPageURL($k2, $total), $total - $i > 1 ? '...' : $k2, "Page {$k2}");
         echo "</span></div>\n";
     }
     if ($firstlast && $i <= $total) {
         echo '<div class="nav-cell last">';
         echo "<span class='valign'>";
         printLink(getPageURL($total, $total), $total, "Page {$total}");
         echo "</span></div>\n";
     }
     $prevNextLinks = array();
     $prevNextLinks['prev'] = ThemeUtil::getLink(getPrevPageURL(), $prevtext) . "\n";
     $prevNextLinks['next'] = ThemeUtil::getLink(getNextPageURL(), $nexttext) . "\n";
     return $prevNextLinks;
 }