Пример #1
0
function Dwoo_Plugin_show_wysiwyg_editor(Dwoo $dwoo, $name, $id, $content, $width = '100%', $height = '350px')
{
    if (!function_exists('show_wysiwyg_editor')) {
        @(require_once CAT_PATH . '/modules/' . WYSIWYG_EDITOR . '/include.php');
        $wysiwyg_editor_loaded = true;
    }
    ob_start();
    show_wysiwyg_editor($name, $id, $content, $width, $height);
    $content = ob_get_clean();
    echo $content;
}
Пример #2
0
?>
" action="<?php 
echo WB_URL;
?>
/modules/wysiwyg/save.php" method="post">
	<input type="hidden" name="page_id" value="<?php 
echo $page_id;
?>
" />
	<input type="hidden" name="section_id" value="<?php 
echo $section_id;
?>
" />
<?php 
echo $admin->getFTAN() . "\n";
show_wysiwyg_editor('content' . $section_id, 'content' . $section_id, $content, '100%', '350');
?>
    <table  style="padding-bottom: 10px; width: 100%;">
		<tr>
            <td style="text-align: left;margin-left: 1em;">
                <input name="modify" type="submit" value="<?php 
echo $TEXT['SAVE'];
?>
" style="min-width: 100px; margin-top: 5px;" />
                <input name="pagetree" type="submit" value="<?php 
echo $TEXT['SAVE'] . ' &amp; ' . $TEXT['BACK'];
?>
" style="min-width: 100px; margin-top: 5px;" />
			</td>
            <td style="text-align: right;margin-right: 1em;">
                <input name="cancel" type="button" value="<?php 
echo registerEditArea('content', 'php', true, 'both', true, true, 600, 450, $toolbar);
function show_wysiwyg_editor($name, $id, $content, $width, $height)
{
    echo '<textarea name="' . $name . '" id="' . $id . '" style="width: ' . $width . '; height: ' . $height . ';">' . $content . '</textarea>';
}
?>
<form action="intro2.php" method="post">
<?php 
print $admin->getFTAN();
?>
<input type="hidden" name="page_id" value="{PAGE_ID}" />
<table cellpadding="0" cellspacing="0" border="0" class="form_submit">
	<tr>
		<td colspan="2">
		<?php 
show_wysiwyg_editor('content', 'content', $content, '100%', '500px');
?>
		</td>
	</tr>
	<tr>
		<td class="left">
			<input type="submit" value="<?php 
echo $TEXT['SAVE'];
?>
" class="submit" />
		</td>
		<td class="right">
			<input type="button" value="<?php 
echo $TEXT['CANCEL'];
?>
" onclick="javascript: window.location = 'index.php';" class="submit" />
Пример #4
0
        
        <tr>
            <td colspan="2">&nbsp;                    
            </td>
        </tr>
        
        <tr>
            <td valign="top" class="setting_name">
                <?php 
echo $WB_TEXT['COMMENT'];
?>
:
            </td>
            <td>
                <?php 
show_wysiwyg_editor("comments", "comments", htmlspecialchars($fetch_content['comments']), "100%", "400px");
?>
            </td>
        </tr>
        
        <tr>
            <td colspan="2">&nbsp;                  
            </td>
        </tr>
 
        <tr>
            <td align="left">
                <button  class="save" name="save" type="submit"><?php 
echo $WB_TEXT['SAVE'];
?>
</button>            
        echo '<textarea name="long" style="width: 98%; height: ' . $long_textareaheight . 'px;">' . $fetch_content['content_long'] . '</textarea>';
    } else {
        show_wysiwyg_editor("long", "long", htmlspecialchars($fetch_content['content_long']), "100%", "" . (75 + $long_textareaheight) . "px");
    }
    echo "\n</td></tr>\n";
}
//Editor EXTRA
if ($extra_textareaheight < 10) {
    echo '<tr><td><textarea name="extra" rows="30" cols="3" style="display:none">' . $fetch_content['content_extra'] . '</textarea></td></tr>';
} else {
    echo '<tr><td>' . $MOD_TOPICS['EXTRA'] . ':</td></tr>
	<tr><td>';
    if ($topics_use_wysiwyg == 0) {
        echo '<textarea name="extra" rows="30" cols="3" style="width: 98%; height: ' . $extra_textareaheight . 'px;">' . $fetch_content['content_extra'] . '</textarea>';
    } else {
        show_wysiwyg_editor("extra", "extra", htmlspecialchars($fetch_content['content_extra']), "100%", "" . (75 + $extra_textareaheight) . "px");
    }
    echo "\n</td></tr>\n";
}
?>

