ComponentName = "contenuti";
$this->Visible = True;
$this->Parent = & $Parent;
$this->RelativePath = $RelativePath;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Grid contenuti";
$this->Attributes = new clsAttributes($this->ComponentName . ":");
$this->DataSource = new clscontenutiDataSource($this);
$this->ds = & $this->DataSource;
$this->PageSize = CCGetParam($this->ComponentName . "PageSize", "");
if(!is_numeric($this->PageSize) || !strlen($this->PageSize))
$this->PageSize = 32000;
else
$this->PageSize = intval($this->PageSize);
if ($this->PageSize > 32000)
$this->PageSize = 32000;
if($this->PageSize == 0)
$this->Errors->addError("
Form: Grid " . $this->ComponentName . "
Error: (CCS06) Invalid page size.
");
$this->PageNumber = intval(CCGetParam($this->ComponentName . "Page", 1));
if ($this->PageNumber <= 0) $this->PageNumber = 1;
$this->nomeFile = new clsControl(ccsLabel, "nomeFile", "nomeFile", ccsText, "", CCGetRequestParam("nomeFile", ccsGet, NULL), $this);
$this->contenuto = new clsControl(ccsLabel, "contenuto", "contenuto", ccsText, "", CCGetRequestParam("contenuto", ccsGet, NULL), $this);
}
//End Class_Initialize Event
//Initialize Method @9-90E704C5
function Initialize()
{
if(!$this->Visible) return;
$this->DataSource->PageSize = & $this->PageSize;
$this->DataSource->AbsolutePage = & $this->PageNumber;
$this->DataSource->SetOrder($this->SorterName, $this->SorterDirection);
}
//End Initialize Method
//Show Method @9-B2B44595
function Show()
{
global $Tpl;
global $CCSLocales;
if(!$this->Visible) return;
$this->RowNumber = 0;
$this->DataSource->Parameters["urls_autore"] = CCGetFromGet("s_autore", NULL);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect", $this);
$this->DataSource->Prepare();
$this->DataSource->Open();
$this->HasRecord = $this->DataSource->has_next_record();
$this->IsEmpty = ! $this->HasRecord;
$this->Attributes->Show();
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow", $this);
if(!$this->Visible) return;
$GridBlock = "Grid " . $this->ComponentName;
$ParentPath = $Tpl->block_path;
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
if (!$this->IsEmpty) {
$this->ControlsVisible["nomeFile"] = $this->nomeFile->Visible;
$this->ControlsVisible["contenuto"] = $this->contenuto->Visible;
while ($this->ForceIteration || (($this->RowNumber < $this->PageSize) && ($this->HasRecord = $this->DataSource->has_next_record()))) {
$this->RowNumber++;
if ($this->HasRecord) {
$this->DataSource->next_record();
$this->DataSource->SetValues();
}
$Tpl->block_path = $ParentPath . "/" . $GridBlock . "/Row";
$this->nomeFile->SetValue($this->DataSource->nomeFile->GetValue());
$this->contenuto->SetValue($this->DataSource->contenuto->GetValue());
$this->Attributes->SetValue("rowNumber", $this->RowNumber);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow", $this);
$this->Attributes->Show();
$this->nomeFile->Show();
$this->contenuto->Show();
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
$Tpl->parse("Row", true);
}
}
else { // Show NoRecords block if no records are found
$this->Attributes->Show();
$Tpl->parse("NoRecords", false);
}
$errors = $this->GetErrors();
if(strlen($errors))
{
$Tpl->replaceblock("", $errors);
$Tpl->block_path = $ParentPath;
return;
}
$Tpl->parse();
$Tpl->block_path = $ParentPath;
$this->DataSource->close();
}
//End Show Method
//GetErrors Method @9-39007E9C
function GetErrors()
{
$errors = "";
$errors = ComposeStrings($errors, $this->nomeFile->Errors->ToString());
$errors = ComposeStrings($errors, $this->contenuto->Errors->ToString());
$errors = ComposeStrings($errors, $this->Errors->ToString());
$errors = ComposeStrings($errors, $this->DataSource->Errors->ToString());
return $errors;
}
//End GetErrors Method
} //End contenuti Class @9-FCB6E20C
class clscontenutiDataSource extends clsDBConnection1 { //contenutiDataSource Class @9-D94A43CC
//DataSource Variables @9-0F4DEDDA
public $Parent = "";
public $CCSEvents = "";
public $CCSEventResult;
public $ErrorBlock;
public $CmdExecution;
public $CountSQL;
public $wp;
// Datasource fields
public $nomeFile;
public $contenuto;
//End DataSource Variables
//DataSourceClass_Initialize Event @9-F8CEDBD0
function clscontenutiDataSource(& $Parent)
{
$this->Parent = & $Parent;
$this->ErrorBlock = "Grid contenuti";
$this->Initialize();
$this->nomeFile = new clsField("nomeFile", ccsText, "");
$this->contenuto = new clsField("contenuto", ccsText, "");
}
//End DataSourceClass_Initialize Event
//SetOrder Method @9-9E1383D1
function SetOrder($SorterName, $SorterDirection)
{
$this->Order = "";
$this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection,
"");
}
//End SetOrder Method
//Prepare Method @9-94A890EA
function Prepare()
{
global $CCSLocales;
global $DefaultDateFormat;
$this->wp = new clsSQLParameters($this->ErrorBlock);
$this->wp->AddParameter("1", "urls_autore", ccsText, "", "", $this->Parameters["urls_autore"], "", false);
$this->wp->Criterion[1] = $this->wp->Operation(opContains, "autore", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsText),false);
$this->wp->Criterion[2] = "( CodiceCat = 'GAME' )";
$this->Where = $this->wp->opAND(
false,
$this->wp->Criterion[1],
$this->wp->Criterion[2]);
}
//End Prepare Method
//Open Method @9-513D1EFE
function Open()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
$this->CountSQL = "SELECT COUNT(*)\n\n" .
"FROM contenuti";
$this->SQL = "SELECT * \n\n" .
"FROM contenuti {SQL_Where} {SQL_OrderBy}";
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
if ($this->CountSQL)
$this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
else
$this->RecordsCount = "CCS not counted";
$this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
}
//End Open Method
//SetValues Method @9-651955FF
function SetValues()
{
$this->nomeFile->SetDBValue($this->f("nomeFile"));
$this->contenuto->SetDBValue($this->f("contenuto"));
}
//End SetValues Method
} //End contenutiDataSource Class @9-FCB6E20C
//Initialize Page @1-9596F191
// Variables
$FileName = "";
$Redirect = "";
$Tpl = "";
$TemplateFileName = "";
$BlockToParse = "";
$ComponentName = "";
$Attributes = "";
// Events;
$CCSEvents = "";
$CCSEventResult = "";
$FileName = FileName;
$Redirect = "";
$TemplateFileName = "giochi.html";
$BlockToParse = "main";
$TemplateEncoding = "CP1252";
$ContentType = "text/html";
$PathToRoot = "./";
//End Initialize Page
//Before Initialize @1-E870CEBC
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeInitialize", $MainPage);
//End Before Initialize
//Initialize Objects @1-5B5A8E23
$DBConnection1 = new clsDBConnection1();
$MainPage->Connections["Connection1"] = & $DBConnection1;
$Attributes = new clsAttributes("page:");
$MainPage->Attributes = & $Attributes;
// Controls
$analytics = new clsanalytics("", "analytics", $MainPage);
$analytics->Initialize();
$contenuti = new clsGridcontenuti("", $MainPage);
$MainPage->analytics = & $analytics;
$MainPage->contenuti = & $contenuti;
$contenuti->Initialize();
$CCSEventResult = CCGetEvent($CCSEvents, "AfterInitialize", $MainPage);
if ($Charset) {
header("Content-Type: " . $ContentType . "; charset=" . $Charset);
} else {
header("Content-Type: " . $ContentType);
}
//End Initialize Objects
//Initialize HTML Template @1-E710DB26
$CCSEventResult = CCGetEvent($CCSEvents, "OnInitializeView", $MainPage);
$Tpl = new clsTemplate($FileEncoding, $TemplateEncoding);
$Tpl->LoadTemplate(PathToCurrentPage . $TemplateFileName, $BlockToParse, "CP1252");
$Tpl->block_path = "/$BlockToParse";
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeShow", $MainPage);
$Attributes->SetValue("pathToRoot", "");
$Attributes->Show();
//End Initialize HTML Template
//Execute Components @1-1E2ED0BE
$analytics->Operations();
//End Execute Components
//Go to destination page @1-FE7074FF
if($Redirect)
{
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload", $MainPage);
$DBConnection1->close();
header("Location: " . $Redirect);
$analytics->Class_Terminate();
unset($analytics);
unset($contenuti);
unset($Tpl);
exit;
}
//End Go to destination page
//Show Page @1-0EFE99CE
$analytics->Show();
$contenuti->Show();
$Tpl->block_path = "";
$Tpl->Parse($BlockToParse, false);
if (!isset($main_block)) $main_block = $Tpl->GetVar($BlockToParse);
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeOutput", $MainPage);
if ($CCSEventResult) echo $main_block;
//End Show Page
//Unload Page @1-073C56BB
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload", $MainPage);
$DBConnection1->close();
$analytics->Class_Terminate();
unset($analytics);
unset($contenuti);
unset($Tpl);
//End Unload Page
?>