function getBEOutput(&$sql, $content) { $content = $this->getOutput($sql, $content, true); $php_content = $this->getValue($sql, 'php'); $php_content = rex_highlight_string($php_content, true); $content = str_replace('REX_PHP', $this->stripPHP($php_content), $content); return $content; }
} ?> </p> <p class="headline"><?php echo $I18N->msg('magnific_popup_module_input'); ?> </p><?php rex_highlight_string($moduleInput); ?> <p class="headline"><?php echo $I18N->msg('magnific_popup_module_output'); ?> </p><?php rex_highlight_string($moduleOutput); ?> <script type="text/javascript"> jQuery(document).ready( function() { jQuery('a#update-module').click(function(e) { if (!confirm("<?php echo $I18N->msg('ckeditor_module_update_msg'); ?> ")) { e.preventDefault(); } }); }); </script>
protected function completeFencedCode($Block) { $text = $Block['element']['text']['text']; $text = rex_highlight_string($text, true); //$text = htmlspecialchars($text, ENT_NOQUOTES, 'UTF-8'); $Block['element']['text']['text'] = $text; return $Block; }
<?php $logFilePath = HR4YOU_SYNC_LOG_FILE_PATH . HR4YOU_SYNC_LOG_FILE; if (file_exists($logFilePath)) { $log = file_get_contents($logFilePath); } else { $log = ''; } ?> <p><?php echo $logFilePath; ?> </p> <?php echo rex_highlight_string($log); ?>
<?php echo $I18N->msg('tinymce_help_module_input'); ?> </p> <?php rex_highlight_string(rex_get_file_contents($REX['INCLUDE_PATH'] . '/addons/tinymce/modul_input.txt')); ?> </div> </div> <div class="rex-addon-output"> <h2 class="rex-hl2"><?php echo $I18N->msg('tinymce_title_module_output'); ?> </h2> <div class="rex-addon-content"> <p class="rex-tx1"> <?php echo $I18N->msg('tinymce_help_module_output'); ?> </p> <?php rex_highlight_string(rex_get_file_contents($REX['INCLUDE_PATH'] . '/addons/tinymce/modul_output.txt')); ?> </div> </div>
\$mail->Body = \$body; \$mail->AltBody = \$text_body; \$mail->AddAddress(\$sql->getValue("email"), \$sql->getValue("full_name")); \$mail->AddStringAttachment(\$sql->getValue("photo"), "YourPhoto.jpg"); if(!\$mail->Send()) echo "There has been a mail error sending to " . \$sql->getValue("email") . "<br>"; // Clear all addresses and attachments for next loop \$mail->ClearAddresses(); \$mail->ClearAttachments(); \$sql->next(); } ?> EOD; ?> <div class="rex-addon-output"> <h2 class="rex-hl2"><?php echo $I18N->msg('phpmailer_example_headline'); ?> </h2> <div class="rex-addon-content"> <?php rex_highlight_string($mdl_ex); ?> </div> </div>
private function parse_block_elements(array $lines, $context = '') { $blocks = array(); $block = array('type' => ''); foreach ($lines as $line) { # context switch ($block['type']) { case 'fenced': if (!isset($block['closed'])) { if (preg_match('/^[ ]*' . $block['fence'][0] . '{3,}[ ]*$/', $line)) { $block['closed'] = true; } else { if ($block['text'] !== '') { $block['text'] .= "\n"; } $block['text'] .= $line; } continue 2; } break; case 'markup': if (!isset($block['closed'])) { if (strpos($line, $block['start']) !== false) { $block['depth']++; } if (strpos($line, $block['end']) !== false) { if ($block['depth'] > 0) { $block['depth']--; } else { $block['closed'] = true; } } $block['text'] .= "\n" . $line; continue 2; } break; } # ~ $indentation = 0; while (isset($line[$indentation]) and $line[$indentation] === ' ') { $indentation++; } $outdented_line = $indentation > 0 ? ltrim($line) : $line; # blank if ($outdented_line === '') { $block['interrupted'] = true; continue; } # context switch ($block['type']) { case 'quote': if (!isset($block['interrupted'])) { $line = preg_replace('/^[ ]*>[ ]?/', '', $line); $block['lines'][] = $line; continue 2; } break; case 'li': if ($block['indentation'] === $indentation and preg_match('/^' . $block['marker'] . '[ ]+(.*)/', $outdented_line, $matches)) { unset($block['last']); $blocks[] = $block; $block['last'] = true; $block['lines'] = array($matches[1]); unset($block['first']); unset($block['interrupted']); continue 2; } if (!isset($block['interrupted'])) { $line = preg_replace('/^[ ]{0,' . $block['baseline'] . '}/', '', $line); $block['lines'][] = $line; continue 2; } elseif ($line[0] === ' ') { $block['lines'][] = ''; $line = preg_replace('/^[ ]{0,' . $block['baseline'] . '}/', '', $line); $block['lines'][] = $line; unset($block['interrupted']); continue 2; } break; } # indentation sensitive types switch ($line[0]) { case ' ': # code if ($indentation >= 4) { $code_line = substr($line, 4); if ($block['type'] === 'code') { if (isset($block['interrupted'])) { $block['text'] .= "\n"; unset($block['interrupted']); } $block['text'] .= "\n" . $code_line; } else { $blocks[] = $block; $block = array('type' => 'code', 'text' => $code_line); } continue 2; } break; case '#': # atx heading (#) if (isset($line[1])) { $blocks[] = $block; $level = 1; while (isset($line[$level]) and $line[$level] === '#') { $level++; } $block = array('type' => 'heading', 'text' => trim($line, '# '), 'level' => $level); continue 2; } break; case '-': case '=': # setext heading (===) if ($block['type'] === 'paragraph' and isset($block['interrupted']) === false) { $chopped_line = chop($line); $i = 1; while (isset($chopped_line[$i])) { if ($chopped_line[$i] !== $line[0]) { break 2; } $i++; } $block['type'] = 'heading'; $block['level'] = $line[0] === '-' ? 2 : 1; continue 2; } break; } # indentation insensitive types switch ($outdented_line[0]) { case '<': $position = strpos($outdented_line, '>'); if ($position > 1) { $substring = substr($outdented_line, 1, $position - 1); $substring = chop($substring); if (substr($substring, -1) === '/') { $is_self_closing = true; $substring = substr($substring, 0, -1); } $position = strpos($substring, ' '); if ($position) { $name = substr($substring, 0, $position); } else { $name = $substring; } if (!ctype_alpha($name)) { break; } if (in_array($name, self::$text_level_elements)) { break; } $blocks[] = $block; if (isset($is_self_closing)) { $block = array('type' => 'self-closing tag', 'text' => $outdented_line); unset($is_self_closing); continue 2; } $block = array('type' => 'markup', 'text' => $outdented_line, 'start' => '<' . $name . '>', 'end' => '</' . $name . '>', 'depth' => 0); if (strpos($outdented_line, $block['end'])) { $block['closed'] = true; } continue 2; } break; case '>': # quote if (preg_match('/^>[ ]?(.*)/', $outdented_line, $matches)) { $blocks[] = $block; $block = array('type' => 'quote', 'lines' => array($matches[1])); continue 2; } break; case '[': # reference $position = strpos($outdented_line, ']:'); if ($position) { $reference = array(); $label = substr($outdented_line, 1, $position - 1); $label = strtolower($label); $substring = substr($outdented_line, $position + 2); $substring = trim($substring); if ($substring === '') { break; } if ($substring[0] === '<') { $position = strpos($substring, '>'); if ($position === false) { break; } $reference['»'] = substr($substring, 1, $position - 1); $substring = substr($substring, $position + 1); } else { $position = strpos($substring, ' '); if ($position === false) { $reference['»'] = $substring; $substring = false; } else { $reference['»'] = substr($substring, 0, $position); $substring = substr($substring, $position + 1); } } if ($substring !== false) { if ($substring[0] !== '"' and $substring[0] !== "'" and $substring[0] !== '(') { break; } $last_char = substr($substring, -1); if ($last_char !== '"' and $last_char !== "'" and $last_char !== ')') { break; } $reference['#'] = substr($substring, 1, -1); } $this->reference_map[$label] = $reference; continue 2; } break; case '`': case '~': # fenced code block if (preg_match('/^([`]{3,}|[~]{3,})[ ]*(\\S+)?[ ]*$/', $outdented_line, $matches)) { $blocks[] = $block; $block = array('type' => 'fenced', 'text' => '', 'fence' => $matches[1]); if (isset($matches[2])) { $block['language'] = $matches[2]; } continue 2; } break; case '*': case '+': case '-': case '_': # hr if (preg_match('/^([-*_])([ ]{0,2}\\1){2,}[ ]*$/', $outdented_line)) { $blocks[] = $block; $block = array('type' => 'rule'); continue 2; } # li if (preg_match('/^([*+-][ ]+)(.*)/', $outdented_line, $matches)) { $blocks[] = $block; $baseline = $indentation + strlen($matches[1]); $block = array('type' => 'li', 'indentation' => $indentation, 'baseline' => $baseline, 'marker' => '[*+-]', 'first' => true, 'last' => true, 'lines' => array()); $block['lines'][] = preg_replace('/^[ ]{0,4}/', '', $matches[2]); continue 2; } } # li if ($outdented_line[0] <= '9' and preg_match('/^(\\d+[.][ ]+)(.*)/', $outdented_line, $matches)) { $blocks[] = $block; $baseline = $indentation + strlen($matches[1]); $block = array('type' => 'li', 'indentation' => $indentation, 'baseline' => $baseline, 'marker' => '\\d+[.]', 'first' => true, 'last' => true, 'ordered' => true, 'lines' => array()); $block['lines'][] = preg_replace('/^[ ]{0,4}/', '', $matches[2]); continue; } # paragraph if ($block['type'] === 'paragraph') { if (isset($block['interrupted'])) { $blocks[] = $block; $block['text'] = $line; unset($block['interrupted']); } else { if ($this->breaks_enabled) { $block['text'] .= ' '; } $block['text'] .= "\n" . $line; } } else { $blocks[] = $block; $block = array('type' => 'paragraph', 'text' => $line); } } $blocks[] = $block; unset($blocks[0]); # $blocks » HTML $markup = ''; foreach ($blocks as $block) { switch ($block['type']) { case 'paragraph': $text = $this->parse_span_elements($block['text']); if ($context === 'li' and $markup === '') { if (isset($block['interrupted'])) { $markup .= "\n" . '<p>' . $text . '</p>' . "\n"; } else { $markup .= $text; if (isset($blocks[2])) { $markup .= "\n"; } } } else { $markup .= '<p>' . $text . '</p>' . "\n"; } break; case 'quote': $text = $this->parse_block_elements($block['lines']); $markup .= '<blockquote>' . "\n" . $text . '</blockquote>' . "\n"; break; case 'code': $text = htmlspecialchars($block['text'], ENT_NOQUOTES, 'UTF-8'); $markup .= '<pre><code>' . $text . '</code></pre>' . "\n"; break; case 'fenced': $markup .= rex_highlight_string($block['text'], true) . "\n"; break; case 'heading': $text = $this->parse_span_elements($block['text']); $markup .= '<h' . $block['level'] . '>' . $text . '</h' . $block['level'] . '>' . "\n"; break; case 'rule': $markup .= '<hr />' . "\n"; break; case 'li': if (isset($block['first'])) { $type = isset($block['ordered']) ? 'ol' : 'ul'; $markup .= '<' . $type . '>' . "\n"; } if (isset($block['interrupted']) and !isset($block['last'])) { $block['lines'][] = ''; } $text = $this->parse_block_elements($block['lines'], 'li'); $markup .= '<li>' . $text . '</li>' . "\n"; if (isset($block['last'])) { $type = isset($block['ordered']) ? 'ol' : 'ul'; $markup .= '</' . $type . '>' . "\n"; } break; case 'markup': $markup .= $block['text'] . "\n"; break; default: $markup .= $block['text'] . "\n"; } } return $markup; }
rex_highlight_string($rss_input); ?> </div> </div> <div class="rex-addon-output"> <h2 class="rex-hl2" id="code_rss_output_intro">Modulausgabe RSS-Export</h2> <div class="rex-addon-content"> <?php rex_highlight_string($rss_output); ?> </div> </div> <div class="rex-addon-output"> <h2 class="rex-hl2" id="code_rssGetter_input_intro">Moduleingabe RSS-Import</h2> <div class="rex-addon-content"> <?php rex_highlight_string($rssGetter_input); ?> </div> </div> <div class="rex-addon-output"> <h2 class="rex-hl2" id="code_rssGetter_output_intro">Modulausgabe RSS-Import</h2> <div class="rex-addon-content"> <?php rex_highlight_string($rssGetter_output); ?> </div> </div>
private function parse_block_elements(array $lines, $context = '') { $elements = array(); $element = array('type' => ''); foreach ($lines as $line) { # fenced elements switch ($element['type']) { case 'fenced block': if (!isset($element['closed'])) { if (preg_match('/^[ ]*' . $element['fence'][0] . '{3,}[ ]*$/', $line)) { $element['closed'] = true; } else { $element['text'] !== '' and $element['text'] .= "\n"; $element['text'] .= $line; } continue 2; } break; case 'block-level markup': if (!isset($element['closed'])) { if (strpos($line, $element['start']) !== false) { $element['depth']++; } if (strpos($line, $element['end']) !== false) { $element['depth'] > 0 ? $element['depth']-- : ($element['closed'] = true); } $element['text'] .= "\n" . $line; continue 2; } break; } # * $deindented_line = ltrim($line); if ($deindented_line === '') { $element['interrupted'] = true; continue; } # composite elements switch ($element['type']) { case 'blockquote': if (!isset($element['interrupted'])) { $line = preg_replace('/^[ ]*>[ ]?/', '', $line); $element['lines'][] = $line; continue 2; } break; case 'li': if (preg_match('/^([ ]{0,3})(\\d+[.]|[*+-])[ ](.*)/', $line, $matches)) { if ($element['indentation'] !== $matches[1]) { $element['lines'][] = $line; } else { unset($element['last']); $elements[] = $element; $element = array('type' => 'li', 'indentation' => $matches[1], 'last' => true, 'lines' => array(preg_replace('/^[ ]{0,4}/', '', $matches[3]))); } continue 2; } if (isset($element['interrupted'])) { if ($line[0] === ' ') { $element['lines'][] = ''; $line = preg_replace('/^[ ]{0,4}/', '', $line); $element['lines'][] = $line; unset($element['interrupted']); continue 2; } } else { $line = preg_replace('/^[ ]{0,4}/', '', $line); $element['lines'][] = $line; continue 2; } break; } # indentation sensitive types switch ($line[0]) { case ' ': # code block if (isset($line[3]) and $line[3] === ' ' and $line[2] === ' ' and $line[1] === ' ') { $code_line = substr($line, 4); if ($element['type'] === 'code block') { if (isset($element['interrupted'])) { $element['text'] .= "\n"; unset($element['interrupted']); } $element['text'] .= "\n" . $code_line; } else { $elements[] = $element; $element = array('type' => 'code block', 'text' => $code_line); } continue 2; } break; case '#': # atx heading (#) if (isset($line[1])) { $elements[] = $element; $level = 1; while (isset($line[$level]) and $line[$level] === '#') { $level++; } $element = array('type' => 'heading', 'text' => trim($line, '# '), 'level' => $level); continue 2; } break; case '-': case '=': # setext heading if ($element['type'] === 'paragraph' and isset($element['interrupted']) === false) { $chopped_line = rtrim($line); $i = 1; while (isset($chopped_line[$i])) { if ($chopped_line[$i] !== $line[0]) { break 2; } $i++; } $element['type'] = 'heading'; $element['level'] = $line[0] === '-' ? 2 : 1; continue 2; } break; } # indentation insensitive types switch ($deindented_line[0]) { case '<': $position = strpos($deindented_line, '>'); if ($position > 1) { $name = substr($deindented_line, 1, $position - 1); $name = rtrim($name); if (substr($name, -1) === '/') { $self_closing = true; $name = substr($name, 0, -1); } $position = strpos($name, ' '); if ($position) { $name = substr($name, 0, $position); } if (!ctype_alpha($name)) { break; } if (in_array($name, $this->inline_tags)) { break; } $elements[] = $element; if (isset($self_closing)) { $element = array('type' => 'self-closing tag', 'text' => $deindented_line); unset($self_closing); continue 2; } $element = array('type' => 'block-level markup', 'text' => $deindented_line, 'start' => '<' . $name . '>', 'end' => '</' . $name . '>', 'depth' => 0); if (strpos($deindented_line, $element['end'])) { $element['closed'] = true; } continue 2; } break; case '>': # quote if (preg_match('/^>[ ]?(.*)/', $deindented_line, $matches)) { $elements[] = $element; $element = array('type' => 'blockquote', 'lines' => array($matches[1])); continue 2; } break; case '[': # reference if (preg_match('/^\\[(.+?)\\]:[ ]*(.+?)(?:[ ]+[\'"](.+?)[\'"])?[ ]*$/', $deindented_line, $matches)) { $label = strtolower($matches[1]); $this->reference_map[$label] = array('»' => trim($matches[2], '<>')); if (isset($matches[3])) { $this->reference_map[$label]['#'] = $matches[3]; } continue 2; } break; case '`': case '~': # fenced code block if (preg_match('/^([`]{3,}|[~]{3,})[ ]*(\\S+)?[ ]*$/', $deindented_line, $matches)) { $elements[] = $element; $element = array('type' => 'fenced block', 'text' => '', 'fence' => $matches[1]); isset($matches[2]) and $element['language'] = $matches[2]; continue 2; } break; case '*': case '+': case '-': case '_': # hr if (preg_match('/^([-*_])([ ]{0,2}\\1){2,}[ ]*$/', $deindented_line)) { $elements[] = $element; $element = array('type' => 'hr'); continue 2; } # li if (preg_match('/^([ ]*)[*+-][ ](.*)/', $line, $matches)) { $elements[] = $element; $element = array('type' => 'li', 'ordered' => false, 'indentation' => $matches[1], 'last' => true, 'lines' => array(preg_replace('/^[ ]{0,4}/', '', $matches[2]))); continue 2; } } # li if ($deindented_line[0] <= '9' and $deindented_line[0] >= '0' and preg_match('/^([ ]*)\\d+[.][ ](.*)/', $line, $matches)) { $elements[] = $element; $element = array('type' => 'li', 'ordered' => true, 'indentation' => $matches[1], 'last' => true, 'lines' => array(preg_replace('/^[ ]{0,4}/', '', $matches[2]))); continue; } # paragraph if ($element['type'] === 'paragraph') { if (isset($element['interrupted'])) { $elements[] = $element; $element['text'] = $line; unset($element['interrupted']); } else { $element['text'] .= "\n" . $line; } } else { $elements[] = $element; $element = array('type' => 'paragraph', 'text' => $line); } } $elements[] = $element; unset($elements[0]); # # ~ # $markup = ''; foreach ($elements as $element) { switch ($element['type']) { case 'paragraph': $text = $this->parse_span_elements($element['text']); if ($context === 'li' and $markup === '') { if (isset($element['interrupted'])) { $markup .= "\n" . '<p>' . $text . '</p>' . "\n"; } else { $markup .= $text; } } else { $markup .= '<p>' . $text . '</p>' . "\n"; } break; case 'blockquote': $text = $this->parse_block_elements($element['lines']); $markup .= '<blockquote>' . "\n" . $text . '</blockquote>' . "\n"; break; case 'code block': $text = htmlspecialchars($element['text'], ENT_NOQUOTES, 'UTF-8'); strpos($text, "\\") !== FALSE and $text = strtr($text, $this->escape_sequence_map); $markup .= isset($element['language']) ? '<pre><code class="language-' . $element['language'] . '">' . $text . '</code></pre>' : '<pre><code>' . $text . '</code></pre>'; $markup .= "\n"; break; case 'fenced block': $text = $element['text']; strpos($text, "\\") !== FALSE and $text = strtr($text, $this->escape_sequence_map); $markup .= rex_highlight_string($text, true) . "\n"; $markup .= "\n"; break; case 'heading': $text = $this->parse_span_elements($element['text']); $markup .= '<h' . $element['level'] . '>' . $text . '</h' . $element['level'] . '>' . "\n"; break; case 'hr': $markup .= '<hr />' . "\n"; break; case 'li': if (isset($element['ordered'])) { $list_type = $element['ordered'] ? 'ol' : 'ul'; $markup .= '<' . $list_type . '>' . "\n"; } if (isset($element['interrupted']) and !isset($element['last'])) { $element['lines'][] = ''; } $text = $this->parse_block_elements($element['lines'], 'li'); $markup .= '<li>' . $text . '</li>' . "\n"; isset($element['last']) and $markup .= '</' . $list_type . '>' . "\n"; break; case 'block-level markup': $markup .= $element['text'] . "\n"; break; default: $markup .= $element['text'] . "\n"; } } return $markup; }
<h2 class="rex-hl2"><?php echo $I18N_A52->msg('title_tipps_media'); ?> </h2> <div class="rex-addon-content"> <?php echo '<p class="form-text">'; echo $I18N_A52->msg('tipps_media_01'); echo $I18N_A52->msg('tipps_media_02'); echo $I18N_A52->msg('tipps_media_03'); echo '</p>'; rex_highlight_string($tinymce_tipp2); echo '<p class="form-text">'; echo $I18N_A52->msg('tipps_media_04'); echo '</p>'; rex_highlight_string($tinymce_tipp3); ?> </div> </div> <!-- <div class="rex-addon-output"> <h2 class="rex-hl2"><?php echo $I18N_A52->msg('title_tipps_syntax'); ?> </h2> <div class="rex-addon-content"> <?php echo '<p class="form-text">';
<p class="rex-form-col-a rex-form-submit"> <input type="submit" value="<?php echo $I18N->Msg('a587_settings_submitbutton'); ?> " name="sendit" class="rex-form-submit"/> </p> </div> </form> <div class="rex-form-row"> <p class="rex-form-col-a rex-form-text" style="margin: 5px;"> Für die Ausgabe wird eine modifizierte <a href="http://wiki.redaxo.de/index.php?n=R4.RexSearch#example_result2" target="_blank">RexSearch Ausgabemaske</a> benötigt. <br /> Der Suchterm muss an den aufgerufenen Artikel übergeben werden. Dies geschieht mit dem Querystring "&search_highlighter=" </p> <div style="overflow: auto;"> <?php rex_highlight_string('<h4><a href="\'. ($url = htmlspecialchars($article->getUrl()) . \'&search_highlighter=\' . urlencode($_REQUEST[\'rexsearch\'])) .\'">\'.$article->getName().\'</a></h4>'); ?> </div> </div> </div> </div> </div> <?php include $REX['INCLUDE_PATH'] . '/layout/bottom.php';
<li>"function cancelCallback(filename){ ... }" <ul> <li>Dateiname des fehlgeschlagenen / abgebrochenen Uploads</li> </ul> </li> <li>"function completeCallback(json){ ... }" - Der wichtigste Callback.<br /> Schickt ein JSON-Objekt mit jeder Menge Informationen zurück. Mittels "json.objectname" kannst du die Rückgaben abrufen:<br /> <ul> <li>json.success (immer true, ansonsten feuert completeCallback gar nicht)</li> <li>json.filename (finale, von Redaxo umgewandelter Dateiname. Die Rückgabe wurde exakt so in den Mediepool gesynced)</li> <li>json.mediaCatId (ID der Medienpool-Kategorie, in die gesynced wurde)</li> <li>json.originalname (Gibt den echten Namen zurück [brauch man das?])</li> <li>json.timestamp (Gibt einen Timestamp der Fertigstellung zurück)</li> </ul> </li> </ul> Damit die Callbacks greifen, muss natürlich eine .JS oder ein <script>..functions..</script> irgendwo im Backend, auf der Seite oder in der Moduleingabe vorbereitet werden. Wichtig: Beim Methodenaufruf im PHP darf der Funktionsname der Callbacks KEINE KLAMMERN() oder sonstige Parameter enthalten. Es darf nur der reine Funktionsname übergeben werden. Lediglich eure JavaScripts müssen für die Parameter-Rückgabe vorbereitet werden </p> <?php rex_highlight_string($code5); ?> <p>Bei Fragen wendet euch bitte im Forum oder direkt bei <a href="http://www.github.com/nightstomp/redaxo_multiupload">GitHub</a></p> <p>© 2011-2012 Hirbod Mirjavadi (info@nightstomp.com)</p> </div> </div>
</ul> </div><!-- /.addon_template --> <div class="addon_template" id="demo_modul" style="display:none;"> <h4>' . $modul_in . ':</h4>'; $file = $REX['INCLUDE_PATH'] . '/addons/' . $mypage . '/modules/' . $modul_in; $fh = fopen($file, 'r'); $contents = fread($fh, filesize($file)); ini_set('highlight.comment', 'silver;font-size:10px;display:none;'); echo rex_highlight_string($contents); echo ' <h4>' . $modul_out . ':</h4>'; $file = $REX['INCLUDE_PATH'] . '/addons/' . $mypage . '/modules/' . $modul_out; $fh = fopen($file, 'r'); $contents = fread($fh, filesize($file)); echo rex_highlight_string($contents); echo ' </div><!-- /.addon_template --> <div class="addon_template"> <p>Die Dateien der Beispielmodule befinden sich im Addon Ordner: <cite>./addons/' . $mypage . '/modules/...</cite></p> </div><!-- /.addon_template --> </div><!-- /.rex-addon-content --> </div><!-- /.rex-addon-output --> <script type="text/javascript"> <!-- jQuery(function($) {
public static function getDebugInfo($articleId = 0) { global $I18N, $REX; if ($articleId != 0) { self::initArticle($articleId); } if (!OOArticle::isValid(self::$curArticle)) { return ''; } $out = '<div id="seo42-debug">'; $out .= '<h1>---------- SEO42 DEBUG BEGIN ----------<h1>'; // general information $out .= '<h2>General Information</h2>'; $out .= '<table>'; $out .= '<tr><td class="left"><code>REDAXO Version</code></td><td class="right"><code>' . $REX['VERSION'] . '.' . $REX['SUBVERSION'] . '.' . $REX['MINORVERSION'] . '</code></td></tr>'; $out .= '<tr><td class="left"><code>SEO42 Version</code></td><td class="right"><code>' . $REX['ADDON']['version']['seo42'] . '</code></td></tr>'; $out .= '<tr><td class="left"><code>PHP Version</code></td><td class="right"><code>' . phpversion() . '</code></td></tr>'; if (isset($REX['ADDON']['version']['community'])) { $out .= '<tr><td class="left"><code>Community Version</code></td><td class="right"><code>' . $REX['ADDON']['version']['community'] . '</code></td></tr>'; } $out .= '</table>'; // methods $out .= '<h2>Class Methods</h2>'; $out .= '<table>'; $out .= self::getDebugInfoRow('rex_getUrl', array(self::$curArticle->getId())); $out .= self::getDebugInfoRow('seo42::getUrl', array(self::$curArticle->getId())); $out .= self::getDebugInfoRow('seo42::getTrimmedUrl', array(self::$curArticle->getId())); $out .= self::getDebugInfoRow('seo42::getFullUrl', array(self::$curArticle->getId())); $out .= self::getDebugInfoRow('seo42::getTitle'); $out .= self::getDebugInfoRow('seo42::getTitlePart'); $out .= self::getDebugInfoRow('seo42::getDescription'); $out .= self::getDebugInfoRow('seo42::getKeywords'); $out .= self::getDebugInfoRow('seo42::getRobotRules'); $out .= self::getDebugInfoRow('seo42::getCanonicalUrl'); $out .= self::getDebugInfoRow('seo42::getArticleName'); $out .= self::getDebugInfoRow('seo42::isStartArticle'); $out .= self::getDebugInfoRow('seo42::getWebsiteName'); $out .= self::getDebugInfoRow('seo42::getLangCode', array('0')); $out .= self::getDebugInfoRow('seo42::getLangSlug', array('0')); $out .= self::getDebugInfoRow('seo42::getLangName', array('0')); $out .= self::getDebugInfoRow('seo42::getOriginalLangName', array('0')); $out .= self::getDebugInfoRow('seo42::getServerProtocol'); $out .= self::getDebugInfoRow('seo42::getBaseUrl'); $out .= self::getDebugInfoRow('seo42::getServerUrl'); $out .= self::getDebugInfoRow('seo42::getServer'); $out .= self::getDebugInfoRow('seo42::getServerWithSubDir'); $out .= self::getDebugInfoRow('seo42::getServerSubDir'); $out .= self::getDebugInfoRow('seo42::isWwwServerUrl'); $out .= self::getDebugInfoRow('seo42::hasTemplateBaseTag'); $out .= self::getDebugInfoRow('seo42::isSubDirInstall'); $out .= self::getDebugInfoRow('seo42::isMultiLangInstall'); $out .= self::getDebugInfoRow('seo42::getLangCount'); $out .= self::getDebugInfoRow('seo42::getTitleDelimiter'); $out .= self::getDebugInfoRow('seo42::getUrlStart'); $out .= self::getDebugInfoRow('seo42::has404ResponseFlag'); $out .= self::getDebugInfoRow('seo42::getQueryString'); $out .= self::getDebugInfoRow('seo42::getMediaDir'); $out .= self::getDebugInfoRow('seo42::getMediaDirName'); $out .= self::getDebugInfoRow('seo42::getMediaFile', array('image.png')); $out .= self::getDebugInfoRow('seo42::getMediaUrl', array('image.png')); $out .= self::getDebugInfoRow('seo42::getAbsoluteMediaFile', array('image.png')); $out .= self::getDebugInfoRow('seo42::getMediaAddonDir'); $out .= self::getDebugInfoRow('seo42::getLangTags'); $out .= self::getDebugInfoRow('seo42::getHtml'); $out .= self::getDebugInfoRow('seo42::getImageTag', array('image.png', 'rex_mediapool_detail', '150', '100')); $out .= self::getDebugInfoRow('seo42::getImageManagerFile', array('image.png', 'rex_mediapool_detail')); $out .= self::getDebugInfoRow('seo42::getDownloadFile', array('doc.pdf')); $out .= self::getDebugInfoRow('seo42::getUrlString', array("The Hitchhiker's Guide to the Galaxy!")); $out .= self::getDebugInfoRow('seo42::getAnswer'); $out .= '</table>'; // settings $out .= '<h2>Settings</h2>'; $out .= '<pre class="rex-code">'; $out .= seo42_utils::print_r_pretty($REX['ADDON']['seo42']['settings'], true); $out .= '</pre>'; // cached redirects $out .= '<h2>Cached Redirects</h2>'; $out .= '<pre class="rex-code">'; $out .= seo42_utils::print_r_pretty($REX['SEO42_CACHED_REDIRECTS'], true); $out .= '</pre>'; // pathlist $out .= '<h2>Pathlist</h2>'; $pathlistRoot = SEO42_PATHLIST; if (file_exists($pathlistRoot)) { $content = rex_get_file_contents($pathlistRoot); $out .= rex_highlight_string($content, true); } else { $out .= 'File not found: ' . $pathlistRoot; } // .htaccess $out .= '<h2>.htaccess</h2>'; $htaccessRoot = $REX['FRONTEND_PATH'] . '/.htaccess'; if (file_exists($htaccessRoot)) { $content = rex_get_file_contents($htaccessRoot); $out .= rex_highlight_string($content, true); } else { $out .= 'File not found: ' . $htaccessRoot; } $out .= '<h1>---------- SEO42 DEBUG END ----------</h1>'; $out .= '</div>'; $out .= '<style type="text/css"> #seo42-debug h1 { font-size: 16px; margin: 10px 0; } #seo42-debug h2 { margin: 15px 0; font-size: 14px; } #seo42-debug .rex-code { border: 1px solid #F2353A; } #seo42-debug code, #seo42-debug .rex-code { color: #000; background: #FAF9F5; } #seo42-debug table { width: 100%; border-collapse: collapse; border-spacing: 0; background: #FAF9F5; } #seo42-debug table th, #seo42-debug table thead td { font-weight: bold; } #seo42-debug table td, #seo42-debug table th { padding: 12px; border: 1px solid #F2353A; text-align: left; } #seo42-debug table td.left { width: 280px; } </style>'; return $out; }
?> <h2>create_website.after.inc.php</h2> <?php echo rex_highlight_string(file_get_contents($REX['INCLUDE_PATH'] . '/data/addons/website_manager/custom/create_website.after.inc.php')); ?> <h2>destroy_website.before.inc.php</h2> <?php echo rex_highlight_string(file_get_contents($REX['INCLUDE_PATH'] . '/data/addons/website_manager/custom/destroy_website.before.inc.php')); ?> <h2>destroy_website.after.inc.php</h2> <?php echo rex_highlight_string(file_get_contents($REX['INCLUDE_PATH'] . '/data/addons/website_manager/custom/destroy_website.after.inc.php')); ?> <style type="text/css"> .rex-addon-output p { margin-bottom: 5px; } .rex-addon-output h2 { margin-bottom: 5px; } .rex-addon-output pre { margin-bottom: 15px; } </style>
<?php $codeExample1 = '<?php echo rex_tracking_code::getTrackingCode(); ?>'; ?> <div class="rex-addon-output"> <h2 class="rex-hl2"><?php echo $I18N->msg('tracking_code_help'); ?> </h2> <div class="rex-area-content"> <p><?php echo $I18N->msg('tracking_code_help_msg'); ?> </p> <?php rex_highlight_string($codeExample1); ?> </div> </div> <style type="text/css"> .rex-addon-output p { margin-bottom: 5px; } </style>
<h4 class="rex-hl3">Tabellen Urls</h4> <p>Bei Tabellen Urls handelt es ich um Urls die aus einer bestimmten Datenbanktabelle generiert werden.<br />Dazu werden 2 Spalten benötigt. Die erste um die <strong>eindeutige Id</strong> zu definieren und eine zweite aus der die <strong>Urls generiert</strong> werden</p> <p>Mit folgenden Code bekommt man die eindeutige Id zu der Url.</p> <?php $module = '<?php $tmp = parse_url($_SERVER[\'REQUEST_URI\']); $myurl = $tmp[\'path\']; $myid = (int)a724_getTableId(\'TABELLENNAME\', $myurl); ?>'; ?> <?php rex_highlight_string($module); ?> <p>Ein Beispiel des Addons findet sich auf <a href="http://www.elbepark.info/de/shops-und-mehr/elbeparkfinder.html">www.elbepark.info</a>. Alle hier verlinkten Mieter sind in einer Tabelle vorhanden und verweisen auf <strong>denselben</strong> Redaxo Artikel.</p> <h3 class="rex-hl4">Voraussetzungen</h3> <p>Das AddOn benötigt die Redaxo SVN Version (Rev 1821) und die Url-Rewrite-Fullnames Klasse. Mit der Version 4.3b5 funktioniert es nicht, da in der fullnames Klasse der EP noch nicht dabei ist</p> <h3 class="rex-hl4">Todo</h3> <p>Marketing Urls cachen</p>