</table>
<hr/>
<?php 
$diff = time() - $fetch_content['posted_first'];
?>
<table class="row_a" cellpadding="2" cellspacing="0" border="0" width="100%">
<tr><td style="width:70%; padding-right:10px;">
<div <?php 
if ($fetch_content['content_long'] == '') {
    echo ' style="display:none;"';
 public function dlgNewsletter()
 {
     global $dbNewsletterPreview;
     global $parser;
     global $dbProvider;
     global $dbContact;
     global $dbContactArrayCfg;
     global $newsletterCommands;
     global $dbNewsletterTemplates;
     global $dbNewsletterArchive;
     global $dbRegister;
     global $tools;
     global $dbNewsletterCfg;
     // bestimmtes Archiv laden?
     isset($_REQUEST[dbKITnewsletterArchive::field_id]) ? $aid = $_REQUEST[dbKITnewsletterArchive::field_id] : ($aid = -1);
     // existiert bereits eine Vorschau?
     isset($_REQUEST[dbKITnewsletterPreview::field_id]) ? $pid = $_REQUEST[dbKITnewsletterPreview::field_id] : ($pid = -1);
     // kit_contact mit kit_register abgleichen?
     $cfgAdjustRegister = $dbNewsletterCfg->getValue(dbKITnewsletterCfg::cfgAdjustRegister);
     // Simulation aktiv?
     $cfgSimulateMailing = $dbNewsletterCfg->getValue(dbKITnewsletterCfg::cfgSimulateMailing);
     if ($cfgSimulateMailing) {
         $this->setMessage(kit_msg_newsletter_simulate_mailing . $this->getMessage());
     }
     if ($aid != -1) {
         // Archiv laden
         $where = array();
         $where[dbKITnewsletterArchive::field_id] = $aid;
         $result = array();
         if (!$dbNewsletterArchive->sqlSelectRecord($where, $result)) {
             $this->setError(sprintf('[%s - %s] %s', __METHOD__, __LINE__, $dbNewsletterArchive->getError()));
             return false;
         }
         if (count($result) < 1) {
             // Datensatz nicht gefunden
             $this->setError(sprintf(kit_error_item_id, $aid));
             return false;
         }
         $result = $result[0];
         foreach ($result as $key => $value) {
             switch ($key) {
                 case dbKITnewsletterArchive::field_distributions:
                 case dbKITnewsletterArchive::field_groups:
                     $value = explode(',', $value);
                     break;
             }
             $_REQUEST[$key] = $value;
         }
     } elseif ($pid != -1) {
         $where = array();
         $where[dbKITnewsletterPreview::field_id] = $pid;
         $preview = array();
         if (!$dbNewsletterPreview->sqlSelectRecord($where, $preview)) {
             $this->setError(sprintf('[%s - %s] %s', __METHOD__, __LINE__, $dbNewsletterPreview->getError()));
             return false;
         }
         if (count($preview) < 1) {
             // Datensatz nicht gefunden
             $this->setError(sprintf(kit_error_item_id, $pid));
             return false;
         }
         $prev_array = explode(dbKITnewsletterPreview::array_separator, $preview[0][dbKITnewsletterPreview::field_view]);
         foreach ($prev_array as $item) {
             list($key, $value) = explode(dbKITnewsletterPreview::array_separator_value, $item);
             switch ($key) {
                 case dbKITnewsletterArchive::field_distributions:
                 case dbKITnewsletterArchive::field_groups:
                     $value = explode(',', $value);
                     break;
             }
             $_REQUEST[$key] = $value;
         }
     }
     $items = '';
     $row = new Dwoo_Template_File($this->template_path . 'backend.newsletter.dlg.tr.htt');
     // show newsletter archive
     $SQL = sprintf("SELECT %s, %s, %s FROM %s ORDER BY %s DESC", dbKITnewsletterArchive::field_id, dbKITnewsletterArchive::field_subject, dbKITnewsletterArchive::field_update_when, $dbNewsletterArchive->getTableName(), dbKITnewsletterArchive::field_id);
     $newsletter_archive = array();
     if (!$dbNewsletterArchive->sqlExec($SQL, $newsletter_archive)) {
         $this->setError(sprintf('[%s - %s] %s', __METHOD__, __LINE__, $dbNewsletterArchive->getError()));
         return false;
     }
     if (count($newsletter_archive) > 0) {
         // show newsletter archive for selection
         $option = sprintf('<option value="-1">%s</option>', kit_text_please_select);
         foreach ($newsletter_archive as $item) {
             $option .= sprintf('<option value="%s">[%04d] %s - %s', $item[dbKITnewsletterArchive::field_id], $item[dbKITnewsletterArchive::field_id], date(CFG_DATETIME_STR, strtotime($item[dbKITnewsletterArchive::field_update_when])), $item[dbKITnewsletterArchive::field_subject]);
         }
         $archive = sprintf('<select id="%s" name="%s" onchange="javascript:addSelectToLink(\'%s\',\'%s\');">%s</select>', dbKITnewsletterArchive::field_id, dbKITnewsletterArchive::field_id, sprintf('%s&amp;%s=%s%s&amp;%s=', $this->page_link, self::request_action, self::action_newsletter, defined('LEPTON_VERSION') && isset($_GET['leptoken']) ? sprintf('&amp;leptoken=%s', $_GET['leptoken']) : '', dbKITnewsletterArchive::field_id), dbKITnewsletterArchive::field_id, $option);
         $items .= $parser->get($row, array('label' => sprintf('<i>%s</i>', kit_label_newsletter_archive_select), 'value' => $archive));
         $items .= $parser->get($row, array('label' => '', 'value' => '<hr />'));
     }
     // get all service provider for selection list
     $SQL = sprintf("SELECT %s,%s,%s FROM %s WHERE %s != '%s' ORDER BY %s ASC", dbKITprovider::field_id, dbKITprovider::field_name, dbKITprovider::field_email, $dbProvider->getTableName(), dbKITprovider::field_status, dbKITprovider::status_deleted, dbKITprovider::field_name);
     $provider_list = array();
     if (!$dbProvider->sqlExec($SQL, $provider_list)) {
         $this->setError(sprintf('[%s - %s] %s', __METHOD__, __LINE__, $dbProvider->getError()));
         return false;
     }
     if (count($provider_list) < 1) {
         // error: no provider defined!
         $this->setError(kit_error_no_provider_defined);
         return false;
     }
     // select provider
     $option = sprintf('<option value="-1">%s</option>', kit_text_please_select);
     isset($_REQUEST[dbKITnewsletterArchive::field_provider]) ? $id = $_REQUEST[dbKITnewsletterArchive::field_provider] : ($id = -1);
     foreach ($provider_list as $item) {
         $item[dbKITprovider::field_id] == $id ? $selected = ' selected="selected"' : ($selected = '');
         $option .= sprintf('<option value="%s"%s>%s</option>', $item[dbKITprovider::field_id], $selected, sprintf('[%s] %s', $item[dbKITprovider::field_email], $item[dbKITprovider::field_name]));
     }
     $provider = sprintf('<select name="%s">%s</select>', dbKITnewsletterArchive::field_provider, $option);
     $items .= $parser->get($row, array('label' => kit_label_provider, 'value' => $provider));
     // Select Newsletter Type
     $SQL = sprintf("SELECT * FROM %s WHERE %s='%s' AND %s='%s' ORDER BY %s ASC", $dbContactArrayCfg->getTableName(), dbKITcontactArrayCfg::field_type, dbKITcontactArrayCfg::type_newsletter, dbKITcontactArrayCfg::field_status, dbKITcontactArrayCfg::status_active, dbKITcontactArrayCfg::field_value);
     $newsletter_array = array();
     if (!$dbContactArrayCfg->sqlExec($SQL, $newsletter_array)) {
         $this->setError(sprintf('[%s - %s] %s', __METHOD__, __LINE__, $dbContactArrayCfg->getError()));
         return false;
     }
     // walk through newsletter array
     $news = '';
     isset($_REQUEST[dbKITnewsletterArchive::field_groups]) ? $news_val = $_REQUEST[dbKITnewsletterArchive::field_groups] : ($news_val = array());
     foreach ($newsletter_array as $news_item) {
         // wenn erforderlich kit_contact mit der db_kit_register abgleichen...
         if ($cfgAdjustRegister) {
             // Newsletter Adressaten ermitteln...
             $SQL = sprintf('SELECT %1$s, %2$s, %3$s FROM %4$s WHERE %5$s=\'%6$s\' AND ((%7$s LIKE \'%8$s\') OR (%7$s LIKE \'%8$s,%%\') OR (%7$s LIKE \'%%,%8$s\') OR (%7$s LIKE \'%%%8$s,%%\'))', dbKITcontact::field_email, dbKITcontact::field_email_standard, dbKITcontact::field_id, $dbContact->getTableName(), dbKITcontact::field_status, dbKITcontact::status_active, dbKITcontact::field_newsletter, $news_item[dbKITcontactArrayCfg::field_identifier]);
             // 8
             $result = array();
             if (!$dbContact->sqlExec($SQL, $result)) {
                 $this->setError(sprintf('[%s - %s] %s', __METHOD__, __LINE__, $dbContact->getError()));
                 return false;
             }
             $this->setMessage($this->getMessage() . sprintf(kit_msg_newsletter_adjust_register, $news_item[dbKITcontactArrayCfg::field_identifier]));
             $count = 0;
             $email_array = array();
             foreach ($result as $contact) {
                 $emails = explode(';', $contact[dbKITcontact::field_email]);
                 list($type, $email) = explode('|', $emails[$contact[dbKITcontact::field_email_standard]]);
                 $where = array(dbKITregister::field_email => $email);
                 $email_array[] = $email;
                 $register = array();
                 if (!$dbRegister->sqlSelectRecord($where, $register)) {
                     $this->setError(sprintf('[%s - %s] %s', __METHOD__, __LINE__, $dbRegister->getError()));
                     return false;
                 }
                 if (count($register) > 0) {
                     // Treffer
                     $newsletters = explode(',', $register[0][dbKITregister::field_newsletter]);
                     if (in_array($news_item[dbKITcontactArrayCfg::field_identifier], $newsletters)) {
                         // befindet sich in der db_kit_register
                         $count++;
                     } else {
                         // befindet sich nicht in der db_kit_register - Annahme: dieser Newsletter wurde abbestellt, ignorieren...
                     }
                 } else {
                     // Datensatz nicht gefunden, neu anlegen
                     $data = array();
                     $data[dbKITregister::field_contact_id] = $contact[dbKITcontact::field_id];
                     $data[dbKITregister::field_email] = $email;
                     $data[dbKITregister::field_status] = dbKITregister::status_active;
                     $data[dbKITregister::field_username] = $email;
                     $data[dbKITregister::field_password] = md5($email);
                     $data[dbKITregister::field_register_key] = $tools->createGUID();
                     $data[dbKITregister::field_register_date] = date('Y-m-d H:i:s');
                     $data[dbKITregister::field_register_confirmed] = date('Y-m-d H:i:s');
                     $data[dbKITregister::field_newsletter] = $news_item[dbKITcontactArrayCfg::field_identifier];
                     $data[dbKITregister::field_update_by] = 'SYSTEM';
                     $data[dbKITregister::field_update_when] = date('Y-m-d H:i:s');
                     $aid = -1;
                     if (!$dbRegister->sqlInsertRecord($data, $aid)) {
                         $this->setError(sprintf('[%s - %s] %s', __METHOD__, __LINE__, $dbRegister->getError()));
                         return false;
                     }
                     // increase counter
                     $count++;
                 }
             }
             // foreach
         } else {
             // Newsletter Adressaten ermitteln...
             $SQL = sprintf('SELECT %1$s FROM %2$s WHERE %3$s=\'%4$s\' AND ((%5$s LIKE \'%6$s\') OR (%5$s LIKE \'%6$s,%%\') OR (%5$s LIKE \'%%,%6$s\') OR (%5$s LIKE \'%%%6$s,%%\'))', dbKITregister::field_contact_id, $dbRegister->getTableName(), dbKITregister::field_status, dbKITregister::status_active, dbKITregister::field_newsletter, $news_item[dbKITcontactArrayCfg::field_identifier]);
             // 6
             $result = array();
             if (!$dbRegister->sqlExec($SQL, $result)) {
                 $this->setError(sprintf('[%s - %s] %s', __METHOD__, __LINE__, $dbRegister->getError()));
                 return false;
             }
             //$count = $result[0][sprintf('count(%s)', dbKITregister::field_id)];
             $count = count($result);
         }
         in_array($news_item[dbKITcontactArrayCfg::field_identifier], $news_val) ? $checked = ' checked="checked"' : ($checked = '');
         $news .= sprintf('<input type="checkbox" name="%s[]" value="%s"%s /> %s (<b>%d</b> %s)<br />', dbKITnewsletterArchive::field_groups, $news_item[dbKITcontactArrayCfg::field_identifier], $checked, $news_item[dbKITcontactArrayCfg::field_value], $count, kit_text_records);
     }
     // foreach
     $items .= $parser->get($row, array('label' => kit_label_newsletter, 'value' => $news));
     // Verteiler ermitteln
     $SQL = sprintf("SELECT * FROM %s WHERE %s='%s' AND %s='%s' ORDER BY %s ASC", $dbContactArrayCfg->getTableName(), dbKITcontactArrayCfg::field_type, dbKITcontactArrayCfg::type_distribution, dbKITcontactArrayCfg::field_status, dbKITcontactArrayCfg::status_active, dbKITcontactArrayCfg::field_value);
     $distribution_array = array();
     if (!$dbContactArrayCfg->sqlExec($SQL, $distribution_array)) {
         $this->setError(sprintf('[%s - %s] %s', __METHOD__, __LINE__, $dbContactArrayCfg->getError()));
         return false;
     }
     // walk through distribution array
     $dist = '';
     isset($_REQUEST[dbKITnewsletterArchive::field_distributions]) ? $dist_val = $_REQUEST[dbKITnewsletterArchive::field_distributions] : ($dist_val = array());
     foreach ($distribution_array as $dist_item) {
         // Verteiler Adressaten ermitteln...
         $SQL = sprintf('SELECT count(%1$s) FROM %2$s WHERE %3$s=\'%4$s\' AND ((%5$s LIKE \'%6$s\') OR (%5$s LIKE \'%6$s,%%\') OR (%5$s LIKE \'%%,%6$s\') OR (%5$s LIKE \'%%%6$s,%%\'))', dbKITcontact::field_id, $dbContact->getTableName(), dbKITcontact::field_status, dbKITcontact::status_active, dbKITcontact::field_distribution, $dist_item[dbKITcontactArrayCfg::field_identifier]);
         // 6
         $result = array();
         if (!$dbContact->sqlExec($SQL, $result)) {
             $this->setError(sprintf('[%s - %s] %s', __METHOD__, __LINE__, $dbContact->getError()));
             return false;
         }
         $count = $result[0][sprintf('count(%s)', dbKITcontact::field_id)];
         in_array($dist_item[dbKITcontactArrayCfg::field_identifier], $dist_val) ? $checked = ' checked="checked"' : ($checked = '');
         $dist .= sprintf('<input type="checkbox" name="%s[]" value="%s"%s /> %s (<b>%d</b> %s)<br />', dbKITnewsletterArchive::field_distributions, $dist_item[dbKITcontactArrayCfg::field_identifier], $checked, $dist_item[dbKITcontactArrayCfg::field_value], $count, kit_text_records);
     }
     // foreach
     $items .= $parser->get($row, array('label' => kit_label_distribution, 'value' => $dist));
     // Template auswaehlen
     isset($_REQUEST[dbKITnewsletterArchive::field_template]) ? $template_id = $_REQUEST[dbKITnewsletterArchive::field_template] : ($template_id = -1);
     $where = array();
     $where[dbKITnewsletterTemplates::field_status] = dbKITnewsletterTemplates::status_active;
     $templates = array();
     if (!$dbNewsletterTemplates->sqlSelectRecord($where, $templates)) {
         $this->setError(sprintf('[%s - %s] %s', __METHOD__, __LINE__, $dbNewsletterTemplates->getError()));
         return false;
     }
     if (count($templates) < 1) {
         // es existiert noch kein Template
         $this->setMessage(kit_msg_newsletter_tpl_missing);
         // Navigation umschalten
         $this->overwriteNavigation = self::action_template;
         return $this->dlgTemplate();
     }
     $template_select = sprintf('<option value="-1">%s</option>', kit_text_please_select);
     foreach ($templates as $item) {
         $item[dbKITnewsletterTemplates::field_id] == $template_id ? $selected = ' selected="selected"' : ($selected = '');
         $template_select .= sprintf('<option value="%s"%s>%s</option>', $item[dbKITnewsletterTemplates::field_id], $selected, $item[dbKITnewsletterTemplates::field_name]);
     }
     $template_select = sprintf('<select name="%s">%s</select>', dbKITnewsletterArchive::field_template, $template_select);
     $items .= $parser->get($row, array('label' => kit_label_newsletter_tpl_select, 'value' => $template_select));
     // Subject
     isset($_REQUEST[dbKITnewsletterArchive::field_subject]) ? $sub = $_REQUEST[dbKITnewsletterArchive::field_subject] : ($sub = '');
     $subject = sprintf('<input type="text" name="%s" value="%s" />', dbKITnewsletterArchive::field_subject, $sub);
     $items .= $parser->get($row, array('label' => kit_label_mail_subject, 'value' => $subject));
     // HTML Edit
     isset($_REQUEST[dbKITnewsletterArchive::field_html]) ? $content = stripcslashes($_REQUEST[dbKITnewsletterArchive::field_html]) : ($content = '');
     ob_start();
     show_wysiwyg_editor(dbKITnewsletterArchive::field_html, dbKITnewsletterArchive::field_html, $content, '99%', '400px');
     $editor = ob_get_contents();
     ob_end_clean();
     // TEXT Edit
     $txt_editor = sprintf('<textarea name="%s" rows="20">%s</textarea>', dbKITnewsletterArchive::field_text, isset($_REQUEST[dbKITnewsletterArchive::field_text]) ? $_REQUEST[dbKITnewsletterArchive::field_text] : '');
     // show commands list
     $commands = '';
     $cmd_array = $newsletterCommands->cmd_array;
     ksort($cmd_array);
     foreach ($cmd_array as $key => $hint) {
         $commands .= sprintf('<option value="%s" title="%s">%s</option>', $key, $this->lang->translate($hint), $key);
     }
     $commands = sprintf('<select name="%s" size="%d" >%s</select>', self::request_command, count($cmd_array), $commands);
     // Mitteilungen anzeigen
     if ($this->isMessage()) {
         $intro = sprintf('<div class="message">%s</div>', $this->getMessage());
     } else {
         $intro = sprintf('<div class="intro">%s</div>', kit_intro_newsletter_create);
     }
     $data = array('form_name' => 'newsletter_dlg', 'form_action' => $this->page_link, 'action_name' => self::request_action, 'action_value' => self::action_newsletter_check, 'preview_name' => dbKITnewsletterPreview::field_id, 'preview_value' => $pid, 'intro' => $intro, 'items' => $items, 'label_html_editor' => kit_label_html_format, 'value_html_editor' => $editor, 'label_text_editor' => kit_label_newsletter_tpl_text, 'value_text_editor' => $txt_editor, 'value_commands' => $commands, 'btn_preview' => $this->lang->translate('Preview'), 'btn_abort' => $this->lang->translate('Abort'), 'abort_location' => $this->page_link);
     return $parser->get($this->template_path . 'backend.newsletter.dlg.htt', $data);
 }
Пример #7
0
	<td>
	<?php 
show_wysiwyg_editor("short", "short", htmlspecialchars($fetch_content['content_short']), "100%", "200px");
?>
	</td>
</tr>
<tr>
	<td valign="top"><?php 
echo $TEXT['LONG'];
?>
:</td>
</tr>
<tr>
	<td>
	<?php 
show_wysiwyg_editor("long", "long", htmlspecialchars($fetch_content['content_long']), "100%", "650px");
?>
	</td>
</tr>
</table>

<table cellpadding="2" cellspacing="0" border="0" width="100%">
<tr>
	<td align="left">
		<input name="save" type="submit" value="<?php 
echo $TEXT['SAVE'];
?>
" style="width: 100px; margin-top: 5px;" />
	</td>
	<td align="right">
		<input type="button" value="<?php 
Пример #8
0
        // no editor-info avaible - so we have to use empty values
        $database->query("INSERT into " . $table . " (editor, skin, menu, width, height) values ('" . WYSIWYG_EDITOR . "','','', '100%', '250px')");
        $last_insert_id = true === $database->db_handle instanceof PDO ? $database->db_handle->lastInsertId() : $database->getOne("SELECT LAST_INSERT_ID()");
        $data = array('id' => $last_insert_id, 'skin' => '', 'menu' => '', 'width' => '100%', 'height' => '250px');
    }
}
$primes = array('176053', '176063', '176081', '176087', '176089', '176123', '176129', '176153', '176159', '176161', '176179', '176191', '176201', '176207', '176213', '176221', '176227', '176237', '176299', '176303', '176317', '176321', '176327', '176243', '176261');
shuffle($primes);
$s = array_shift($primes) . "-" . array_shift($primes);
$salt = sha1($s . time() . " Und Schlag auf Schlag werd' ich zum Augenblicke sagen: du bist so schön!" . $_SERVER['HTTP_USER_AGENT'] . microtime() . $_SESSION['session_started']);
if (isset($_SESSION['wysiwyg_admin'])) {
    unset($_SESSION['wysiwyg_admin']);
}
$_SESSION['wysiwyg_admin'] = $salt;
$leptoken = isset($_GET['leptoken']) ? "?leptoken=" . $_GET['leptoken'] : "";
$interface_values = array('ADMIN_URL' => ADMIN_URL, 'salt' => $salt, 'time' => TIME(), 'id' => $data['id'], 'label_SKINS' => $MOD_WYSIWYG_ADMIN['SKINS'], 'label_TOOL' => $MOD_WYSIWYG_ADMIN['TOOL'], 'select_SKIN' => $editor_ref->build_select("skins", "skin", $data['skin']), 'select_TOOL' => $editor_ref->build_select("toolbars", "menu", $data['menu']), 'label_WIDTH' => $MOD_WYSIWYG_ADMIN['WIDTH'], 'width' => $data['width'], 'label_HEIGHT' => $MOD_WYSIWYG_ADMIN['HEIGHT'], 'height' => $data['height'], 'SAVE' => $TEXT['SAVE'], 'CANCEL' => $TEXT['CANCEL'], 'leptoken' => $leptoken);
$twig_util->resolve_path("modify.lte");
echo $parser->render($twig_modul_namespace . "modify.lte", $interface_values);
// Preview section:
$section_id = -1;
$page_id = -120;
$_GET['page_id'] = $page_id;
$preview = true;
$h = $data['height'];
$w = $data['width'];
global $id_list;
$id_list = array(1);
require_once LEPTON_PATH . "/modules/wysiwyg/modify.php";
$section_id *= -1;
show_wysiwyg_editor('content' . $section_id, 'content' . $section_id, $content, $w, $h);
Пример #9
0
    $contentLong = OutputFilterApi('ReplaceSysvar', $contentLong);
}
show_wysiwyg_editor("short", "short", htmlspecialchars($contentShort), "100%", "200px");
?>
   </td>
