<?php
/*
	Copyright © Eleanor CMS
	URL: http://eleanor-cms.ru, http://eleanor-cms.com
	E-mail: support@eleanor-cms.ru
	Developing: Alexander Sunvas*
	Interface: Rumin Sergey
	=====
	*Pseudonym
*/
if(!defined('CMS'))die;

return array(
	'title'=>array(
		'title'=>$lang['name'],
		'descr'=>'',
		'type'=>'input',
		'bypost'=>&$Eleanor->sc_post,
		'multilang'=>Eleanor::$vars['multilang'],
		'load'=>function($co)use(&$imgalt)
		{
			$imgalt=$co['value'];
			return array();
		},
		'save'=>function($co)use(&$imgalt)
		{
			$imgalt=$co['value'];
			return$co['value'];
		},
		'options'=>array(
			'htmlsafe'=>true,
		),
	),
	'uri'=>array(
		'title'=>'URI',
		'descr'=>'',
		'type'=>'input',
		'bypost'=>&$Eleanor->sc_post,
		'multilang'=>Eleanor::$vars['multilang'],
		'options'=>array(
			'htmlsafe'=>true,
		),
	),
	'text'=>array(
		'title'=>$lang['descr'],
		'descr'=>'',
		'type'=>'editor',
		'bypost'=>&$Eleanor->sc_post,
		'multilang'=>Eleanor::$vars['multilang'],
		'options'=>array(
			'htmlsafe'=>true,
			'imgalt'=>&$imgalt,
		),
	),
	'image'=>array(
		'title'=>$lang['image'],
		'descr'=>'',
		'type'=>'select',
		'bypost'=>&$Eleanor->sc_post,
		'options'=>array(
			'extra'=>array(
				'id'=>'image',
			),
			'callback'=>function($a)
			{
				$imgs=Eleanor::Option('&mdash;','',!$a['value'],array(),2);
				$hdir=opendir(Eleanor::$root.'images/errors');
				while($entry=readdir($hdir))
					if(preg_match('#\.(gif|png|jpe?g|bmp)#i',$entry)>0)
						$imgs.=Eleanor::Option($entry,false,in_array($entry,$a['value']));
				closedir($hdir);
				return$imgs;
			},
		),
	),
	0=>array(
		'title'=>$lang['preview'],
		'descr'=>'',
		'type'=>'',
		'options'=>array(
			'content'=>Eleanor::$Template->ImagePreview(),
		),
	),
	'http_code'=>array(
		'title'=>$lang['http_status'],
		'descr'=>$lang['http_status_'],
		'type'=>'input',
		'bypost'=>&$Eleanor->sc_post,
		'load'=>function($a)
		{
			if(!$a['value'])
				$a['value']='';
			return$a;
		},
		'options'=>array(
			'extra'=>array(
				'maxlenght'=>3,
			),
		),
	),
	'mail'=>array(
		'title'=>'E-mail',
		'descr'=>$lang['mail_'],
		'type'=>'input',
		'bypost'=>&$Eleanor->sc_post,
		'save'=>function($a,$Obj)
		{
			if($a['value'] and !Strings::CheckEmail($a['value']))
				$Obj->errors[]='INCORRECT_EMAIL';
			else
				return$a['value'];
		},
		'options'=>array(
			'htmlsafe'=>false,
		),
	),
	'log'=>array(
		'title'=>$lang['log'],
		'descr'=>$lang['log_'],
		'type'=>'check',
		'bypost'=>&$Eleanor->sc_post,
	),
	'meta_title'=>array(
		'title'=>'Window title',
		'descr'=>'',
		'type'=>'input',
		'bypost'=>&$Eleanor->sc_post,
		'multilang'=>Eleanor::$vars['multilang'],
		'options'=>array(
			'htmlsafe'=>true,
		),
	),
	'meta_descr'=>array(
		'title'=>'Meta description',
		'descr'=>'',
		'type'=>'input',
		'bypost'=>&$Eleanor->sc_post,
		'multilang'=>Eleanor::$vars['multilang'],
		'options'=>array(
			'htmlsafe'=>true,
		),
	),
);