_html = '';
$this->_object = NULL;
$this->_css = '';
$this->_style = '';
$this->_script = '';
$this->_js = '';
$this->_messages = '';
$this->_select2 = false;
$this->_inputMask = false;
$this->_inputSwitch = false;
$this->_inputWizard = false;
$this->_inputTag = false;
$this->_dateTime = false;
}
public function renderStyle() {
$this->_style .= '';
return $this->_style;
}
public function renderScript() {
$this->_script .= '';
$this->_script .= '';
$this->_script .= '';
if ($this->_select2) {
$this->_script .= '';
}
if ($this->_dateTimePicker) {
$this->_script .= '';
$this->_script .= '';
}
if ($this->_inputMask) {
$this->_script .= '';
}
if ($this->_inputTag) {
$this->_script .= '';
}
if ($this->_inputSwitch) {
$this->_script .= '';
}
if ($this->_inputWizard) {
$this->_script .= '';
}
$this->_script .= '';
$this->_script .= $this->_js;
return $this->_script;
}
public function renderForm($display = true, $action = NULL, $method = 'POST', $enctype = 'multipart/form-data'){
$this->generateForms();
$form = ($this->_messages ? implode("\n", $this->_messages) : '') . $this->_html;
if ($display)
echo $form;
return $form;
}
public function generateForms($action = NULL, $method = 'POST', $enctype = 'multipart/form-data'){
if (!$this->_forms || empty($this->_forms))
return;
if (!$method)
$method = 'POST';
if (!$enctype)
$enctype = 'multipart/form-data';
foreach ($this->_forms as $form) {
$class_div = isset($form['class_div']) ? $form['class_div'] : '';
$action = isset($form['action']) ? $form['action'] : $action;
$method = isset($form['method']) ? $form['method'] : $method;
$enctype = isset($form['enctype']) ? $form['enctype'] : $enctype;
$css = isset($form['style']) ? $form['style'] : '';
$class = isset($form['class']) ? $form['class'] : '';
$id = (isset($form['id']) && $form['id']) ? $form['id'] : false;
$icon = (isset($form['icon']) && $form['icon']) ? $form['icon'] : false;
$title = (isset($form['title']) && $form['title']) ? $form['title'] : '';
// OPEN FORM
$this->_html .= '
';
$this->_js .= '
';
}
public function inputSwitch($p = array()) {
$this->_html .='
';
}
public function inputText($p = array()){
if (isset($p['lang']) && $p['lang'] === true) {
return $this->inputTextL($p);
}
$default_value = (isset($p['default']) ? $p['default'] : '');
$disabled = ((isset($p['disabled']) && $p['disabled']) ? 'disabled="disabled"' : '');
$this->_html .= '
';
}
public function inputTextL($p = array()){
$default_value = (isset($p['default']) ? $p['default'] : '');
$defaultLanguage = isset($p['default_language']) ? $p['default_language'] : 2;
$this->_html .= '
';
}
public function inputTextarea($p = array()){
if (isset($p['lang']) && $p['lang'] === true) {
return $this->inputTextareaL($p);
}
}
public function inputTextareaL($p = array()){
$default_value = (isset($p['default']) ? $p['default'] : '');
$defaultLanguage = isset($p['default_language']) ? $p['default_language'] : 2;
$this->_html .= '
';
}
public function inputFile($p = array()){
$this->_html .= '
';
}
public function inputSelect($p = array()){
$disabled = ((isset($p['disabled']) && $p['disabled']) ? 'disabled="disabled"' : '');
$this->_html .= '
';
}
public function inputSelectStyled($p = array()){
$disabled = ((isset($p['disabled']) && $p['disabled']) ? 'disabled="disabled"' : '');
$this->_html .= '
';
}
public function inputBool($p = array()) {
$checked = ((isset($p['default']) && $p['default']) ? $p['default'] : false);
$this->_html .= '
';
}
public function inputRadio($p = array()) {
$this->_html .= '
';
}
public function inputCheckbox($p = array()){
$checked = ((isset($p['checked']) && $p['checked']) ? $p['checked'] : false);
if ($this->_object)
$checked = $this->_object->{$p['name']};
$this->_html .= '
';
}
public function inputDate($p = array()){
$this->_dateTime = true;
$default = ((isset($p['default']) && $p['default']) ? $p['default'] : '');
$this->_html .= '
';
}
public function inputRte($p = array()){
$this->_html .= '
';
}
public function selectCheck($p = array()){
$this->_selectCheck = true;
$size = ((isset($p['size']) && $p['size']) ? (int) $p['size'] : 5);
$this->_html .= '
';
}
public function inputButtonLink($p = array()){
$css = isset($p['css']) && $p['css'] ? $p['css'] : false;
$class = isset($p['css']) && $p['css'] ? $p['css'] : false;
$this->_html .= '
'.$p['label'].'
';
}
public function inputButton($p = array()){
$label = isset($p['label']) && $p['label'] ? $p['label'] : false;
$css = isset($p['css']) && $p['css'] ? $p['css'] : false;
$class = isset($p['class']) && $p['class'] ? $p['class'] : false;
$this->_html .= '
';
}
public function inputSubmit($p = array()){
$label = isset($p['label']) && $p['label'] ? $p['label'] : false;
$css = isset($p['css']) && $p['css'] ? $p['css'] : false;
$class = isset($p['class']) && $p['class'] ? $p['class'] : false;
if($label) {
$this->_html .= '
';
}
}
public function inputHidden($p = array()){
$id = ((isset($p['id']) && $p['id']) ? $p['id'] : $p['name']);
$this->_html .= '
';
}
public function displayError($message){
$this->_messages[] = '
' . $message . '
';
}
public function displayMessage($message){
return $this->_messages[] = '
' . $message . '
';
}
public function displayConf($message){
return $this->_messages[] = '
' . $message . '
';
}
public static function echoConfirmation($message){
echo '
Success:
'.$message.'
';
}
public static function echoError($message){
echo '
Error:
'.$message.'
';
}
public static function displaySuccess($message){
echo '
'.$message.'
';
}
public static function displayWarning($message){
echo '
'.$message.'
';
}
public static function displayErrors($message){
echo '
'.$message.'
';
}
public function displayFlags($languages, $default_language, $ids, $id, $return = false, $use_vars_instead_of_ids = false, $link_flag_img = "../img/l/", $display ='block')
{
if (sizeof($languages) == 1)
return false;
$output = '
Choose language:
';
foreach ($languages as $language) {
if($use_vars_instead_of_ids)
$output .= '
';
else
$output .= '
';
}
$output .= '
';
if ($return)
return $output;
echo $output;
}
}