</tr>
<tr>
   <td valign="top"><?php 
echo $TEXT['LONG'];
?>
:</td>
</tr>
<tr>
   <td>
<?php 
show_wysiwyg_editor("long", "long", htmlspecialchars($contentLong), "100%", "650px");
?>
   </td>
</tr>
</table>

<table class="news">
<tr>
   <td align="left">
      <input name="save" type="submit" value="<?php 
echo $TEXT['SAVE'];
?>
" style="width: 100px; margin-top: 5px;" />
   </td>
   <td align="right">
      <input type="button" value="<?php 
Пример #10
0
    }
    if (!defined('WYSIWYG_EDITOR') || WYSIWYG_EDITOR == "none" || !file_exists(CAT_PATH . '/modules/' . WYSIWYG_EDITOR . '/include.php')) {
        function show_wysiwyg_editor($name, $id, $content, $width = '100%', $height = '250px', $print = true)
        {
            $editor = '<textarea name="' . $name . '" id="' . $id . '" style="width: ' . $width . '; height: ' . $height . ';">' . $content . '</textarea>';
            if ($print) {
                echo $editor;
            } else {
                return $editor;
            }
        }
    } else {
        $id_list = array();
        $result = CAT_Helper_Page::getInstance()->db()->query(sprintf("SELECT `section_id` FROM `%ssections` " . "WHERE `page_id`= '%d' AND `module`= 'wysiwyg' " . "ORDER BY position", CAT_TABLE_PREFIX, $page_id));
        if ($result->numRows() > 0) {
            while (!false == ($wysiwyg_section = $result->fetchRow(MYSQL_ASSOC))) {
                $temp_id = abs(intval($wysiwyg_section['section_id']));
                $id_list[] = 'content' . $temp_id;
            }
            require_once CAT_PATH . "/modules/wysiwyg/classes/pathfinder.php";
            $wb_path_info = new c_pathfinder($database);
            require_once CAT_PATH . '/modules/' . WYSIWYG_EDITOR . '/include.php';
        }
    }
}
if (isset($preview) && $preview == true) {
    return false;
}
$parser->setPath(dirname(__FILE__) . '/templates/default');
$parser->output('modify', array('section_id' => $section_id, 'page_id' => $page_id, 'action' => CAT_URL . '/modules/wysiwyg/save.php', 'WYSIWYG' => show_wysiwyg_editor('content' . $section_id, 'content' . $section_id, $content, $config['width'], $config['height'], false)));
Пример #11
0
			<?php 
