function showType() { global $notify_subscribe; $data['type'] = get('type', '', 'pg'); $res = mysql_query($notify_subscribe[$data['type']]); for ($i = 0; $i < mysql_num_fields($res); $i++) { $field = mysql_fetch_field($res); $comment = sql_getValue("\n\t\t\t\t\tSELECT \n\t\t\t\t\tcomment\n\t\t\t\t\tFROM phpmyadmin.pma_column_info \n\t\t\t\t\tWHERE \n\t\t\t\t\ttable_name='" . $field->table . "'\n\t\t\t\t\tAND column_name='" . $field->name . "'\n\t\t\t\t\tAND db_name='" . MYSQL_DB . "' \n\t\t\t\t\t"); $data['fields'][$field->table . '.' . $field->name] = $comment; } $data['fld'] = sql_getRow('SELECT * FROM notify_subscribe_tpls WHERE id="' . $data['type'] . '"'); include_fckeditor(); $oFCKeditor =& Registry::get('FCKeditor'); $oFCKeditor->ToolbarSet = 'Small'; $oFCKeditor->Value = $data['fld']['header']; $data['fld']['header'] = $oFCKeditor->ReturnFCKeditor('fld[header]', '100%', '100px'); $oFCKeditor =& Registry::get('FCKeditor'); $oFCKeditor->ToolbarSet = 'Source'; $oFCKeditor->Value = $data['fld']['template']; $data['fld']['template'] = $oFCKeditor->ReturnFCKeditor('fld[template]', '100%', '200px'); $oFCKeditor =& Registry::get('FCKeditor'); $oFCKeditor->ToolbarSet = 'Small'; $oFCKeditor->Value = $data['fld']['footer']; $data['fld']['footer'] = $oFCKeditor->ReturnFCKeditor('fld[footer]', '100%', '100px'); $this->AddStrings($data); $tpl = NOTIFY_DIR . 'tmpls/' . $this->name . '.editform.tmpl'; if (is_file($tpl)) { return Parse($data, $tpl); } return $content; }
function EditForm() { $id = (int) get('id', 0); if ($id) { $row = $this->GetRow($id); } else { $row['id'] = $id; $row['date'] = time(); $row['notify_date'] = 0; $row['text'] = ''; } $GLOBALS['title'] = $this->str($id ? 'edit' : 'add'); $this->AddStrings($row); $client_id = get('client_id', 0, 'g'); $row['client_id'] = $client_id; $row['date'] = date('Y-m-d H:i', $row['date']); if ($row['notify_date']) { $row['notify_date'] = date('Y-m-d H:i', $row['notify_date']); } else { $row['notify_date'] = ''; } include_fckeditor(); $oFCKeditor =& new FCKeditor(); $oFCKeditor->ToolbarSet = 'Simple'; $oFCKeditor->CanUpload = false; $oFCKeditor->Value = isset($row['text']) ? $row['text'] : ''; $row['text'] = $oFCKeditor->ReturnFCKeditor('fld[text]', '100%', '100%'); return $this->Parse($row, $this->name . '.editform.tmpl'); }
function Send_Email($mailto = '', $subject = '', $text = '') { $this->AddStrings($row); // Берем из сессии $use_client_selection = get('use_client_selection', array(), 's'); if ($mailto == 'use_client_selection' && $use_client_selection) { $client_selection = join(' AND ', $use_client_selection); $row['use_client_selection'] = '1'; $emails = $this->GetValue("SELECT COUNT(*) FROM auth_users AS c WHERE subscribe=1 AND " . $client_selection); $row['mailto'] = sprintf($this->str('client_selection'), $emails); $row['mailto_readonly'] = 'READONLY'; } else { $row['mailto'] = h($mailto); $row['use_client_selection'] = '0'; $row['client_selector']['value'] = ' '; } $row['subject'] = h($subject); $managers = sql_getRows("SELECT id, CONCAT(fullname,' <',email,'>') FROM admins WHERE email<>'' " . " AND fullname!='' ORDER BY fullname", true); $row['managers'] = $this->GetArrayOptions($managers, $this->user['id'], true); ### include_fckeditor(); $oFCKeditor = new FCKeditor(); $oFCKeditor->ToolbarSet = 'Common'; $oFCKeditor->Value = $text; $row['editor'] = $oFCKeditor->ReturnFCKeditor('editor[html]', '100%', '100%'); ### return $this->Parse($row, $this->name . '.tmpl'); }
function getContent() { $data = array(); $func = get('func', '', 'pg'); if (!empty($func)) { $func = get('func', '', 'pg'); if (!empty($func)) { $data = $this->{$func}(); } } else { global $user; $data['current_user'] = $user['id']; $data['managers'] = sql_getRows("SELECT id, CONCAT(login,' (',email,') ') as name FROM admins", true); $this->AddStrings($data); include_fckeditor(); $oFCKeditor = new FCKeditor(); $oFCKeditor->ToolbarSet = 'Common'; $oFCKeditor->Value = ''; $data['editor'] = $oFCKeditor->ReturnFCKeditor('fld[html]', '100%', '100%'); $this->AddStrings($data); } $tpl = strtolower($this->dir . '/' . $this->name . (!empty($func) ? '.' . $func : '') . '.tmpl'); if (is_file($tpl)) { return Parse($data, $tpl); } else { return $data; } }
function EditForm() { $id = get('id'); if ($id) { $row = $this->GetRow($id); } else { $row['visible'] = 1; $row['content_type'] = 'html'; $row['text'] = ''; $row['user_id'] = ''; } $row['private_checked'] = $row['user_id'] ? 'checked' : ''; $row['user_id'] = $GLOBALS['user']['id']; $row['options'] = $this->getSetOptions('content_type', $row['content_type']); $row['vis_etext'] = $row['content_type'] == 'text' ? 'show' : 'hide'; $row['vis_ehtml'] = $row['content_type'] == 'html' ? 'show' : 'hide'; ### include_fckeditor(); $oFCKeditor = new FCKeditor(); $oFCKeditor->ToolbarSet = 'Common'; $oFCKeditor->Value = $row['text']; $row['editor'] = $oFCKeditor->ReturnFCKeditor('editor[html]', '100%', '100%'); ### $this->AddStrings($row); return $this->Parse($row, $this->name . '.editform.tmpl'); }
function EditForm() { $id = (int) get('id'); if ($id) { $row = $this->GetRow($id); } $GLOBALS['title'] = $this->str('title_one'); $row['id'] = $id; $row['visible_checked'] = isset($row['visible']) ? 'checked' : (!$id ? 'checked' : ''); $trgt = get('trgt'); $row['target'] = $trgt ? $trgt : 'tmp' . $this->name; include_fckeditor(); $oFCKeditor =& new FCKeditor(); $oFCKeditor->ToolbarSet = 'Small'; $oFCKeditor->CanUpload = false; $oFCKeditor->Value = isset($row['description']) ? $row['description'] : ''; $row['description'] = $oFCKeditor->ReturnFCKeditor('fld[description]', '100%', '275'); $this->AddStrings($row); return $this->Parse($row, $this->name . '.editform.tmpl'); }
function EditDetailForm() { $id = (int) get('id'); $row['support_id'] = (int) get('support_id'); $row['visible'] = 1; $this->table = $this->dialog_table; if ($id) { $row = $this->GetRow($id); } else { } $this->AddStrings($row); include_fckeditor(); $oFCKeditor =& new FCKeditor(); $oFCKeditor->ToolbarSet = 'Common'; $oFCKeditor->CanUpload = false; $oFCKeditor->Value = $id ? $row['text'] : ''; $row['text'] = $oFCKeditor->ReturnFCKeditor('fld[text]', '100%', '100%'); $row['thisname'] = $this->name; $row['save'] = $this->str('save'); $row['close'] = $this->str('cancel'); $GLOBALS['title'] = $this->str('title'); return $this->Parse($row, $this->name . '.editdetailform.tmpl'); }
function EditForm() { $id = (int) get('id', 0); if ($id) { $row = $this->getRow($id); $type = $row['html'] ? 'html' : 'img'; } else { $row['id'] = $id; $row['visible'] = 1; $row['target'] = 1; $row['position'] = ''; $row['root_id'] = get('root_id', '100'); $columns = sql_getRows('SHOW COLUMNS FROM banners', true); if (isset($columns['alt_image'])) { $row['alt_image'] = ''; } if (isset($columns['show_at_sites'])) { $row['show_at_sites'] = ''; } $type = 'image'; } $GLOBALS['title'] = $this->str($id ? 'edit' : 'add'); $this->AddStrings($row); $row['visible_checked'] = $row['visible'] ? 'checked' : ''; if (!empty($row['pages'])) { $row['pages_checked'] = 'checked'; } if (isset($row['image']) && is_file(".." . $row['image'])) { $ext = strtolower(get_file_ext($row['image'])); $size = getimagesize(".." . $row['image']); // Рисуем картинку if ($ext == '.gif' || $ext == '.jpg' || $ext == '.png') { $row['img_preview'] = '<img src="' . $row['image'] . '" ' . $size[3] . ' alt="" />'; } elseif ($ext == '.swf') { $row['img_preview'] = str_replace(array('{filename}', '{width}', '{height}'), array($row['image'], $size[0], $size[1]), $this->swf_code); } } if (isset($row['alt_image']) && is_file(".." . $row['alt_image'])) { $ext = strtolower(get_file_ext($row['alt_image'])); $size = getimagesize(".." . $row['alt_image']); // Рисуем картинку if ($ext == '.gif' || $ext == '.jpg' || $ext == '.png') { $row['alt_img_preview'] = '<img src="' . $row['alt_image'] . '" ' . $size[3] . ' alt="" />'; } } $row['options_target'] = $this->GetArrayOptions(array('_self', '_blank'), $row['target'], true, true); // Список положений баннера foreach ($this->position as $key => $val) { $options_pos[$key] = utf($val['display'][int_langId()]); } $row['options_pos'] = $this->GetArrayOptions($options_pos, $row['position'], true, false); // Список сайтов if (isset($row['show_at_sites'])) { global $site_domains; $sites = array(); $root = domainRootID(); foreach ($site_domains as $key => $val) { foreach ($val['langs'] as $l) { if ($l['root_id'] != $root) { $sites[$l['root_id']] = (LANG_SELECT && !empty($val['descr_' . lang()]) ? $val['descr_' . lang()] : (!empty($val['descr']) ? $val['descr'] : $val['name'])) . ' (' . $l['descr'] . ')'; } } } $row['sites'] = $sites; if (!empty($row['show_at_sites'])) { $row['show_at_sites'] = explode(",", $row['show_at_sites']); } } // Список вариантов для редактирования баннеров $options_type = array('img', 'html'); $row['options_type'] = $this->GetArrayOptions($options_type, $type, false, true); // Текст для HTML баннера include_fckeditor(); $oFCKeditor = new FCKeditor(); $oFCKeditor->ToolbarSet = 'Common'; $oFCKeditor->Value = isset($row['html']) ? $row['html'] : ''; $row['html'] = $oFCKeditor->ReturnFCKeditor('fld[html]', '100%', '300px'); return $this->Parse($row, $this->name . '.editform.tmpl'); }
function EditForm() { $id = (int) get('id', 0); if ($id) { $row = $this->getRow($id); $type = $row['html'] ? 'html' : 'img'; } else { $row['id'] = $id; $row['visible'] = 1; $row['target'] = 1; $row['position'] = ''; $row['root_id'] = get('root_id', '100'); $type = 'image'; } $GLOBALS['title'] = $this->str($id ? 'edit' : 'add'); $this->AddStrings($row); $row['visible_checked'] = $row['visible'] ? 'checked' : ''; if (!empty($row['pages'])) { $row['pages_checked'] = 'checked'; } if (isset($row['image']) && is_file(".." . $row['image'])) { $ext = strtolower(get_file_ext($row['image'])); $size = getimagesize(".." . $row['image']); // Рисуем картинку if ($ext == '.gif' || $ext == '.jpg' || $ext == '.png') { $row['img_preview'] = '<img src="' . $row['image'] . '" ' . $size[3] . ' alt="" />'; } elseif ($ext == '.swf') { $row['img_preview'] = str_replace(array('{filename}', '{width}', '{height}'), array($row['image'], $size[0], $size[1]), $this->swf_code); } } $row['options_target'] = $this->GetArrayOptions(array('_self', '_blank'), $row['target'], true, true); // Список положений баннера foreach ($this->position as $key => $val) { $options_pos[$key] = utf($val['display'][int_langId()]); } $row['options_pos'] = $this->GetArrayOptions($options_pos, $row['position'], true, false); // Список вариантов для редактирования баннеров $options_type = array('img', 'html'); $row['options_type'] = $this->GetArrayOptions($options_type, $type, false, true); // Текст для HTML баннера include_fckeditor(); $oFCKeditor = new FCKeditor(); $oFCKeditor->ToolbarSet = 'Common'; $oFCKeditor->Value = $row['html']; $row['html'] = $oFCKeditor->ReturnFCKeditor('fld[html]', '100%', '300px'); return $this->Parse($row, $this->name . '.editform.tmpl'); }
function EditForm() { // получает значение из GET, POST, COOKIE, SESSION // 1 параметр - название переменной, 2 параметр - дефолтное значение $id = (int) get('id', 0); if ($id) { // выбирает строку из $this->table по id $row = $this->GetRow($id); } else { $row['id'] = $id; } // конвертим дату в нужный формат для отображения if (!empty($row['date'])) { $row['date'] = date('d.m.Y', strtotime($row['date'])); } else { $row['date'] = date('d.m.Y'); } // добавляет в шаблон дефолтные строковые константы $this->AddStrings($row); $row['types'] = array('article' => $this->str('article'), 'news' => $this->str('news'), 'action' => $this->str('action')); // подключение FCKeditora include_fckeditor(); $oFCKeditor =& Registry::get('FCKeditor'); $oFCKeditor->ToolbarSet = 'Common'; $oFCKeditor->CanUpload = false; $oFCKeditor->Value = isset($row['text']) ? $row['text'] : ''; $row['text'] = $oFCKeditor->ReturnFCKeditor('fld[text]', '100%', '100%'); //-- $row['visible'] = !empty($row['visible']) ? ' checked="checked"' : ''; return $this->Parse($row, $this->name . '.editform.tmpl'); }