Ejemplo n.º 1
0
 function GetPropertiesFromDataSet($DataSet, &$Context)
 {
     $this->Title = FormatHtmlStringInline(ForceString($DataSet["Name"], ""));
     $this->Link = PrependString("http://", AppendFolder(agDOMAIN, "comments.php?DiscussionID=" . ForceInt($DataSet["DiscussionID"], 0)));
     $this->Id = $this->Link;
     $this->Published = FixDate(@$DataSet["DateCreated"]);
     $this->Updated = FixDate(@$DataSet["DateLastActive"]);
     $this->AuthorName = FormatHtmlStringInline(ForceString($DataSet["AuthUsername"], ""));
     $this->AuthorUrl = PrependString("http://", AppendFolder(agDOMAIN, "account.php?u=" . ForceInt($DataSet["AuthUserID"], 0)));
     $this->Content = $this->RemoveHtml(ForceString(@$DataSet["Body"], ""));
     $this->Summary = SliceString($this->Content, 200);
     $this->Summary = str_replace("\r\n", " ", $this->Content);
     $this->Content = str_replace("\r\n", "<br />", $this->Content);
     if (agUSE_CATEGORIES) {
         $this->Category = FormatStringForDisplay(ForceString($DataSet["Category"], ""), true);
         $this->CategoryLink = "http://" . AppendFolder(agDOMAIN, "?CategoryID=" . ForceInt($DataSet["CategoryID"], 0));
     }
 }
Ejemplo n.º 2
0
function CheckForFolder($Path, $FolderKey, &$Config)
{
    $FolderHandle = opendir($Path);
    $aCurrentSubFolders = array();
    // Only look at folders
    while (false !== ($Item = readdir($FolderHandle))) {
        if ($Item != '.' && $Item != '..' && is_dir($Path . "/" . $Item) && !in_array($Path . "/" . $Item, $Config->FullyQualifiedHideFiles)) {
            $aCurrentSubFolders[] = $Item;
        }
    }
    closedir($FolderHandle);
    // Sort the folders according to the config setting
    usort($aCurrentSubFolders, "strcasecmp");
    reset($aCurrentSubFolders);
    if ($Config->SortDirection == "desc") {
        $aCurrentSubFolders = array_reverse($aCurrentSubFolders);
    }
    // If the key supplied is less than the total count of folders found, append the folder name to the path
    if ($FolderKey < count($aCurrentSubFolders)) {
        $Config->FolderNavigatorLocation = FormatDelimitedString($Config->FolderNavigatorLocation, $FolderKey, $Config->FolderDelimiter);
        $Config->FolderNavigator[] = array($aCurrentSubFolders[$FolderKey], $Config->FolderNavigatorLocation);
        return AppendFolder($Path, $aCurrentSubFolders[$FolderKey]);
    } else {
        return false;
    }
}
$Body = $Context->ObjectFactory->NewContextObject($Context, "Body");
$Foot = $Context->ObjectFactory->NewContextObject($Context, "Foot");
$PageEnd = $Context->ObjectFactory->NewContextObject($Context, "PageEnd");
// BUILD THE PAGE HEAD
// Every page will require some basic definitions for the header.
$Head->AddScript("./js/global.js");
$Head->AddScript("./js/vanilla.js");
$Head->AddScript("./js/data.js");
$Head->AddScript("./js/protect.js");
$Head->AddScript("./js/autocomplete.js");
$Head->AddScript("./js/sort.js");
$Head->AddScript("/egroupware/jscripts/tiny_mce/tiny_mce_src.js");
$Head->AddStyleSheet($Context->StyleUrl . "global.css", "screen");
$Head->AddStyleSheet("/egroupware/sitemgr/sitemgr-site/templates/rhuk_orange_smoothie/css/template_css.css", "screen");
$Head->AddStyleSheet($Context->StyleUrl . "global.handheld.css", "handheld");
$Head->AddString("<link rel=\"alternate\" type=\"application/atom+xml\" href=\"" . PrependString("http://", AppendFolder(agDOMAIN, "feeds/?Type=atom")) . "\" title=\"" . $Context->GetDefinition("Atom") . " " . $Context->GetDefinition("Feed") . "\" />");
$Head->AddString('<script language="javascript" type="text/javascript">
                  tinyMCE.init({
				theme : "advanced",
                                mode: "exact",
                                elements: "CommentBox",
				plugins : "table",
				entity_encoding: "raw",
				cleanup : false,
				content_css : "/egroupware/jscripts/tiny_mce/themes/advanced/vanilla.css",
				theme_advanced_buttons1_add : "forecolor,backcolor",
// 				add_form_submit_trigger : false,
// 				submit_patch : false,
                                force_br_newlines : true,
				theme_advanced_buttons3_add_before : "tablecontrols,separator",
				theme_advanced_styles : "Header 1=header1;Header 2=header2;Header 3=header3;Table Row=tableRow1",