本文整理汇总了PHP中Layout::GetErrorMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP Layout::GetErrorMessage方法的具体用法?PHP Layout::GetErrorMessage怎么用?PHP Layout::GetErrorMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Layout
的用法示例。
在下文中一共展示了Layout::GetErrorMessage方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: SetLayoutXml
/**
* Sets the Layout Xml and writes it back to the database
* @return
* @param $layoutid Object
* @param $xml Object
*/
private function SetLayoutXml($layoutid, $xml)
{
$layout = new Layout($this->db);
if (!$layout->SetLayoutXml($layoutid, $xml)) {
return $this->SetError($layout->GetErrorMessage());
}
return true;
}
示例2: SetLayoutXml
/**
* Sets the Layout Xml and writes it back to the database
* @return
* @param $layoutid Object
* @param $xml Object
*/
private function SetLayoutXml($layoutid, $xml)
{
// Update Cache
$this->layoutXml = $xml;
$layout = new Layout($this->db);
$layout->delayFinalise = $this->delayFinalise;
if (!$layout->SetLayoutXml($layoutid, $xml)) {
return $this->SetError($layout->GetErrorMessage());
}
return true;
}
示例3: TemplateDelete
/**
* Delete Template
* @return <XiboAPIResponse>
*/
public function TemplateDelete()
{
if (!$this->user->PageAuth('template')) {
return $this->Error(1, 'Access Denied');
}
$layout = new Layout();
$layoutId = $this->GetParam('templateId', _INT);
if (!$this->user->LayoutAuth($layoutId)) {
return $this->Error(1, 'Access Denied');
}
if (!$layout->Delete($layoutId)) {
return $this->Error($layout->GetErrorNumber(), $layout->GetErrorMessage());
}
return $this->Respond($this->ReturnId('success', true));
}
示例4: Import
public function Import()
{
$db =& $this->db;
$response = new ResponseManager();
// What are we importing?
$template = Kit::GetParam('template', _POST, _STRING, 'false');
$template = $template == 'true';
$layout = Kit::GetParam('layout', _POST, _STRING);
$replaceExisting = Kit::GetParam('replaceExisting', _POST, _CHECKBOX);
$importTags = Kit::GetParam('importTags', _POST, _CHECKBOX, !$template);
// File data
$tmpName = Kit::GetParam('hidFileID', _POST, _STRING);
if ($tmpName == '') {
trigger_error(__('Please ensure you have picked a file and it has finished uploading'), E_USER_ERROR);
}
// File name and extension (orignial name)
$fileName = Kit::GetParam('txtFileName', _POST, _STRING);
$fileName = basename($fileName);
$ext = strtolower(substr(strrchr($fileName, "."), 1));
// File upload directory.. get this from the settings object
$fileLocation = Config::GetSetting('LIBRARY_LOCATION') . 'temp/' . $tmpName;
Kit::ClassLoader('layout');
$layoutObject = new Layout($this->db);
if (!$layoutObject->Import($fileLocation, $layout, $this->user->userid, $template, $replaceExisting, $importTags)) {
trigger_error($layoutObject->GetErrorMessage(), E_USER_ERROR);
}
$response->SetFormSubmitResponse(__('Layout Imported'));
$response->Respond();
}
示例5: DeleteTemplate
/**
* Deletes a template
* @return
*/
function DeleteTemplate()
{
// Check the token
if (!Kit::CheckToken()) {
trigger_error(__('Sorry the form has expired. Please refresh.'), E_USER_ERROR);
}
$db =& $this->db;
$user =& $this->user;
$response = new ResponseManager();
$templateId = Kit::GetParam('templateId', _POST, _INT);
if ($templateId == 0) {
trigger_error(__('No template selected'), E_USER_ERROR);
}
// Is this user allowed to delete this template?
$auth = $this->user->TemplateAuth($templateId, true);
if (!$auth->del) {
trigger_error(__('Access denied'), E_USER_ERROR);
}
// Use the data class
$template = new Layout();
// Delete the template
if (!$template->Delete($templateId)) {
trigger_error($template->GetErrorMessage(), E_USER_ERROR);
}
$response->SetFormSubmitResponse(__('The Template has been Deleted'));
$response->Respond();
}
示例6: LayoutDelete
/**
* Delete Layout
* @return <XiboAPIResponse>
*/
public function LayoutDelete()
{
if (!$this->user->PageAuth('layout')) {
return $this->Error(1, 'Access Denied');
}
Kit::ClassLoader('Layout');
$layout = new Layout($this->db);
$layoutId = $this->GetParam('layoutId', _INT);
if (!$this->user->LayoutAuth($layoutId)) {
return $this->Error(1, 'Access Denied');
}
if (!$layout->Delete($layoutId)) {
return $this->Error($layout->GetErrorNumber(), $layout->GetErrorMessage());
}
return $this->Respond($this->ReturnId('success', true));
}
示例7: Copy
/**
* Copys a layout
*/
public function Copy()
{
// Check the token
if (!Kit::CheckToken()) {
trigger_error('Token does not match', E_USER_ERROR);
}
$db =& $this->db;
$user =& $this->user;
$response = new ResponseManager();
$layoutid = Kit::GetParam('layoutid', _POST, _INT);
$layout = Kit::GetParam('layout', _POST, _STRING);
$copyMedia = Kit::GetParam('copyMediaFiles', _POST, _CHECKBOX);
Kit::ClassLoader('Layout');
$layoutObject = new Layout($db);
if (!$layoutObject->Copy($layoutid, $layout, $user->userid, (bool) $copyMedia)) {
trigger_error($layoutObject->GetErrorMessage(), E_USER_ERROR);
}
$response->SetFormSubmitResponse(__('Layout Copied'));
$response->Respond();
}
示例8: Delete
/**
* Delete User
* @return bool
*/
public function Delete()
{
if (!isset($this->userId) || $this->userId == 0) {
return $this->SetError(__('Missing userId'));
}
try {
$dbh = PDOConnect::init();
// Delete all layouts
$layout = new Layout();
if (!$layout->deleteAllForUser($this->userId)) {
return $this->SetError($layout->GetErrorMessage());
}
// Delete all Campaigns
$campaign = new Campaign();
if (!$campaign->deleteAllForUser($this->userId)) {
return $this->SetError($campaign->GetErrorMessage());
}
// Delete all media
$media = new Media();
if (!$media->deleteAllForUser($this->userId)) {
return $this->SetError($media->GetErrorMessage());
}
// Delete all schedules that have not been caught by deleting layouts and campaigns
// These would be schedules for other peoples layouts
$schedule = new Schedule();
if (!$schedule->deleteAllForUser($this->userId)) {
}
// Delete the user itself
$sth = $dbh->prepare('DELETE FROM `user` WHERE userid = :userid');
$sth->execute(array('userid' => $this->userId));
// Delete from the session table
$sth = $dbh->prepare('DELETE FROM `session` WHERE userid = :userid');
$sth->execute(array('userid' => $this->userId));
return true;
} catch (Exception $e) {
Debug::LogEntry('error', $e->getMessage(), get_class(), __FUNCTION__);
if (!$this->IsError()) {
$this->SetError(1, __('Unknown Error'));
}
return false;
}
}