function CreateEmail($mailto = '', $subject = '', $text = '') { $this->AddStrings($row); if ($mailto == 'use_client_selection' && $_SESSION['use_client_selection']) { $client_selection = join(' AND ', $_SESSION['use_client_selection']); $row['use_client_selection'] = '1'; $emails = $this->GetValue("SELECT COUNT(*) FROM clients AS c WHERE subscribe=1 AND " . $client_selection); $row['mailto'] = sprintf($this->str('client_selection'), $emails); $row['mailto_readonly'] = 'READONLY'; } else { $row['mailto'] = htmlspecialchars($mailto); $row['use_client_selection'] = '0'; $row['client_selector']['value'] = ' '; } $row['subject'] = htmlspecialchars($subject); $managers = sql_getRows("SELECT id, CONCAT(fullname,' <',email,'>') FROM admins WHERE email<>'' " . (is_root() ? '' : "AND id IN (" . join(',', $this->user['subst']) . ") AND fullname!=''") . " ORDER BY fullname", true); $row['managers'] = $this->GetArrayOptions($managers, $this->user['id'], true); ### include "editor/fckeditor.php"; $oFCKeditor = new FCKeditor(); $oFCKeditor->ToolbarSet = 'Common'; $oFCKeditor->Value = $text; $row['editor'] = $oFCKeditor->ReturnFCKeditor('editor[html]', '100%', '100%'); ### return 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 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 render() { include_once JIEQI_ROOT_PATH . '/lib/html/form/fckeditor/fckeditor.php'; $editor = new FCKeditor(); $editor->Value = $this->getValue(); return $editor->ReturnFCKeditor($this->getName(), $this->getWidth(), $this->getHeight()); }
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', 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 EditDetailForm() { $id = (int) get('id'); $row['kb_id'] = (int) get('kb_id'); $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'] : ''; //$oFCKeditor->BasePath = BASE.'editor/'; $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'); }
} } $grp_text = zen_get_email_group($db, $P['grp'], $id); if (HTML_EDITOR_PREFERENCE != "NONE" && EMAIL_USE_HTML == 'true') { $out = zen_draw_form('email_template', FILENAME_ADDON_MODULES_ADMIN, zen_get_all_get_params(array('action', 'id', 'delete', 'module')) . 'action=' . $_GET['action'] . '&module=' . FILENAME_EMAIL_TEMPLATES, 'post') . ' <table width="100%" border="0" cellspacing="1" cellpadding="2"> <tr class="dataTableHeadingRow"><td class="dataTableHeadingContent" colspan="2" height="25"><b>' . $form_title . '</b></td></tr> <tr class="dataTableRow"><td class="dataTableContent" width="30%" nowrap><b>' . TABLE_HEADING_GROUP . '</b>' . TEXT_FIELD_REQUIRED . '</td><td class="dataTableContent" width="70%">' . $grp_text . '</td></tr> <tr class="dataTableRow"><td class="dataTableContent" nowrap><b>' . TABLE_HEADING_TITLE . '</b>' . TEXT_FIELD_REQUIRED . '</td><td>' . zen_draw_input_field('title', stripslashes($P['title']), zen_set_field_length(TABLE_EMAIL_TEMPLATES, 'title', 50)) . '</td></tr> <tr class="dataTableRow"><td class="dataTableContent" nowrap><b>' . TABLE_HEADING_EMAIL_SUBJECT . '</b></td><td>' . zen_draw_input_field('subject', stripslashes($P['subject']), zen_set_field_length(TABLE_EMAIL_TEMPLATES, 'subject', 50)) . '</td></tr> <tr class="dataTableRow"><td class="dataTableContent" valign="top"><b>' . TABLE_HEADING_EMAIL_CONTENTS . '</b>' . TABLE_HEADING_HELP . '</td><td>'; if (HTML_EDITOR_PREFERENCE == "FCKEDITOR") { include DIR_WS_INCLUDES . 'fckeditor.php'; $oFCKeditor = new FCKeditor(); $oFCKeditor->Value = stripslashes($P['contents']); $out .= $oFCKeditor->ReturnFCKeditor('contents', '700', '350'); //instanceName, width, height (px or %) } else { // using HTMLAREA or just raw "source" $out .= zen_draw_textarea_field('contents', 'soft', '76', '20', stripslashes($P['contents']), 'style="width:100%"', 'false'); } $out .= ' </td></tr> <tr class="dataTableRow"><td class="dataTableContent" colspan="2" align="center"><br><p>' . $hidden_field . $submit_field . '</p> </td></tr> </table> </form>'; $is_html = true; } } //ロード時はここに入る if (!$is_html) { $search_query = '';