class clsRecordimageupload { //imageupload Class @4-6EA119FA
//Variables @4-9E315808
// Public variables
public $ComponentType = "Record";
public $ComponentName;
public $Parent;
public $HTMLFormAction;
public $PressedButton;
public $Errors;
public $ErrorBlock;
public $FormSubmitted;
public $FormEnctype;
public $Visible;
public $IsEmpty;
public $CCSEvents = "";
public $CCSEventResult;
public $RelativePath = "";
public $InsertAllowed = false;
public $UpdateAllowed = false;
public $DeleteAllowed = false;
public $ReadAllowed = false;
public $EditMode = false;
public $ds;
public $DataSource;
public $ValidatingControls;
public $Controls;
public $Attributes;
// Class variables
//End Variables
//Class_Initialize Event @4-0D338B88
function clsRecordimageupload($RelativePath, & $Parent)
{
global $FileName;
global $CCSLocales;
global $DefaultDateFormat;
$this->Visible = true;
$this->Parent = & $Parent;
$this->RelativePath = $RelativePath;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Record imageupload/Error";
$this->DataSource = new clsimageuploadDataSource($this);
$this->ds = & $this->DataSource;
$this->ReadAllowed = true;
$this->Visible = (CCSecurityAccessCheck("4;2;3") == "success");
if($this->Visible)
{
$this->ReadAllowed = $this->ReadAllowed && CCUserInGroups(CCGetGroupID(), "4;2;3");
$this->InsertAllowed = CCUserInGroups(CCGetGroupID(), "4;3");
$this->UpdateAllowed = CCUserInGroups(CCGetGroupID(), "4");
$this->DeleteAllowed = CCUserInGroups(CCGetGroupID(), "4");
$this->ComponentName = "imageupload";
$this->Attributes = new clsAttributes($this->ComponentName . ":");
$CCSForm = explode(":", CCGetFromGet("ccsForm", ""), 2);
if(sizeof($CCSForm) == 1)
$CCSForm[1] = "";
list($FormName, $FormMethod) = $CCSForm;
$this->EditMode = ($FormMethod == "Edit");
$this->FormEnctype = "application/x-[URL unfurl="true"]www-form-urlencoded";[/URL]
$this->FormSubmitted = ($FormName == $this->ComponentName);
$Method = $this->FormSubmitted ? ccsPost : ccsGet;
$this->Link = new clsControl(ccsLabel, "Link", "Link", ccsText, "", CCGetRequestParam("Link", $Method, NULL), $this);
$this->Link->HTML = true;
$this->ImageDescription = new clsControl(ccsTextBox, "ImageDescription", "<em>Description</em>", ccsText, "", CCGetRequestParam("ImageDescription", $Method, NULL), $this);
$this->ImageDescription->Required = true;
$this->ImageCategory = new clsControl(ccsListBox, "ImageCategory", "<em>Image Category</em>", ccsInteger, "", CCGetRequestParam("ImageCategory", $Method, NULL), $this);
$this->ImageCategory->DSType = dsTable;
$this->ImageCategory->DataSource = new clsDBsunvirgin();
$this->ImageCategory->ds = & $this->ImageCategory->DataSource;
$this->ImageCategory->DataSource->SQL = "SELECT ID, CategoryName, ImageType \n" .
"FROM lookup_imagecategories {SQL_Where} {SQL_OrderBy}";
$this->ImageCategory->DataSource->Order = "CategoryName";
list($this->ImageCategory->BoundColumn, $this->ImageCategory->TextColumn, $this->ImageCategory->DBFormat) = array("ID", "CategoryName", "");
$this->ImageCategory->DataSource->Parameters["expr102"] = "Discography";
$this->ImageCategory->DataSource->wp = new clsSQLParameters();
$this->ImageCategory->DataSource->wp->AddParameter("1", "expr102", ccsText, "", "", $this->ImageCategory->DataSource->Parameters["expr102"], "", false);
$this->ImageCategory->DataSource->wp->Criterion[1] = $this->ImageCategory->DataSource->wp->Operation(opBeginsWith, "CategoryName", $this->ImageCategory->DataSource->wp->GetDBValue("1"), $this->ImageCategory->DataSource->ToSQL($this->ImageCategory->DataSource->wp->GetDBValue("1"), ccsText),false);
$this->ImageCategory->DataSource->Where =
$this->ImageCategory->DataSource->wp->Criterion[1];
$this->ImageCategory->DataSource->Order = "CategoryName";
$this->ImageCategory->Required = true;
$this->ResetWidth = new clsControl(ccsListBox, "ResetWidth", "ResetWidth", ccsInteger, "", CCGetRequestParam("ResetWidth", $Method, NULL), $this);
$this->ResetWidth->DSType = dsListOfValues;
$this->ResetWidth->Values = array(array("0", "No Resize"), array("185", "Discography (185)"), array("250", "General Purpose (250)"), array("500", "Large Format (500)"));
$this->ResetWidth->Required = true;
$this->ChangeFormat = new clsControl(ccsRadioButton, "ChangeFormat", "ChangeFormat", ccsInteger, "", CCGetRequestParam("ChangeFormat", $Method, NULL), $this);
$this->ChangeFormat->DSType = dsListOfValues;
$this->ChangeFormat->Values = array(array("0", "No Conversion"), array("1", "Convert"));
$this->HideWatermark = new clsControl(ccsCheckBox, "HideWatermark", "HideWatermark", ccsBoolean, $CCSLocales->GetFormatInfo("BooleanFormat"), CCGetRequestParam("HideWatermark", $Method, NULL), $this);
$this->HideWatermark->CheckedValue = true;
$this->HideWatermark->UncheckedValue = false;
$this->WatermarkLevel = new clsControl(ccsListBox, "WatermarkLevel", "WatermarkLevel", ccsInteger, "", CCGetRequestParam("WatermarkLevel", $Method, NULL), $this);
$this->WatermarkLevel->DSType = dsTable;
$this->WatermarkLevel->DataSource = new clsDBsunvirgin();
$this->WatermarkLevel->ds = & $this->WatermarkLevel->DataSource;
$this->WatermarkLevel->DataSource->SQL = "SELECT Level, LevelName \n" .
"FROM watermark_levels {SQL_Where} {SQL_OrderBy}";
$this->WatermarkLevel->DataSource->Order = "Level";
list($this->WatermarkLevel->BoundColumn, $this->WatermarkLevel->TextColumn, $this->WatermarkLevel->DBFormat) = array("Level", "LevelName", "");
$this->WatermarkLevel->DataSource->Order = "Level";
$this->WatermarkLevel->Required = true;
$this->ThumbWidth = new clsControl(ccsListBox, "ThumbWidth", "ThumbWidth", ccsInteger, "", CCGetRequestParam("ThumbWidth", $Method, NULL), $this);
$this->ThumbWidth->DSType = dsListOfValues;
$this->ThumbWidth->Values = array(array("50", "50px wide"), array("75", "75px wide"), array("125", "125px wide"), array("150", "150px wide"), array("200", "200px wide"));
$this->Thumbnail = new clsControl(ccsHidden, "Thumbnail", "Thumbnail", ccsMemo, "", CCGetRequestParam("Thumbnail", $Method, NULL), $this);
$this->Insert = new clsButton("Insert", $Method, $this);
$this->Update = new clsButton("Update", $Method, $this);
$this->Delete = new clsButton("Delete", $Method, $this);
$this->Cancel = new clsButton("Cancel", $Method, $this);
$this->ShowThumbnail = new clsControl(ccsLabel, "ShowThumbnail", "ShowThumbnail", ccsText, "", CCGetRequestParam("ShowThumbnail", $Method, NULL), $this);
$this->ShowThumbnail->HTML = true;
$this->ShowImage = new clsControl(ccsLabel, "ShowImage", "ShowImage", ccsText, "", CCGetRequestParam("ShowImage", $Method, NULL), $this);
$this->ShowImage->HTML = true;
$this->ImageFormat = new clsControl(ccsHidden, "ImageFormat", "ImageFormat", ccsText, "", CCGetRequestParam("ImageFormat", $Method, NULL), $this);
$this->ImageSize = new clsControl(ccsHidden, "ImageSize", "ImageSize", ccsInteger, "", CCGetRequestParam("ImageSize", $Method, NULL), $this);
$this->ImageWidth = new clsControl(ccsHidden, "ImageWidth", "ImageWidth", ccsInteger, "", CCGetRequestParam("ImageWidth", $Method, NULL), $this);
$this->ImageHeight = new clsControl(ccsHidden, "ImageHeight", "ImageHeight", ccsInteger, "", CCGetRequestParam("ImageHeight", $Method, NULL), $this);
$this->ID = new clsControl(ccsHidden, "ID", "ID", ccsInteger, "", CCGetRequestParam("ID", $Method, NULL), $this);
$this->Image = new clsControl(ccsHidden, "Image", "Image", ccsMemo, "", CCGetRequestParam("Image", $Method, NULL), $this);
$this->FileUpload = new clsControl(ccsTextBox, "FileUpload", "FileUpload", ccsText, "", CCGetRequestParam("FileUpload", $Method, NULL), $this);
if(!$this->FormSubmitted) {
if(!is_array($this->ResetWidth->Value) && !strlen($this->ResetWidth->Value) && $this->ResetWidth->Value !== false)
$this->ResetWidth->SetText(185);
if(!is_array($this->ChangeFormat->Value) && !strlen($this->ChangeFormat->Value) && $this->ChangeFormat->Value !== false)
$this->ChangeFormat->SetText(0);
if(!is_array($this->HideWatermark->Value) && !strlen($this->HideWatermark->Value) && $this->HideWatermark->Value !== false)
$this->HideWatermark->SetValue(false);
if(!is_array($this->WatermarkLevel->Value) && !strlen($this->WatermarkLevel->Value) && $this->WatermarkLevel->Value !== false)
$this->WatermarkLevel->SetText(50);
if(!is_array($this->ThumbWidth->Value) && !strlen($this->ThumbWidth->Value) && $this->ThumbWidth->Value !== false)
$this->ThumbWidth->SetText(50);
}
}
}
//End Class_Initialize Event