Commit 4d57868a authored by Anthony.Suerte's avatar Anthony.Suerte

Advertisement Uploader Enhancement [Replace Image Log Message]

parent a6a76898
......@@ -645,44 +645,48 @@ HTMLTABLE;
* @return : 表示用HTML文字列
-------------------------------------------------------------------------*/
public function getActivity(){
$type = $this -> getType();
$details = array();
$type = $this -> getType();
$details = array();
$fileDetails = $this -> getFileDetailsByID($this -> adID);
if($type == TYPE_IMAGE_MANAGER_UPLOAD_COMPLETE){
$message = 'Uploaded ['.basename($_FILES[PARAM_IMG1][PARAM_NAME]).']';
}elseif($type == TYPE_DELETE){
$message = 'Deleted ['.$this -> getFileDetailsByID($this -> adID, 'file_name').']';
}elseif($type == TYPE_UPDATE){
$origID = $this -> getFileDetailsByID($this -> adID, 'ads_id');
$message = "Uploaded {$this -> saveName} [{$this -> adsID}]";
}elseif($type == TYPE_DELETE && $this -> isLoopData($fileDetails)){
$message = "Deleted [{$this -> getColumnData($fileDetails, 'ads_id')}]";
}elseif($type == TYPE_UPDATE && $this -> isLoopData($fileDetails)){
$origID = $this -> getColumnData($fileDetails, 'ads_id');
$newID = $this -> adName;
$origLink = $this -> getFileDetailsByID($this -> adID, 'redirect_link');
$origLink = $this -> getColumnData($fileDetails, 'redirect_link');
$newLink = $this -> link;
$origLang = $this -> getFileDetailsByID($this -> adID, 'language');
$origLang = $this -> getColumnData($fileDetails, 'language');
$newLang = $this -> language;
$origLoc = $this -> getFileDetailsByID($this -> adID, 'ads_location');
$origLoc = $this -> getColumnData($fileDetails, 'ads_location');
$newLoc = $this -> location;
if($origID != $newID){
$details[] = 'Edited ID of '.$this -> getFileDetailsByID($this -> adID, 'file_name').' from ['.$origID.'] to ['.$newID.']';
$details[] = "Edited ID of {$this -> getColumnData($fileDetails, 'ads_id')} from [{$origID}] to [{$newID}]";
}
if($origLink != $newLink){
$details[] = 'Edited Link of '.$this -> getFileDetailsByID($this -> adID, 'file_name').' from ['.$origLink.'] to ['.$newLink.']';
$details[] = "Edited Link of {$this -> getColumnData($fileDetails, 'ads_id')} from [{$origLink}] to [{$newLink}]";
}
if($origLang != $newLang){
$details[] = 'Edited Language of '.$this -> getFileDetailsByID($this -> adID, 'file_name').' from ['.$origLang.'] to ['.$newLang.']';
$details[] = "Edited Language of {$this -> getColumnData($fileDetails, 'ads_id')} from [{$origLang}] to [{$newLang}]";
}
if($origLoc != $newLoc){
$details[] = 'Edited Location of '.$this -> getFileDetailsByID($this -> adID, 'file_name').' from ['.$origLoc.'] to ['.$newLoc.']';
$details[] = "Edited Location of {$this -> getColumnData($fileDetails, 'ads_id')} from [{$origLoc}] to [{$newLoc}]";
}
if($this -> isUpload(PARAM_IMG1)){
$details[] = "Uploaded New Image of {$this -> getColumnData($fileDetails, 'ads_id')}";
}
if($details != NULL){
$message = implode(', <br/>', $details);
$message = implode(", <br/>", $details);
}else{
$message = 'Saved without any changes';
$message = "Saved without any changes";
}
}
......@@ -698,10 +702,7 @@ HTMLTABLE;
return $rtn;
}
public function getFileDetailsByID($id, $column){
$row = $this -> accessSelect('SELECT_AD_DETAILS', array($id));
$details = $this -> getColumnData($row[0], $column);
return $details;
public function getFileDetailsByID($id){
return $this -> getRowData($this -> accessSelect('SELECT_AD_DETAILS', array($id)));
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment