芝麻web文件管理V1.00
编辑当前文件:/home/prismawe/clients/canaldegap.fr_old/lib/classes/contenttypes/ErrorPage.inc.php
ContentBase(); $this->error_types = array('404' => lang('404description')); $this->doAliasCheck = false; $this->doAutoAliasIfEnabled = false; } function HandlesAlias() { return true; } function FriendlyName() { return lang('contenttype_errorpage'); } function SetProperties() { parent::SetProperties(); $this->RemoveProperty('searchable',false); $this->RemoveProperty('parent',-1); $this->RemoveProperty('showinmenu',false); $this->RemoveProperty('menutext',''); $this->RemoveProperty('target',''); $this->RemoveProperty('extra1',''); $this->RemoveProperty('extra2',''); $this->RemoveProperty('extra3',''); $this->RemoveProperty('image',''); $this->RemoveProperty('thumbnail',''); $this->RemoveProperty('accesskey',''); $this->RemoveProperty('titleattribute',''); $this->RemoveProperty('active',true); $this->RemoveProperty('cachable',false); $this->RemoveProperty('alias',''); $this->AddBaseProperty('alias',10,1); #Turn on preview $this->mPreview = true; } function IsCopyable() { return FALSE; } function IsDefaultPossible() { return FALSE; } function HasUsableLink() { return false; } function WantsChildren() { return false; } function IsSystemPage() { return true; } /** * Handle Auto Aliasing */ function DoAutoAlias() { return FALSE; } function FillParams($params) { parent::FillParams($params); $this->mParentId = -1; $this->mShowInMenu = false; $this->mCachable = false; $this->mActive = true; } function display_single_element($one,$adding) { switch($one) { case 'alias': $dropdownopts = '
'.lang('none').'
'; foreach ($this->error_types as $code=>$name) { $dropdownopts .= '
mAlias) { $dropdownopts .= ' selected="selected" '; } $dropdownopts .= ">{$name} ({$code})
"; } return array(lang('error_type').':', '
'.$dropdownopts.'
'); break; default: return parent::display_single_element($one,$adding); } } function ValidateData() { $errors = parent::ValidateData(); if ($errors == FALSE) { $errors = array(); } //Do our own alias check if ($this->mAlias == '') { $errors[] = lang('nofieldgiven', array(lang('error_type'))); } else if (in_array($this->mAlias, $this->error_types)) { $errors[] = lang('nofieldgiven', array(lang('error_type'))); } else if ($this->mAlias != $this->mOldAlias) { global $gCms; $contentops =& $gCms->GetContentOperations(); $error = $contentops->CheckAliasError($this->mAlias, $this->mId); if ($error !== FALSE) { if ($error == lang('aliasalreadyused')) { $errors[] = lang('errorpagealreadyinuse'); } else { $errors[] = $error; } } } return (count($errors) > 0 ? $errors : FALSE); } } # vim:ts=4 sw=4 noet ?>