Show Page.php syntax highlighted
<?php
class Page {
private static $title='';
private static $metaKeywords = array ();
private static $metaDescription = array ();
/**
*
* @return string Returns current page's title.
*/
public function getTitle() {
return self :: $title;
}
/**
* Sets the current page's title.
*
* @param string $title
*/
public function setTitle($title) {
self :: $title = $title;
}
/**
* This method is used in style/theme/index.php context. It will include all
* CSS styles that are needed by modules and 3rd party objects.
*
* @return string HTML code
*/
public function includeCSStyles() {
global $ECP,$Config;
$css_styles = array ();
$retval = "\n\t<link rel=\"stylesheet\" type=\"text/css\" href=\"" . $Config->getPath() . "core/main.css\" media=\"screen\" /> \n";
$retval .= "\n\t<link rel=\"stylesheet\" type=\"text/css\" href=\"" . $Config->getPath() . "ext/windows_js_0.99/themes/default.css\" media=\"screen\" /> \n";
$retval .= "\n\t<link rel=\"stylesheet\" type=\"text/css\" href=\"" . $Config->getPath() . "ext/windows_js_0.99/themes/alphacube.css\" media=\"screen\" /> \n";
$retval .= "\n\t<link rel=\"stylesheet\" type=\"text/css\" href=\"" . $Config->getPath() . "ext/lightbox/css/lightbox.css\" media=\"screen\" /> \n";
$defaultStyle="modules/" . $_GET['module'] . "/application/desktop.css";
if (Engine :: file_exists($defaultStyle))
$retval .= "\t<link rel=\"stylesheet\" type=\"text/css\" href=\"" . $Config->getPath() . "modules/" . $_GET['module'] . "/application/desktop.css\" media=\"screen\" />\n";
else if (Engine :: file_exists("styles/" . $ECP->getDefaultTheme() . "/" . Perspective :: getTheme() . ".css"))
$retval .= "\t<link rel=\"stylesheet\" type=\"text/css\" href=\"" . $Config->getPath() . "styles/" . $ECP->getDefaultTheme() . "/" . Perspective :: getTheme() . ".css\" media=\"screen\" />\n";
else
if (Engine :: file_exists("styles/" . $ECP->getDefaultTheme() . "/desktop.css"))
$retval .= "\t<link rel=\"stylesheet\" type=\"text/css\" href=\"" . $Config->getPath() . "styles/" . $ECP->getDefaultTheme() . "/desktop.css\" media=\"screen\" />\n";
foreach (ModulesManager :: getModules() as $Module) {
if (Engine :: file_exists($Module->CSS) && !in_array($Module->CSS, $css_styles))
$retval .= "\t<link rel=\"stylesheet\" type=\"text/css\" href=\"" . Engine :: getPath($Module->CSS) . "\" media=\"screen\" />\n";
else
if (Engine :: file_exists($Module->CSS . ".php") && !in_array($Module->CSS, $css_styles)) {
$retval .= "\t<link rel=\"stylesheet\" type=\"text/css\" href=\"" . Engine :: getPath($Module->CSS . ".php") . "?cssid=_" . $Module->getTemplate() . "\" media=\"screen\" />\n";
}
$css_styles[] = $Module->CSS;
}
return $retval;
}
/**
* This method is used in style/theme/index.php context. It will add META
* tags into your (x)HTML page so search engines and robots can easily find
* you.
*
* @return string HTML code
*/
public function includeMetaTags() {
global $ECP,$Config;
$description = '';
$keywords = '';
if (!sizeof(self::$metaKeywords) || !sizeof(self::$metaDescription)) {
$TA = new TA();
$TA->addQuery(TA :: SELECT, "ecp_engine_config", "description");
$TA->addParam("value");
$TA->WHERE("name='description'");
$TA->LIMIT(1);
$TA->addQuery(TA :: SELECT, "ecp_engine_config", "keywords");
$TA->addParam("value");
$TA->WHERE("name='keywords'");
$TA->LIMIT(1);
$TA->Execute();
$object = $TA->Result("description")->FetchObject();
if (isset ($object->value))
$description = $object->value;
$object = $TA->Result("keywords")->FetchObject();
if (isset ($object->value))
$keywords = $object->value;
$TA->End();
}
if (sizeof(self::$metaKeywords)) {
self::$metaKeywords = array_unique(self::$metaKeywords);
$keywords = '';
foreach (self::$metaKeywords as $key => $keyword) {
if ($key != 0)
$keywords .= ",";
$keywords .= $keyword;
}
}
if (sizeof(self::$metaDescription)) {
$description = '';
foreach (self::$metaDescription as $key => $word) {
if ($key != 0)
$description .= ",";
$description .= $word;
}
}
$retval = '';
$retval .= '<meta name="keywords" content="' . $keywords . '" />';
$retval .= '<meta name="description" content="' . $description . '" />';
$retval .= '<meta name="generator" content="' . $ECP->toString() . '" />';
$retval .= '<meta name="robots" content="all,follow" />';
$retval .= '<meta name="author" content="Content © Luke cyberluk Satin" />';
$retval .= '<meta name="copyright" content="Content © Luke cyberluk Satin" />';
$retval .= '<meta http-equiv="Pragma" content="no-cache" />';
$retval .= '<meta http-equiv="Cache-Control" content="no-cache, must-revalidate" />';
$retval .= '<meta http-equiv="Expires" content="-1" />';
$retval .= '<meta http-equiv="content-type" content="' . $Config->getMimetype() . '; charset=' . $Config->getCharset() . '" />';
$retval .= '<meta http-equiv="content-language" content="' . $Config->getLanguageCode() . '" />';
return $retval;
}
public function metaAddKeyword($keyword) {
$keyword = String :: removeSpecialChars($keyword);
$words = explode(" ", $keyword);
$similar_keywords = '';
foreach ($words as $key => $word) {
if (strlen($word) >= 3) {
if ($key != 0)
$similar_keywords .= ",";
$similar_keywords .= $word;
}
}
self::$metaKeywords[] = $keyword;
if (!empty ($similar_keywords))
self::$metaKeywords[] = $similar_keywords;
}
public function metaAddDescription($description) {
$description = strip_tags($description);
self::$metaDescription[] = $description;
}
/**
* Includes javascript plugins. For example a wysiwyg editor and overLib
* plugin.
*
* @return string HTML code
*/
public function includeJavascript() {
global $ECP, $Config;
$retval = '';
$javascript = "var Path='" . $Config->getMaster() . "';var Modules=new Object();";
foreach (ModulesManager :: getModules() as $Module) {
$base = ucfirst($Module->getBase());
if (@ file_exists('core_js/net.elitemedia.modules.' . $base . '.js')) {
$javascript .= "var x=new Object();";
$javascript .= "x.base='" . $base . "';";
$javascript .= "x.name='" . $Module->getNick() . "';";
$javascript .= "Modules['" . $Module->getID() . "']=x;";
}
}
$retval .= '<script type="text/javascript">' . $javascript . '</script>';
$retval .= '<script type="text/javascript" src="' . $Config->getMaster() . 'ext/prototype/prototype.js"></script>';
$retval .= '<script type="text/javascript" src="' . $Config->getMaster() . 'ext/scriptaculous-js-1.6.1/src/scriptaculous.js"></script>';
$retval .= '<script type="text/javascript" src="' . $Config->getMaster() . 'ext/tooltip/dom_evt.js"></script>';
$retval .= '<script type="text/javascript" src="' . $Config->getMaster() . 'ext/tooltip/v_1.3.js"></script>';
$retval .= '<script type="text/javascript" src="' . $Config->getMaster() . 'ext/windows_js_0.99/javascripts/window.js"></script>';
$retval .= '<script type="text/javascript" src="' . $Config->getMaster() . 'ext/event-selectors.js"></script>';
$retval .= '<script type="text/javascript" src="' . $Config->getMaster() . 'ext/swfobject_source.js"></script>';
$retval .= '<script type="text/javascript" src="' . $Config->getMaster() . 'ext/lightbox/js/lightbox.js"></script>';
$retval .= '<script type="text/javascript" src="' . $Config->getMaster() . 'core_js/index.php"></script>';
try {
$retval .= '<script type="text/javascript" src="' . $ECP->getSiteIndex('js') . '"></script>';
} catch (Exception $e) {
}
return $retval;
}
}
?>
See more files for this project here
EliteCore Project is a PHP5.1/Javascript/AJAX/XHTML/CSS framework for creating WEB 2.0 applications and services.The basic open-source instalation can be also used as an interactive personal page or BLOG.This project uses the latest features available.
Project homepage:
http://sourceforge.net/projects/elitecore
Programming language(s): JavaScript,PHP,XML
License: cpl
debug/
content.php
exceptions/
ajaxflush.php
nomodule.php
undefineddata.php
interface/
encryption.php
form.php
module_class.php
session_interface.php
renderers/
default.php
sql/
mysql.php
mysqli.php
themes/
ECP/
accept.png
add.png
alt_star.gif
anchor.png
arrow_refresh.png
asterisk_orange.png
asterisk_yellow.png
attach.png
back.png
cog_error.png
cog_go.png
comment.png
comment_add.png
comment_delete.png
comment_edit.png
comments.png
comments_add.png
comments_delete.png
control_play_blue.png
drive.png
gnome-fs-directory.png
gnome-mime-audio.png
layers.png
layout.png
layout_add.png
layout_content.png
layout_delete.png
layout_edit.png
layout_error.png
layout_header.png
layout_link.png
layout_sidebar.png
lightbulb.png
lightbulb_add.png
lightbulb_delete.png
lightbulb_off.png
lightning.png
lightning_add.png
lightning_delete.png
lightning_go.png
link.png
link_add.png
link_break.png
link_delete.png
link_edit.png
link_error.png
link_go.png
lock.png
lock_add.png
lock_break.png
lock_delete.png
lock_edit.png
lock_go.png
lock_open.png
newspaper.png
newspaper_add.png
newspaper_delete.png
newspaper_go.png
newspaper_link.png
note.gif
note.png
note_add.png
note_delete.gif
note_delete.png
note_edit.png
note_error.png
note_go.png
note_new.gif
overlays.png
package.png
package_add.png
package_delete.png
package_go.png
package_green.png
package_link.png
page.gif
page.png
page_add.png
page_attach.png
page_code.png
page_copy.png
page_delete.png
page_edit.png
page_error.png
page_excel.png
page_find.png
page_gear.png
page_go.png
page_green.png
page_key.png
page_lightning.png
page_link.png
page_paintbrush.png
page_paste.png
page_red.png
page_refresh.png
page_save.png
page_white.png
pencil.png
pencil_add.png
pencil_delete.png
pencil_go.png
photo.png
photo_add.png
photo_delete.png
photo_link.png
photos.png
picture.png
picture_add.png
picture_delete.png
picture_edit.png
picture_empty.png
picture_error.png
picture_go.png
picture_key.png
picture_link.png
picture_save.png
pictures.png
plugin.png
plugin_add.png
plugin_delete.png
plugin_disabled.png
plugin_edit.png
plugin_error.png
plugin_go.png
plugin_link.png
report.png
report_add.png
report_delete.png
report_disk.png
report_edit.png
report_go.png
report_key.png
report_link.png
report_magnify.png
report_picture.png
report_user.png
report_word.png
script.png
script_add.png
script_code.png
script_code_red.png
script_delete.png
script_edit.png
script_error.png
script_gear.png
script_go.png
script_key.png
script_lightning.png
script_link.png
script_palette.png
script_save.png
star.png
star_rating.gif
stop.png
style.png
text_align_center.png
text_align_justify.png
text_align_left.png
text_align_right.png
text_allcaps.png
text_bold.png
text_columns.png
text_dropcaps.png
text_heading_1.png
text_heading_2.png
text_heading_3.png
text_heading_4.png
text_heading_5.png
text_heading_6.png
text_horizontalrule.png
text_indent.png
text_indent_remove.png
text_italic.png
text_kerning.png
text_letter_omega.png
text_letterspacing.png
text_linespacing.png
text_list_bullets.png
text_list_numbers.png
text_lowercase.png
text_padding_bottom.png
text_padding_left.png
text_padding_right.png
text_padding_top.png
text_replace.png
text_signature.png
text_smallcaps.png
text_strikethrough.png
text_subscript.png
text_superscript.png
text_underline.png
text_uppercase.png
textfield.png
textfield_add.png
textfield_delete.png
textfield_key.png
textfield_rename.png
tux.png
vert_star.gif
ECP.xml
Icon.php
Location.php
Module.php
ModulesManager.php
MusicTags.php
Page.php
XHTMLParser.php
XMLForms.php
ajax.php
author.html
cache.php
config.php
date.php
db.php
debug.php
ecp-full.php
ecp-mini.php
engine.php
events.php
filesystem.php
footer.html
i18n.php
mailer.php
main.css
mcrypt.php
mime.php
mod_rewrite.php
perspective.php
rc4.php
reflection.php
session_passport.php
storage.php
string.php
template.php
texy.php
user.php
user_cache.php
wysiwyg_texy.php
xhtml_form.php
xtea.php