$content = $fetch_item['full_desc'];
$name = "full_desc";
$id = "full_desc";
$width = "98%";
$height = "300px";
if (!defined('WYSIWYG_EDITOR') or WYSIWYG_EDITOR == "none" or !file_exists(WB_PATH . '/modules/' . WYSIWYG_EDITOR . '/include.php')) {
    function show_wysiwyg_editor($name, $id, $content, $width, $height)
    {
        echo '<textarea name="' . $name . '" id="' . $id . '" style="width: ' . $width . '; height: ' . $height . ';">' . $content . '</textarea>';
    }
} else {
    $id_list = array("full_desc");
    require WB_PATH . '/modules/' . WYSIWYG_EDITOR . '/include.php';
}
show_wysiwyg_editor($name, $id, $content, $width, $height);
?>
	  </td>
	</tr>
	<tr height="40" class="mod_bakery_submit_row_b">
		<td colspan="2">
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td align="left" style="padding-left: 12px;">
					<input name="save_and_return" type="submit" value="<?php 
echo $TEXT['SAVE'];
?>
" style="width: 100px;" />
					<input name="save" type="submit" value="<?php 
echo $TEXT['SAVE'] . ' &amp; ' . $TEXT['BACK'];
?>
Пример #12
0
            $backend->print_error('Cannot save file', CAT_ADMIN_URL . '/pages/modify.php?page_id=' . $page_id);
        } else {
            $backend->print_success('Success', CAT_ADMIN_URL . '/pages/modify.php?page_id=' . $page_id);
        }
    }
} else {
    if (!CAT_Helper_Validate::sanitizePost('edit_file')) {
        // find JS files
        $js = CAT_Helper_Directory::getInstance()->maxRecursionDepth(5)->setSuffixFilter(array('js'))->scanDirectory($path, true, true, $path);
        // find CSS files
        $css = CAT_Helper_Directory::getInstance()->maxRecursionDepth(5)->setSuffixFilter(array('css'))->scanDirectory($path, true, true, $path);
        $list = true;
    } else {
        $file = CAT_Helper_Directory::sanitizePath($path . '/' . CAT_Helper_Validate::sanitizePost('edit_file'));
        if (!file_exists($file)) {
            $backend->printFatalError("No such file");
        }
        $in = fopen($file, 'r');
        $code = fread($in, filesize($file));
        fclose($in);
        if (file_exists(CAT_PATH . '/modules/edit_area/include.php')) {
            include_once CAT_PATH . '/modules/edit_area/include.php';
            ea_syntax('css');
            $js = show_wysiwyg_editor('code', 'code', $code, '100%', '350px', false);
            $code = NULL;
        }
    }
    $page = CAT_Helper_Page::properties($page_id);
    $parser->output('backend_addons_editfile.tpl', array('code' => $code, 'js' => $js, 'css' => $css, 'page_id' => $page_id, 'section_id' => $section_id, 'mod_dir' => CAT_Helper_Validate::sanitizePost('mod_dir'), 'edit_file' => CAT_Helper_Validate::sanitizePost('edit_file'), 'list' => $list, 'PAGE_TITLE' => $page['page_title'], 'PAGE_ID' => $page_id, 'PAGE_HEADER' => $backend->lang()->translate('Modify file')));
}
$backend->print_footer();