Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4

Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4

Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4

Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4

Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4

Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
editors/codemirror/codemirror.xml000066600000007717150771657550013313 0ustar00 plg_editors_codemirror 3.15 28 March 2011 Marijn Haverbeke N/A PLG_CODEMIRROR_XML_DESCRIPTION codemirror.php index.html en-GB.plg_editors_codemirror.ini en-GB.plg_editors_codemirror.sys.ini
editors/codemirror/index.html000066600000000037150771657550012405 0ustar00 editors/codemirror/codemirror.php000066600000024212150771657550013267 0ustar00_basePath . 'js/codemirror.js', false, false, false, false); JHtml::_('script', $this->_basePath . 'js/fullscreen.js', false, false, false, false); JHtml::_('stylesheet', $this->_basePath . 'css/codemirror.css'); JHtml::_('stylesheet', $this->_basePath . 'css/configuration.css'); return ''; } /** * Copy editor content to form field. * * @param string $id The id of the editor field. * * @return string Javascript */ public function onSave($id) { return "document.getElementById('$id').value = Joomla.editors.instances['$id'].getValue();\n"; } /** * Get the editor content. * * @param string $id The id of the editor field. * * @return string Javascript */ public function onGetContent($id) { return "Joomla.editors.instances['$id'].getValue();\n"; } /** * Set the editor content. * * @param string $id The id of the editor field. * @param string $content The content to set. * * @return string Javascript */ public function onSetContent($id, $content) { return "Joomla.editors.instances['$id'].setValue($content);\n"; } /** * Adds the editor specific insert method. * * @return boolean */ public function onGetInsertMethod() { static $done = false; // Do this only once. if (!$done) { $done = true; $doc = JFactory::getDocument(); $js = "\tfunction jInsertEditorText(text, editor) { Joomla.editors.instances[editor].replaceSelection(text);\n }"; $doc->addScriptDeclaration($js); } return true; } /** * Display the editor area. * * @param string $name The control name. * @param string $content The contents of the text area. * @param string $width The width of the text area (px or %). * @param string $height The height of the text area (px or %). * @param integer $col The number of columns for the textarea. * @param integer $row The number of rows for the textarea. * @param boolean $buttons True and the editor buttons will be displayed. * @param string $id An optional ID for the textarea (note: since 1.6). If not supplied the name is used. * @param string $asset Unused * @param object $author Unused * @param array $params Associative array of editor parameters. * * @return string HTML Output */ public function onDisplay($name, $content, $width, $height, $col, $row, $buttons = true, $id = null, $asset = null, $author = null, $params = array()) { if (empty($id)) { $id = $name; } // Only add "px" to width and height if they are not given as a percentage if (is_numeric($width)) { $width .= 'px'; } if (is_numeric($height)) { $height .= 'px'; } // Must pass the field id to the buttons in this editor. $buttons = $this->_displayButtons($id, $buttons, $asset, $author); // Look if we need special syntax coloring. $syntax = $this->params->get('syntax', 'php'); if ($syntax) { switch ($syntax) { case 'css': $parserFile = array('css.js', 'closebrackets.js'); $mode = 'text/css'; $autoCloseBrackets = true; $autoCloseTags = false; $fold = true; $matchTags = false; $matchBrackets = true; JHtml::_('script', $this->_basePath . 'js/brace-fold.js', false, false, false, false); break; case 'ini': $parserFile = array('css.js'); $mode = 'text/css'; $autoCloseBrackets = false; $autoCloseTags = false; $fold = false; $matchTags = false; $matchBrackets = false; break; case 'xml': $parserFile = array('xml.js', 'closetag.js'); $mode = 'application/xml'; $fold = true; $autoCloseBrackets = false; $autoCloseTags = true; $matchTags = true; $matchBrackets = false; JHtml::_('script', $this->_basePath . 'js/xml-fold.js', false, false, false, false); break; case 'js': $parserFile = array('javascript.js', 'closebrackets.js'); $mode = 'text/javascript'; $autoCloseBrackets = true; $autoCloseTags = false; $fold = true; $matchTags = false; $matchBrackets = true; JHtml::_('script', $this->_basePath . 'js/brace-fold.js', false, false, false, false); break; case 'less': $parserFile = array('less.js', 'css.js', 'closebrackets.js'); $mode = 'text/x-less'; $autoCloseBrackets = true; $autoCloseTags = false; $fold = true; $matchTags = false; $matchBrackets = true; JHtml::_('script', $this->_basePath . 'js/brace-fold.js', false, false, false, false); break; case 'php': $parserFile = array('xml.js', 'clike.js', 'css.js', 'javascript.js', 'htmlmixed.js', 'php.js', 'closebrackets.js', 'closetag.js'); $mode = 'application/x-httpd-php'; $autoCloseBrackets = true; $autoCloseTags = true; $fold = true; $matchTags = true; $matchBrackets = true; JHtml::_('script', $this->_basePath . 'js/brace-fold.js', false, false, false, false); JHtml::_('script', $this->_basePath . 'js/xml-fold.js', false, false, false, false); break; default: $parserFile = false; $mode = 'text/plain'; $autoCloseBrackets = false; $autoCloseTags = false; $fold = false; $matchTags = false; $matchBrackets = false; break; } } if ($parserFile) { foreach ($parserFile as $file) { JHtml::_('script', $this->_basePath . 'js/' . $file, false, false, false, false); } } $options = new stdClass; $options->mode = $mode; $options->smartIndent = true; // Enabled the line numbers. if ($this->params->get('lineNumbers') == "1") { $options->lineNumbers = true; } if ($this->params->get('autoFocus') == "1") { $options->autofocus = true; } if ($this->params->get('autoCloseBrackets') == "1") { $options->autoCloseBrackets = $autoCloseBrackets; } if ($this->params->get('autoCloseTags') == "1") { $options->autoCloseTags = $autoCloseTags; } if ($this->params->get('matchTags') == "1") { $options->matchTags = $matchTags; JHtml::_('script', $this->_basePath . 'js/matchtags.js', false, false, false, false); } if ($this->params->get('matchBrackets') == "1") { $options->matchBrackets = $matchBrackets; JHtml::_('script', $this->_basePath . 'js/matchbrackets.js', false, false, false, false); } if ($this->params->get('marker-gutter') == "1") { $options->foldGutter = $fold; $options->gutters = array('CodeMirror-linenumbers', 'CodeMirror-foldgutter', 'breakpoints'); JHtml::_('script', $this->_basePath . 'js/foldcode.js', false, false, false, false); JHtml::_('script', $this->_basePath . 'js/foldgutter.js', false, false, false, false); } if ($this->params->get('theme', '') == 'ambiance') { $options->theme = 'ambiance'; JHtml::_('stylesheet', $this->_basePath . 'css/ambiance.css'); } if ($this->params->get('lineWrapping') == "1") { $options->lineWrapping = true; } if ($this->params->get('tabmode', '') == 'shift') { $options->tabMode = 'shift'; } $html = array(); $html[] = ""; $html[] = $buttons; $html[] = ''; return implode("\n", $html); } /** * Displays the editor buttons. * * @param string $name The editor name * @param mixed $buttons [array with button objects | boolean true to display buttons] * @param string $asset The object asset * @param object $author The author. * * @return string HTML */ protected function _displayButtons($name, $buttons, $asset, $author) { $return = ''; $args = array( 'name' => $name, 'event' => 'onGetInsertMethod' ); $results = (array) $this->update($args); if ($results) { foreach ($results as $result) { if (is_string($result) && trim($result)) { $return .= $result; } } } if (is_array($buttons) || (is_bool($buttons) && $buttons)) { $buttons = $this->_subject->getButtons($name, $buttons, $asset, $author); $return .= JLayoutHelper::render('joomla.editors.buttons', $buttons); } return $return; } } editors/tinymce/tinymce.xml000066600000031003150771657550012102 0ustar00 plg_editors_tinymce 4.0.22 2005-2013 Moxiecode Systems AB N/A tinymce.moxiecode.com Moxiecode Systems AB LGPL PLG_TINY_XML_DESCRIPTION tinymce.php index.html en-GB.plg_editors_tinymce.ini en-GB.plg_editors_tinymce.sys.ini
editors/tinymce/index.html000066600000000037150771657550011710 0ustar00 editors/tinymce/tinymce.php000066600000052400150771657550012075 0ustar00params->get('mode', 1); $theme = 'modern'; $skin = $this->params->get('skin', '0'); switch ($skin) { case '0': default: $skin = 'skin : "lightgray",'; } $entity_encoding = $this->params->get('entity_encoding', 'raw'); $langMode = $this->params->get('lang_mode', 0); $langPrefix = $this->params->get('lang_code', 'en'); if ($langMode) { if (file_exists(JPATH_ROOT . "/media/editors/tinymce/langs/" . $language->getTag() . ".js")) { $langPrefix = $language->getTag(); } elseif (file_exists(JPATH_ROOT . "/media/editors/tinymce/langs/" . substr($language->getTag(), 0, strpos($language->getTag(), '-')) . ".js")) { $langPrefix = substr($language->getTag(), 0, strpos($language->getTag(), '-')); } else { $langPrefix = "en"; } } $text_direction = 'ltr'; if ($language->isRTL()) { $text_direction = 'rtl'; } $use_content_css = $this->params->get('content_css', 1); $content_css_custom = $this->params->get('content_css_custom', ''); /* * Lets get the default template for the site application */ $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('template') ->from('#__template_styles') ->where('client_id=0 AND home=' . $db->quote('1')); $db->setQuery($query); $template = $db->loadResult(); $content_css = ''; $templates_path = JPATH_SITE . '/templates'; // Loading of css file for 'styles' dropdown if ( $content_css_custom ) { // If URL, just pass it to $content_css if (strpos($content_css_custom, 'http') !== false) { $content_css = 'content_css : "' . $content_css_custom . '",'; } // If it is not a URL, assume it is a file name in the current template folder else { $content_css = 'content_css : "' . JUri::root() . 'templates/' . $template . '/css/' . $content_css_custom . '",'; // Issue warning notice if the file is not found (but pass name to $content_css anyway to avoid TinyMCE error if (!file_exists($templates_path . '/' . $template . '/css/' . $content_css_custom)) { $msg = sprintf(JText::_('PLG_TINY_ERR_CUSTOMCSSFILENOTPRESENT'), $content_css_custom); JLog::add($msg, JLog::WARNING, 'jerror'); } } } else { // Process when use_content_css is Yes and no custom file given if ($use_content_css) { // First check templates folder for default template // if no editor.css file in templates folder, check system template folder if (!file_exists($templates_path . '/' . $template . '/css/editor.css')) { // If no editor.css file in system folder, show alert if (!file_exists($templates_path . '/system/css/editor.css')) { JLog::add(JText::_('PLG_TINY_ERR_EDITORCSSFILENOTPRESENT'), JLog::WARNING, 'jerror'); } else { $content_css = 'content_css : "' . JUri::root() . 'templates/system/css/editor.css",'; } } else { $content_css = 'content_css : "' . JUri::root() . 'templates/' . $template . '/css/editor.css",'; } } } $relative_urls = $this->params->get('relative_urls', '1'); if ($relative_urls) { // Relative $relative_urls = "true"; } else { // Absolute $relative_urls = "false"; } $newlines = $this->params->get('newlines', 0); if ($newlines) { // Break $forcenewline = "force_br_newlines : true, force_p_newlines : false, forced_root_block : '',"; } else { // Paragraph $forcenewline = "force_br_newlines : false, force_p_newlines : true, forced_root_block : 'p',"; } $invalid_elements = $this->params->get('invalid_elements', 'script,applet,iframe'); $extended_elements = $this->params->get('extended_elements', ''); // Advanced Options $html_height = $this->params->get('html_height', '550'); $html_width = $this->params->get('html_width', '750'); // Image advanced options $image_advtab = $this->params->get('image_advtab', 1); if ($image_advtab) { $image_advtab = "true"; } else { $image_advtab = "false"; } // The param is true false, so we turn true to both rather than showing vertical resize only $resizing = $this->params->get('resizing', '1'); if ($resizing || $resizing == 'true') { $resizing = 'resize: "both",'; } else { $resizing = 'resize: false,'; } $toolbar1_add = array(); $toolbar2_add = array(); $toolbar3_add = array(); $toolbar4_add = array(); $elements = array(); $plugins = array('autolink', 'lists', 'image', 'charmap', 'print', 'preview', 'anchor', 'pagebreak', 'code', 'save', 'textcolor', 'importcss'); $toolbar1_add[] = 'bold'; $toolbar1_add[] = 'italic'; $toolbar1_add[] = 'underline'; $toolbar1_add[] = 'strikethrough'; // Alignment buttons $alignment = $this->params->get('alignment', 1); if ($alignment) { $toolbar1_add[] = '|'; $toolbar1_add[] = 'alignleft'; $toolbar1_add[] = 'aligncenter'; $toolbar1_add[] = 'alignright'; $toolbar1_add[] = 'alignjustify'; } $toolbar1_add[] = '|'; $toolbar1_add[] = 'styleselect'; $toolbar1_add[] = '|'; $toolbar1_add[] = 'formatselect'; // Fonts $fonts = $this->params->get('fonts', 1); if ($fonts) { $toolbar1_add[] = 'fontselect'; $toolbar1_add[] = 'fontsizeselect'; } // Search & replace $searchreplace = $this->params->get('searchreplace', 1); if ($searchreplace) { $plugins[] = 'searchreplace'; $toolbar2_add[] = 'searchreplace'; } $toolbar2_add[] = '|'; $toolbar2_add[] = 'bullist'; $toolbar2_add[] = 'numlist'; $toolbar2_add[] = '|'; $toolbar2_add[] = 'outdent'; $toolbar2_add[] = 'indent'; $toolbar2_add[] = '|'; $toolbar2_add[] = 'undo'; $toolbar2_add[] = 'redo'; $toolbar2_add[] = '|'; // Insert date and/or time plugin $insertdate = $this->params->get('insertdate', 1); if ($insertdate) { $plugins[] = 'insertdatetime'; $toolbar4_add[] = 'inserttime'; } // Link plugin $link = $this->params->get('link', 1); if ($link) { $plugins[] = 'link'; $toolbar2_add[] = 'link'; $toolbar2_add[] = 'unlink'; } $toolbar2_add[] = 'anchor'; $toolbar2_add[] = 'image'; $toolbar2_add[] = '|'; $toolbar2_add[] = 'code'; // Colours $colours = $this->params->get('colours', 1); if ($colours) { $toolbar2_add[] = '|'; $toolbar2_add[] = 'forecolor,backcolor'; } // Fullscreen $fullscreen = $this->params->get('fullscreen', 1); if ($fullscreen) { $plugins[] = 'fullscreen'; $toolbar2_add[] = '|'; $toolbar2_add[] = 'fullscreen'; } // Table $table = $this->params->get('table', 1); if ($table) { $plugins[] = 'table'; $toolbar3_add[] = 'table'; $toolbar3_add[] = '|'; } $toolbar3_add[] = 'subscript'; $toolbar3_add[] = 'superscript'; $toolbar3_add[] = '|'; $toolbar3_add[] = 'charmap'; // Emotions $smilies = $this->params->get('smilies', 1); if ($smilies) { $plugins[] = 'emoticons'; $toolbar3_add[] = 'emoticons'; } // Media plugin $media = $this->params->get('media', 1); if ($media) { $plugins[] = 'media'; $toolbar3_add[] = 'media'; } // Horizontal line $hr = $this->params->get('hr', 1); if ($hr) { $plugins[] = 'hr'; $elements[] = 'hr[id|title|alt|class|width|size|noshade]'; $toolbar3_add[] = 'hr'; } else { $elements[] = 'hr[id|class|title|alt]'; } // RTL/LTR buttons $directionality = $this->params->get('directionality', 1); if ($directionality) { $plugins[] = 'directionality'; $toolbar3_add[] = 'ltr rtl'; } if ($extended_elements != "") { $elements = explode(',', $extended_elements); } $toolbar4_add[] = 'cut'; $toolbar4_add[] = 'copy'; // Paste $paste = $this->params->get('paste', 1); if ($paste) { $plugins[] = 'paste'; $toolbar4_add[] = 'paste'; } $toolbar4_add[] = '|'; // Visualchars $visualchars = $this->params->get('visualchars', 1); if ($visualchars) { $plugins[] = 'visualchars'; $toolbar4_add[] = 'visualchars'; } // Visualblocks $visualblocks = $this->params->get('visualblocks', 1); if ($visualblocks) { $plugins[] = 'visualblocks'; $toolbar4_add[] = 'visualblocks'; } // Non-breaking $nonbreaking = $this->params->get('nonbreaking', 1); if ($nonbreaking) { $plugins[] = 'nonbreaking'; $toolbar4_add[] = 'nonbreaking'; } // Blockquote $blockquote = $this->params->get('blockquote', 1); if ($blockquote) { $toolbar4_add[] = 'blockquote'; } // Template $template = $this->params->get('template', 1); if ($template) { $plugins[] = 'template'; $toolbar4_add[] = 'template'; // Note this check for the template_list.js file will be removed in Joomla 4.0 if (is_file(JPATH_ROOT . "/media/editors/tinymce/templates/template_list.js")) { // If using the legacy file we need to include and input the files the new way $str = file_get_contents(JPATH_ROOT . "/media/editors/tinymce/templates/template_list.js"); // Find from one [ to the last ] preg_match_all('/\[.*\]/', $str, $matches); $templates = "templates: ["; // Set variables foreach ($matches['0'] as $match) { preg_match_all('/\".*\"/', $match, $values); $result = trim($values["0"]["0"], '"'); $final_result = explode(',', $result); $templates .= "{title: '" . trim($final_result['0'], ' " ') . "', description: '" . trim($final_result['2'], ' " ') . "', url: '" . JUri::root() . trim($final_result['1'], ' " ') . "'},"; } $templates .= "],"; } else { $templates = "templates: [ {title: 'Layout', description: 'HTMLLayout', url:'" . JUri::root() . "media/editors/tinymce/templates/layout1.html'}, {title: 'Simple snippet', description: 'Simple HTML snippet', url:'" . JUri::root() . "media/editors/tinymce/templates/snippet1.html'} ],"; } } else { $templates = ''; } // Print $print = $this->params->get('print', 1); if ($print) { $plugins[] = 'print'; $toolbar4_add[] = '|'; $toolbar4_add[] = 'print'; $toolbar4_add[] = 'preview'; } // Spellchecker $spell = $this->params->get('spell', 0); if ($spell) { $plugins[] = 'spellchecker'; $toolbar4_add[] = '|'; $toolbar4_add[] = 'spellchecker'; } // Wordcount $wordcount = $this->params->get('wordcount', 1); if ($wordcount) { $plugins[] = 'wordcount'; } // Advlist $advlist = $this->params->get('advlist', 1); if ($advlist) { $plugins[] = 'advlist'; } // Autosave $autosave = $this->params->get('autosave', 1); if ($autosave) { $plugins[] = 'autosave'; } // Context menu $contextmenu = $this->params->get('contextmenu', 1); if ($contextmenu) { $plugins[] = 'contextmenu'; } $custom_plugin = $this->params->get('custom_plugin', ''); if ($custom_plugin != "") { $plugins[] = $custom_plugin; } $custom_button = $this->params->get('custom_button', ''); if ($custom_button != "") { $toolbar4_add[] = $custom_button; } // Prepare config variables $plugins = implode(',', $plugins); $elements = implode(',', $elements); // Prepare config variables $toolbar1 = implode(' ', $toolbar1_add); $toolbar2 = implode(' ', $toolbar2_add); $toolbar3 = implode(' ', $toolbar3_add); $toolbar4 = implode(' ', $toolbar4_add); // See if mobileVersion is activated $mobileVersion = $this->params->get('mobile', 0); $load = "\t\n"; /** * Shrink the buttons if not on a mobile or if mobile view is off. * If mobile view is on force into simple mode and enlarge the buttons **/ if (!$this->app->client->mobile) { $smallButtons = 'toolbar_items_size: "small",'; } elseif ($mobileVersion == false) { $smallButtons = ''; } else { $smallButtons = ''; $mode = 0; } switch ($mode) { case 0: /* Simple mode*/ $return = $load . "\t"; break; case 1: default: /* Advanced mode*/ $toolbar1 = "bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | formatselect | bullist numlist"; $toolbar2 = "outdent indent | undo redo | link unlink anchor image code | hr table | subscript superscript | charmap"; $return = $load . "\t"; break; case 2: /* Extended mode*/ $return = $load . "\t"; break; } return $return; } /** * TinyMCE WYSIWYG Editor - get the editor content * * @param string $editor The name of the editor * * @return string */ public function onGetContent($editor) { return 'tinyMCE.get(\'' . $editor . '\').getContent();'; } /** * TinyMCE WYSIWYG Editor - set the editor content * * @param string $editor The name of the editor * @param string $html The html to place in the editor * * @return string */ public function onSetContent($editor, $html) { return 'tinyMCE.get(\'' . $editor . '\').setContent(' . $html . ');'; } /** * TinyMCE WYSIWYG Editor - copy editor content to form field * * @param string $editor The name of the editor * * @return string */ public function onSave($editor) { return 'if (tinyMCE.get("' . $editor . '").isHidden()) {tinyMCE.get("' . $editor . '").show()}; tinyMCE.get("' . $editor . '").save();'; } /** * Inserts html code into the editor * * @param string $name The name of the editor * * @return boolean */ public function onGetInsertMethod($name) { $doc = JFactory::getDocument(); $js = " function isBrowserIE() { return navigator.appName==\"Microsoft Internet Explorer\"; } function jInsertEditorText( text, editor ) { if (isBrowserIE()) { if (window.parent.tinyMCE) { window.parent.tinyMCE.selectedInstance.selection.moveToBookmark(window.parent.global_ie_bookmark); } } tinyMCE.execCommand('mceInsertContent', false, text); } var global_ie_bookmark = false; function IeCursorFix() { if (isBrowserIE()) { tinyMCE.execCommand('mceInsertContent', false, ''); global_ie_bookmark = tinyMCE.activeEditor.selection.getBookmark(false); } return true; }"; $doc->addScriptDeclaration($js); return true; } /** * Display the editor area. * * @param string $name The name of the editor area. * @param string $content The content of the field. * @param string $width The width of the editor area. * @param string $height The height of the editor area. * @param int $col The number of columns for the editor area. * @param int $row The number of rows for the editor area. * @param boolean $buttons True and the editor buttons will be displayed. * @param string $id An optional ID for the textarea. If not supplied the name is used. * @param string $asset The object asset * @param object $author The author. * * @return string */ public function onDisplay($name, $content, $width, $height, $col, $row, $buttons = true, $id = null, $asset = null, $author = null) { if (empty($id)) { $id = $name; } // Only add "px" to width and height if they are not given as a percentage if (is_numeric($width)) { $width .= 'px'; } if (is_numeric($height)) { $height .= 'px'; } // Data object for the layout $textarea = new stdClass; $textarea->name = $name; $textarea->id = $id; $textarea->cols = $col; $textarea->rows = $row; $textarea->width = $width; $textarea->height = $height; $textarea->content = $content; $editor = '
'; $editor .= JLayoutHelper::render('joomla.tinymce.textarea', $textarea); $editor .= $this->_displayButtons($id, $buttons, $asset, $author); $editor .= $this->_toogleButton($id); $editor .= '
'; return $editor; } /** * Displays the editor buttons. * * @param string $name The editor name * @param mixed $buttons [array with button objects | boolean true to display buttons] * @param string $asset The object asset * @param object $author The author. * * @return string HTML */ private function _displayButtons($name, $buttons, $asset, $author) { $return = ''; $args = array( 'name' => $name, 'event' => 'onGetInsertMethod' ); $results = (array) $this->update($args); if ($results) { foreach ($results as $result) { if (is_string($result) && trim($result)) { $return .= $result; } } } if (is_array($buttons) || (is_bool($buttons) && $buttons)) { $buttons = $this->_subject->getButtons($name, $buttons, $asset, $author); $return .= JLayoutHelper::render('joomla.editors.buttons', $buttons); } return $return; } /** * Get the toggle editor button * * @param string $name Editor name * * @return string */ private function _toogleButton($name) { return JLayoutHelper::render('joomla.tinymce.togglebutton', $name); } } editors/index.html000066600000000037150771657550010240 0ustar00 editors/jce/jce.php000066600000016022150771657550010257 0ustar00setMetaData('X-UA-Compatible', 'IE=Edge', true); // Check for existence of Admin Component if (!is_dir(JPATH_SITE . '/components/com_jce') || !is_dir(JPATH_ADMINISTRATOR . '/components/com_jce')) { JError::raiseWarning('SOME_ERROR_CODE', 'WF_COMPONENT_MISSING'); } $language->load('plg_editors_jce', JPATH_ADMINISTRATOR); $language->load('com_jce', JPATH_ADMINISTRATOR); // load constants and loader require_once(JPATH_ADMINISTRATOR . '/components/com_jce/includes/base.php'); wfimport('admin.models.editor'); $model = new WFModelEditor(); return $model->buildEditor(); } /** * JCE WYSIWYG Editor - get the editor content * * @vars string The name of the editor */ public function onGetContent($editor) { //return "WFEditor.getContent('" . $editor . "');"; return $this->onSave($editor); } /** * JCE WYSIWYG Editor - set the editor content * * @vars string The name of the editor */ public function onSetContent($editor, $html) { return "WFEditor.setContent('" . $editor . "','" . $html . "');"; } /** * JCE WYSIWYG Editor - copy editor content to form field * * @vars string The name of the editor */ public function onSave($editor) { return "WFEditor.getContent('" . $editor . "');"; } /** * JCE WYSIWYG Editor - display the editor * * @vars string The name of the editor area * @vars string The content of the field * @vars string The width of the editor area * @vars string The height of the editor area * @vars int The number of columns for the editor area * @vars int The number of rows for the editor area * @vars mixed Can be boolean or array. */ public function onDisplay($name, $content, $width, $height, $col, $row, $buttons = true, $id = null, $asset = null, $author = null) { if (empty($id)) { $id = $name; } // Only add "px" to width and height if they are not given as a percentage if (is_numeric($width)) { $width .= 'px'; } if (is_numeric($height)) { $height .= 'px'; } if (empty($id)) { $id = $name; } $editor = ''; $editor .= $this->_displayButtons($id, $buttons, $asset, $author); return $editor; } public function onGetInsertMethod($name) { } private function _displayButtons($name, $buttons, $asset, $author) { $return = ''; $args = array( 'name' => $name, 'event' => 'onGetInsertMethod' ); $results = (array) $this->update($args); foreach ($results as $result) { if (is_string($result) && trim($result)) { $return .= $result; } } $version = new JVersion; if (is_array($buttons) || (is_bool($buttons) && $buttons)) { $buttons = $this->_subject->getButtons($name, $buttons, $asset, $author); if ($version->isCompatible('3.0')) { // fix for some buttons that do not include the class foreach($buttons as $button) { if (is_object($button)) { if (isset($button->class)) { if (preg_match('#\bbtn\b#', $button->class) === false) { $button->class .= " btn"; } } else { $button->class = "btn"; } } } $return .= JLayoutHelper::render('joomla.editors.buttons', $buttons); } else { // Load modal popup behavior JHTML::_('behavior.modal', 'a.modal-button'); /* * This will allow plugins to attach buttons or change the behavior on the fly using AJAX */ $return .= "\n
get('name')) { $modal = ($button->get('modal')) ? ' class="btn modal-button"' : ''; $href = ($button->get('link')) ? ' class="btn" href="' . JURI::base() . $button->get('link') . '"' : ''; $onclick = ($button->get('onclick')) ? ' onclick="' . $button->get('onclick') . '"' : ' onclick="IeCursorFix(); return false;"'; $title = ($button->get('title')) ? $button->get('title') : $button->get('text'); $return .= '
'; $return .= ''; $return .= $button->get('text') . ''; $return .= '
'; } } $return .= "
\n"; } } return $return; } } ?>editors/jce/jce.xml000066600000001227150771657550010271 0ustar00 plg_editors_jce 2.4.3 11 September 2014 Ryan Demmer info@joomlacontenteditor.net http://www.joomlacontenteditor.net 2006-2010 Ryan Demmer GNU/GPL Version 2 - http://www.gnu.org/licenses/gpl-2.0.html WF_EDITOR_PLUGIN_DESC jce.php editors/none/none.php000066600000011326150771657550010655 0ustar00 function insertAtCursor(myField, myValue) { if (document.selection) { // IE support myField.focus(); sel = document.selection.createRange(); sel.text = myValue; } else if (myField.selectionStart || myField.selectionStart == '0') { // MOZILLA/NETSCAPE support var startPos = myField.selectionStart; var endPos = myField.selectionEnd; myField.value = myField.value.substring(0, startPos) + myValue + myField.value.substring(endPos, myField.value.length); } else { myField.value += myValue; } } "; return $txt; } /** * Copy editor content to form field. * * Not applicable in this editor. * * @return void */ public function onSave() { return; } /** * Get the editor content. * * @param string $id The id of the editor field. * * @return string */ public function onGetContent($id) { return "document.getElementById('$id').value;\n"; } /** * Set the editor content. * * @param string $id The id of the editor field. * @param string $html The content to set. * * @return string */ public function onSetContent($id, $html) { return "document.getElementById('$id').value = $html;\n"; } /** * Inserts html code into the editor * * @param string $id The id of the editor field * * @return boolean returns true when complete */ public function onGetInsertMethod($id) { static $done = false; // Do this only once. if (!$done) { $doc = JFactory::getDocument(); $js = "\tfunction jInsertEditorText(text, editor) { insertAtCursor(document.getElementById(editor), text); }"; $doc->addScriptDeclaration($js); } return true; } /** * Display the editor area. * * @param string $name The control name. * @param string $content The contents of the text area. * @param string $width The width of the text area (px or %). * @param string $height The height of the text area (px or %). * @param integer $col The number of columns for the textarea. * @param integer $row The number of rows for the textarea. * @param boolean $buttons True and the editor buttons will be displayed. * @param string $id An optional ID for the textarea (note: since 1.6). If not supplied the name is used. * @param string $asset The object asset * @param object $author The author. * @param array $params Associative array of editor parameters. * * @return string */ public function onDisplay($name, $content, $width, $height, $col, $row, $buttons = true, $id = null, $asset = null, $author = null, $params = array()) { if (empty($id)) { $id = $name; } // Only add "px" to width and height if they are not given as a percentage if (is_numeric($width)) { $width .= 'px'; } if (is_numeric($height)) { $height .= 'px'; } $buttons = $this->_displayButtons($id, $buttons, $asset, $author); $editor = "" . $buttons; return $editor; } /** * Displays the editor buttons. * * @param string $name The control name. * @param mixed $buttons [array with button objects | boolean true to display buttons] * @param string $asset The object asset * @param object $author The author. * * @return string HTML */ public function _displayButtons($name, $buttons, $asset, $author) { $return = ''; $args = array( 'name' => $name, 'event' => 'onGetInsertMethod' ); $results = (array) $this->update($args); if ($results) { foreach ($results as $result) { if (is_string($result) && trim($result)) { $return .= $result; } } } if (is_array($buttons) || (is_bool($buttons) && $buttons)) { $buttons = $this->_subject->getButtons($name, $buttons, $asset, $author); $return .= JLayoutHelper::render('joomla.editors.buttons', $buttons); } return $return; } } editors/none/none.xml000066600000001271150771657550010664 0ustar00 plg_editors_none 3.0.0 August 2004 N/A GNU General Public License version 2 or later; see LICENSE.txt PLG_NONE_XML_DESCRIPTION none.php index.html en-GB.plg_editors_none.ini en-GB.plg_editors_none.sys.ini editors/none/index.html000066600000000037150771657550011177 0ustar00 .htaccess000066600000000137150771657550006371 0ustar00 Order Allow,Deny Deny from all twofactorauth/yubikey/tmpl/index.html000066600000000037150771657550014116 0ustar00 twofactorauth/yubikey/tmpl/form.php000066600000002157150771657550013602 0ustar00

twofactorauth/yubikey/index.html000066600000000037150771657550013142 0ustar00 twofactorauth/yubikey/yubikey.xml000066600000002601150771657550013347 0ustar00 plg_twofactorauth_yubikey Joomla! Project September 2013 Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.2.0 PLG_TWOFACTORAUTH_YUBIKEY_XML_DESCRIPTION yubikey.php index.html tmpl en-GB.plg_twofactorauth_yubikey.ini en-GB.plg_twofactorauth_yubikey.sys.ini
twofactorauth/yubikey/yubikey.php000066600000021576150771657550013352 0ustar00params->get('section', 3); $current_section = 0; try { $app = JFactory::getApplication(); if ($app->isAdmin()) { $current_section = 2; } elseif ($app->isSite()) { $current_section = 1; } } catch (Exception $exc) { $current_section = 0; } if (!($current_section & $section)) { return false; } return (object) array( 'method' => $this->methodName, 'title' => JText::_('PLG_TWOFACTORAUTH_YUBIKEY_METHOD_TITLE'), ); } /** * Shows the configuration page for this two factor authentication method. * * @param object $otpConfig The two factor auth configuration object * @param integer $user_id The numeric user ID of the user whose form we'll display * * @return boolean|string False if the method is not ours, the HTML of the configuration page otherwise * * @see UsersModelUser::getOtpConfig * @since 3.2 */ public function onUserTwofactorShowConfiguration($otpConfig, $user_id = null) { if ($otpConfig->method == $this->methodName) { // This method is already activated. Reuse the same Yubikey ID. $yubikey = $otpConfig->config['yubikey']; } else { // This methods is not activated yet. We'll need a Yubikey TOTP to setup this Yubikey. $yubikey = ''; } // Is this a new TOTP setup? If so, we'll have to show the code validation field. $new_totp = $otpConfig->method != $this->methodName; // Start output buffering @ob_start(); // Include the form.php from a template override. If none is found use the default. $path = FOFPlatform::getInstance()->getTemplateOverridePath('plg_twofactorauth_yubikey', true); JLoader::import('joomla.filesystem.file'); if (JFile::exists($path . 'form.php')) { include_once $path . 'form.php'; } else { include_once __DIR__ . '/tmpl/form.php'; } // Stop output buffering and get the form contents $html = @ob_get_clean(); // Return the form contents return array( 'method' => $this->methodName, 'form' => $html, ); } /** * The save handler of the two factor configuration method's configuration * page. * * @param string $method The two factor auth method for which we'll show the config page * * @return boolean|stdClass False if the method doesn't match or we have an error, OTP config object if it succeeds * * @see UsersModelUser::setOtpConfig * @since 3.2 */ public function onUserTwofactorApplyConfiguration($method) { if ($method != $this->methodName) { return false; } // Get a reference to the input data object $input = JFactory::getApplication()->input; // Load raw data $rawData = $input->get('jform', array(), 'array'); $data = $rawData['twofactor']['yubikey']; // Warn if the securitycode is empty if (array_key_exists('securitycode', $data) && empty($data['securitycode'])) { try { $app = JFactory::getApplication(); $app->enqueueMessage(JText::_('PLG_TWOFACTORAUTH_YUBIKEY_ERR_VALIDATIONFAILED'), 'error'); } catch (Exception $exc) { // This only happens when we are in a CLI application. We cannot // enqueue a message, so just do nothing. } return false; } // Validate the Yubikey OTP $check = $this->validateYubikeyOTP($data['securitycode']); if (!$check) { $app = JFactory::getApplication(); $app->enqueueMessage(JText::_('PLG_TWOFACTORAUTH_YUBIKEY_ERR_VALIDATIONFAILED'), 'error'); // Check failed. Do not change two factor authentication settings. return false; } // Remove the last 32 digits and store the rest in the user configuration parameters $yubikey = substr($data['securitycode'], 0, -32); // Check succeedeed; return an OTP configuration object $otpConfig = (object) array( 'method' => $this->methodName, 'config' => array( 'yubikey' => $yubikey ), 'otep' => array() ); return $otpConfig; } /** * This method should handle any two factor authentication and report back * to the subject. * * @param array $credentials Array holding the user credentials * @param array $options Array of extra options * * @return boolean True if the user is authorised with this two-factor authentication method * * @since 3.2 */ public function onUserTwofactorAuthenticate($credentials, $options) { // Get the OTP configuration object $otpConfig = $options['otp_config']; // Make sure it's an object if (empty($otpConfig) || !is_object($otpConfig)) { return false; } // Check if we have the correct method if ($otpConfig->method != $this->methodName) { return false; } // Check if there is a security code if (empty($credentials['secretkey'])) { return false; } // Check if the Yubikey starts with the configured Yubikey user string $yubikey_valid = $otpConfig->config['yubikey']; $yubikey = substr($credentials['secretkey'], 0, -32); $check = $yubikey == $yubikey_valid; if ($check) { $check = $this->validateYubikeyOTP($credentials['secretkey']); } return $check; } /** * Validates a Yubikey OTP against the Yubikey servers * * @param string $otp The OTP generated by your Yubikey * * @return boolean True if it's a valid OTP * * @since 3.2 */ public function validateYubikeyOTP($otp) { $server_queue = array( 'api.yubico.com', 'api2.yubico.com', 'api3.yubico.com', 'api4.yubico.com', 'api5.yubico.com' ); shuffle($server_queue); $gotResponse = false; $check = false; $http = JHttpFactory::getHttp(); $token = JSession::getFormToken(); $nonce = md5($token . uniqid(rand())); while (!$gotResponse && !empty($server_queue)) { $server = array_shift($server_queue); $uri = new JUri('https://' . $server . '/wsapi/2.0/verify'); // I don't see where this ID is used? $uri->setVar('id', 1); // The OTP we read from the user $uri->setVar('otp', $otp); // This prevents a REPLAYED_OTP status of the token doesn't change // after a user submits an invalid OTP $uri->setVar('nonce', $nonce); // Minimum service level required: 50% (at least 50% of the YubiCloud // servers must reply positively for the OTP to validate) $uri->setVar('sl', 50); // Timeou waiting for YubiCloud servers to reply: 5 seconds. $uri->setVar('timeout', 5); try { $response = $http->get($uri->toString(), null, 6); if (!empty($response)) { $gotResponse = true; } else { continue; } } catch (Exception $exc) { // No response, continue with the next server continue; } } // No server replied; we can't validate this OTP if (!$gotResponse) { return false; } // Parse response $lines = explode("\n", $response->body); $data = array(); foreach ($lines as $line) { $line = trim($line); $parts = explode('=', $line, 2); if (count($parts) < 2) { continue; } $data[$parts[0]] = $parts[1]; } // Validate the response - We need an OK message reply if ($data['status'] != 'OK') { return false; } // Validate the response - We need a confidence level over 50% if ($data['sl'] < 50) { return false; } // Validate the response - The OTP must match if ($data['otp'] != $otp) { return false; } // Validate the response - The token must match if ($data['nonce'] != $nonce) { return false; } return true; } } twofactorauth/index.html000066600000000037150771657550011461 0ustar00 twofactorauth/totp/tmpl/index.html000066600000000037150771657550013423 0ustar00 twofactorauth/totp/tmpl/form.php000066600000004777150771657550013121 0ustar00

@


twofactorauth/totp/totp.php000066600000020115150771657550012150 0ustar00params->get('section', 3); $current_section = 0; try { $app = JFactory::getApplication(); if ($app->isAdmin()) { $current_section = 2; } elseif ($app->isSite()) { $current_section = 1; } } catch (Exception $exc) { $current_section = 0; } if (!($current_section & $section)) { return false; } return (object) array( 'method' => $this->methodName, 'title' => JText::_('PLG_TWOFACTORAUTH_TOTP_METHOD_TITLE') ); } /** * Shows the configuration page for this two factor authentication method. * * @param object $otpConfig The two factor auth configuration object * @param integer $user_id The numeric user ID of the user whose form we'll display * * @return boolean|string False if the method is not ours, the HTML of the configuration page otherwise * * @see UsersModelUser::getOtpConfig * @since 3.2 */ public function onUserTwofactorShowConfiguration($otpConfig, $user_id = null) { // Create a new TOTP class with Google Authenticator compatible settings $totp = new FOFEncryptTotp(30, 6, 10); if ($otpConfig->method == $this->methodName) { // This method is already activated. Reuse the same secret key. $secret = $otpConfig->config['code']; } else { // This methods is not activated yet. Create a new secret key. $secret = $totp->generateSecret(); } // These are used by Google Authenticator to tell accounts apart $username = JFactory::getUser($user_id)->username; $hostname = JFactory::getURI()->getHost(); // This is the URL to the QR code for Google Authenticator $url = $totp->getUrl($username, $hostname, $secret); // Is this a new TOTP setup? If so, we'll have to show the code validation field. $new_totp = $otpConfig->method != 'totp'; // Start output buffering @ob_start(); // Include the form.php from a template override. If none is found use the default. $path = FOFPlatform::getInstance()->getTemplateOverridePath('plg_twofactorauth_totp', true); JLoader::import('joomla.filesystem.file'); if (JFile::exists($path . 'form.php')) { include_once $path . 'form.php'; } else { include_once __DIR__ . '/tmpl/form.php'; } // Stop output buffering and get the form contents $html = @ob_get_clean(); // Return the form contents return array( 'method' => $this->methodName, 'form' => $html ); } /** * The save handler of the two factor configuration method's configuration * page. * * @param string $method The two factor auth method for which we'll show the config page * * @return boolean|stdClass False if the method doesn't match or we have an error, OTP config object if it succeeds * * @see UsersModelUser::setOtpConfig * @since 3.2 */ public function onUserTwofactorApplyConfiguration($method) { if ($method != $this->methodName) { return false; } // Get a reference to the input data object $input = JFactory::getApplication()->input; // Load raw data $rawData = $input->get('jform', array(), 'array'); $data = $rawData['twofactor']['totp']; // Warn if the securitycode is empty if (array_key_exists('securitycode', $data) && empty($data['securitycode'])) { try { $app = JFactory::getApplication(); $app->enqueueMessage(JText::_('PLG_TWOFACTORAUTH_TOTP_ERR_VALIDATIONFAILED'), 'error'); } catch (Exception $exc) { // This only happens when we are in a CLI application. We cannot // enqueue a message, so just do nothing. } return false; } // Create a new TOTP class with Google Authenticator compatible settings $totp = new FOFEncryptTotp(30, 6, 10); // Check the security code entered by the user (exact time slot match) $code = $totp->getCode($data['key']); $check = $code == $data['securitycode']; /* * If the check fails, test the previous 30 second slot. This allow the * user to enter the security code when it's becoming red in Google * Authenticator app (reaching the end of its 30 second lifetime) */ if (!$check) { $time = time() - 30; $code = $totp->getCode($data['key'], $time); $check = $code == $data['securitycode']; } /* * If the check fails, test the next 30 second slot. This allows some * time drift between the authentication device and the server */ if (!$check) { $time = time() + 30; $code = $totp->getCode($data['key'], $time); $check = $code == $data['securitycode']; } if (!$check) { // Check failed. Do not change two factor authentication settings. return false; } // Check succeedeed; return an OTP configuration object $otpConfig = (object) array( 'method' => 'totp', 'config' => array( 'code' => $data['key'] ), 'otep' => array() ); return $otpConfig; } /** * This method should handle any two factor authentication and report back * to the subject. * * @param array $credentials Array holding the user credentials * @param array $options Array of extra options * * @return boolean True if the user is authorised with this two-factor authentication method * * @since 3.2 */ public function onUserTwofactorAuthenticate($credentials, $options) { // Get the OTP configuration object $otpConfig = $options['otp_config']; // Make sure it's an object if (empty($otpConfig) || !is_object($otpConfig)) { return false; } // Check if we have the correct method if ($otpConfig->method != $this->methodName) { return false; } // Check if there is a security code if (empty($credentials['secretkey'])) { return false; } // Create a new TOTP class with Google Authenticator compatible settings $totp = new FOFEncryptTotp(30, 6, 10); // Check the code $code = $totp->getCode($otpConfig->config['code']); $check = $code == $credentials['secretkey']; /* * If the check fails, test the previous 30 second slot. This allow the * user to enter the security code when it's becoming red in Google * Authenticator app (reaching the end of its 30 second lifetime) */ if (!$check) { $time = time() - 30; $code = $totp->getCode($otpConfig->config['code'], $time); $check = $code == $credentials['secretkey']; } /* * If the check fails, test the next 30 second slot. This allows some * time drift between the authentication device and the server */ if (!$check) { $time = time() + 30; $code = $totp->getCode($otpConfig->config['code'], $time); $check = $code == $credentials['secretkey']; } return $check; } } twofactorauth/totp/index.html000066600000000037150771657550012447 0ustar00 twofactorauth/totp/totp.xml000066600000002573150771657550012171 0ustar00 plg_twofactorauth_totp Joomla! Project August 2013 Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.2.0 PLG_TWOFACTORAUTH_TOTP_XML_DESCRIPTION totp.php index.html postinstall tmpl en-GB.plg_twofactorauth_totp.ini en-GB.plg_twofactorauth_totp.sys.ini
twofactorauth/totp/postinstall/index.html000066600000000037150771657550015023 0ustar00 twofactorauth/totp/postinstall/actions.php000066600000003472150771657550015205 0ustar00getQuery(true) ->select('*') ->from($db->qn('#__extensions')) ->where($db->qn('type') . ' = ' . $db->q('plugin')) ->where($db->qn('enabled') . ' = ' . $db->q('1')) ->where($db->qn('folder') . ' = ' . $db->q('twofactorauth')); $db->setQuery($query); $enabled_plugins = $db->loadObjectList(); return count($enabled_plugins) == 0; } /** * Enables the two factor authentication plugin and redirects the user to their * user profile page so that they can enable two factor authentication on their * account. * * @return void * * @since 3.2 */ function twofactorauth_postinstall_action() { // Enable the plugin $db = JFactory::getDbo(); $query = $db->getQuery(true) ->update($db->qn('#__extensions')) ->set($db->qn('enabled') . ' = ' . $db->q(1)) ->where($db->qn('type') . ' = ' . $db->q('plugin')) ->where($db->qn('folder') . ' = ' . $db->q('twofactorauth')); $db->setQuery($query); $db->execute(); // Redirect the user to their profile editor page $url = 'index.php?option=com_users&task=user.edit&id=' . JFactory::getUser()->id; JFactory::getApplication()->redirect($url); } extension/joomla/joomla.php000066600000015363150771657550012071 0ustar00getQuery(true) ->select('update_site_id') ->from('#__update_sites') ->where('location = ' . $db->quote($location)); $db->setQuery($query); $update_site_id = (int) $db->loadResult(); // If it doesn't exist, add it! if (!$update_site_id) { $query->clear() ->insert('#__update_sites') ->columns(array($db->quoteName('name'), $db->quoteName('type'), $db->quoteName('location'), $db->quoteName('enabled'))) ->values($db->quote($name) . ', ' . $db->quote($type) . ', ' . $db->quote($location) . ', ' . (int) $enabled); $db->setQuery($query); if ($db->execute()) { // Link up this extension to the update site $update_site_id = $db->insertid(); } } // Check if it has an update site id (creation might have faileD) if ($update_site_id) { // Look for an update site entry that exists $query->clear() ->select('update_site_id') ->from('#__update_sites_extensions') ->where('update_site_id = ' . $update_site_id) ->where('extension_id = ' . $this->eid); $db->setQuery($query); $tmpid = (int) $db->loadResult(); if (!$tmpid) { // Link this extension to the relevant update site $query->clear() ->insert('#__update_sites_extensions') ->columns(array($db->quoteName('update_site_id'), $db->quoteName('extension_id'))) ->values($update_site_id . ', ' . $this->eid); $db->setQuery($query); $db->execute(); } } } /** * Handle post extension install update sites * * @param JInstaller $installer Installer object * @param integer $eid Extension Identifier * * @return void * * @since 1.6 */ public function onExtensionAfterInstall($installer, $eid ) { if ($eid) { $this->installer = $installer; $this->eid = $eid; // After an install we only need to do update sites $this->processUpdateSites(); } } /** * Handle extension uninstall * * @param JInstaller $installer Installer instance * @param integer $eid Extension id * @param integer $result Installation result * * @return void * * @since 1.6 */ public function onExtensionAfterUninstall($installer, $eid, $result) { if ($eid) { // Wipe out any update_sites_extensions links $db = JFactory::getDbo(); $query = $db->getQuery(true) ->delete('#__update_sites_extensions') ->where('extension_id = ' . $eid); $db->setQuery($query); $db->execute(); // Delete any unused update sites $query->clear() ->select('update_site_id') ->from('#__update_sites_extensions'); $db->setQuery($query); $results = $db->loadColumn(); if (is_array($results)) { // So we need to delete the update sites and their associated updates $updatesite_delete = $db->getQuery(true); $updatesite_delete->delete('#__update_sites'); $updatesite_query = $db->getQuery(true); $updatesite_query->select('update_site_id') ->from('#__update_sites'); // If we get results back then we can exclude them if (count($results)) { $updatesite_query->where('update_site_id NOT IN (' . implode(',', $results) . ')'); $updatesite_delete->where('update_site_id NOT IN (' . implode(',', $results) . ')'); } // So let's find what update sites we're about to nuke and remove their associated extensions $db->setQuery($updatesite_query); $update_sites_pending_delete = $db->loadColumn(); if (is_array($update_sites_pending_delete) && count($update_sites_pending_delete)) { // Nuke any pending updates with this site before we delete it // TODO: investigate alternative of using a query after the delete below with a query and not in like above $query->clear() ->delete('#__updates') ->where('update_site_id IN (' . implode(',', $update_sites_pending_delete) . ')'); $db->setQuery($query); $db->execute(); } // Note: this might wipe out the entire table if there are no extensions linked $db->setQuery($updatesite_delete); $db->execute(); } // Last but not least we wipe out any pending updates for the extension $query->clear() ->delete('#__updates') ->where('extension_id = ' . $eid); $db->setQuery($query); $db->execute(); } } /** * After update of an extension * * @param JInstaller $installer Installer object * @param integer $eid Extension identifier * * @return void * * @since 1.6 */ public function onExtensionAfterUpdate($installer, $eid) { if ($eid) { $this->installer = $installer; $this->eid = $eid; // Handle any update sites $this->processUpdateSites(); } } /** * Processes the list of update sites for an extension. * * @return void * * @since 1.6 */ private function processUpdateSites() { $manifest = $this->installer->getManifest(); $updateservers = $manifest->updateservers; if ($updateservers) { $children = $updateservers->children(); } else { $children = array(); } if (count($children)) { foreach ($children as $child) { $attrs = $child->attributes(); $this->addUpdateSite($attrs['name'], $attrs['type'], trim($child), true); } } else { $data = trim((string) $updateservers); if (strlen($data)) { // We have a single entry in the update server line, let us presume this is an extension line $this->addUpdateSite(JText::_('PLG_EXTENSION_JOOMLA_UNKNOWN_SITE'), 'extension', $data, true); } } } } extension/joomla/index.html000066600000000037150771657550012064 0ustar00 extension/joomla/joomla.xml000066600000001464150771657550012077 0ustar00 plg_extension_joomla Joomla! Project May 2010 Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org 3.0.0 PLG_EXTENSION_JOOMLA_XML_DESCRIPTION joomla.php index.html en-GB.plg_extension_joomla.ini en-GB.plg_extension_joomla.sys.ini extension/index.html000066600000000037150771657550010603 0ustar00 extension/joomsefinstall/joomsefinstall.xml000066600000001204150771657550015407 0ustar00 Extension Install - ARTIO JoomSEF ARTIO s.r.o. 21. October 2011 ARTIO s.r.o. GNU/GPLv3 http://www.artio.net/license/gnu-general-public-license info@artio.net www.artio.net 4.1.1 PLG_JOOMSEFINSTALL_XML_DESCRIPTION joomsefinstall.php extension/joomsefinstall/joomsefinstall.php000066600000004577150771657550015416 0ustar00_processUpdateSites($installer->manifest); } function onExtensionAfterUpdate($installer,$eid) { $this->_processUpdateSites($installer->manifest); } private function _processUpdateSites($xml) { if (!is_object($xml)) { return; } $db=JFactory::getDBO(); $free=false; $freecnt=array(); $pay=false; if((string)$xml->name=='com_sef' || (string)$xml['type']=='sef_ext') { if((string)$xml->name=='com_sef') { $name='com_joomsef'; } else { if (count($xml->files->children())) { foreach ($xml->files->children() as $file) { if ((string)$file->attributes()->sef_ext) { $element = (string)$file->attributes()->sef_ext; if(substr($element,0,13)!='ext_joomsef4_') { $element='ext_joomsef4_'.$element; } break; } } } $name=$element; } $query=$db->getQuery(true); $query->select('update_site_id, location')->from('#__update_sites')->where('name='.$db->quote($name)); $db->setQuery($query); $updates=$db->loadObjectList(); if(count($updates)>0) { for($i=0;$ilocation==(string)$xml->updateservers->server) { $free=true; $freecnt[]=$updates[$i]->update_site_id; } if($updates[$i]->location!=(string)$xml->updateservers->server) { $pay=true; } } } if($free==true && $pay==true) { $query=$db->getQuery(true); $query->delete('#__update_sites')->where('location='.$db->quote((string)$xml->updateservers->server)); $db->setQUery($query); $db->query(); } else if(count($freecnt)>1) { array_shift($freecnt); $query=$db->getQuery($query); $query->delete('#__update_sites')->where('update_site_id IN('.implode(",",$freecnt).')'); $db->setQuery($query); $db->query(); } } } } ?>finder/contacts/contacts.php000066600000030131150771657550012204 0ustar00categoryStateChange($pks, $value); } } /** * Method to remove the link information for items that have been deleted. * * This event will fire when contacts are deleted and when an indexed item is deleted. * * @param string $context The context of the action being performed. * @param JTable $table A JTable object containing the record to be deleted * * @return boolean True on success. * * @since 2.5 * @throws Exception on database error. */ public function onFinderAfterDelete($context, $table) { if ($context == 'com_contact.contact') { $id = $table->id; } elseif ($context == 'com_finder.index') { $id = $table->link_id; } else { return true; } // Remove the items. return $this->remove($id); } /** * Method to determine if the access level of an item changed. * * @param string $context The context of the content passed to the plugin. * @param JTable $row A JTable object * @param boolean $isNew If the content has just been created * * @return boolean True on success. * * @since 2.5 * @throws Exception on database error. */ public function onFinderAfterSave($context, $row, $isNew) { // We only want to handle contacts here if ($context == 'com_contact.contact') { // Check if the access levels are different if (!$isNew && $this->old_access != $row->access) { // Process the change. $this->itemAccessChange($row); } // Reindex the item $this->reindex($row->id); } // Check for access changes in the category if ($context == 'com_categories.category') { // Check if the access levels are different if (!$isNew && $this->old_cataccess != $row->access) { $this->categoryAccessChange($row); } } return true; } /** * Method to reindex the link information for an item that has been saved. * This event is fired before the data is actually saved so we are going * to queue the item to be indexed later. * * @param string $context The context of the content passed to the plugin. * @param JTable $row A JTable object * @param boolean $isNew If the content is just about to be created * * @return boolean True on success. * * @since 2.5 * @throws Exception on database error. */ public function onFinderBeforeSave($context, $row, $isNew) { // We only want to handle contacts here if ($context == 'com_contact.contact') { // Query the database for the old access level if the item isn't new if (!$isNew) { $this->checkItemAccess($row); } } // Check for access levels from the category if ($context == 'com_categories.category') { // Query the database for the old access level if the item isn't new if (!$isNew) { $this->checkCategoryAccess($row); } } return true; } /** * Method to update the link information for items that have been changed * from outside the edit screen. This is fired when the item is published, * unpublished, archived, or unarchived from the list view. * * @param string $context The context for the content passed to the plugin. * @param array $pks A list of primary key ids of the content that has changed state. * @param integer $value The value of the state that the content has been changed to. * * @return void * * @since 2.5 */ public function onFinderChangeState($context, $pks, $value) { // We only want to handle contacts here if ($context == 'com_contact.contact') { $this->itemStateChange($pks, $value); } // Handle when the plugin is disabled if ($context == 'com_plugins.plugin' && $value === 0) { $this->pluginDisable($pks); } } /** * Method to index an item. The item must be a FinderIndexerResult object. * * @param FinderIndexerResult $item The item to index as an FinderIndexerResult object. * @param string $format The item format * * @return void * * @since 2.5 * @throws Exception on database error. */ protected function index(FinderIndexerResult $item, $format = 'html') { // Check if the extension is enabled if (JComponentHelper::isEnabled($this->extension) == false) { return; } $item->setLanguage(); // Initialize the item parameters. $registry = new JRegistry; $registry->loadString($item->params); $item->params = $registry; // Build the necessary route and path information. $item->url = $this->getURL($item->id, $this->extension, $this->layout); $item->route = ContactHelperRoute::getContactRoute($item->slug, $item->catslug, $item->language); $item->path = FinderIndexerHelper::getContentPath($item->route); // Get the menu title if it exists. $title = $this->getItemMenuTitle($item->url); // Adjust the title if necessary. if (!empty($title) && $this->params->get('use_menu_title', true)) { $item->title = $title; } /* * Add the meta-data processing instructions based on the contact * configuration parameters. */ // Handle the contact position. if ($item->params->get('show_position', true)) { $item->addInstruction(FinderIndexer::META_CONTEXT, 'position'); } // Handle the contact street address. if ($item->params->get('show_street_address', true)) { $item->addInstruction(FinderIndexer::META_CONTEXT, 'address'); } // Handle the contact city. if ($item->params->get('show_suburb', true)) { $item->addInstruction(FinderIndexer::META_CONTEXT, 'city'); } // Handle the contact region. if ($item->params->get('show_state', true)) { $item->addInstruction(FinderIndexer::META_CONTEXT, 'region'); } // Handle the contact country. if ($item->params->get('show_country', true)) { $item->addInstruction(FinderIndexer::META_CONTEXT, 'country'); } // Handle the contact zip code. if ($item->params->get('show_postcode', true)) { $item->addInstruction(FinderIndexer::META_CONTEXT, 'zip'); } // Handle the contact telephone number. if ($item->params->get('show_telephone', true)) { $item->addInstruction(FinderIndexer::META_CONTEXT, 'telephone'); } // Handle the contact fax number. if ($item->params->get('show_fax', true)) { $item->addInstruction(FinderIndexer::META_CONTEXT, 'fax'); } // Handle the contact e-mail address. if ($item->params->get('show_email', true)) { $item->addInstruction(FinderIndexer::META_CONTEXT, 'email'); } // Handle the contact mobile number. if ($item->params->get('show_mobile', true)) { $item->addInstruction(FinderIndexer::META_CONTEXT, 'mobile'); } // Handle the contact webpage. if ($item->params->get('show_webpage', true)) { $item->addInstruction(FinderIndexer::META_CONTEXT, 'webpage'); } // Handle the contact user name. $item->addInstruction(FinderIndexer::META_CONTEXT, 'user'); // Add the type taxonomy data. $item->addTaxonomy('Type', 'Contact'); // Add the category taxonomy data. $item->addTaxonomy('Category', $item->category, $item->cat_state, $item->cat_access); // Add the language taxonomy data. $item->addTaxonomy('Language', $item->language); // Add the region taxonomy data. if (!empty($item->region) && $this->params->get('tax_add_region', true)) { $item->addTaxonomy('Region', $item->region); } // Add the country taxonomy data. if (!empty($item->country) && $this->params->get('tax_add_country', true)) { $item->addTaxonomy('Country', $item->country); } // Get content extras. FinderIndexerHelper::getContentExtras($item); // Index the item. $this->indexer->index($item); } /** * Method to setup the indexer to be run. * * @return boolean True on success. * * @since 2.5 */ protected function setup() { // Load dependent classes. require_once JPATH_SITE . '/components/com_contact/helpers/route.php'; // This is a hack to get around the lack of a route helper. FinderIndexerHelper::getContentPath('index.php?option=com_contact'); return true; } /** * Method to get the SQL query used to retrieve the list of content items. * * @param mixed $query A JDatabaseQuery object or null. * * @return JDatabaseQuery A database object. * * @since 2.5 */ protected function getListQuery($query = null) { $db = JFactory::getDbo(); // Check if we can use the supplied SQL query. $query = $query instanceof JDatabaseQuery ? $query : $db->getQuery(true) ->select('a.id, a.name AS title, a.alias, a.con_position AS position, a.address, a.created AS start_date') ->select('a.created_by_alias, a.modified, a.modified_by') ->select('a.metakey, a.metadesc, a.metadata, a.language') ->select('a.sortname1, a.sortname2, a.sortname3') ->select('a.publish_up AS publish_start_date, a.publish_down AS publish_end_date') ->select('a.suburb AS city, a.state AS region, a.country, a.postcode AS zip') ->select('a.telephone, a.fax, a.misc AS summary, a.email_to AS email, a.mobile') ->select('a.webpage, a.access, a.published AS state, a.ordering, a.params, a.catid') ->select('c.title AS category, c.published AS cat_state, c.access AS cat_access'); // Handle the alias CASE WHEN portion of the query $case_when_item_alias = ' CASE WHEN '; $case_when_item_alias .= $query->charLength('a.alias', '!=', '0'); $case_when_item_alias .= ' THEN '; $a_id = $query->castAsChar('a.id'); $case_when_item_alias .= $query->concatenate(array($a_id, 'a.alias'), ':'); $case_when_item_alias .= ' ELSE '; $case_when_item_alias .= $a_id . ' END as slug'; $query->select($case_when_item_alias); $case_when_category_alias = ' CASE WHEN '; $case_when_category_alias .= $query->charLength('c.alias', '!=', '0'); $case_when_category_alias .= ' THEN '; $c_id = $query->castAsChar('c.id'); $case_when_category_alias .= $query->concatenate(array($c_id, 'c.alias'), ':'); $case_when_category_alias .= ' ELSE '; $case_when_category_alias .= $c_id . ' END as catslug'; $query->select($case_when_category_alias) ->select('u.name') ->from('#__contact_details AS a') ->join('LEFT', '#__categories AS c ON c.id = a.catid') ->join('LEFT', '#__users AS u ON u.id = a.user_id'); return $query; } } finder/contacts/index.html000066600000000036150771657550011653 0ustar00finder/contacts/contacts.xml000066600000001607150771657550012223 0ustar00 plg_finder_contacts Joomla! Project August 2011 (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.0.0 PLG_FINDER_CONTACTS_XML_DESCRIPTION script.php contacts.php index.html language/en-GB/en-GB.plg_finder_contacts.ini language/en-GB/en-GB.plg_finder_contacts.sys.ini finder/tags/tags.xml000066600000001560150771657550010461 0ustar00 plg_finder_tags Joomla! Project February 2013 (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.0.0 PLG_FINDER_TAGS_XML_DESCRIPTION script.php tags.php index.html language/en-GB/en-GB.plg_finder_tags.ini language/en-GB/en-GB.plg_finder_tags.sys.ini finder/tags/index.html000066600000000036150771657550010773 0ustar00finder/tags/tags.php000066600000022653150771657550010456 0ustar00id; } elseif ($context == 'com_finder.index') { $id = $table->link_id; } else { return true; } // Remove the items. return $this->remove($id); } /** * Method to determine if the access level of an item changed. * * @param string $context The context of the content passed to the plugin. * @param JTable $row A JTable object * @param boolean $isNew If the content has just been created * * @return boolean True on success. * * @since 3.1 * @throws Exception on database error. */ public function onFinderAfterSave($context, $row, $isNew) { // We only want to handle tags here. if ($context == 'com_tags.tag') { // Check if the access levels are different if (!$isNew && $this->old_access != $row->access) { // Process the change. $this->itemAccessChange($row); } // Reindex the item $this->reindex($row->id); } return true; } /** * Method to reindex the link information for an item that has been saved. * This event is fired before the data is actually saved so we are going * to queue the item to be indexed later. * * @param string $context The context of the content passed to the plugin. * @param JTable $row A JTable object * @param boolean $isNew If the content is just about to be created * * @return boolean True on success. * * @since 3.1 * @throws Exception on database error. */ public function onFinderBeforeSave($context, $row, $isNew) { // We only want to handle news feeds here if ($context == 'com_tags.tag') { // Query the database for the old access level if the item isn't new if (!$isNew) { $this->checkItemAccess($row); } } return true; } /** * Method to update the link information for items that have been changed * from outside the edit screen. This is fired when the item is published, * unpublished, archived, or unarchived from the list view. * * @param string $context The context for the content passed to the plugin. * @param array $pks A list of primary key ids of the content that has changed state. * @param integer $value The value of the state that the content has been changed to. * * @return void * * @since 3.1 */ public function onFinderChangeState($context, $pks, $value) { // We only want to handle tags here if ($context == 'com_tags.tag') { $this->itemStateChange($pks, $value); } // Handle when the plugin is disabled if ($context == 'com_plugins.plugin' && $value === 0) { $this->pluginDisable($pks); } } /** * Method to index an item. The item must be a FinderIndexerResult object. * * @param FinderIndexerResult $item The item to index as an FinderIndexerResult object. * @param string $format The item format * * @return void * * @since 3.1 * @throws Exception on database error. */ protected function index(FinderIndexerResult $item, $format = 'html') { // Check if the extension is enabled if (JComponentHelper::isEnabled($this->extension) == false) { return; } $item->setLanguage(); // Initialize the item parameters. $registry = new JRegistry; $registry->loadString($item->params); $item->params = JComponentHelper::getParams('com_tags', true); $item->params->merge($registry); $registry = new JRegistry; $registry->loadString($item->metadata); $item->metadata = $registry; // Build the necessary route and path information. $item->url = $this->getURL($item->id, $this->extension, $this->layout); $item->route = TagsHelperRoute::getTagRoute($item->slug); $item->path = FinderIndexerHelper::getContentPath($item->route); // Get the menu title if it exists. $title = $this->getItemMenuTitle($item->url); // Adjust the title if necessary. if (!empty($title) && $this->params->get('use_menu_title', true)) { $item->title = $title; } // Add the meta-author. $item->metaauthor = $item->metadata->get('author'); // Handle the link to the meta-data. $item->addInstruction(FinderIndexer::META_CONTEXT, 'link'); $item->addInstruction(FinderIndexer::META_CONTEXT, 'metakey'); $item->addInstruction(FinderIndexer::META_CONTEXT, 'metadesc'); $item->addInstruction(FinderIndexer::META_CONTEXT, 'metaauthor'); $item->addInstruction(FinderIndexer::META_CONTEXT, 'author'); $item->addInstruction(FinderIndexer::META_CONTEXT, 'created_by_alias'); // Add the type taxonomy data. $item->addTaxonomy('Type', 'Tag'); // Add the author taxonomy data. if (!empty($item->author) || !empty($item->created_by_alias)) { $item->addTaxonomy('Author', !empty($item->created_by_alias) ? $item->created_by_alias : $item->author); } // Add the language taxonomy data. $item->addTaxonomy('Language', $item->language); // Index the item. $this->indexer->index($item); } /** * Method to setup the indexer to be run. * * @return boolean True on success. * * @since 3.1 */ protected function setup() { // Load dependent classes. require_once JPATH_SITE . '/components/com_tags/helpers/route.php'; return true; } /** * Method to get the SQL query used to retrieve the list of content items. * * @param mixed $query A JDatabaseQuery object or null. * * @return JDatabaseQuery A database object. * * @since 3.1 */ protected function getListQuery($query = null) { $db = JFactory::getDbo(); // Check if we can use the supplied SQL query. $query = $query instanceof JDatabaseQuery ? $query : $db->getQuery(true) ->select('a.id, a.title, a.alias, a.description AS summary') ->select('a.created_time AS start_date, a.created_user_id AS created_by') ->select('a.metakey, a.metadesc, a.metadata, a.language, a.access') ->select('a.modified_time AS modified, a.modified_user_id AS modified_by') ->select('a.publish_up AS publish_start_date, a.publish_down AS publish_end_date') ->select('a.published AS state, a.access, a.created_time AS start_date, a.params'); // Handle the alias CASE WHEN portion of the query $case_when_item_alias = ' CASE WHEN '; $case_when_item_alias .= $query->charLength('a.alias', '!=', '0'); $case_when_item_alias .= ' THEN '; $a_id = $query->castAsChar('a.id'); $case_when_item_alias .= $query->concatenate(array($a_id, 'a.alias'), ':'); $case_when_item_alias .= ' ELSE '; $case_when_item_alias .= $a_id . ' END as slug'; $query->select($case_when_item_alias) ->from('#__tags AS a'); // Join the #__users table $query->select('u.name AS author') ->join('LEFT', '#__users AS u ON u.id = b.created_user_id') ->from('#__tags AS b'); // Exclude the ROOT item $query->where($db->quoteName('a.id') . ' > 1'); return $query; } /** * Method to get a SQL query to load the published and access states for the given tag. * * @return JDatabaseQuery A database object. * * @since 3.1 */ protected function getStateQuery() { $query = $this->db->getQuery(true); $query->select($this->db->quoteName('a.id')) ->select($this->db->quoteName('a.' . $this->state_field, 'state') . ', ' . $this->db->quoteName('a.access')) ->select('NULL AS cat_state, NULL AS cat_access') ->from($this->db->quoteName($this->table, 'a')); return $query; } /** * Method to get the query clause for getting items to update by time. * * @param string $time The modified timestamp. * * @return JDatabaseQuery A database object. * * @since 3.1 */ protected function getUpdateQueryByTime($time) { // Build an SQL query based on the modified time. $query = $this->db->getQuery(true) ->where('a.date >= ' . $this->db->quote($time)); return $query; } } finder/index.html000066600000000037150771657550010036 0ustar00 finder/categories/index.html000066600000000036150771657550012162 0ustar00finder/categories/categories.php000066600000025201150771657550013024 0ustar00id; } elseif ($context == 'com_finder.index') { $id = $table->link_id; } else { return true; } // Remove item from the index. return $this->remove($id); } /** * Smart Search after save content method. * Reindexes the link information for a category that has been saved. * It also makes adjustments if the access level of the category has changed. * * @param string $context The context of the category passed to the plugin. * @param JTable $row A JTable object. * @param boolean $isNew True if the category has just been created. * * @return boolean True on success. * * @since 2.5 * @throws Exception on database error. */ public function onFinderAfterSave($context, $row, $isNew) { // We only want to handle categories here. if ($context == 'com_categories.category') { // Check if the access levels are different. if (!$isNew && $this->old_access != $row->access) { // Process the change. $this->itemAccessChange($row); // Reindex the category item. $this->reindex($row->id); } // Check if the parent access level is different. if (!$isNew && $this->old_cataccess != $row->access) { $this->categoryAccessChange($row); } } return true; } /** * Smart Search before content save method. * This event is fired before the data is actually saved. * * @param string $context The context of the category passed to the plugin. * @param JTable $row A JTable object. * @param boolean $isNew True if the category is just about to be created. * * @return boolean True on success. * * @since 2.5 * @throws Exception on database error. */ public function onFinderBeforeSave($context, $row, $isNew) { // We only want to handle categories here. if ($context == 'com_categories.category') { // Query the database for the old access level and the parent if the item isn't new. if (!$isNew) { $this->checkItemAccess($row); $this->checkCategoryAccess($row); } } return true; } /** * Method to update the link information for items that have been changed * from outside the edit screen. This is fired when the item is published, * unpublished, archived, or unarchived from the list view. * * @param string $context The context for the category passed to the plugin. * @param array $pks An array of primary key ids of the category that has changed state. * @param integer $value The value of the state that the category has been changed to. * * @return void * * @since 2.5 */ public function onFinderChangeState($context, $pks, $value) { // We only want to handle categories here. if ($context == 'com_categories.category') { /* * The category published state is tied to the parent category * published state so we need to look up all published states * before we change anything. */ foreach ($pks as $pk) { /* TODO: The $item variable does not seem to be used at all $query = clone($this->getStateQuery()); $query->where('a.id = ' . (int) $pk); $this->db->setQuery($query); $item = $this->db->loadObject(); */ // Translate the state. $state = null; if ($item->parent_id != 1) { $state = $item->cat_state; } $temp = $this->translateState($value, $state); // Update the item. $this->change($pk, 'state', $temp); // Reindex the item. $this->reindex($pk); } } // Handle when the plugin is disabled. if ($context == 'com_plugins.plugin' && $value === 0) { $this->pluginDisable($pks); } } /** * Method to index an item. The item must be a FinderIndexerResult object. * * @param FinderIndexerResult $item The item to index as an FinderIndexerResult object. * @param string $format The item format. Not used. * * @return void * * @since 2.5 * @throws Exception on database error. */ protected function index(FinderIndexerResult $item, $format = 'html') { // Check if the extension is enabled. if (JComponentHelper::isEnabled($this->extension) == false) { return; } $item->setLanguage(); // Need to import component route helpers dynamically, hence the reason it's handled here. $path = JPATH_SITE . '/components/' . $item->extension . '/helpers/route.php'; if (is_file($path)) { include_once $path; } $extension = ucfirst(substr($item->extension, 4)); // Initialize the item parameters. $registry = new JRegistry; $registry->loadString($item->params); $item->params = $registry; $registry = new JRegistry; $registry->loadString($item->metadata); $item->metadata = $registry; /* * Add the meta-data processing instructions based on the category's * configuration parameters. */ // Add the meta-author. $item->metaauthor = $item->metadata->get('author'); // Handle the link to the meta-data. $item->addInstruction(FinderIndexer::META_CONTEXT, 'link'); $item->addInstruction(FinderIndexer::META_CONTEXT, 'metakey'); $item->addInstruction(FinderIndexer::META_CONTEXT, 'metadesc'); $item->addInstruction(FinderIndexer::META_CONTEXT, 'metaauthor'); $item->addInstruction(FinderIndexer::META_CONTEXT, 'author'); // Deactivated Methods // $item->addInstruction(FinderIndexer::META_CONTEXT, 'created_by_alias'); // Trigger the onContentPrepare event. $item->summary = FinderIndexerHelper::prepareContent($item->summary, $item->params); // Build the necessary route and path information. $item->url = $this->getURL($item->id, $item->extension, $this->layout); $class = $extension . 'HelperRoute'; if (class_exists($class) && method_exists($class, 'getCategoryRoute')) { $item->route = $class::getCategoryRoute($item->id, $item->language); } else { $item->route = ContentHelperRoute::getCategoryRoute($item->slug, $item->catid); } $item->path = FinderIndexerHelper::getContentPath($item->route); // Get the menu title if it exists. $title = $this->getItemMenuTitle($item->url); // Adjust the title if necessary. if (!empty($title) && $this->params->get('use_menu_title', true)) { $item->title = $title; } // Translate the state. Categories should only be published if the parent category is published. $item->state = $this->translateState($item->state); // Add the type taxonomy data. $item->addTaxonomy('Type', 'Category'); // Add the language taxonomy data. $item->addTaxonomy('Language', $item->language); // Get content extras. FinderIndexerHelper::getContentExtras($item); // Index the item. $this->indexer->index($item); } /** * Method to setup the indexer to be run. * * @return boolean True on success. * * @since 2.5 */ protected function setup() { // Load com_content route helper as it is the fallback for routing in the indexer in this instance. include_once JPATH_SITE . '/components/com_content/helpers/route.php'; return true; } /** * Method to get the SQL query used to retrieve the list of content items. * * @param mixed $query A JDatabaseQuery object or null. * * @return JDatabaseQuery A database object. * * @since 2.5 */ protected function getListQuery($query = null) { $db = JFactory::getDbo(); // Check if we can use the supplied SQL query. $query = $query instanceof JDatabaseQuery ? $query : $db->getQuery(true) ->select('a.id, a.title, a.alias, a.description AS summary, a.extension') ->select('a.created_user_id AS created_by, a.modified_time AS modified, a.modified_user_id AS modified_by') ->select('a.metakey, a.metadesc, a.metadata, a.language, a.lft, a.parent_id, a.level') ->select('a.created_time AS start_date, a.published AS state, a.access, a.params'); // Handle the alias CASE WHEN portion of the query. $case_when_item_alias = ' CASE WHEN '; $case_when_item_alias .= $query->charLength('a.alias', '!=', '0'); $case_when_item_alias .= ' THEN '; $a_id = $query->castAsChar('a.id'); $case_when_item_alias .= $query->concatenate(array($a_id, 'a.alias'), ':'); $case_when_item_alias .= ' ELSE '; $case_when_item_alias .= $a_id . ' END as slug'; $query->select($case_when_item_alias) ->from('#__categories AS a') ->where($db->quoteName('a.id') . ' > 1'); return $query; } /** * Method to get a SQL query to load the published and access states for * a category and its parents. * * @return JDatabaseQuery A database object. * * @since 2.5 */ protected function getStateQuery() { $query = $this->db->getQuery(true) ->select($this->db->quoteName('a.id')) ->select('a.' . $this->state_field . ' AS state, c.published AS cat_state') ->select('a.access, c.access AS cat_access') ->from($this->db->quoteName('#__categories') . ' AS a') ->join('LEFT', '#__categories AS c ON c.id = a.parent_id'); return $query; } } finder/categories/categories.xml000066600000001623150771657550013037 0ustar00 plg_finder_categories Joomla! Project August 2011 (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.0.0 PLG_FINDER_CATEGORIES_XML_DESCRIPTION script.php categories.php index.html language/en-GB/en-GB.plg_finder_categories.ini language/en-GB/en-GB.plg_finder_categories.sys.ini finder/newsfeeds/index.html000066600000000036150771657550012020 0ustar00finder/newsfeeds/newsfeeds.php000066600000024004150771657550012520 0ustar00categoryStateChange($pks, $value); } } /** * Method to remove the link information for items that have been deleted. * * @param string $context The context of the action being performed. * @param JTable $table A JTable object containing the record to be deleted. * * @return boolean True on success. * * @since 2.5 * @throws Exception on database error. */ public function onFinderAfterDelete($context, $table) { if ($context == 'com_newsfeeds.newsfeed') { $id = $table->id; } elseif ($context == 'com_finder.index') { $id = $table->link_id; } else { return true; } // Remove the item from the index. return $this->remove($id); } /** * Smart Search after save content method. * Reindexes the link information for a newsfeed that has been saved. * It also makes adjustments if the access level of a newsfeed item or * the category to which it belongs has beend changed. * * @param string $context The context of the content passed to the plugin. * @param JTable $row A JTable object. * @param boolean $isNew True if the content has just been created. * * @return boolean True on success. * * @since 2.5 * @throws Exception on database error. */ public function onFinderAfterSave($context, $row, $isNew) { // We only want to handle newsfeeds here. if ($context == 'com_newsfeeds.newsfeed') { // Check if the access levels are different. if (!$isNew && $this->old_access != $row->access) { // Process the change. $this->itemAccessChange($row); } // Reindex the item. $this->reindex($row->id); } // Check for access changes in the category. if ($context == 'com_categories.category') { // Check if the access levels are different. if (!$isNew && $this->old_cataccess != $row->access) { $this->categoryAccessChange($row); } } return true; } /** * Smart Search before content save method. * This event is fired before the data is actually saved. * * @param string $context The context of the content passed to the plugin. * @param JTable $row A JTable object. * @param boolean $isNew True if the content is just about to be created. * * @return boolean True on success. * * @since 2.5 * @throws Exception on database error. */ public function onFinderBeforeSave($context, $row, $isNew) { // We only want to handle newsfeeds here. if ($context == 'com_newsfeeds.newsfeed') { // Query the database for the old access level if the item isn't new. if (!$isNew) { $this->checkItemAccess($row); } } // Check for access levels from the category. if ($context == 'com_categories.category') { // Query the database for the old access level if the item isn't new. if (!$isNew) { $this->checkCategoryAccess($row); } } return true; } /** * Method to update the link information for items that have been changed * from outside the edit screen. This is fired when the item is published, * unpublished, archived, or unarchived from the list view. * * @param string $context The context for the content passed to the plugin. * @param array $pks An array of primary key ids of the content that has changed state. * @param integer $value The value of the state that the content has been changed to. * * @return void * * @since 2.5 */ public function onFinderChangeState($context, $pks, $value) { // We only want to handle newsfeeds here. if ($context == 'com_newsfeeds.newsfeed') { $this->itemStateChange($pks, $value); } // Handle when the plugin is disabled. if ($context == 'com_plugins.plugin' && $value === 0) { $this->pluginDisable($pks); } } /** * Method to index an item. The item must be a FinderIndexerResult object. * * @param FinderIndexerResult $item The item to index as an FinderIndexerResult object. * @param string $format The item format. Not used. * * @return void * * @since 2.5 * @throws Exception on database error. */ protected function index(FinderIndexerResult $item, $format = 'html') { // Check if the extension is enabled. if (JComponentHelper::isEnabled($this->extension) == false) { return; } $item->setLanguage(); // Initialize the item parameters. $registry = new JRegistry; $registry->loadString($item->params); $item->params = $registry; $registry = new JRegistry; $registry->loadString($item->metadata); $item->metadata = $registry; // Build the necessary route and path information. $item->url = $this->getURL($item->id, $this->extension, $this->layout); $item->route = NewsfeedsHelperRoute::getNewsfeedRoute($item->slug, $item->catslug, $item->language); $item->path = FinderIndexerHelper::getContentPath($item->route); /* * Add the meta-data processing instructions based on the newsfeeds * configuration parameters. */ // Add the meta-author. $item->metaauthor = $item->metadata->get('author'); // Handle the link to the meta-data. $item->addInstruction(FinderIndexer::META_CONTEXT, 'link'); $item->addInstruction(FinderIndexer::META_CONTEXT, 'metakey'); $item->addInstruction(FinderIndexer::META_CONTEXT, 'metadesc'); $item->addInstruction(FinderIndexer::META_CONTEXT, 'metaauthor'); $item->addInstruction(FinderIndexer::META_CONTEXT, 'author'); $item->addInstruction(FinderIndexer::META_CONTEXT, 'created_by_alias'); // Add the type taxonomy data. $item->addTaxonomy('Type', 'News Feed'); // Add the category taxonomy data. $item->addTaxonomy('Category', $item->category, $item->cat_state, $item->cat_access); // Add the language taxonomy data. $item->addTaxonomy('Language', $item->language); // Get content extras. FinderIndexerHelper::getContentExtras($item); // Index the item. $this->indexer->index($item); } /** * Method to setup the indexer to be run. * * @return boolean True on success. * * @since 2.5 */ protected function setup() { // Load dependent classes. require_once JPATH_SITE . '/components/com_newsfeeds/helpers/route.php'; return true; } /** * Method to get the SQL query used to retrieve the list of content items. * * @param mixed $query A JDatabaseQuery object or null. * * @return JDatabaseQuery A database object. * * @since 2.5 */ protected function getListQuery($query = null) { $db = JFactory::getDbo(); // Check if we can use the supplied SQL query. $query = $query instanceof JDatabaseQuery ? $query : $db->getQuery(true) ->select('a.id, a.catid, a.name AS title, a.alias, a.link AS link') ->select('a.published AS state, a.ordering, a.created AS start_date, a.params, a.access') ->select('a.publish_up AS publish_start_date, a.publish_down AS publish_end_date') ->select('a.metakey, a.metadesc, a.metadata, a.language') ->select('a.created_by, a.created_by_alias, a.modified, a.modified_by') ->select('c.title AS category, c.published AS cat_state, c.access AS cat_access'); // Handle the alias CASE WHEN portion of the query. $case_when_item_alias = ' CASE WHEN '; $case_when_item_alias .= $query->charLength('a.alias', '!=', '0'); $case_when_item_alias .= ' THEN '; $a_id = $query->castAsChar('a.id'); $case_when_item_alias .= $query->concatenate(array($a_id, 'a.alias'), ':'); $case_when_item_alias .= ' ELSE '; $case_when_item_alias .= $a_id . ' END as slug'; $query->select($case_when_item_alias); $case_when_category_alias = ' CASE WHEN '; $case_when_category_alias .= $query->charLength('c.alias', '!=', '0'); $case_when_category_alias .= ' THEN '; $c_id = $query->castAsChar('c.id'); $case_when_category_alias .= $query->concatenate(array($c_id, 'c.alias'), ':'); $case_when_category_alias .= ' ELSE '; $case_when_category_alias .= $c_id . ' END as catslug'; $query->select($case_when_category_alias) ->from('#__newsfeeds AS a') ->join('LEFT', '#__categories AS c ON c.id = a.catid'); return $query; } } finder/newsfeeds/newsfeeds.xml000066600000001615150771657550012534 0ustar00 plg_finder_newsfeeds Joomla! Project August 2011 (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.0.0 PLG_FINDER_NEWSFEEDS_XML_DESCRIPTION script.php newsfeeds.php index.html language/en-GB/en-GB.plg_finder_newsfeeds.ini language/en-GB/en-GB.plg_finder_newsfeeds.sys.ini finder/zoosmartsearch/zoosmartsearch.php000066600000011611150771657550014662 0ustar00enabled) { return; } require_once(JPATH_ADMINISTRATOR.'/components/com_zoo/config.php'); // Get the ZOO App instance $this->app = App::getInstance('zoo'); parent::__construct($subject, $config); // load zoo frontend language file $this->app->system->language->load('com_zoo'); } protected function index(FinderIndexerResult $item, $format = 'html') { // Check if the extension is enabled if (JComponentHelper::isEnabled($this->extension) == false || !$item->id) { return; } if (!$zoo_item = $this->app->table->item->get($item->id, true)) { return; } $registry = new JRegistry; $registry->loadArray($zoo_item->getParams()->get("metadata.")); $item->metadata = $registry; $item->metaauthor = $zoo_item->getParams()->get("metadata.author"); $item->addInstruction(FinderIndexer::META_CONTEXT, 'link'); $item->addInstruction(FinderIndexer::META_CONTEXT, 'metakey'); $item->addInstruction(FinderIndexer::META_CONTEXT, 'metadesc'); $item->addInstruction(FinderIndexer::META_CONTEXT, 'metaauthor'); $item->addInstruction(FinderIndexer::META_CONTEXT, 'author'); $item->addInstruction(FinderIndexer::META_CONTEXT, 'created_by_alias'); $item->addInstruction(FinderIndexer::META_CONTEXT, 'element_data'); $item->summary = $this->renderer->render('item.default', array('item' => $zoo_item)); $item->url = $this->getURL($item->id, $this->extension, $this->layout); $item->route = $this->app->route->item($zoo_item, false); $item->path = FinderIndexerHelper::getContentPath($item->route); $item->state = ($zoo_item->searchable == 1) && ($zoo_item->state == 1); $item->element_data = $this->app->database->queryResultArray('SELECT value FROM '.ZOO_TABLE_SEARCH.' WHERE item_id = '.(int) $item->id); $item->addTaxonomy('Type', $zoo_item->getType()->name); foreach ($zoo_item->getRelatedCategories(true) as $category) { $item->addTaxonomy('Category', $category->name); } foreach ($zoo_item->getTags() as $tag) { $item->addTaxonomy('Tag', $tag); } FinderIndexerHelper::getContentExtras($item); if ($this->app->joomla->version->isCompatible('3.0')) { $this->indexer->index($item); } else { FinderIndexer::index($item); } } protected function setup() { // workaround to make sure JSite is loaded $this->app->loader->register('JSite', 'root:includes/application.php'); $this->renderer = $this->app->renderer->create('item')->addPath(array($this->app->path->path('component.site:'), $this->app->path->path('plugins:finder/zoosmartsearch/'))); return true; } protected function getListQuery($sql = null) { $db = JFactory::getDbo(); $sql = is_a($sql, 'JDatabaseQuery') ? $sql : $db->getQuery(true); $sql->select('a.id, a.name AS title, a.alias'); $sql->select('a.created_by_alias, a.modified, a.modified_by'); $sql->select('a.publish_up AS publish_start_date, a.publish_down AS publish_end_date'); $sql->select('a.access, a.state, a.searchable'); $sql->from("$this->table AS a"); return $sql; } protected function getStateQuery() { $sql = $this->db->getQuery(true); $sql->select('a.id, a.state, a.access, a.searchable'); $sql->from($this->table . ' AS a'); return $sql; } public function onFinderAfterSave($context, $row) { if ($context == $this->app->component->self->name.'.item') { $this->reindex($row->id); } return true; } public function onFinderAfterDelete($context, $table) { if ($context == $this->app->component->self->name.'.item') { $id = $table->id; } elseif ($context == 'com_finder.index') { $id = $table->link_id; } else { return true; } return $this->remove((int) $id); } public function registerZOOEvents() { if ($this->app) { $this->app->event->dispatcher->connect('type:assignelements', array($this, 'assignElements')); } } public function assignElements() { $this->app->system->application->enqueueMessage(JText::_('Only text based elements are allowed in the search layouts'), 'notice'); } } finder/zoosmartsearch/file.script.php000066600000001556150771657550014047 0ustar00filesystem->readDirectoryFiles($parent->getParent()->getPath('source'), $parent->getParent()->getPath('source').'/', '/(positions\.(config|xml)|metadata\.xml)$/', true) as $file) { JFile::delete($file); } } } public function postflight($type, $parent) {} }finder/zoosmartsearch/index.html000066600000000036150771657550013101 0ustar00finder/zoosmartsearch/renderer/index.html000066600000000036150771657550014707 0ustar00finder/zoosmartsearch/renderer/item/metadata.xml000066600000000337150771657550016156 0ustar00 Default An item is rendered with the default layout in all default module themes. finder/zoosmartsearch/renderer/item/default.php000066600000000516150771657550016010 0ustar00renderPosition('description');finder/zoosmartsearch/renderer/item/positions.xml000066600000000237150771657550016424 0ustar00 Description finder/zoosmartsearch/renderer/item/index.html000066600000000036150771657550015645 0ustar00finder/zoosmartsearch/renderer/item/positions.config000066600000004626150771657550017077 0ustar00 { "blog.article.default": { "description": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "separator=[ ]", "element": "08795744-c2dc-4a68-8252-4e21c4c4c774" }, "1": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "all", "element": "2e3c9e69-1f9e-4647-8d13-4e88094d2790" } } }, "business.company.default": { "description": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "all", "element": "1a85a7a6-2aba-4480-925b-6b97d311ee6c" } } }, "blog.author.default": { "description": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "all", "element": "14c0dd9f-ae3c-4eb2-8e22-4e9294ad3120" } } }, "business.employee.default": { "description": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "all", "element": "241905cc-36d4-4611-a1d5-fadfe280f70e" } } }, "cookbook.recipe.default": { "description": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "all", "element": "35155961-b9ae-48d4-b4aa-1a569ec7930c" } } }, "download.file.default": { "description": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "separator=[ ]", "element": "b9e826b5-e671-4fe8-a447-bf08c8c6b8e4" }, "1": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "all", "element": "c5121091-6f63-43ad-a86a-136025fe6da0" } } }, "movie.movie.default": { "description": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "all", "element": "b40b44c8-a289-46b6-a6da-9f9824714762" } } }, "movie.person.default": { "description": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "all", "element": "a552a157-ce11-4b11-ad34-5de19e065d53" } } }, "product.product.default": { "description": { "0": { "showlabel": "0", "altlabel": "", "date_format": "%A, %d %B %Y", "custom_format": "", "separated_by": "separator=[ ]", "element": "667ea4d6-3745-40b5-b2a2-41fdc13b9a47" } } } }finder/zoosmartsearch/zoosmartsearch.xml000066600000001615150771657550014676 0ustar00 Smart Search - ZOO YOOtheme Febuary 2012 Copyright (C) YOOtheme GmbH http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only YOOtheme Proprietary Use License (http://www.yootheme.com/license) info@yootheme.com http://www.yootheme.com 2.5.0 Smart Search plugin for ZOO developed by YOOtheme (http://www.yootheme.com) zoosmartsearch.php index.html file.script.php renderer file.script.php finder/weblinks/weblinks.php000066600000024675150771657550012224 0ustar00categoryStateChange($pks, $value); } } /** * Method to remove the link information for items that have been deleted. * * @param string $context The context of the action being performed. * @param JTable $table A JTable object containing the record to be deleted. * * @return boolean True on success. * * @since 2.5 * @throws Exception on database error. */ public function onFinderAfterDelete($context, $table) { if ($context == 'com_weblinks.weblink') { $id = $table->id; } elseif ($context == 'com_finder.index') { $id = $table->link_id; } else { return true; } // Remove the item from the index. return $this->remove($id); } /** * Smart Search after content save method. * Reindexes the link information for a weblink that has been saved. * It also makes adjustments if the access level of a weblink item or * the category to which it belongs has been changed. * * @param string $context The context of the content passed to the plugin. * @param JTable $row A JTable object. * @param boolean $isNew True if the content has just been created. * * @return boolean True on success. * * @since 2.5 * @throws Exception on database error. */ public function onFinderAfterSave($context, $row, $isNew) { // We only want to handle web links here. We need to handle front end and back end editing. if ($context == 'com_weblinks.weblink' || $context == 'com_weblinks.form' ) { // Check if the access levels are different. if (!$isNew && $this->old_access != $row->access) { // Process the change. $this->itemAccessChange($row); } // Reindex the item. $this->reindex($row->id); } // Check for access changes in the category. if ($context == 'com_categories.category') { // Check if the access levels are different. if (!$isNew && $this->old_cataccess != $row->access) { $this->categoryAccessChange($row); } } return true; } /** * Smart Search before content save method. * This event is fired before the data is actually saved. * * @param string $context The context of the content passed to the plugin. * @param JTable $row A JTable object. * @param boolean $isNew True if the content is just about to be created. * * @return boolean True on success. * * @since 2.5 * @throws Exception on database error. */ public function onFinderBeforeSave($context, $row, $isNew) { // We only want to handle web links here. if ($context == 'com_weblinks.weblink' || $context == 'com_weblinks.form') { // Query the database for the old access level if the item isn't new. if (!$isNew) { $this->checkItemAccess($row); } } // Check for access levels from the category. if ($context == 'com_categories.category') { // Query the database for the old access level if the item isn't new. if (!$isNew) { $this->checkCategoryAccess($row); } } return true; } /** * Method to update the link information for items that have been changed * from outside the edit screen. This is fired when the item is published, * unpublished, archived, or unarchived from the list view. * * @param string $context The context for the content passed to the plugin. * @param array $pks An array of primary key ids of the content that has changed state. * @param integer $value The value of the state that the content has been changed to. * * @return void * * @since 2.5 */ public function onFinderChangeState($context, $pks, $value) { // We only want to handle web links here. if ($context == 'com_weblinks.weblink' || $context == 'com_weblinks.form') { $this->itemStateChange($pks, $value); } // Handle when the plugin is disabled. if ($context == 'com_plugins.plugin' && $value === 0) { $this->pluginDisable($pks); } } /** * Method to index an item. The item must be a FinderIndexerResult object. * * @param FinderIndexerResult $item The item to index as an FinderIndexerResult object. * @param string $format The item format. Not used. * * @return void * * @since 2.5 * @throws Exception on database error. */ protected function index(FinderIndexerResult $item, $format = 'html') { // Check if the extension is enabled if (JComponentHelper::isEnabled($this->extension) == false) { return; } $item->setLanguage(); // Initialise the item parameters. $registry = new JRegistry; $registry->loadString($item->params); $item->params = $registry; $registry = new JRegistry; $registry->loadString($item->metadata); $item->metadata = $registry; // Build the necessary route and path information. $item->url = $this->getURL($item->id, $this->extension, $this->layout); $item->route = WeblinksHelperRoute::getWeblinkRoute($item->slug, $item->catslug, $item->language); $item->path = FinderIndexerHelper::getContentPath($item->route); /* * Add the meta-data processing instructions based on the newsfeeds * configuration parameters. */ // Add the meta-author. $item->metaauthor = $item->metadata->get('author'); // Handle the link to the meta-data. $item->addInstruction(FinderIndexer::META_CONTEXT, 'link'); $item->addInstruction(FinderIndexer::META_CONTEXT, 'metakey'); $item->addInstruction(FinderIndexer::META_CONTEXT, 'metadesc'); $item->addInstruction(FinderIndexer::META_CONTEXT, 'metaauthor'); $item->addInstruction(FinderIndexer::META_CONTEXT, 'author'); $item->addInstruction(FinderIndexer::META_CONTEXT, 'created_by_alias'); // Add the type taxonomy data. $item->addTaxonomy('Type', 'Web Link'); // Add the category taxonomy data. $item->addTaxonomy('Category', $item->category, $item->cat_state, $item->cat_access); // Add the language taxonomy data. $item->addTaxonomy('Language', $item->language); // Get content extras. FinderIndexerHelper::getContentExtras($item); // Index the item. $this->indexer->index($item); } /** * Method to setup the indexer to be run. * * @return boolean True on success. * * @since 2.5 */ protected function setup() { // Load dependent classes. require_once JPATH_SITE . '/components/com_weblinks/helpers/route.php'; return true; } /** * Method to get the SQL query used to retrieve the list of content items. * * @param mixed $query A JDatabaseQuery object or null. * * @return JDatabaseQuery A database object. * * @since 2.5 */ protected function getListQuery($query = null) { $db = JFactory::getDbo(); // Check if we can use the supplied SQL query. $query = $query instanceof JDatabaseQuery ? $query : $db->getQuery(true) ->select('a.id, a.catid, a.title, a.alias, a.url AS link, a.description AS summary') ->select('a.metakey, a.metadesc, a.metadata, a.language, a.access, a.ordering') ->select('a.created_by_alias, a.modified, a.modified_by') ->select('a.publish_up AS publish_start_date, a.publish_down AS publish_end_date') ->select('a.state AS state, a.created AS start_date, a.params') ->select('c.title AS category, c.published AS cat_state, c.access AS cat_access'); // Handle the alias CASE WHEN portion of the query. $case_when_item_alias = ' CASE WHEN '; $case_when_item_alias .= $query->charLength('a.alias', '!=', '0'); $case_when_item_alias .= ' THEN '; $a_id = $query->castAsChar('a.id'); $case_when_item_alias .= $query->concatenate(array($a_id, 'a.alias'), ':'); $case_when_item_alias .= ' ELSE '; $case_when_item_alias .= $a_id . ' END as slug'; $query->select($case_when_item_alias); $case_when_category_alias = ' CASE WHEN '; $case_when_category_alias .= $query->charLength('c.alias', '!=', '0'); $case_when_category_alias .= ' THEN '; $c_id = $query->castAsChar('c.id'); $case_when_category_alias .= $query->concatenate(array($c_id, 'c.alias'), ':'); $case_when_category_alias .= ' ELSE '; $case_when_category_alias .= $c_id . ' END as catslug'; $query->select($case_when_category_alias) ->from('#__weblinks AS a') ->join('LEFT', '#__categories AS c ON c.id = a.catid'); return $query; } /** * Method to get the query clause for getting items to update by time. * * @param string $time The modified timestamp. * * @return JDatabaseQuery A database object. * * @since 2.5 */ protected function getUpdateQueryByTime($time) { // Build an SQL query based on the modified time. $query = $this->db->getQuery(true) ->where('a.date >= ' . $this->db->quote($time)); return $query; } } finder/weblinks/index.html000066600000000036150771657550011653 0ustar00finder/weblinks/weblinks.xml000066600000001607150771657550012223 0ustar00 plg_finder_weblinks Joomla! Project August 2011 (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.0.0 PLG_FINDER_WEBLINKS_XML_DESCRIPTION script.php weblinks.php index.html language/en-GB/en-GB.plg_finder_weblinks.ini language/en-GB/en-GB.plg_finder_weblinks.sys.ini finder/content/index.html000066600000000036150771657550011507 0ustar00finder/content/content.xml000066600000001601150771657550011705 0ustar00 plg_finder_content Joomla! Project August 2011 (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.0.0 PLG_FINDER_CONTENT_XML_DESCRIPTION script.php content.php index.html language/en-GB/en-GB.plg_finder_content.ini language/en-GB/en-GB.plg_finder_content.sys.ini finder/content/content.php000066600000025340150771657550011702 0ustar00categoryStateChange($pks, $value); } } /** * Method to remove the link information for items that have been deleted. * * @param string $context The context of the action being performed. * @param JTable $table A JTable object containing the record to be deleted * * @return boolean True on success. * * @since 2.5 * @throws Exception on database error. */ public function onFinderAfterDelete($context, $table) { if ($context == 'com_content.article') { $id = $table->id; } elseif ($context == 'com_finder.index') { $id = $table->link_id; } else { return true; } // Remove item from the index. return $this->remove($id); } /** * Smart Search after save content method. * Reindexes the link information for an article that has been saved. * It also makes adjustments if the access level of an item or the * category to which it belongs has changed. * * @param string $context The context of the content passed to the plugin. * @param JTable $row A JTable object. * @param boolean $isNew True if the content has just been created. * * @return boolean True on success. * * @since 2.5 * @throws Exception on database error. */ public function onFinderAfterSave($context, $row, $isNew) { // We only want to handle articles here. if ($context == 'com_content.article' || $context == 'com_content.form') { // Check if the access levels are different. if (!$isNew && $this->old_access != $row->access) { // Process the change. $this->itemAccessChange($row); } // Reindex the item. $this->reindex($row->id); } // Check for access changes in the category. if ($context == 'com_categories.category') { // Check if the access levels are different. if (!$isNew && $this->old_cataccess != $row->access) { $this->categoryAccessChange($row); } } return true; } /** * Smart Search before content save method. * This event is fired before the data is actually saved. * * @param string $context The context of the content passed to the plugin. * @param JTable $row A JTable object. * @param boolean $isNew If the content is just about to be created. * * @return boolean True on success. * * @since 2.5 * @throws Exception on database error. */ public function onFinderBeforeSave($context, $row, $isNew) { // We only want to handle articles here. if ($context == 'com_content.article' || $context == 'com_content.form') { // Query the database for the old access level if the item isn't new. if (!$isNew) { $this->checkItemAccess($row); } } // Check for access levels from the category. if ($context == 'com_categories.category') { // Query the database for the old access level if the item isn't new. if (!$isNew) { $this->checkCategoryAccess($row); } } return true; } /** * Method to update the link information for items that have been changed * from outside the edit screen. This is fired when the item is published, * unpublished, archived, or unarchived from the list view. * * @param string $context The context for the content passed to the plugin. * @param array $pks An array of primary key ids of the content that has changed state. * @param integer $value The value of the state that the content has been changed to. * * @return void * * @since 2.5 */ public function onFinderChangeState($context, $pks, $value) { // We only want to handle articles here. if ($context == 'com_content.article' || $context == 'com_content.form') { $this->itemStateChange($pks, $value); } // Handle when the plugin is disabled. if ($context == 'com_plugins.plugin' && $value === 0) { $this->pluginDisable($pks); } } /** * Method to index an item. The item must be a FinderIndexerResult object. * * @param FinderIndexerResult $item The item to index as an FinderIndexerResult object. * @param string $format The item format. Not used. * * @return void * * @since 2.5 * @throws Exception on database error. */ protected function index(FinderIndexerResult $item, $format = 'html') { $item->setLanguage(); // Check if the extension is enabled. if (JComponentHelper::isEnabled($this->extension) == false) { return; } // Initialise the item parameters. $registry = new JRegistry; $registry->loadString($item->params); $item->params = JComponentHelper::getParams('com_content', true); $item->params->merge($registry); $registry = new JRegistry; $registry->loadString($item->metadata); $item->metadata = $registry; // Trigger the onContentPrepare event. $item->summary = FinderIndexerHelper::prepareContent($item->summary, $item->params); $item->body = FinderIndexerHelper::prepareContent($item->body, $item->params); // Build the necessary route and path information. $item->url = $this->getURL($item->id, $this->extension, $this->layout); $item->route = ContentHelperRoute::getArticleRoute($item->slug, $item->catslug, $item->language); $item->path = FinderIndexerHelper::getContentPath($item->route); // Get the menu title if it exists. $title = $this->getItemMenuTitle($item->url); // Adjust the title if necessary. if (!empty($title) && $this->params->get('use_menu_title', true)) { $item->title = $title; } // Add the meta-author. $item->metaauthor = $item->metadata->get('author'); // Add the meta-data processing instructions. $item->addInstruction(FinderIndexer::META_CONTEXT, 'metakey'); $item->addInstruction(FinderIndexer::META_CONTEXT, 'metadesc'); $item->addInstruction(FinderIndexer::META_CONTEXT, 'metaauthor'); $item->addInstruction(FinderIndexer::META_CONTEXT, 'author'); $item->addInstruction(FinderIndexer::META_CONTEXT, 'created_by_alias'); // Translate the state. Articles should only be published if the category is published. $item->state = $this->translateState($item->state, $item->cat_state); // Add the type taxonomy data. $item->addTaxonomy('Type', 'Article'); // Add the author taxonomy data. if (!empty($item->author) || !empty($item->created_by_alias)) { $item->addTaxonomy('Author', !empty($item->created_by_alias) ? $item->created_by_alias : $item->author); } // Add the category taxonomy data. $item->addTaxonomy('Category', $item->category, $item->cat_state, $item->cat_access); // Add the language taxonomy data. $item->addTaxonomy('Language', $item->language); // Get content extras. FinderIndexerHelper::getContentExtras($item); // Index the item. $this->indexer->index($item); } /** * Method to setup the indexer to be run. * * @return boolean True on success. * * @since 2.5 */ protected function setup() { // Load dependent classes. include_once JPATH_SITE . '/components/com_content/helpers/route.php'; return true; } /** * Method to get the SQL query used to retrieve the list of content items. * * @param mixed $query A JDatabaseQuery object or null. * * @return JDatabaseQuery A database object. * * @since 2.5 */ protected function getListQuery($query = null) { $db = JFactory::getDbo(); // Check if we can use the supplied SQL query. $query = $query instanceof JDatabaseQuery ? $query : $db->getQuery(true) ->select('a.id, a.title, a.alias, a.introtext AS summary, a.fulltext AS body') ->select('a.state, a.catid, a.created AS start_date, a.created_by') ->select('a.created_by_alias, a.modified, a.modified_by, a.attribs AS params') ->select('a.metakey, a.metadesc, a.metadata, a.language, a.access, a.version, a.ordering') ->select('a.publish_up AS publish_start_date, a.publish_down AS publish_end_date') ->select('c.title AS category, c.published AS cat_state, c.access AS cat_access'); // Handle the alias CASE WHEN portion of the query $case_when_item_alias = ' CASE WHEN '; $case_when_item_alias .= $query->charLength('a.alias', '!=', '0'); $case_when_item_alias .= ' THEN '; $a_id = $query->castAsChar('a.id'); $case_when_item_alias .= $query->concatenate(array($a_id, 'a.alias'), ':'); $case_when_item_alias .= ' ELSE '; $case_when_item_alias .= $a_id . ' END as slug'; $query->select($case_when_item_alias); $case_when_category_alias = ' CASE WHEN '; $case_when_category_alias .= $query->charLength('c.alias', '!=', '0'); $case_when_category_alias .= ' THEN '; $c_id = $query->castAsChar('c.id'); $case_when_category_alias .= $query->concatenate(array($c_id, 'c.alias'), ':'); $case_when_category_alias .= ' ELSE '; $case_when_category_alias .= $c_id . ' END as catslug'; $query->select($case_when_category_alias) ->select('u.name AS author') ->from('#__content AS a') ->join('LEFT', '#__categories AS c ON c.id = a.catid') ->join('LEFT', '#__users AS u ON u.id = a.created_by'); return $query; } } user/profile/profiles/index.html000066600000000037150771657550013030 0ustar00 user/profile/profiles/profile.xml000066600000005304150771657550013217 0ustar00
user/profile/index.html000066600000000037150771657550011205 0ustar00 user/profile/fields/tos.php000066600000005142150771657550011776 0ustar00hidden) { return $label; } // Get the label text from the XML element, defaulting to the element name. $text = $this->element['label'] ? (string) $this->element['label'] : (string) $this->element['name']; $text = $this->translateLabel ? JText::_($text) : $text; // Set required to true as this field is not displayed at all if not required. $this->required = true; // Add CSS and JS for the TOS field $doc = JFactory::getDocument(); $css = "#jform_profile_tos {width: 18em; margin: 0 !important; padding: 0 2px !important;} #jform_profile_tos input {margin:0 5px 0 0 !important; width:10px !important;} #jform_profile_tos label {margin:0 15px 0 0 !important; width:auto;} "; $doc->addStyleDeclaration($css); JHtml::_('behavior.modal'); // Build the class for the label. $class = !empty($this->description) ? 'hasTip' : ''; $class = $class . ' required'; $class = !empty($this->labelClass) ? $class . ' ' . $this->labelClass : $class; // Add the opening label tag and main attributes attributes. $label .= ''; return $label; } } user/profile/fields/index.html000066600000000037150771657550012453 0ustar00 user/profile/profile.php000066600000024543150771657550011371 0ustar00id) ? $data->id : 0; if (!isset($data->profile) and $userId > 0) { // Load the profile data from the database. $db = JFactory::getDbo(); $db->setQuery( 'SELECT profile_key, profile_value FROM #__user_profiles' . ' WHERE user_id = ' . (int) $userId . " AND profile_key LIKE 'profile.%'" . ' ORDER BY ordering' ); try { $results = $db->loadRowList(); } catch (RuntimeException $e) { $this->_subject->setError($e->getMessage()); return false; } // Merge the profile data. $data->profile = array(); foreach ($results as $v) { $k = str_replace('profile.', '', $v[0]); $data->profile[$k] = json_decode($v[1], true); if ($data->profile[$k] === null) { $data->profile[$k] = $v[1]; } } } if (!JHtml::isRegistered('users.url')) { JHtml::register('users.url', array(__CLASS__, 'url')); } if (!JHtml::isRegistered('users.calendar')) { JHtml::register('users.calendar', array(__CLASS__, 'calendar')); } if (!JHtml::isRegistered('users.tos')) { JHtml::register('users.tos', array(__CLASS__, 'tos')); } } return true; } public static function url($value) { if (empty($value)) { return JHtml::_('users.value', $value); } else { // Convert website url to utf8 for display $value = JStringPunycode::urlToUTF8(htmlspecialchars($value)); if (substr($value, 0, 4) == "http") { return '' . $value . ''; } else { return '' . $value . ''; } } } public static function calendar($value) { if (empty($value)) { return JHtml::_('users.value', $value); } else { return JHtml::_('date', $value, null, null); } } public static function tos($value) { if ($value) { return JText::_('JYES'); } else { return JText::_('JNO'); } } /** * @param JForm $form The form to be altered. * @param array $data The associated data for the form. * * @return boolean * @since 1.6 */ public function onContentPrepareForm($form, $data) { if (!($form instanceof JForm)) { $this->_subject->setError('JERROR_NOT_A_FORM'); return false; } // Check we are manipulating a valid form. $name = $form->getName(); if (!in_array($name, array('com_admin.profile', 'com_users.user', 'com_users.profile', 'com_users.registration'))) { return true; } // Add the registration fields to the form. JForm::addFormPath(__DIR__ . '/profiles'); $form->loadFile('profile', false); $fields = array( 'address1', 'address2', 'city', 'region', 'country', 'postal_code', 'phone', 'website', 'favoritebook', 'aboutme', 'dob', 'tos', ); //Change fields description when displayed in front-end $app = JFactory::getApplication(); if ($app->isSite()) { $form->setFieldAttribute('address1', 'description', 'PLG_USER_PROFILE_FILL_FIELD_DESC_SITE', 'profile'); $form->setFieldAttribute('address2', 'description', 'PLG_USER_PROFILE_FILL_FIELD_DESC_SITE', 'profile'); $form->setFieldAttribute('city', 'description', 'PLG_USER_PROFILE_FILL_FIELD_DESC_SITE', 'profile'); $form->setFieldAttribute('region', 'description', 'PLG_USER_PROFILE_FILL_FIELD_DESC_SITE', 'profile'); $form->setFieldAttribute('country', 'description', 'PLG_USER_PROFILE_FILL_FIELD_DESC_SITE', 'profile'); $form->setFieldAttribute('postal_code', 'description', 'PLG_USER_PROFILE_FILL_FIELD_DESC_SITE', 'profile'); $form->setFieldAttribute('phone', 'description', 'PLG_USER_PROFILE_FILL_FIELD_DESC_SITE', 'profile'); $form->setFieldAttribute('website', 'description', 'PLG_USER_PROFILE_FILL_FIELD_DESC_SITE', 'profile'); $form->setFieldAttribute('favoritebook', 'description', 'PLG_USER_PROFILE_FILL_FIELD_DESC_SITE', 'profile'); $form->setFieldAttribute('aboutme', 'description', 'PLG_USER_PROFILE_FILL_FIELD_DESC_SITE', 'profile'); $form->setFieldAttribute('dob', 'description', 'PLG_USER_PROFILE_FILL_FIELD_DESC_SITE', 'profile'); $form->setFieldAttribute('tos', 'description', 'PLG_USER_PROFILE_FIELD_TOS_DESC_SITE', 'profile'); } $tosarticle = $this->params->get('register_tos_article'); $tosenabled = $this->params->get('register-require_tos', 0); // We need to be in the registration form, field needs to be enabled and we need an article ID if ($name != 'com_users.registration' || !$tosenabled || !$tosarticle) { // We only want the TOS in the registration form $form->removeField('tos', 'profile'); } else { // Push the TOS article ID into the TOS field. $form->setFieldAttribute('tos', 'article', $tosarticle, 'profile'); } foreach ($fields as $field) { // Case using the users manager in admin if ($name == 'com_users.user') { // Remove the field if it is disabled in registration and profile if ($this->params->get('register-require_' . $field, 1) == 0 && $this->params->get('profile-require_' . $field, 1) == 0 ) { $form->removeField($field, 'profile'); } } // Case registration elseif ($name == 'com_users.registration') { // Toggle whether the field is required. if ($this->params->get('register-require_' . $field, 1) > 0) { $form->setFieldAttribute($field, 'required', ($this->params->get('register-require_' . $field) == 2) ? 'required' : '', 'profile'); } else { $form->removeField($field, 'profile'); } if ($this->params->get('register-require_dob', 1) > 0) { $form->setFieldAttribute('spacer', 'type', 'spacer', 'profile'); } } // Case profile in site or admin elseif ($name == 'com_users.profile' || $name == 'com_admin.profile') { // Toggle whether the field is required. if ($this->params->get('profile-require_' . $field, 1) > 0) { $form->setFieldAttribute($field, 'required', ($this->params->get('profile-require_' . $field) == 2) ? 'required' : '', 'profile'); } else { $form->removeField($field, 'profile'); } if ($this->params->get('profile-require_dob', 1) > 0) { $form->setFieldAttribute('spacer', 'type', 'spacer', 'profile'); } } } return true; } /** * Method is called before user data is stored in the database * * @param array $user Holds the old user data. * @param boolean $isnew True if a new user is stored. * @param array $data Holds the new user data. * * @return boolean * * @since 3.1 * @throws InvalidArgumentException on invalid date. */ public function onUserBeforeSave($user, $isnew, $data) { // Check that the date is valid. if (!empty($data['profile']['dob'])) { try { // Convert website url to punycode $data['profile']['website'] = JStringPunycode::urlToPunycode($data['profile']['website']); $date = new JDate($data['profile']['dob']); $this->_date = $date->format('Y-m-d'); } catch (Exception $e) { // Throw an exception if date is not valid. throw new InvalidArgumentException(JText::_('PLG_USER_PROFILE_ERROR_INVALID_DOB')); } } return true; } public function onUserAfterSave($data, $isNew, $result, $error) { $userId = JArrayHelper::getValue($data, 'id', 0, 'int'); if ($userId && $result && isset($data['profile']) && (count($data['profile']))) { try { // Sanitize the date $data['profile']['dob'] = $this->_date; $db = JFactory::getDbo(); $query = $db->getQuery(true) ->delete($db->quoteName('#__user_profiles')) ->where($db->quoteName('user_id') . ' = ' . (int) $userId) ->where($db->quoteName('profile_key') . ' LIKE ' . $db->quote('profile.%')); $db->setQuery($query); $db->execute(); $tuples = array(); $order = 1; foreach ($data['profile'] as $k => $v) { $tuples[] = '(' . $userId . ', ' . $db->quote('profile.' . $k) . ', ' . $db->quote(json_encode($v)) . ', ' . $order++ . ')'; } $db->setQuery('INSERT INTO #__user_profiles VALUES ' . implode(', ', $tuples)); $db->execute(); } catch (RuntimeException $e) { $this->_subject->setError($e->getMessage()); return false; } } return true; } /** * Remove all user profile information for the given user ID * * Method is called after user data is deleted from the database * * @param array $user Holds the user data * @param boolean $success True if user was succesfully stored in the database * @param string $msg Message * * @return boolean */ public function onUserAfterDelete($user, $success, $msg) { if (!$success) { return false; } $userId = JArrayHelper::getValue($user, 'id', 0, 'int'); if ($userId) { try { $db = JFactory::getDbo(); $db->setQuery( 'DELETE FROM #__user_profiles WHERE user_id = ' . $userId . " AND profile_key LIKE 'profile.%'" ); $db->execute(); } catch (Exception $e) { $this->_subject->setError($e->getMessage()); return false; } } return true; } } user/profile/profile.xml000066600000021331150771657550011372 0ustar00 plg_user_profile Joomla! Project January 2008 (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.0.0 PLG_USER_PROFILE_XML_DESCRIPTION profile.php index.html profiles en-GB.plg_user_profile.ini en-GB.plg_user_profile.sys.ini
user/joomla/joomla.php000066600000020200150771657550011015 0ustar00db->getQuery(true) ->delete($this->db->quoteName('#__session')) ->where($this->db->quoteName('userid') . ' = ' . (int) $user['id']); $this->db->setQuery($query)->execute(); return true; } /** * Utility method to act on a user after it has been saved. * * This method sends a registration email to new users created in the backend. * * @param array $user Holds the new user data. * @param boolean $isnew True if a new user is stored. * @param boolean $success True if user was succesfully stored in the database. * @param string $msg Message. * * @return void * * @since 1.6 */ public function onUserAfterSave($user, $isnew, $success, $msg) { $mail_to_user = $this->params->get('mail_to_user', 1); if ($isnew) { // TODO: Suck in the frontend registration emails here as well. Job for a rainy day. if ($this->app->isAdmin()) { if ($mail_to_user) { $lang = JFactory::getLanguage(); $defaultLocale = $lang->getTag(); /** * Look for user language. Priority: * 1. User frontend language * 2. User backend language */ $userParams = new JRegistry($user['params']); $userLocale = $userParams->get('language', $userParams->get('admin_language', $defaultLocale)); if ($userLocale != $defaultLocale) { $lang->setLanguage($userLocale); } $lang->load('plg_user_joomla', JPATH_ADMINISTRATOR); // Compute the mail subject. $emailSubject = JText::sprintf( 'PLG_USER_JOOMLA_NEW_USER_EMAIL_SUBJECT', $user['name'], $config = $this->app->get('sitename') ); // Compute the mail body. $emailBody = JText::sprintf( 'PLG_USER_JOOMLA_NEW_USER_EMAIL_BODY', $user['name'], $this->app->get('sitename'), JUri::root(), $user['username'], $user['password_clear'] ); // Assemble the email data...the sexy way! $mail = JFactory::getMailer() ->setSender( array( $this->app->get('mailfrom'), $this->app->get('fromname') ) ) ->addRecipient($user['email']) ->setSubject($emailSubject) ->setBody($emailBody); // Set application language back to default if we changed it if ($userLocale != $defaultLocale) { $lang->setLanguage($defaultLocale); } if (!$mail->Send()) { $this->app->enqueueMessage(JText::_('JERROR_SENDING_EMAIL'), 'warning'); } } } } else { // Existing user - nothing to do...yet. } } /** * This method should handle any login logic and report back to the subject * * @param array $user Holds the user data * @param array $options Array holding options (remember, autoregister, group) * * @return boolean True on success * * @since 1.5 */ public function onUserLogin($user, $options = array()) { $instance = $this->_getUser($user, $options); // If _getUser returned an error, then pass it back. if ($instance instanceof Exception) { return false; } // If the user is blocked, redirect with an error if ($instance->get('block') == 1) { $this->app->enqueueMessage(JText::_('JERROR_NOLOGIN_BLOCKED'), 'warning'); return false; } // Authorise the user based on the group information if (!isset($options['group'])) { $options['group'] = 'USERS'; } // Check the user can login. $result = $instance->authorise($options['action']); if (!$result) { $this->app->enqueueMessage(JText::_('JERROR_LOGIN_DENIED'), 'warning'); return false; } // Mark the user as logged in $instance->set('guest', 0); // Register the needed session variables $session = JFactory::getSession(); $session->set('user', $instance); // Check to see the the session already exists. $this->app->checkSession(); // Update the user related fields for the Joomla sessions table. $query = $this->db->getQuery(true) ->update($this->db->quoteName('#__session')) ->set($this->db->quoteName('guest') . ' = ' . $this->db->quote($instance->guest)) ->set($this->db->quoteName('username') . ' = ' . $this->db->quote($instance->username)) ->set($this->db->quoteName('userid') . ' = ' . (int) $instance->id) ->where($this->db->quoteName('session_id') . ' = ' . $this->db->quote($session->getId())); $this->db->setQuery($query)->execute(); // Hit the user last visit field $instance->setLastVisit(); return true; } /** * This method should handle any logout logic and report back to the subject * * @param array $user Holds the user data. * @param array $options Array holding options (client, ...). * * @return object True on success * * @since 1.5 */ public function onUserLogout($user, $options = array()) { $my = JFactory::getUser(); $session = JFactory::getSession(); // Make sure we're a valid user first if ($user['id'] == 0 && !$my->get('tmp_user')) { return true; } // Check to see if we're deleting the current session if ($my->get('id') == $user['id'] && $options['clientid'] == $this->app->getClientId()) { // Hit the user last visit field $my->setLastVisit(); // Destroy the php session for this user $session->destroy(); } // Force logout all users with that userid $query = $this->db->getQuery(true) ->delete($this->db->quoteName('#__session')) ->where($this->db->quoteName('userid') . ' = ' . (int) $user['id']) ->where($this->db->quoteName('client_id') . ' = ' . (int) $options['clientid']); $this->db->setQuery($query)->execute(); return true; } /** * This method will return a user object * * If options['autoregister'] is true, if the user doesn't exist yet he will be created * * @param array $user Holds the user data. * @param array $options Array holding options (remember, autoregister, group). * * @return object A JUser object * * @since 1.5 */ protected function _getUser($user, $options = array()) { $instance = JUser::getInstance(); $id = (int) JUserHelper::getUserId($user['username']); if ($id) { $instance->load($id); return $instance; } // TODO : move this out of the plugin $config = JComponentHelper::getParams('com_users'); // Hard coded default to match the default value from com_users. $defaultUserGroup = $config->get('new_usertype', 2); $instance->set('id', 0); $instance->set('name', $user['fullname']); $instance->set('username', $user['username']); $instance->set('password_clear', $user['password_clear']); // Result should contain an email (check). $instance->set('email', $user['email']); $instance->set('groups', array($defaultUserGroup)); // If autoregister is set let's register the user $autoregister = isset($options['autoregister']) ? $options['autoregister'] : $this->params->get('autoregister', 1); if ($autoregister) { if (!$instance->save()) { JLog::add('Error in autoregistration for user ' . $user['username'] . '.', JLog::WARNING, 'error'); } } else { // No existing user and autoregister off, this is a temporary user. $instance->set('tmp_user', true); } return $instance; } } user/joomla/index.html000066600000000037150771657550011026 0ustar00 user/joomla/joomla.xml000066600000003017150771657550011035 0ustar00 plg_user_joomla Joomla! Project December 2006 (C) 2005 - 2009 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.0.0 PLG_USER_JOOMLA_XML_DESCRIPTION joomla.php index.html postinstall en-GB.plg_user_joomla.ini en-GB.plg_user_joomla.sys.ini
user/index.html000066600000000037150771657550007545 0ustar00 user/contactcreator/contactcreator.php000066600000010126150771657550014307 0ustar00params->get('category', 0); if (empty($categoryId)) { JError::raiseWarning('', JText::_('PLG_CONTACTCREATOR_ERR_NO_CATEGORY')); return false; } if ($contact = $this->getContactTable()) { /** * Try to pre-load a contact for this user. Apparently only possible if other plugin creates it * Note: $user_id is cleaned above */ if (!$contact->load(array('user_id' => (int) $user_id))) { $contact->published = $this->params->get('autopublish', 0); } $contact->name = $user['name']; $contact->user_id = $user_id; $contact->email_to = $user['email']; $contact->catid = $categoryId; $contact->access = (int) JFactory::getConfig()->get('access'); $contact->language = '*'; $contact->generateAlias(); // Check if the contact already exists to generate new name & alias if required if ($contact->id == 0) { list($name, $alias) = $this->generateAliasAndName($contact->alias, $contact->name, $categoryId); $contact->name = $name; $contact->alias = $alias; } $autowebpage = $this->params->get('autowebpage', ''); if (!empty($autowebpage)) { // Search terms $search_array = array('[name]', '[username]', '[userid]', '[email]'); // Replacement terms, urlencoded $replace_array = array_map('urlencode', array($user['name'], $user['username'], $user['id'], $user['email'])); // Now replace it in together $contact->webpage = str_replace($search_array, $replace_array, $autowebpage); } if ($contact->check() && $contact->store()) { return true; } } JError::raiseWarning('', JText::_('PLG_CONTACTCREATOR_ERR_FAILED_CREATING_CONTACT')); return false; } /** * Method to change the name & alias if alias is already in use * * @param string $alias The alias. * @param string $name The name. * @param integer $categoryId Category identifier * * @return array Contains the modified title and alias. * * @since 3.2.3 */ protected function generateAliasAndName($alias, $name, $categoryId) { $table = $this->getContactTable(); while ($table->load(array('alias' => $alias, 'catid' => $categoryId))) { if ($name == $table->name) { $name = JString::increment($name); } $alias = JString::increment($alias, 'dash'); } return array($name, $alias); } /** * Get an instance of the contact table * * @return ContactTableContact * * @since 3.2.3 */ protected function getContactTable() { JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_contact/tables'); return JTable::getInstance('contact', 'ContactTable'); } } user/contactcreator/index.html000066600000000037150771657550012560 0ustar00 user/contactcreator/contactcreator.xml000066600000003105150771657550014317 0ustar00 plg_user_contactcreator Joomla! Project August 2009 (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.0.0 PLG_CONTACTCREATOR_XML_DESCRIPTION contactcreator.php index.html en-GB.plg_user_contactcreator.ini en-GB.plg_user_contactcreator.sys.ini
system/joomsefgoogle/joomsefgoogle.xml000066600000001221150771657550014332 0ustar00 System - ARTIO JoomSEF Google Analytics ARTIO s.r.o. 31. October 2011 ARTIO s.r.o. GNU/GPLv3 http://www.artio.net/license/gnu-general-public-license info@artio.net www.artio.net 4.0.0 Plugin which add Google Adsense Code to Pages. joomsefgoogle.php system/joomsefgoogle/joomsefgoogle.php000066600000004331150771657550014326 0ustar00isAdmin()) { return; } if(JFactory::getApplication()->getCfg('sef')==0) { return; } if(JFactory::getURI()->getVar('tmpl')=='component') { return; } $config=SEFConfig::getConfig(); if (!$config->enabled) { return; } if ($config->google_enable == 0 || !$config->google_id) { return; } if (JRequest::getInt('google_analytics_exclude', 0, 'cookie') == 1) { return; } $ips_exclude = explode("\r\n", $config->google_exclude_ip); if (in_array(IPAddressHelper::getip(), $ips_exclude)) { return; } $groups = null; $user = JFactory::getUser(); if ($user) { $groups = $user->get('groups'); } if (is_array($groups)) { foreach ($groups as $group) { if (in_array($group, $config->google_exclude_level)) { return; } } } $script = " (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); ga('create', '".$config->google_id."', 'auto'); ga('send', 'pageview'); "; JFactory::getDocument()->addScriptDeclaration($script); } } system/sef/index.html000066600000000037150771657550010670 0ustar00 system/sef/sef.xml000066600000002044150771657550010172 0ustar00 plg_system_sef Joomla! Project December 2007 Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.0.0 PLG_SEF_XML_DESCRIPTION sef.php index.html en-GB.plg_system_sef.ini en-GB.plg_system_sef.sys.ini
system/sef/sef.php000066600000011012150771657550010154 0ustar00getName() != 'site' || $doc->getType() !== 'html') { return true; } $router = $app->getRouter(); $uri = clone JUri::getInstance(); $domain = $this->params->get('domain'); if ($domain === null || $domain === '') { $domain = $uri->toString(array('scheme', 'host', 'port')); } $parsed = $router->parse($uri); $fakelink = 'index.php?' . http_build_query($parsed); $link = $domain . JRoute::_($fakelink, false); if ($uri !== $link) { $doc->addHeadLink(htmlspecialchars($link), 'canonical'); } } /** * Convert the site URL to fit to the HTTP request. * * @return void */ public function onAfterRender() { $app = JFactory::getApplication(); if ($app->getName() != 'site' || $app->getCfg('sef') == '0') { return true; } // Replace src links. $base = JUri::base(true) . '/'; $buffer = $app->getBody(); $regex = '#href="index.php\?([^"]*)#m'; $buffer = preg_replace_callback($regex, array('PlgSystemSef', 'route'), $buffer); $this->checkBuffer($buffer); // Check for all unknown protocals (a protocol must contain at least one alpahnumeric character followed by a ":"). $protocols = '[a-zA-Z0-9]+:'; $regex = '#(src|href|poster)="(?!/|' . $protocols . '|\#|\')([^"]*)"#m'; $buffer = preg_replace($regex, "$1=\"$base\$2\"", $buffer); $this->checkBuffer($buffer); $regex = '#(onclick="window.open\(\')(?!/|' . $protocols . '|\#)([^/]+[^\']*?\')#m'; $buffer = preg_replace($regex, '$1' . $base . '$2', $buffer); $this->checkBuffer($buffer); // ONMOUSEOVER / ONMOUSEOUT $regex = '#(onmouseover|onmouseout)="this.src=([\']+)(?!/|' . $protocols . '|\#|\')([^"]+)"#m'; $buffer = preg_replace($regex, '$1="this.src=$2' . $base . '$3$4"', $buffer); $this->checkBuffer($buffer); // Background image. $regex = '#style\s*=\s*[\'\"](.*):\s*url\s*\([\'\"]?(?!/|' . $protocols . '|\#)([^\)\'\"]+)[\'\"]?\)#m'; $buffer = preg_replace($regex, 'style="$1: url(\'' . $base . '$2$3\')', $buffer); $this->checkBuffer($buffer); // OBJECT -- fix it only inside the tag. $regex = '#(]\s*value\s*=\s*"(?!/|' . $protocols . '|\#|\')([^"]*)"#m'; $buffer = preg_replace($regex, '$1name="$2" value="' . $base . '$3"', $buffer); $this->checkBuffer($buffer); // OBJECT -- fix it only inside the tag. $regex = '#(]*)value\s*=\s*"(?!/|' . $protocols . '|\#|\')([^"]*)"\s*name\s*=\s*"(movie|src|url)"#m'; $buffer = preg_replace($regex, 'checkBuffer($buffer); // OBJECT data="xx" attribute -- fix it only in the object tag. $regex = '#(]*)data\s*=\s*"(?!/|' . $protocols . '|\#|\')([^"]*)"#m'; $buffer = preg_replace($regex, '$1data="' . $base . '$2"$3', $buffer); $this->checkBuffer($buffer); $app->setBody($buffer); return true; } /** * Check the buffer. * * @param string $buffer Buffer to be checked. * * @return void */ private function checkBuffer($buffer) { if ($buffer === null) { switch (preg_last_error()) { case PREG_BACKTRACK_LIMIT_ERROR: $message = "PHP regular expression limit reached (pcre.backtrack_limit)"; break; case PREG_RECURSION_LIMIT_ERROR: $message = "PHP regular expression limit reached (pcre.recursion_limit)"; break; case PREG_BAD_UTF8_ERROR: $message = "Bad UTF8 passed to PCRE function"; break; default: $message = "Unknown PCRE error calling PCRE function"; } throw new RuntimeException($message); } } /** * Replace the matched tags. * * @param array &$matches An array of matches (see preg_match_all). * * @return string */ protected static function route(&$matches) { $url = $matches[1]; $url = str_replace('&', '&', $url); $route = JRoute::_('index.php?' . $url); return 'href="' . $route; } } system/widgetkit_joomla/widgetkit_joomla.xml000066600000001605150771657550015532 0ustar00 System - Widgetkit Joomla YOOtheme December 2011 Copyright (C) 2007 - 2011 YOOtheme GmbH http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only YOOtheme Proprietary Use License (http://www.yootheme.com/license) info@yootheme.com http://www.yootheme.com 1.0.0 Joomla Content plugin for Widgetkit developed by YOOtheme (http://www.yootheme.com) widgetkit_joomla.php assets layouts widgets helper.php system/widgetkit_joomla/assets/js/dashboard.js000066600000002300150771657550015650 0ustar00/* Copyright (C) YOOtheme GmbH, YOOtheme Proprietary Use License (http://www.yootheme.com/license) */ (function(b){var a=function(){};b.extend(a.prototype,{name:"JoomlaDashboard",options:{edit_ids:[]},initialize:function(a,c){this.options=b.extend({},this.options,c);var d=this;a.find(".actions a.action.edit").each(function(){-1 render('title', array('title' => ($widget->id ? 'Edit' : 'Add').' ' . ucfirst($type))); ?>
">

Joomla Articles

xpath('params/param')) { $settings = array_merge($settings, $setting); } foreach ($settings as $setting) { $name = (string) $setting->attributes()->name; $type = (string) $setting->attributes()->type; $label = (string) $setting->attributes()->label; $name = (string) $setting->attributes()->name; $default = (string) $setting->attributes()->default; $value = isset($widget->joomla[$name]) ? $widget->joomla[$name] : $default; echo '
'; echo '

'.$label.'

'; echo '
'; echo $this['field']->render($type, 'joomla['.$name.']', $value, $setting); echo '
'; echo '
'; } ?>

system/widgetkit_joomla/layouts/fields/category.php000066600000001167150771657550016753 0ustar00', $this['field']->attributes(compact('name'))); foreach (JHtml::_('category.options', 'com_content') as $option) { // set attributes $attributes = array('value' => $option->value); // is checked ? if ($option->value == $value) { $attributes = array_merge($attributes, array('selected' => 'selected')); } printf('', $this['field']->attributes($attributes), $option->text); } printf('');system/widgetkit_joomla/widgetkit_joomla.php000066600000015303150771657550015521 0ustar00enabled) { return; } // load widgetkit require_once(JPATH_ADMINISTRATOR.'/components/com_widgetkit/classes/widgetkit.php'); // get widgetkit instance $this->widgetkit = Widgetkit::getInstance(); // register plugin paths $path = JPATH_ROOT.'/plugins/system/widgetkit_joomla/'; $this->widgetkit['path']->register($path, 'widgetkit_joomla.root'); $this->widgetkit['path']->register($path.'widgets', 'widgetkit_joomla.widgets'); $this->widgetkit['path']->register($path.'assets', 'widgetkit_joomla.assets'); // load helper require_once($path.'helper.php'); // bind init event $this->widgetkit['event']->bind('admin', array($this, 'init')); $this->widgetkit['event']->bind('site', array($this, 'init')); $this->widgetkit['event']->bind('site', array($this, 'loadAssets')); $this->widgetkit['event']->bind('widgetoutput', array($this, '_applycontentplugins')); } /* Function: init Init Admin Widgets Returns: void */ public function init() { // require widget files foreach ($this->widgetkit['path']->dirs('widgetkit_joomla.widgets:') as $widget) { if ($file = $this->widgetkit['path']->path("widgetkit_joomla.widgets:{$widget}/{$widget}.php")) { // require widget file require_once($file); } } } /* Function: loadAssets Load widgets css/js assets. Returns: Void */ public function loadAssets() { $this->widgetkit['asset']->addFile('css', 'widgetkit_joomla.assets:css/style.css'); } /* Function: _applycontentplugins Apply content plugins Returns: Void */ public function _applycontentplugins(&$text) { // import joomla content plugins JPluginHelper::importPlugin('content'); $registry = new JRegistry(''); $dispatcher = JDispatcher::getInstance(); $article = JTable::getInstance('content'); $article->text = $text; $dispatcher->trigger('onPrepareContent', array(&$article, &$registry, 0)); $dispatcher->trigger('onContentPrepare', array('com_widgetkit', &$article, &$registry, 0)); $text = $article->text; } } /* Class: JoomlaWidget Joomla Widget base class */ class JoomlaWidget { /* widgetkit */ public $widgetkit; /* type */ public $type; /* options */ public $options; /* Function: Constructor Class Constructor. */ public function __construct() { // init vars $this->widgetkit = Widgetkit::getInstance(); $this->type = strtolower(str_replace('Joomla', '', get_class($this))); $this->options = $this->widgetkit['system']->options; // bind events $this->widgetkit['event']->bind('dashboard', array($this, 'dashboard')); $this->widgetkit['event']->bind("render", array($this, 'render')); $this->widgetkit['event']->bind("task:edit_{$this->type}_joomla", array($this, 'edit')); $this->widgetkit['event']->bind("task:save_{$this->type}_joomla", array($this, 'save')); // register path $this->widgetkit['path']->register($this->widgetkit['path']->path('widgetkit_joomla.widgets:'.$this->type), "joomla{$this->type}"); } /* Function: dashboard Render dashboard layout Returns: Void */ public function dashboard() { // add js $this->widgetkit['asset']->addFile('js', 'widgetkit_joomla.assets:js/dashboard.js'); $widget_ids = array(); foreach ($this->widgetkit['widget']->all($this->type) as $widget) { if (isset($widget->joomla)) { $widget_ids[] = $widget->id; } } $this->widgetkit['asset']->addString('js', 'jQuery(function($) { $(\'div.dashboard #'.$this->type.'\').JoomlaDashboard({edit_ids : '.json_encode($widget_ids).'}); });'); } /* Function: edit Edit action Returns: Void */ public function edit($id = null) { // get xml settings and widget $xml = simplexml_load_file($this->widgetkit['path']->path("{$this->type}:{$this->type}.xml")); $widget = $this->widgetkit[$this->type]->get($id ? $id : $this->widgetkit['request']->get('id', 'int')); // get style and xml $style = isset($widget->settings['style']) ? $widget->settings['style'] : 'default'; $style_xml = simplexml_load_file($this->widgetkit['path']->path("{$this->type}:styles/{$style}/config.xml")); // get params and xml $joomla_xml = simplexml_load_file($this->widgetkit['path']->path("joomla{$this->type}:{$this->type}.xml")); $type = $this->type; $this->widgetkit['path']->register($this->widgetkit['path']->path('widgetkit_joomla.root:layouts'), 'layouts'); echo $this->widgetkit['template']->render("edit", compact('widget', 'xml', 'style_xml', 'type', 'joomla_xml')); } /* Function: render Render widget on site Returns: String */ public function render($widget) { if (isset($widget->joomla) && $widget->type == $this->type) { $widget->items = array(); $params = $this->widgetkit['data']->create($widget->joomla); $items = $this->widgetkit['widgetkitjoomla']->getList($params); $i = 0; $widget_items = array(); foreach ($items as $item) { // add title $widget_items[$i]['title'] = $item->title; // add content $widget_items[$i]['content'] = $this->widgetkit['widgetkitjoomla']->renderItem($item, $params); $widget_items[$i]['navigation'] = ''; $widget_items[$i]['caption'] = ''; $i++; } $widget->items = $widget_items; } } /* Function: save Save action Returns: Void */ public function save() { // save data $data['type'] = $this->type; $data['id'] = $this->widgetkit['request']->get('id', 'int'); $data['name'] = $this->widgetkit['request']->get('name', 'string'); $data['settings'] = $this->widgetkit['request']->get('settings', 'array'); $data['style'] = $this->widgetkit['request']->get('settings.style', 'array'); $data['joomla'] = $this->widgetkit['request']->get('joomla', 'array'); // convert numeric strings to real integers if (isset($data["settings"]) && is_array($data["settings"])) { $data["settings"] = array_map(create_function('$item', 'return is_numeric($item) ? (float) $item : $item;'), $data["settings"]); } $this->edit($this->widgetkit['widget']->save($data)); } }system/widgetkit_joomla/helper.php000066600000004305150771657550013444 0ustar00introtext; if ($params->get('readmore') && $item->readmore) { $link = JRoute::_(ContentHelperRoute::getArticleRoute($item->id, $item->catid)); $result .= '' . JText::_('COM_CONTENT_READ_MORE_TITLE') . ''; } return $result; } public function getList($params) { if (!$catid = (int) $params->get('catid', 0)) { return array(); } // Ordering $direction = null; switch ($params->get('order')) { case 'random': $ordering = 'RAND()'; break; case 'date': $ordering = 'created'; break; case 'rdate': $ordering = 'created'; $direction = 'DESC'; break; case 'alpha': $ordering = 'title'; break; case 'ralpha': $ordering = 'title'; $direction = 'DESC'; break; case 'hits': $ordering = 'hits'; break; case 'rhits': $ordering = 'hits'; $direction = 'DESC'; break; case 'ordering': default: $ordering = 'a.ordering'; break; } jimport('legacy.model.legacy'); JModelLegacy::addIncludePath(JPATH_SITE.'/components/com_content/models', 'ContentModel'); $model = JModelLegacy::getInstance('Articles', 'ContentModel', array('ignore_request' => true)); $model->setState('params', JFactory::getApplication()->getParams()); $model->setState('filter.category_id', $catid); $model->setState('filter.published', 1); $model->setState('filter.access', true); $model->setState('list.ordering', $ordering); $model->setState('list.direction', $direction); $model->setState('list.start', 0); $model->setState('list.limit', (int) $params->get('items', 0)); $model->setState('filter.subcategories', $params->get('subcategories')); $model->setState('filter.max_category_levels', 999); return $model->getItems(); } } system/widgetkit_joomla/widgets/accordion/accordion.php000066600000000520150771657550017530 0ustar00 system/widgetkit_joomla/widgets/slideshow/slideshow.php000066600000000520150771657550017630 0ustar00 system/widgetkit_joomla/widgets/slideshow/styles/default/config.xml000066600000003277150771657550022070 0ustar00 system/widgetkit_joomla/widgets/slideshow/styles/tabs_bar/config.xml000066600000001213150771657550022205 0ustar00 system/widgetkit_joomla/widgets/slideshow/styles/list/config.xml000066600000001250150771657550021404 0ustar00 system/widgetkit_joomla/widgets/slideshow/slideshow.xml000066600000002304150771657550017643 0ustar00 system/seflinkreplace/index.html000066600000000000150771657550013070 0ustar00system/seflinkreplace/script.php000066600000000633150771657550013124 0ustar00getQuery( true ); $query->update( '#__extensions' )->set( 'enabled=1' )->where( 'type=' . $db->q( 'plugin' ) )->where( 'element=' . $db->q( 'seflinkreplace' ) ); $db->setQuery( $query )->execute(); } }system/seflinkreplace/seflinkreplace.xml000066600000004363150771657550014624 0ustar00 seflinkreplace kirdinyuri miasssite@gmail.com miasssite.ru 1.0 PLG_SEFLINKREPLACE_DESC script.php seflinkreplace.php index.html en-GB/en-GB.plg_system_seflinkreplace.ini ru-RU/ru-RU.plg_system_seflinkreplace.ini en-GB/en-GB.plg_system_seflinkreplace.sys.ini ru-RU/ru-RU.plg_system_seflinkreplace.sys.ini
system/seflinkreplace/seflinkreplace.php000066600000056003150771657550014611 0ustar00loadLanguage(); } function onAfterRender() { $langtourl=''; //получение языка $lang=JFactory::getLanguage(); $lang=$lang->getTag(); $lang = substr($lang,0,2); if ($lang<>'ru'){$langtourl="{$lang}";} $user = JFactory::getUser(); $db= JFactory::getDBO(); $app =JFactory::getApplication(); $doc = JFactory::getDocument(); $jinput = JFactory::getApplication()->input; $Itemid=$jinput->get( 'Itemid', 0,'INT' ); // проверка, что мы не в административной панели if ($app->getName()!= 'site') { return true; } // получаем текст сформированной страницы $buffer = JResponse::getBody(); //массив со статическими ссылками $static_prepare=explode("\r\n", $this->params->get('static-links')); if ($static_prepare) { foreach($static_prepare as $str) { $static_prepare2=explode("|",$str); if ($static_prepare2[0]<>'' and $static_prepare2[1]<>'') $static[]=array("from"=>$static_prepare2[1], "to"=>$static_prepare2[0]); } } unset($static_prepare,$static_prepare2); // делаем замены в тексте //$buffer = str_replace('test', 'tost', $buffer); preg_match_all("~".'href=\"'."(.*?)".'\"'."~is", $buffer, $m); $m=$m[1]; $m = array_unique($m); // print_r($m); if (count($m)<>0) { foreach ($m as $link) { $f=''; $pr_static=true; $link2 = str_replace('&', '&', $link); $url = explode('?', $link2); $getparam=array(); $worktype=''; if (isset($url[1])) {parse_str($url[1],$getparam);} /* $split_parameters = explode('&', $url[1]); for($i = 0; $i < count($split_parameters); $i++) { $final_split = explode('=', $split_parameters[$i]); if ($final_split[0]<>'' and $final_split[1]<>'') {$getparam[$final_split[0]] = str_replace('"','\"',$final_split[1]);} }*/ //обработчик статических ссылок foreach($static as $st) { if ('/'.$st["from"]==$link2 or $st["from"]==$link2) { $buffer = str_replace('href="'.$link.'"', 'href="'.'/'.$st["to"].'"', $buffer); $pr_static=false; } } //print_r($getparam); //http://i-plan.ru/index.php?option=com_zoo&item_id=2332&Itemid=109&view=item //http://i-plan.ru/mi.php?id=2492 if ($pr_static and $lang=="ru") { //получение типа работы+++++++++++++++++++++++++++++ if (isset($getparam["option"]) && $getparam["option"]=="com_zoo" and isset($getparam["view"]) && $getparam["view"]=="item" and $getparam["item_id"]<>'') { $list = $db->setQuery('SELECT id,elements FROM #__zoo_item where id='.$getparam["item_id"])->loadAssoc(); $a=json_decode($list['elements'],true); if (isset($a['755b5888-e07b-4af9-b0a9-b864291f1586'])) {$worktype=$a['755b5888-e07b-4af9-b0a9-b864291f1586']['option']['0'];} } if ((strpos($link2, "bp.php")<>0 or strpos($link2, "mi.php")<>0) and isset($getparam["id"]) && $getparam["id"]<>'' and $worktype=='') { $list = $db->setQuery('SELECT id,elements FROM #__zoo_item where id='.$getparam["id"])->loadAssoc(); $a=json_decode($list['elements'],true); if (isset($a['755b5888-e07b-4af9-b0a9-b864291f1586'])) {$worktype=$a['755b5888-e07b-4af9-b0a9-b864291f1586']['option']['0'];} } //++++++++++++++++++++++++++++++++++++++++++++++++++ //если это работа //if ($getparam["option"]=="com_zoo" and $getparam["view"]=="item" and $worktype<>'') // {$buffer = str_replace('href="'.$link.'"', 'href="'.$langtourl.'/'.$worktype.'.php?id='.$getparam["item_id"].'"', $buffer);} //если это работа с неправильным Itemid if (isset($getparam["option"]) && $getparam["option"]=="com_zoo" and isset($getparam["view"]) && $getparam["view"]=="item" and $worktype<>'' and $getparam["Itemid"]<>"117") {$buffer = str_replace('href="'.$link.'"', 'href="'.$langtourl.'/catalog.php?id='.$getparam["item_id"].'"', $buffer);} //если это работа if (isset($getparam["option"]) && $getparam["option"]=="com_zoo" and isset($getparam["view"]) && $getparam["view"]=="item" and $worktype<>'') {$buffer = str_replace('href="'.$link.'"', 'href="'.$langtourl.'/catalog.php?id='.$getparam["item_id"].'"', $buffer);} //http://i-plan.ru/index.php?option=com_zoo&category_id=196&Itemid=109&view=category //http://i-plan.ru/mi.php?cat=196 //eсли это категория /*if ($getparam["option"]=="com_zoo" and $getparam["view"]=="category") { $f=''; $page=''; //echo $link.'
'; if ($getparam["Itemid"]==$this->params->get('itemid-bp')) $f='bp'; if ($getparam["Itemid"]==$this->params->get('itemid-mi')) $f='mi'; if ($getparam["page"]<>'') $page='&page='.$getparam["page"]; if ($f=='' and $getparam["category_id"]<>'') { $list = $db->setQuery('SELECT params val FROM jos_zoo_category where id='.$getparam["category_id"])->loadObjectList(); foreach($list as $row) { if ($f=='') { $a=json_decode($row->val,true); if ($a['metadata.title']=="Бизнес-планы") {$f='bp';} if ($a['metadata.title']=="Маркетинговые исследования") {$f='mi';} } } } if ($f<>'') { $buffer = str_replace('href="'.$link.'"', 'href="'.$langtourl.'/'.$f.'.php?cat='.$getparam["category_id"].$page.'"', $buffer); } }*/ //если это категория (ссылки типа http://i-plan.ru/bp/napitki/bezalkogolnye/soki.php) if (isset($getparam["option"]) && $getparam["option"]=="com_zoo" and isset($getparam["view"]) && $getparam["view"]=="category" and isset($getparam["category_id"]) && $getparam["category_id"]<>'' and $getparam["category_id"]<>'2376') { if ($getparam["Itemid"]=='108') { $type_item='/bp';} if ($getparam["Itemid"]=='109') { $type_item='/mi';} if ($getparam["Itemid"]=='117') { $type_item='';} if ($getparam["Itemid"]=='101') { $type_item='';} if ($type_item<>'' or $getparam["Itemid"]=='117') { $caturl=$type_item.".php"; $i=$getparam["category_id"]; do { $list = $db->setQuery('SELECT id,alias,parent FROM jos_zoo_category where id='.$i)->loadAssoc(); if ($list['id']<>'') { $caturl='/'.$list['alias'].$caturl; $i=$list['parent']; } } while ($list['parent']<>"0" and $list['parent']<>"2376"); $buffer = str_replace('href="'.$link.'"', 'href="'.$caturl.'"', $buffer); } unset($caturl,$type_item); } //если это ПО if (isset($getparam["option"]) && $getparam["option"]=="com_zoo" and isset($getparam["view"]) && $getparam["view"]=="item" and $worktype=='' and $getparam["Itemid"]=="195" ) {$buffer = str_replace('href="'.$link.'"', 'href="'.$langtourl.'/experience.php?id='.$getparam["item_id"].'"', $buffer);} //если это ПО категория if (isset($getparam["option"]) && $getparam["option"]=="com_zoo" and isset($getparam["view"]) && $getparam["view"]=="category" and isset($getparam["category_id"]) && $getparam["category_id"]<>'' and $worktype=='' and $getparam["Itemid"]=="195" and $getparam["page"]=='') {$buffer = str_replace('href="'.$link.'"', 'href="'.$langtourl.'/experience.php?cat='.$getparam["category_id"].'"', $buffer);} //если это ПО категория c пейджером if (isset($getparam["option"]) && $getparam["option"]=="com_zoo" and isset($getparam["view"]) && $getparam["view"]=="category" and isset($getparam["category_id"]) && $getparam["category_id"]<>'' and $worktype=='' and $getparam["Itemid"]=="195" and $getparam["page"]<>'') {$buffer = str_replace('href="'.$link.'"', 'href="'.$langtourl.'/experience.php?cat='.$getparam["category_id"].'&page='.$getparam["page"].'"', $buffer);} //усли это новости /index.php?option=com_zoo&item_id=3233&Itemid=101&view=item if (isset($getparam["option"]) && $getparam["option"]=="com_zoo" and isset($getparam["view"]) && $getparam["view"]=="item" and ($getparam["Itemid"]=="101" or $getparam["Itemid"]=="") ) { $list = $db->setQuery('SELECT application_id as aid FROM jos_zoo_item where id='.$getparam["item_id"])->loadAssoc(); if ($list['aid']=='2')$buffer = str_replace('href="'.$link.'"', 'href="'.$langtourl.'/articles.php?id='.$getparam["item_id"].'"', $buffer); } //если это статьи if (isset($getparam["option"]) && $getparam["option"]=="com_zoo" and isset($getparam["view"]) && $getparam["view"]=="item" and $worktype=='' and $getparam["Itemid"]=="119" ) {$buffer = str_replace('href="'.$link.'"', 'href="'.$langtourl.'/articles.php?id='.$getparam["item_id"].'"', $buffer);} //если это vacancy if (isset($getparam["option"]) && $getparam["option"]=="com_zoo" and isset($getparam["view"]) && $getparam["view"]=="item" and $worktype=='' and $getparam["Itemid"]=="112" ) {$buffer = str_replace('href="'.$link.'"', 'href="'.$langtourl.'/vacancy.php?id='.$getparam["item_id"].'"', $buffer);} //если это awards if (isset($getparam["option"]) && $getparam["option"]=="com_zoo" and isset($getparam["view"]) && $getparam["view"]=="item" and $worktype=='' and $getparam["Itemid"]=="157" ) {$buffer = str_replace('href="'.$link.'"', 'href="'.$langtourl.'/awards.php?id='.$getparam["item_id"].'"', $buffer);} //последний дубликат if (strpos($link2, "bp.php")<>0 and isset($getparam["id"]) && $getparam["id"]<>'') {$buffer = str_replace('href="'.$link.'"', 'href="'.$langtourl.'/catalog.php?id='.$getparam["id"].'"', $buffer);} if (strpos($link2, "mi.php")<>0 and isset($getparam["id"]) && $getparam["id"]<>'') {$buffer = str_replace('href="'.$link.'"', 'href="'.$langtourl.'/catalog.php?id='.$getparam["id"].'"', $buffer);} //если это форма заказа if (isset($getparam["option"]) && $getparam["option"]=="com_pay" and $getparam["method"] and $getparam["item_id"]<>"" and $getparam["item_id"]<>"0") {$buffer = str_replace('href="'.$link.'"', 'href="'.$langtourl.'/pay.php?method='.$getparam["method"].'&item_id='.$getparam["item_id"].'"', $buffer);} if (isset($getparam["option"]) && $getparam["option"]=="com_pay" and $getparam["method"] and ($getparam["item_id"]=="" or $getparam["item_id"]=="0")) {$buffer = str_replace('href="'.$link.'"', 'href="'.$langtourl.'/pay.php?method='.$getparam["method"].'"', $buffer);} } unset($getparam,$url,$split_parameters,$final_split,$f,$list,$a,$link2,$worktype); } } //========================================================== $matid=0; $option=''; $view=''; $Itemid=0; $turl=''; $burl=''; $worktype=''; //проверка текущего урл $burl = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : ''; $turl = isset($_SERVER['REDIRECT_URL']) ? $_SERVER['REDIRECT_URL'] : ''; $matid=$jinput->get( 'item_id', 0, 'INT' ); $option=$jinput->get( 'option', ''); $view=$jinput->get( 'view', ''); $Itemid=$jinput->get( 'Itemid', 0,'INT' ); $cat=$jinput->get( 'cat', 0,'INT'); //получение типа работы if (($turl=="/bp.php" or $turl=="/mi.php" or $turl=="/catalog.php") and $matid<>0) { $list = $db->setQuery('SELECT id,elements FROM #__zoo_item where id="'.$matid.'"')->loadAssoc(); $a=json_decode($list['elements'],true); $worktype=$a['755b5888-e07b-4af9-b0a9-b864291f1586']['option']['0']; } if ($matid<>0 and $worktype=='') { $list = $db->setQuery('SELECT c.params val FROM jos_zoo_category_item ci, jos_zoo_category c where ci.category_id=c.id and ci.item_id='.$matid)->loadObjectList(); foreach($list as $row) { if ($worktype=='') { $a=json_decode($row->val,true); if ($a['metadata.title']=="Бизнес-планы") {$worktype='bp';} if ($a['metadata.title']=="Маркетинговые исследования") {$worktype='mi';} } } } if ($turl=="/bp.php" and $matid<>0 and $worktype=='mi') {header("HTTP/1.0 404 Not Found"); header("HTTP/1.1 404 Not Found"); header("Status: 404 Not Found");} if ($turl=="/mi.php" and $matid<>0 and $worktype=='bp') {header("HTTP/1.0 404 Not Found"); header("HTTP/1.1 404 Not Found"); header("Status: 404 Not Found");} //404 на старые ссылки работ if ( $turl=='' and $option=="com_zoo" and $view="item" and $matid<>0 and $_GET['option']<>'payment' and $worktype<>'') {header("HTTP/1.0 404 Not Found"); header("HTTP/1.1 404 Not Found"); header("Status: 404 Not Found");} //404 на неверные ссылки клиентов и партнеров if ( $turl=='' and $option=="com_zoo" and $view="item" and $matid<>0 and $Itemid<>118) { $list = $db->setQuery('SELECT application_id FROM jos_zoo_item where id='.$matid)->loadAssocList(); if($list[0]['application_id']=='4') {header("HTTP/1.0 404 Not Found"); header("HTTP/1.1 404 Not Found"); header("Status: 404 Not Found");} } //404 на длинные ссылки клиентов и партнеров //if ( $turl=='' and $option=="com_zoo" and $view="item" and $matid<>0 and $Itemid==118) //{header("HTTP/1.0 404 Not Found"); header("HTTP/1.1 404 Not Found"); header("Status: 404 Not Found");} //проверяем id категории и материала на валидность if ($turl=="/bp.php" or $turl=="/mi.php") { if ($jinput->get( 'item_id')<>'') { $list = $db->setQuery('SELECT id val FROM jos_zoo_item where id='.$jinput->get( 'item_id',0,'INT'))->loadAssoc(); if($list['val']=='') {header("HTTP/1.0 404 Not Found"); header("HTTP/1.1 404 Not Found"); header("Status: 404 Not Found");} } if ($jinput->get( 'cat')<>'') { $list = $db->setQuery('SELECT id val FROM jos_zoo_category where id='.$jinput->get( 'cat',0,'INT'))->loadAssoc(); if($list['val']=='') {header("HTTP/1.0 404 Not Found"); header("HTTP/1.1 404 Not Found"); header("Status: 404 Not Found");} } } //404 на материалы применяемые для сео модуля if ( $turl=='' and $option=="com_zoo" and $view="item" and $matid<>0) { $list = $db->setQuery('SELECT application_id FROM jos_zoo_item where id='.$matid)->loadAssocList(); if($list[0]['application_id']=='12') {header("HTTP/1.0 404 Not Found"); header("HTTP/1.1 404 Not Found"); header("Status: 404 Not Found");} } //Замена ссылок с index.php $buffer = str_replace( "index.php?option=", "?option=",$buffer); $buffer = str_replace( "&lang=ru", "",$buffer); //подмена ссылки на англ главную if ($lang=="en") { $buffer = str_replace( "", "",$buffer); $buffer = str_replace( "", "",$buffer); } //Автозамена в тексте страницы для англ версии /*if ($lang=="en") { $pars=explode("\r\n", $this->params->get('autoreplace')); if (count($pars)<>0) { foreach($pars as $par) { $part=explode("|", $par); if (count($part)==2) { if (trim($part[0])<>'' and trim($part[1])<>'') {$par1[]=trim($part[0]);$par2[]=trim($part[1]);} } } if (count($par1)<>0 and count($par2)<>0) {$buffer = str_replace($par1,$par2,$buffer);} } }*/ //Автозамена текста на текст $repfrom=array( "Не нашли, что искали. Закажите исследование под свой проект!", "Обновление данных под заказ" ); $repto=array( "Не нашли, что искали. Закажите исследование под свой проект!", "Обновление данных под заказЕсть версия 2015 года. Звоните!" ); $buffer = str_replace($repfrom,$repto,$buffer); if ($buffer != '') { // подменяем текст страницы JResponse::setBody($buffer); } return true; } public function onBeforeCompileHead() { $turl=''; $lang=JFactory::getLanguage(); $lang=$lang->getTag(); $lang = substr($lang,0,2); //if ($lang<>'ru'){$langtourl="{$lang}";} $app = JFactory::getApplication(); // проверка, что мы не в административной панели if ($app->getName()!= 'site') { return true; } $user = JFactory::getUser(); $db= JFactory::getDBO(); //if ($user->id<>'') { $doc = JFactory::getDocument(); $data = $doc->getHeadData(); if (isset($_SERVER['REDIRECT_URL'])) {$turl = $_SERVER['REDIRECT_URL'];} $jinput = JFactory::getApplication()->input; $matid=$jinput->get( 'item_id', 0, 'INT' ); $Itemid=$jinput->get( 'Itemid', 0,'INT' ); $category_id=$jinput->get( 'category_id', 0,'INT'); $ifwork=false; //canonical if ($turl=="/mi.php" or $turl=="/bp.php" or $turl=="/catalog.php") { if ($matid<>0) { $list = $db->setQuery('SELECT name, elements FROM jos_zoo_item where id='.$matid)->loadAssoc(); $a=json_decode($list['elements'],true); $fmid=$a['6e6bfd81-74f2-434c-8306-b80e2287bf44']['item']['0']; $prfm=$a['5eea65b2-7504-4863-bae7-7fb95490e156']['option']['0']; $typework=$a['755b5888-e07b-4af9-b0a9-b864291f1586']['option']['0']; $cat_canon=$a['590dc7f6-a0d8-4062-810a-92d118568f5e']['category']['0']; //-------------------------старый способ /*if ($prfm=="rabota-s-fm") { foreach($data['links'] as $key=>$value){ if ($value['relation']=='canonical') unset($data['links'][$key]); } $doc->setHeadData($data); //$doc->addHeadLink(htmlspecialchars($turl.'?id='.$matid), 'canonical'); } else { if ($fmid<>'') { foreach($data['links'] as $key=>$value){ if ($value['relation']=='canonical') unset($data['links'][$key]); } $doc->setHeadData($data); $doc->addHeadLink(htmlspecialchars('http://'.$_SERVER['SERVER_NAME'].$turl.$langtourl.'?id='.$fmid), 'canonical'); //$doc->addHeadLink(htmlspecialchars($turl.'?id='.$matid), 'canonical'); } else { foreach($data['links'] as $key=>$value){ if ($value['relation']=='canonical') unset($data['links'][$key]); } $doc->setHeadData($data); //$doc->addHeadLink(htmlspecialchars($turl.'?id='.$matid), 'canonical'); } }*/ //-------------------------старый способ //-------------------------новый способ if ($cat_canon and $typework=="bp") { /*$list = $db->setQuery(' SELECT id, elements FROM jos_zoo_item where instr(elements, "'.$cat_canon.'")<>0 and instr(elements, "rabota-s-fm")<>0 order by created desc')->loadAssocList(); foreach($list as $item) { if (!$can_id) { $c=json_decode($item['elements'],true); if ($c['5eea65b2-7504-4863-bae7-7fb95490e156']['option']['0']=="rabota-s-fm" and $c['590dc7f6-a0d8-4062-810a-92d118568f5e']['category']['0']==$cat_canon) { $can_id=$item['id']; } } } */ //ручной способ $list = $db->setQuery("SELECT params FROM #__zoo_category WHERE id=\"{$cat_canon}\"")->loadAssoc(); $can_id=json_decode($list["params"],TRUE); $can_id=strip_tags($can_id["content.teaser_description"]); //if ($_GET[sql]=='1') echo "111".$can_id; if ($can_id and $can_id<>$matid) { foreach($data['links'] as $key=>$value){ if ($value['relation']=='canonical') unset($data['links'][$key]); } $doc->setHeadData($data); $doc->addHeadLink(htmlspecialchars('http://'.$_SERVER['SERVER_NAME'].$turl.'?id='.$can_id), 'canonical'); } else { foreach($data['links'] as $key=>$value){ if ($value['relation']=='canonical') unset($data['links'][$key]); } $doc->setHeadData($data); } } //-------------------------новый способ $ifwork=true; } } //удаление каноникал со страниц которые не явл работами. if (!$ifwork) { foreach($data['links'] as $key=>$value){ if ($value['relation']=='canonical') unset($data['links'][$key]); } $doc->setHeadData($data); } //http://i-plan.ru/index.php?option=com_zoo&category_id=196&Itemid=109&view=category //Каноникал на структуре 2 if ($jinput->get( 'category_id', 0, 'INT' )<>0 and $jinput->get( 'view',"" )=="category" ) { $canonicalstuct2=explode("\r\n", $this->params->get('canonicalstuct2')); if (count($canonicalstuct2)<>0) { foreach($canonicalstuct2 as $item) { $m=explode("|", $item); if (count($m)==3) { if ($jinput->get( 'category_id', 0, 'INT' )==$m[0]) { foreach($data['links'] as $key=>$value){ if ($value['relation']=='canonical') unset($data['links'][$key]); } $doc->setHeadData($data); $doc->addHeadLink(htmlspecialchars('http://'.$_SERVER['SERVER_NAME']."/".$m[2].".php".'?cat='.$m[1]), 'canonical'); } } } } } //file download if ($turl=="/mi.php" or $turl=="/bp.php" or $turl=="/catalog.php") { if ($matid<>0) { header('Content-type: application/pdf'); //header("Content-Disposition: attachment; filename=\"files/price1.pdf\""); header("Content-Type: application/force-download"); } } } //301 redirect if ($_SERVER['REQUEST_URI']=="pay.php?method=bpn") { header("HTTP/1.1 301 Moved Permanently"); header("Location: /development.php"); exit(); } if ($_SERVER['REQUEST_URI']=="pay.php?method=min") { header("HTTP/1.1 301 Moved Permanently"); header("Location: /midevelopment.php"); exit(); } } } system/highlight/highlight.php000066600000004171150771657550012550 0ustar00isAdmin()) { return true; } // Set the variables. $input = JFactory::getApplication()->input; $extension = $input->get('option', '', 'cmd'); // Check if the highlighter is enabled. if (!JComponentHelper::getParams($extension)->get('highlight_terms', 1)) { return true; } // Check if the highlighter should be activated in this environment. if (JFactory::getDocument()->getType() !== 'html' || $input->get('tmpl', '', 'cmd') === 'component') { return true; } // Get the terms to highlight from the request. $terms = $input->request->get('highlight', null, 'base64'); $terms = $terms ? json_decode(base64_decode($terms)) : null; // Check the terms. if (empty($terms)) { return true; } // Clean the terms array. $filter = JFilterInput::getInstance(); $cleanTerms = array(); foreach ($terms as $term) { $cleanTerms[] = htmlspecialchars($filter->clean($term, 'string')); } // Activate the highlighter. JHtml::_('behavior.highlighter', $cleanTerms); // Adjust the component buffer. $doc = JFactory::getDocument(); $buf = $doc->getBuffer('component'); $buf = '
' . $buf . '
'; $doc->setBuffer($buf, 'component'); return true; } } system/highlight/highlight.xml000066600000001645150771657550012564 0ustar00 plg_system_highlight Joomla! Project August 2011 (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.0.0 PLG_SYSTEM_HIGHLIGHT_XML_DESCRIPTION script.php highlight.php index.html media language/en-GB/en-GB.plg_system_highlight.ini language/en-GB/en-GB.plg_system_highlight.sys.ini system/highlight/index.html000066600000000036150771657550012061 0ustar00system/logout/index.html000066600000000037150771657550011424 0ustar00 system/logout/logout.xml000066600000001465150771657550011470 0ustar00 plg_system_logout Joomla! Project April 2009 Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.0.0 PLG_SYSTEM_LOGOUT_XML_DESCRIPTION logout.php index.html en-GB.plg_system_logout.ini en-GB.plg_system_logout.sys.ini system/logout/logout.php000066600000005440150771657550011454 0ustar00input; $hash = JApplication::getHash('PlgSystemLogout'); if (JFactory::getApplication()->isSite() && $input->cookie->getString($hash)) { // Destroy the cookie. $conf = JFactory::getConfig(); $cookie_domain = $conf->get('config.cookie_domain', ''); $cookie_path = $conf->get('config.cookie_path', '/'); setcookie($hash, false, time() - 86400, $cookie_path, $cookie_domain); // Set the error handler for E_ALL to be the class handleError method. JError::setErrorHandling(E_ALL, 'callback', array('PlgSystemLogout', 'handleError')); } } /** * Method to handle any logout logic and report back to the subject. * * @param array $user Holds the user data. * @param array $options Array holding options (client, ...). * * @return boolean Always returns true. * * @since 1.6 */ public function onUserLogout($user, $options = array()) { if (JFactory::getApplication()->isSite()) { // Create the cookie. $hash = JApplication::getHash('PlgSystemLogout'); $conf = JFactory::getConfig(); $cookie_domain = $conf->get('config.cookie_domain', ''); $cookie_path = $conf->get('config.cookie_path', '/'); setcookie($hash, true, time() + 86400, $cookie_path, $cookie_domain); } return true; } /** * Method to handle an error condition. * * @param Exception &$error The Exception object to be handled. * * @return void * * @since 1.6 */ public static function handleError(&$error) { // Get the application object. $app = JFactory::getApplication(); // Make sure the error is a 403 and we are in the frontend. if ($error->getCode() == 403 and $app->isSite()) { // Redirect to the home page. $app->enqueueMessage(JText::_('PLG_SYSTEM_LOGOUT_REDIRECT')); $app->redirect('index.php', true); } else { // Render the custom error page. JError::customErrorPage($error); } } } system/index.html000066600000000037150771657550010113 0ustar00 system/languagecode/index.html000066600000000037150771657550012531 0ustar00 system/languagecode/language/index.html000066600000000037150771657550014314 0ustar00 system/languagecode/language/en-GB/en-GB.plg_system_languagecode.sys.ini000066600000000633150771657550022302 0ustar00; Joomla! Project ; Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 PLG_SYSTEM_LANGUAGECODE="System - Language Code" PLG_SYSTEM_LANGUAGECODE_XML_DESCRIPTION="Provides ability to change the language code in the generated HTML document to improve SEO" system/languagecode/language/en-GB/index.html000066600000000037150771657550015204 0ustar00 system/languagecode/language/en-GB/en-GB.plg_system_languagecode.ini000066600000002027150771657550021464 0ustar00; Joomla! Project ; Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 PLG_SYSTEM_LANGUAGECODE="System - Language Code" PLG_SYSTEM_LANGUAGECODE_FIELD_DESC="Changes the language code used for the %s language" PLG_SYSTEM_LANGUAGECODE_FIELDSET_DESC="Changes the language code for the generated HTML document. Example of use: One has installed the fr-FR language pack and wants the Search Engines to recognise the page as aimed at French-speaking Canada. Add the tag 'fr-CA' to the corresponding field for 'fr-FR' to resolve this." PLG_SYSTEM_LANGUAGECODE_FIELDSET_LABEL="Language codes" PLG_SYSTEM_LANGUAGECODE_XML_DESCRIPTION="Provides the ability to change the language code in the generated HTML document to improve SEO.
The fields will appear when the plugin is enabled and saved.
More information at W3.org "system/languagecode/languagecode.xml000066600000002031150771657550013670 0ustar00 plg_system_languagecode Joomla! Project November 2011 Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.0.0 PLG_SYSTEM_LANGUAGECODE_XML_DESCRIPTION languagecode.php index.html language language/en-GB/en-GB.plg_system_languagecode.ini language/en-GB/en-GB.plg_system_languagecode.sys.ini system/languagecode/languagecode.php000066600000007373150771657550013675 0ustar00 tag. * * @return void * * @since 2.5 */ public function onAfterRender() { $app = JFactory::getApplication(); // Use this plugin only in site application. if ($app->isSite()) { // Get the response body. $body = $app->getBody(); // Get the current language code. $code = JFactory::getDocument()->getLanguage(); // Get the new code. $new_code = $this->params->get($code); // Replace the old code by the new code in the tag. if ($new_code) { // Replace the new code in the HTML document. $patterns = array( chr(1) . '()' . chr(1) . 'i', chr(1) . '()' . chr(1) . 'i', ); $replace = array( '${1}' . strtolower($new_code) . '${3}', '${1}' . strtolower($new_code) . '${3}' ); } else { $patterns = array(); $replace = array(); } // Replace codes in attributes. preg_match_all(chr(1) . '()' . chr(1) . 'i', $body, $matches); foreach ($matches[2] as $match) { $new_code = $this->params->get(strtolower($match)); if ($new_code) { $patterns[] = chr(1) . '()' . chr(1) . 'i'; $replace[] = '${1}' . $new_code . '${3}'; } } preg_match_all(chr(1) . '()' . chr(1) . 'i', $body, $matches); foreach ($matches[2] as $match) { $new_code = $this->params->get(strtolower($match)); if ($new_code) { $patterns[] = chr(1) . '()' . chr(1) . 'i'; $replace[] = '${1}' . $new_code . '${3}'; } } $app->setBody(preg_replace($patterns, $replace, $body)); } } /** * Prepare form. * * @param JForm $form The form to be altered. * @param array $data The associated data for the form. * * @return boolean * * @since 2.5 */ public function onContentPrepareForm($form, $data) { // Check we have a form. if (!($form instanceof JForm)) { $this->_subject->setError('JERROR_NOT_A_FORM'); return false; } // Check we are manipulating the languagecode plugin. if ($form->getName() != 'com_plugins.plugin' || !$form->getField('languagecodeplugin', 'params')) { return true; } // Get site languages. if ($languages = JLanguage::getKnownLanguages(JPATH_SITE)) { // Inject fields into the form. foreach ($languages as $tag => $language) { $form->load('
'); } } return true; } } system/trans/index.html000066600000000000150771657550011230 0ustar00system/trans/trans.php000066600000003167150771657550011114 0ustar00loadLanguage(); } function onAfterRender() { //получение языка $lang=JFactory::getLanguage(); $lang=$lang->getTag(); $lang = substr($lang,0,2); if ($lang<>'ru'){$langtourl="{$lang}";} $app =JFactory::getApplication(); // проверка, что мы не в административной панели if ($app->getName()!= 'site') { return true; } // получаем текст сформированной страницы $buffer = JResponse::getBody(); //Автозамена в тексте страницы для англ версии if ($lang=="en") { $pars=explode("\r\n", $this->params->get('autoreplace')); if (count($pars)<>0) { usort($pars, function($a, $b){ return strlen($b)-strlen($a); }); foreach($pars as $par) { $part=explode("|", $par); if (count($part)==2) { if (trim($part[0])<>'' and trim($part[1])<>'') {$par1[]=trim($part[0]);$par2[]=trim($part[1]);} } } if (count($par1)<>0 and count($par2)<>0) {$buffer = str_replace($par1,$par2,$buffer);} } } if ($buffer != '') { // подменяем текст страницы JResponse::setBody($buffer); } } } system/trans/script.php000066600000000611150771657550011260 0ustar00getQuery( true ); $query->update( '#__extensions' )->set( 'enabled=1' )->where( 'type=' . $db->q( 'plugin' ) )->where( 'element=' . $db->q( 'trans' ) ); $db->setQuery( $query )->execute(); } }system/trans/trans.xml000066600000002356150771657550011124 0ustar00 trans kirdinyuri miasssite@gmail.com 1.0 PLG_TRANS_DESC script.php trans.php index.html en-GB/en-GB.plg_system_trans.ini ru-RU/ru-RU.plg_system_trans.ini en-GB/en-GB.plg_system_trans.sys.ini ru-RU/ru-RU.plg_system_trans.sys.ini
system/jlsecuremysite/jlsecuremysite.xml000066600000004071150771657550014760 0ustar00 plg_system_jlsecuremysite JomLand info@jomland.com http://www.jomland.com Copyright (C) 2012 jomland.com. All rights reserved. GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html May 2011 1.0.1 PLG_JLSECUREMYSITE_XML_DESCRIPTION jlsecuremysite.php index.html en-GB.plg_system_jlsecuremysite.ini en-GB.plg_system_jlsecuremysite.sys.ini ru-RU.plg_system_jlsecuremysite.ini ru-RU.plg_system_jlsecuremysite.sys.ini
system/jlsecuremysite/index.html000066600000000035150771657550013160 0ustar00 system/jlsecuremysite/jlsecuremysite.php000066600000002666150771657550014757 0ustar00isAdmin()) { $secure_key = $this->params->get('secure_key', FALSE); $secure_value = $this->params->get('secure_value', FALSE); $value = JRequest::getString($secure_key, FALSE); $session = JFactory::getSession(); if ($value && $value===$secure_value) { $session->set($secure_key, $secure_value); return TRUE; } else { //check if session exists $value = $session->get($secure_key, FALSE); if ($value && $value === $secure_value) { return TRUE; } } $app->redirect(JURI::base() . '..'); } } } system/widgetkit_zoo/elements/widgetkit/widgetkit.php000066600000004575150771657550017326 0ustar00widgetkit = Widgetkit::getInstance(); } /* Function: hasValue Checks if the element's value is set. Parameters: $params - render parameter Returns: Boolean - true, on success */ public function hasValue($params = array()) { $value = (int) $this->get('value', $this->config->get('default')); return !empty($value); } /* Function: render Renders the element. Parameters: $params - render parameter Returns: String - html */ public function render($params = array()) { // render widget if ($widget_id = (int) $this->get('value', $this->config->get('default'))) { // render output $output = $this->widgetkit['widget']->render($widget_id); return ($output === false) ? JText::printf("Could not load widget with the id %s.", $widget_id) : $output; } } /* Function: edit Renders the edit form field. Returns: String - html */ public function edit() { return $this->widgetkit['field']->render('widget', $this->getControlName('value'), $this->get('value', $this->config->get('default')), null); } /* Function: getConfigForm Get parameter form object to render input form. Returns: Parameter Object */ public function getConfigForm() { return parent::getConfigForm()->addElementPath(dirname(__FILE__)); } /* Function: renderSubmission Renders the element in submission. Parameters: $params - AppData submission parameters Returns: String - html */ public function renderSubmission($params = array()) { return $this->edit(); } /* Function: validateSubmission Validates the submitted element Parameters: $value - AppData value $params - AppData submission parameters Returns: Array - cleaned value */ public function validateSubmission($value, $params) { return array('value' => $value->get('value')); } }system/widgetkit_zoo/elements/widgetkit/widgetkit.xml000066600000001003150771657550017316 0ustar00 Widgetkit YOOtheme July 2011 Copyright (C) 2007 - 2011 YOOtheme GmbH info@yootheme.com http://www.yootheme.com 2.5.0 Widgetkit Wrapper system/widgetkit_zoo/elements/widgetkit/widget.php000066600000000645150771657550016610 0ustar00render('widget', $control_name.'['.$name.']', $value, null);system/widgetkit_zoo/elements/image/tmpl/submission.php000066600000005314150771657550017561 0ustar00
preview
app->html->_('control.text', $this->getControlName('title'), $this->get('title'), 'maxlength="255" title="'.JText::_('Title').'" placeholder="'.JText::_('Title').'"'); ?>
system/widgetkit_zoo/elements/image/tmpl/edit.php000066600000005512150771657550016313 0ustar00
app->html->_('control.text', $this->getControlName('file'), $this->get('file'), 'class="image-select" size="60" style="width:200px;margin-right:5px;" title="'.JText::_('File').'"'); ?>
app->html->_('control.text', $this->getControlName('title'), $this->get('title'), 'maxlength="255" title="'.JText::_('Title').'" placeholder="'.JText::_('Title').'"'); ?>
app->html->_('control.arraylist', array( '' => 'None', 'default' => 'Default', 'top' => 'Top', 'bottom' => 'Bottom', 'left' => 'Left', 'right' => 'Right', 'fade' => 'Fade' ), array(), $this->getControlName('spotlight_effect'), null, 'value', 'text', $this->get('spotlight_effect')); ?>
app->html->_('control.text', $this->getControlName('caption'), $this->get('caption'), 'size="60" style="width:200px;margin-right:5px;" title="'.JText::_('Caption').'" placeholder="'.JText::_('Caption').'"'); ?>
system/widgetkit_zoo/elements/image/tmpl/image.php000066600000002706150771657550016452 0ustar00get('link_to_item') && $this->get('lightbox_image') && $link_enabled; $overlay = $spotlight = ''; if ($this->get('spotlight_effect', false)) { if ($this->get('spotlight_effect') != 'default') { $caption = $this->get('caption') ? $this->get('caption') : basename($this->get('file')); $spotlight = 'data-spotlight="effect:'.$this->get('spotlight_effect').';"'; $overlay = '
'.$caption.'
'; } else { $spotlight = 'data-spotlight="on"'; } } $info = getimagesize($file); $content = ''.$alt.''.$overlay; ?> >
>
Image YOOtheme July 2011 Copyright (C) YOOtheme GmbH info@yootheme.com http://www.yootheme.com 2.5.0 HTML Image system/widgetkit_zoo/elements/image/image.js000066600000002575150771657550015327 0ustar00/* Copyright (C) YOOtheme GmbH, YOOtheme Proprietary Use License (http://www.yootheme.com/license) */ (function(d){var a=function(){};d.extend(a.prototype,{name:"ImageSubmission",options:{uri:""},initialize:function(a,c){this.options=d.extend({},this.options,c);var b=this;this.element=a;this.advanced=a.find("select.image");this.select_image=this.advanced.length?this.advanced:a.find("input.image");a.find("span.image-cancel").bind("click",function(){b.select_image.val("");b.sanatize()});this.advanced.length&&this.select_image.bind("change",function(){a.find("img").attr("src",b.options.uri+b.select_image.val()); b.sanatize()});b.sanatize()},sanatize:function(){this.select_image.val()?(this.element.find("div.image-select").addClass("hidden"),this.element.find("div.image-preview").removeClass("hidden")):(this.element.find("div.image-select").removeClass("hidden"),this.element.find("div.image-preview").addClass("hidden"))}});d.fn[a.prototype.name]=function(){var e=arguments,c=e[0]?e[0]:null;return this.each(function(){var b=d(this);if(a.prototype[c]&&b.data(a.prototype.name)&&"initialize"!=c)b.data(a.prototype.name)[c].apply(b.data(a.prototype.name), Array.prototype.slice.call(e,1));else if(!c||d.isPlainObject(c)){var f=new a;a.prototype.initialize&&f.initialize.apply(f,d.merge([b],e));b.data(a.prototype.name,f)}else d.error("Method "+c+" does not exist on jQuery."+a.name)})}})(jQuery); system/widgetkit_zoo/elements/image/image.php000066600000021066150771657550015476 0ustar00get('file'); return !empty($file) && JFile::exists(JPATH_ROOT.'/'.$this->get('file')); } /* Function: getSearchData Get elements search data. Returns: String - Search data */ public function getSearchData() { return $this->get('title'); } /* Function: render Renders the element. Parameters: $params - render parameter Returns: String - html */ public function render($params = array()) { // init vars $params = $this->app->data->create($params); $title = $this->get('title'); $file = $this->app->zoo->resizeImage(JPATH_ROOT.'/'.$this->get('file'), $params->get('width', 0), $params->get('height', 0)); $link = JURI::root() . $this->app->path->relative($file); $url = $target = $rel = ''; if ($params->get('link_to_item', false)) { if ($this->getItem()->getState()) { $url = $this->app->route->item($this->_item); $title = empty($title) ? $this->_item->name : $title; } } else if ($this->get('link')) { $url = $this->get('link'); $target = $this->get('target'); $rel = $this->get('rel'); } else if ($this->get('lightbox_image')) { $url = JURI::root() . $this->app->path->relative($this->app->zoo->resizeImage(JPATH_ROOT.'/'.$this->get('lightbox_image', ''), 0 , 0)); } // get alt $alt = empty($title) ? $this->_item->name : $title; // render layout if ($file && $layout = $this->getLayout()) { return $this->renderLayout($layout, compact('file', 'title', 'alt', 'link', 'params', 'url', 'target', 'rel') ); } return null; } /* Function: edit Renders the edit form field. Returns: String - html */ public function edit() { $this->app->document->addScript('assets:js/image.js'); if ($layout = $this->getLayout('edit.php')) { return $this->renderLayout($layout); } } /* Function: renderSubmission Renders the element in submission. Parameters: $params - AppData submission parameters Returns: String - html */ public function renderSubmission($params = array()) { // load js $this->app->document->addScript('elements:image/image.js'); // init vars $image = $this->get('file'); // is uploaded file $image = is_array($image) ? '' : $image; // get params $trusted_mode = $params->get('trusted_mode'); // build image select $lists = array(); if ($trusted_mode) { $options = array($this->app->html->_('select.option', '', '- '.JText::_('Select Image').' -')); if (!empty($image) && !$this->_inUploadPath($image)) { $options[] = $this->app->html->_('select.option', $image, '- '.JText::_('No Change').' -'); } $img_ext = str_replace(',', '|', trim(JComponentHelper::getParams('com_media')->get('image_extensions'), ',')); foreach ($this->app->path->files('root:'.$this->_getUploadImagePath(), false, '/\.('.$img_ext.')$/i') as $file) { $options[] = $this->app->html->_('select.option', $this->_getUploadImagePath().'/'.$file, $file); } $lists['image_select'] = $this->app->html->_('select.genericlist', $options, $this->getControlName('image'), 'class="image"', 'value', 'text', $image); } else { if (!empty($image)) { $image = $this->app->zoo->resizeImage($this->app->path->path('root:' . $image), 0, 0); $image = $this->app->path->relative($image); } } if (!empty($image)) { $image = $this->app->path->url('root:' . $image); } if ($layout = $this->getLayout('submission.php')) { return $this->renderLayout($layout, compact('lists', 'image', 'trusted_mode') ); } } /* Function: validateSubmission Validates the submitted element Parameters: $value - AppData value $params - AppData submission parameters Returns: Array - cleaned value */ public function validateSubmission($value, $params) { // init vars $trusted_mode = $params->get('trusted_mode'); // get old file value $old_file = $this->get('file'); $file = ''; // get file from select list if ($trusted_mode && $file = $value->get('image')) { if (!$this->_inUploadPath($file) && $file != $old_file) { throw new AppValidatorException(sprintf('This file is not located in the upload directory.')); } if (!JFile::exists($file)) { throw new AppValidatorException(sprintf('This file does not exist.')); } // get file from upload } else { try { // get the uploaded file information $userfile = $value->get('userfile', null); $max_upload_size = $this->config->get('max_upload_size', '512') * 1024; $max_upload_size = empty($max_upload_size) ? null : $max_upload_size; $file = $this->app->validator ->create('file', array('mime_type_group' => 'image', 'max_size' => $max_upload_size)) ->addMessage('mime_type_group', 'Uploaded file is not an image.') ->clean($userfile); } catch (AppValidatorException $e) { if ($e->getCode() != UPLOAD_ERR_NO_FILE) { throw $e; } if (!$trusted_mode && $old_file && $value->get('image')) { $file = $old_file; } } } if ($params->get('required') && empty($file)) { throw new AppValidatorException('Please select an image to upload.'); } $result = compact('file'); if ($trusted_mode) { $result['title'] = $this->app->validator->create('string', array('required' => false))->clean($value->get('title')); $result['link'] = $this->app->validator->create('url', array('required' => false), array('required' => 'Please enter an URL.'))->clean($value->get('link')); $result['target'] = $this->app->validator->create('', array('required' => false))->clean($value->get('target')); $result['rel'] = $this->app->validator->create('string', array('required' => false))->clean($value->get('rel')); } // connect to submission beforesave event $this->app->event->dispatcher->connect('submission:beforesave', array($this, 'submissionBeforeSave')); return $result; } protected function _inUploadPath($image) { return $this->_getUploadImagePath() == dirname($image); } protected function _getUploadImagePath() { return trim(trim($this->config->get('upload_directory', 'images/zoo/uploads/')), '\/'); } /* Function: submissionBeforeSave Callback before item submission is saved Returns: void */ public function submissionBeforeSave() { // get the uploaded file information if (($userfile = $this->get('file')) && is_array($userfile)) { // get file name $ext = $this->app->filesystem->getExtension($userfile['name']); $base_path = JPATH_ROOT . '/' . $this->_getUploadImagePath() . '/'; $file = $base_path . $userfile['name']; $filename = basename($file, '.'.$ext); $i = 1; while (JFile::exists($file)) { $file = $base_path . $filename . '-' . $i++ . '.' . $ext; } if (!JFile::upload($userfile['tmp_name'], $file)) { throw new AppException('Unable to upload file.'); } $this->app->zoo->putIndexFile(dirname($file)); $this->set('file', $this->app->path->relative($file)); } } /* Function: bindData Set data through data array. Parameters: $data - array Returns: Void */ public function bindData($data = array()) { parent::bindData($data); // add image width/height $file = $this->get('file'); if ($file && $filepath = $this->app->path->path('root:'.$file)) { $size = getimagesize($filepath); $this->set('width', ($size ? $size[0] : 0)); $this->set('height', ($size ? $size[1] : 0)); } } }system/widgetkit_zoo/elements/gallery/gallery.css000066600000005420150771657550016425 0ustar00/* Copyright (C) YOOtheme GmbH, YOOtheme Proprietary Use License (http://www.yootheme.com/license) */ /* * General ZOO Style Sheet */ /* Grid and Clearing Tools ----------------------------------------------------------------------------------------------------*/ .clearfix:before, .clearfix:after { content: ""; display: table; } .clearfix:after { clear: both; } /* Grid Units */ .width20 { width: 20%; } .width25 { width: 25%; } .width33 { width: 33.333%; } .width50 { width: 50%; } /* * ZOO Gallery Style Sheet */ .zoo-gallery .slides > li { position: absolute; } .zoo-gallery .slides, .zoo-gallery .nav { list-style: none; margin: 0; padding: 0; } .zoo-gallery .nav span { display: block; cursor: pointer; } .zoo-gallery .next, .zoo-gallery .prev { position: absolute; z-index: 5; cursor: pointer; } .zoo-gallery .caption { position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; padding: 10px; background: rgba(0,0,0,0.5); } .zoo-gallery .caption, .zoo-gallery .caption a { color: #fff; } .zoo-gallery .caption a { text-decoration: underline; } .zoo-gallery article > *:first-child { margin-top: 0; } .zoo-gallery article > *:first-child { margin-bottom: 0; } .zoo-gallery article > a:first-child, .zoo-gallery article > img:first-child, .zoo-gallery article > a:first-child > img { display: block; } /* * ZOO Gallery: Default Style */ .zoo-gallery-wall > * { display: block; float: left; } /* Margin ----------------------------------------------------------------------------------------------------*/ .zoo-gallery-wall.margin { margin: 0 -15px -15px 0; } .zoo-gallery-wall.margin > * { margin: 0 15px 15px 0; } /* Round Corners ----------------------------------------------------------------------------------------------------*/ .zoo-gallery-wall.round > *, .zoo-gallery-wall.round > * > img, .zoo-gallery-wall.round .spotlight > img + div { border-radius: 10px; overflow: hidden; } /* Webkit Fix */ .zoo-gallery-wall.round .spotlight[data-spotlight*="top"] .overlay { border-bottom-left-radius: 0; border-bottom-right-radius: 0; } .zoo-gallery-wall.round .spotlight[data-spotlight*="bottom"] .overlay { border-top-left-radius: 0; border-top-right-radius: 0; } /* Zoom Effect ----------------------------------------------------------------------------------------------------*/ .zoo-gallery-wall.zoom > * { -moz-transition: all 0.1s ease-out; -o-transition: all 0.1s ease-out; -webkit-transition: all 0.1s ease-out; transition: all 0.1s ease-out; } .zoo-gallery-wall.zoom > *:hover { z-index: 10; box-shadow: 8px 8px 15px rgba(0,0, 0, 0.4); -webkit-transform: rotate(0deg) scale(1.2); -o-transform: rotate(0deg) scale(1.2); -moz-transform: rotate(0deg) scale(1.2); -ms-transform: rotate(0deg) scale(1.2); transform: rotate(0deg) scale(1.2); }system/widgetkit_zoo/elements/gallery/tmpl/slideshow.php000066600000004641150771657550017746 0ustar00get('corners', 'square') == 'round') ? 'round ' : ''; $css_classes .= ($params->get('effect') == 'zoom') ? 'zoom ' : ''; $css_classes .= ($params->get('margin')) ? 'margin ' : ''; $settings = array(); foreach ((array) $params as $key => $value) { if (strpos($key, "slideshow_") === 0) { $settings[str_replace('slideshow_', '', $key)] = is_numeric($value) ? (float) $value : $value; } } $id = $this->identifier.'-'.uniqid(); ?> get('effect') == 'opacity') { $this->app->document->addScriptDeclaration(sprintf("jQuery(function($) { $('%s').opacity(); });", '#'.$id .' .thumb')); } ?> system/widgetkit_zoo/elements/gallery/tmpl/edit.php000066600000002336150771657550016671 0ustar00
app->html->_('control.text', $this->getControlName('title'), $title, 'maxlength="255" title="'.JText::_('Thumbnail Title').'" placeholder="'.JText::_('Thumbnail Title').'"'); ?>
system/widgetkit_zoo/elements/gallery/tmpl/lightbox.php000066600000003547150771657550017571 0ustar00get('corners', 'square') == 'round') ? 'round ' : ''; $css_classes .= ($params->get('effect') == 'zoom') ? 'zoom ' : ''; $css_classes .= ($params->get('margin')) ? 'margin ' : ''; $id = $this->identifier.'-'.uniqid(); ?> get('effect') == 'opacity') { $this->app->document->addScriptDeclaration(sprintf("jQuery(function($) { $('%s').opacity(); });", '#'.$id .' .thumb')); } system/widgetkit_zoo/elements/gallery/gallery.xml000066600000010666150771657550016445 0ustar00 Gallery YOOtheme July 2011 Copyright (C) YOOtheme GmbH info@yootheme.com http://www.yootheme.com 2.5.0 Widgetkit Gallery system/widgetkit_zoo/elements/gallery/gallery.js000066600000001516150771657550016253 0ustar00/* Copyright (C) YOOtheme GmbH, YOOtheme Proprietary Use License (http://www.yootheme.com/license) */ (function(b){var a=function(){};b.extend(a.prototype,{name:"opacity",initialize:function(a){a.each(function(){var a=b(this).find("img");a.css("opacity",0.3);b(this).bind("mouseenter",function(){a.fadeTo("fast",1)}).bind("mouseleave",function(){a.fadeTo("slow",0.3)})})}});b.fn[a.prototype.name]=function(){var e=arguments,c=e[0]?e[0]:null;return this.each(function(){var d=b(this);if(a.prototype[c]&&d.data(a.prototype.name)&&"initialize"!=c)d.data(a.prototype.name)[c].apply(d.data(a.prototype.name), Array.prototype.slice.call(e,1));else if(!c||b.isPlainObject(c)){var f=new a;a.prototype.initialize&&f.initialize.apply(f,b.merge([d],e));d.data(a.prototype.name,f)}else b.error("Method "+c+" does not exist on jQuery."+a.name)})}})(jQuery); system/widgetkit_zoo/elements/gallery/gallery.php000066600000015134150771657550016427 0ustar00app->system->application->isAdmin()) { // set callbacks $this->registerCallback('dirs'); } // connect to submission beforesubmissiondisplay event $this->app->event->dispatcher->connect('element:beforesubmissiondisplay', array($this, 'showInSubmission')); } /* Function: getDirectory Returns the directory with trailing slash. Returns: String - directory */ public function getDirectory() { return rtrim($this->config->get('directory'), '/').'/'; } public function getResource() { return 'root:'.$this->getDirectory().trim($this->get('value'), '/'); } public function getFiles() { return $this->app->path->files($this->getResource(), false, $this->filter); } /* Function: hasValue Checks if the element's value is set. Parameters: $params - AppData render parameter Returns: Boolean - true, on success */ public function hasValue($params = array()) { // init vars $params = $this->app->data->create($params); $value = $this->get('value'); if (empty($value)) { return false; } $thumbs = $this->_getThumbnails($params); return !empty($thumbs); } /* Function: render Renders the element. Parameters: $params - AppData render parameter Returns: String - html */ public function render($params = array()) { // init vars $params = $this->app->data->create($params); // get thumbnails $thumbs = $this->_getThumbnails($params); // no thumbnails found if (empty($thumbs)) { return JText::_('No thumbnails found'); } // limit thumbnails to count if (($count = (int) $params->get('count', 0)) && $count < count($thumbs)) { $thumbs = array_slice($thumbs, 0, $count); } // add css and javascript $this->app->document->addScript('elements:gallery/gallery.js'); $this->app->document->addStylesheet('elements:gallery/gallery.css'); if ($layout = $this->getLayout($params->get('mode', 'lightbox').'.php')) { return $this->renderLayout($layout, compact('thumbs', 'params')); } return null; } /* Function: edit Renders the edit form field. Returns: String - html */ public function edit() { // init vars $title = htmlspecialchars(html_entity_decode($this->get('title'), ENT_QUOTES), ENT_QUOTES); if ($layout = $this->getLayout('edit.php')) { return $this->renderLayout($layout, compact('title')); } return null; } /* Function: loadAssets Load elements css/js assets. Returns: Void */ public function loadAssets() { $this->app->document->addScript('assets:js/finder.js'); $this->app->document->addScript('elements:gallery/gallery.js'); } /* Function: dirs Get directory list JSON formatted Returns: Void */ public function dirs() { $dirs = array(); $path = $this->app->request->get('path', 'string'); foreach ($this->app->path->dirs('root:'.$this->getDirectory().$path) as $dir) { $count = count($this->app->path->files('root:'.$this->getDirectory().$path.'/'.$dir, false, $this->filter)); $dirs[] = array('name' => basename($dir) . " ($count)", 'path' => $path.'/'.$dir, 'type' => 'folder'); } return json_encode($dirs); } /* Function: renderSubmission Renders the element in submission. Parameters: $params - AppData submission parameters Returns: String - html */ public function renderSubmission($params = array()) { if ($params->get('trusted_mode', false)) { echo $this->app->html->_('control.selectdirectory', 'root:'.$this->_getDirectoryPath(), null, $this->getControlName('value'), $this->get('value')); } return false; } /* Function: validateSubmission Validates the submitted element Parameters: $value - AppData value $params - AppData submission parameters Returns: Array - cleaned value */ public function validateSubmission($value, $params) { $value = $value->get('value', ''); if ($params->get('required') && empty($value)) { throw new AppValidatorException('Please select a gallery folder.'); } if (!empty($value) && !$this->_inDirectoryPath($value)) { throw new AppValidatorException(sprintf('This file is not located in the upload directory.')); } return compact('value'); } protected function _getThumbnails($params) { $thumbs = array(); $width = (int) $params->get('width'); $height = (int) $params->get('height'); $title = $this->get('title', ''); $path = $this->app->path->path($this->getResource()).'/'; // set default thumbnail size, if incorrect sizes defined if ($width < 1 && $height < 1) { $width = 100; $height = null; } foreach ($this->getFiles() as $filename) { $file = $path.$filename; $thumb = $this->app->zoo->resizeImage($file, $width, $height); // if thumbnail exists, add it to return value if (is_file($thumb)) { // set image name or title if exsist $name = !empty($title) ? $title : $this->app->string->ucwords($this->app->string->str_ireplace('_', ' ', JFile::stripExt($filename))); // get image info list($thumb_width, $thumb_height) = @getimagesize($thumb); $thumbs[] = array( 'name' => $name, 'filename' => $filename, 'img' => JURI::root().$this->app->path->relative($file), 'img_file' => $file, 'thumb' => JURI::root().$this->app->path->relative($thumb), 'thumb_width' => $thumb_width, 'thumb_height' => $thumb_height ); } } usort($thumbs, create_function('$a,$b', 'return strcmp($a["filename"], $b["filename"]);')); switch ($params->get('order', 'asc')) { case 'random': shuffle($thumbs); break; case 'desc': $thumbs = array_reverse($thumbs); break; } return $thumbs; } protected function _inDirectoryPath($folder) { return (bool) $this->app->path->path('root:'.$this->_getDirectoryPath().'/'.$folder); } protected function _getDirectoryPath() { return trim(trim($this->config->get('directory', 'images/')), '\/'); } public function showInSubmission($event) { if ($event['element']->identifier == $this->identifier) { $event['render'] = (bool) $event['params']['trusted_mode']; } } }system/widgetkit_zoo/elements/link/tmpl/edit.php000066600000003757150771657550016177 0ustar00
app->html->_('control.text', $this->getControlName('value'), $this->get('value'), 'size="60" title="'.JText::_('Link').'"'); ?>
app->html->_('control.text', $this->getControlName('text'), $this->get('text'), 'size="60" title="'.JText::_('Text').'" placeholder="'.JText::_('Text').'"'); ?>
app->html->_('select.booleanlist', $this->getControlName('target'), '', $this->get('target', $this->config->get('default_target'))) ?>
app->html->_('control.text', $this->getControlName('custom_title'), $this->get('custom_title'), 'size="60" title="'.JText::_('Title').'" placeholder="'.JText::_('Title').'"'); ?>
app->html->_('control.text', $this->getControlName('rel'), $this->get('rel'), 'size="60" title="'.JText::_('Lightbox').'" placeholder="'.JText::_('Lightbox').'"'); ?>
config->get('add_protocol', 1)) : ?> Link YOOtheme August 2011 Copyright (C) YOOtheme GmbH info@yootheme.com http://www.yootheme.com 2.5.0 HTML Link
]]]> system/widgetkit_zoo/elements/link/link.php000066600000006510150771657550015221 0ustar00loader->register('ElementRepeatable', 'elements:repeatable/repeatable.php'); /* Class: ElementLink The link element class */ class ElementLink extends ElementRepeatable implements iRepeatSubmittable { /* Function: _hasValue Checks if the repeatables element's value is set. Parameters: $params - render parameter Returns: Boolean - true, on success */ protected function _hasValue($params = array()) { $link = $this->get('value', ''); return !empty($link); } /* Function: getText Gets the link text. Returns: String - text */ public function getText() { $text = $this->get('text', ''); return empty($text) ? $this->get('value', '') : $text; } /* Function: getTitle Gets the link title. Returns: String - title */ public function getTitle() { $title = $this->get('custom_title', ''); return empty($title) ? $this->getText() : $title; } /* Function: render Renders the repeatable element. Parameters: $params - render parameter Returns: String - html */ protected function _render($params = array()) { $target = ($this->get('target', $this->config->get('default_target', ''))) ? 'target="_blank"' : ''; $rel = $this->get('rel', ''); $rel = !empty($rel) ? 'data-lightbox="' . $rel .'"' : ''; return ''.$this->getText().''; } /* Function: _edit Renders the repeatable edit form field. Returns: String - html */ protected function _edit(){ return $this->_editForm(); } /* Function: _renderSubmission Renders the element in submission. Parameters: $params - AppData submission parameters Returns: String - html */ public function _renderSubmission($params = array()) { return $this->_editForm($params->get('trusted_mode')); } protected function _editForm($trusted_mode = true) { if ($layout = $this->getLayout('edit.php')) { return $this->renderLayout($layout, compact('trusted_mode') ); } } /* Function: _validateSubmission Validates the submitted element Parameters: $value - AppData value $params - AppData submission parameters Returns: Array - cleaned value */ public function _validateSubmission($value, $params) { $values = $value; $validator = $this->app->validator->create('string', array('required' => false)); $text = $validator->clean($values->get('text')); $target = $validator->clean($values->get('target')); $custom_title = $validator->clean($values->get('custom_title')); $rel = $validator->clean($values->get('rel')); $value = $this->app->validator ->create('url', array('required' => $params->get('required')), array('required' => 'Please enter an URL.')) ->clean($values->get('value')); return compact('value', 'text', 'target', 'custom_title', 'rel'); } }system/widgetkit_zoo/assets/js/dashboard.js000066600000002261150771657550015204 0ustar00/* Copyright (C) YOOtheme GmbH, YOOtheme Proprietary Use License (http://www.yootheme.com/license) */ (function(b){var a=function(){};b.extend(a.prototype,{name:"ZooDashboard",options:{edit_ids:[]},initialize:function(a,c){this.options=b.extend({},this.options,c);var d=this;a.find(".actions a.action.edit").each(function(){-1 img, .wk-zoo-item div.media > a > img, .wk-zoo-item div.media > object, .wk-zoo-item div.media > embed { display: block; } /* position: title */ .wk-zoo-item h3.title { margin: 0px; font-size: 20px; line-height: 26px; font-weight: normal; letter-spacing: 0px; } .wk-zoo-item h3.title a { text-decoration: none; } /* position: meta */ .wk-zoo-item p.meta { margin: 0px; font-size: 11px; color: #969696; line-height: 13px; font-style: italic; } /* position: description */ .wk-zoo-item div.description { margin: 10px 0px 0px 0px; } .wk-zoo-item div.description > div { margin-top: 5px; } .wk-zoo-item div.description > div:first-child { margin-top: 0px; } /* position: links */ .wk-zoo-item p.links { margin: 7px 0px 0px 0px; } .wk-zoo-item p.links a:after { content: " »"; font-size: 14px; } .wk-map .wk-zoo-item img { max-width: none; height: auto; }system/widgetkit_zoo/layouts/edit.php000066600000004316150771657550014142 0ustar00
render('title', array('title' => ($widget->id ? 'Edit' : 'Add').' ' . ucfirst($type))); ?>
">

ZOO Items

render('zoo[params]'); ?>

system/widgetkit_zoo/layouts/fields/filename.php000066600000001152150771657550016236 0ustar00attributes()->path; $options = array(); if (is_dir($path)) { foreach (JFolder::files($path, '^([-_A-Za-z0-9]*)\.php$') as $tmpl) { $tmpl = basename($tmpl, '.php'); $options[] = $this->app->html->_('select.option', $tmpl, ucwords($tmpl)); } } echo $this->app->html->_('select.genericlist', $options, $control_name.'['.$name.']', '', 'value', 'text', $value);system/widgetkit_zoo/widgetkit_zoo.xml000066600000001557150771657550014414 0ustar00 System - Widgetkit ZOO YOOtheme June 2011 Copyright (C) 2007 - 2011 YOOtheme GmbH http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only YOOtheme Proprietary Use License (http://www.yootheme.com/license) info@yootheme.com http://www.yootheme.com 1.0.0 ZOO plugin for Widgetkit developed by YOOtheme (http://www.yootheme.com) widgetkit_zoo.php assets elements layouts widgets system/widgetkit_zoo/widgetkit_zoo.php000066600000024305150771657550014377 0ustar00enabled || !JFile::exists(JPATH_ADMINISTRATOR.'/components/com_zoo/config.php') || !JComponentHelper::getComponent('com_zoo', true)->enabled) { return; } // load widgetkit require_once(JPATH_ADMINISTRATOR.'/components/com_widgetkit/classes/widgetkit.php'); // get widgetkit instance $this->widgetkit = Widgetkit::getInstance(); // load zoo require_once(JPATH_ADMINISTRATOR.'/components/com_zoo/config.php'); // check if Zoo > 2.4 is loaded if (!class_exists('App')) { return; } // get zoo instance $this->zoo = App::getInstance('zoo'); // check if Zoo > 2.5 if (version_compare($this->zoo->zoo->version(), '2.5') < 0) { return; } // load zoo language file $this->zoo->system->language->load('com_'.$this->zoo->id); // register plugin paths $path = $this->zoo->path->path('plugins:system/widgetkit_zoo/'); $this->widgetkit['path']->register($path, 'plugin.root'); $this->widgetkit['path']->register($path.'/widgets', 'zoowidgets'); $this->widgetkit['path']->register($path.'/assets', 'assets'); // register widgetkit element path $this->zoo->path->register($path.'/elements', 'elements'); // bind init event $this->widgetkit['event']->bind('admin', array($this, 'init')); $this->widgetkit['event']->bind('site', array($this, 'init')); $this->widgetkit['event']->bind('site', array($this, 'loadAssets')); // bind zoo type events $this->zoo->event->dispatcher->connect('layout:init', array($this, 'initTypeLayouts')); $this->zoo->event->dispatcher->connect('type:beforesave', array($this, 'beforeTypeSave')); $this->zoo->event->dispatcher->connect('type:copied', array($this, 'typeCopied')); $this->zoo->event->dispatcher->connect('type:deleted', array($this, 'typeDeleted')); } /* Function: init Init Admin Widgets Returns: void */ public function init() { // require widget files foreach ($this->widgetkit['path']->dirs('zoowidgets:') as $widget) { if ($file = $this->widgetkit['path']->path("zoowidgets:{$widget}/{$widget}.php")) { // require widget file require_once($file); } } } /* Function: loadAssets Load widgets css/js assets. Returns: Void */ public function loadAssets() { $this->widgetkit['asset']->addFile('css', 'assets:css/style.css'); } /* Function: initTypeLayouts Callback function for the zoo layouts Returns: void */ public function initTypeLayouts($event) { $extensions = (array) $event->getReturnValue(); // add zoo widgetkit widgets to modules $this->widgets = array(); foreach ($this->widgetkit['path']->dirs("zoowidgets:") as $widget) { if ($this->widgetkit['path']->path("zoowidgets:$widget/renderer")) { $name = JText::_('Widget') . ' ' . ucfirst($widget); $extensions[$name] = array('type' => 'modules', 'name' => $name, 'path' => $this->widgetkit['path']->path("zoowidgets:$widget")); } } $event->setReturnValue($extensions); } /* Function: beforeTypeSave Callback function for the zoo type save event Returns: void */ public function beforeTypeSave($event) { $type = $event->getSubject(); // clean and save layout positions if (!empty($type->id) && $type->id != $type->identifier) { // update modules foreach ($this->widgetkit['path']->dirs("zoowidgets:") as $widget) { if ($this->widgetkit['path']->path("zoowidgets:$widget/renderer")) { $this->zoo->type->sanatizePositionsConfig($this->widgetkit['path']->path("zoowidgets:$widget"), $type); } } } } /* Function: typeCopied Callback function for the zoo type copied event Returns: void */ public function typeCopied($event) { $type = $event->getSubject(); $old_id = $event['old_id']; // copy module positions foreach ($this->widgetkit['path']->dirs("zoowidgets:") as $widget) { if ($this->widgetkit['path']->path("zoowidgets:$widget/renderer")) { $this->zoo->type->copyPositionsConfig($old_id, $this->widgetkit['path']->path("zoowidgets:$widget"), $type); } } } /* Function: typeDeleted Callback function for the zoo type deleted event Returns: void */ public function typeDeleted($event) { $type = $event->getSubject(); // remove module positions foreach ($this->widgetkit['path']->dirs("zoowidgets:") as $widget) { if ($this->widgetkit['path']->path("zoowidgets:$widget/renderer")) { $this->zoo->type->sanatizePositionsConfig($this->widgetkit['path']->path("zoowidgets:$widget"), $type, true); } } } } /* Class: ZooWidget Zoo Widget base class */ class ZooWidget { /* ZOO app */ public $zoo; /* widgetkit */ public $widgetkit; /* type */ public $type; /* options */ public $options; /* Function: Constructor Class Constructor. */ public function __construct() { // init vars $this->zoo = App::getInstance('zoo'); $this->widgetkit = Widgetkit::getInstance(); $this->type = strtolower(str_replace('Zoo', '', get_class($this))); $this->options = $this->widgetkit['system']->options; // bind events $this->widgetkit['event']->bind('dashboard', array($this, 'dashboard')); $this->widgetkit['event']->bind("render", array($this, 'render')); $this->widgetkit['event']->bind("task:edit_{$this->type}_zoo", array($this, 'edit')); $this->widgetkit['event']->bind("task:save_{$this->type}_zoo", array($this, 'save')); // register path $this->widgetkit['path']->register($this->widgetkit['path']->path('zoowidgets:'.$this->type), "zoo{$this->type}"); } /* Function: dashboard Render dashboard layout Returns: Void */ public function dashboard() { // add js $this->widgetkit['asset']->addFile('js', 'assets:js/dashboard.js'); $widget_ids = array(); foreach ($this->widgetkit['widget']->all($this->type) as $widget) { if (isset($widget->zoo)) { $widget_ids[] = $widget->id; } } $this->widgetkit['asset']->addString('js', 'jQuery(function($) { $(\'div.dashboard #'.$this->type.'\').ZooDashboard({edit_ids : '.json_encode($widget_ids).'}); });'); } /* Function: edit Edit action Returns: Void */ public function edit($id = null) { // load tooltip behavior $this->zoo->html->_('behavior.tooltip'); // get xml settings and widget $xml = simplexml_load_file($this->widgetkit['path']->path("{$this->type}:{$this->type}.xml")); $widget = $this->widgetkit[$this->type]->get($id ? $id : $this->widgetkit['request']->get('id', 'int')); // get style and xml $style = isset($widget->settings['style']) ? $widget->settings['style'] : 'default'; $style_xml = simplexml_load_file($this->widgetkit['path']->path("{$this->type}:styles/{$style}/config.xml")); $params = isset($widget->zoo['params']) ? $widget->zoo['params'] : array(); // get form $form = $this->zoo->parameterform->create($this->widgetkit['path']->path("zoo{$this->type}:{$this->type}.xml")); $form->setValues($params); $form->addElementPath($this->widgetkit['path']->path('plugin.root:layouts/fields')); $type = $this->type; echo $this->widgetkit['template']->render("plugin.root:layouts/edit", compact('widget', 'xml', 'style_xml', 'form', 'type')); } /* Function: render Render widget on site Returns: String */ public function render($widget) { if (isset($widget->zoo['params']) && $widget->type == $this->type) { $widget->items = array(); $params = $this->zoo->data->create($widget->zoo['params']); if ($application = $this->zoo->table->application->get($params->get('application', 0))) { // load template if (($zoo_items = $this->zoo->module->getItems($params)) && !empty($zoo_items)) { // set renderer $renderer = $this->zoo->renderer->create('item')->addPath(array($this->zoo->path->path('component.site:'), $this->widgetkit['path']->path('zoowidgets:'.$widget->type))); $i = 0; $widget_items = array(); foreach ($zoo_items as $item) { // add the item itself $widget_items[$i]['zooitem'] = $item; // add item title $widget_items[$i]['title'] = $item->name; // add item content $widget_items[$i]['content'] = $renderer->render('item.'.$params->get('layout'), compact('item', 'params')); // add item special positions $style = isset($widget->settings['style']) ? $widget->settings['style'] : 'default'; $style_xml = simplexml_load_file($this->widgetkit['path']->path("{$this->type}:styles/{$style}/config.xml")); foreach ($style_xml->xpath('fields/field') as $field) { $name = (string) $field->attributes()->name; if (!in_array($name, array('title', 'content'))) { $widget_items[$i][$name] = $renderer->checkPosition($name) ? $renderer->renderPosition($name) : ''; } } $i++; } $widget->items = $widget_items; } } } } /* Function: save Save action Returns: Void */ public function save() { // save data $data['type'] = $this->type; $data['id'] = $this->widgetkit['request']->get('id', 'int'); $data['name'] = $this->widgetkit['request']->get('name', 'string'); $data['settings'] = $this->widgetkit['request']->get('settings', 'array'); $data['style'] = $this->widgetkit['request']->get('settings.style', 'array'); $data['zoo'] = $this->widgetkit['request']->get('zoo', 'array'); // convert numeric strings to real integers if (isset($data["settings"]) && is_array($data["settings"])) { $data["settings"] = array_map(create_function('$item', 'return is_numeric($item) ? (float) $item : $item;'), $data["settings"]); } $this->edit($this->widgetkit['widget']->save($data)); } }system/widgetkit_zoo/widgets/map/map.php000066600000006073150771657550014517 0ustar00zoo['params']) && $widget->type == 'map') { $params = $this->zoo->data->create($widget->zoo['params']); if ($application = $this->zoo->table->application->get($params->get('application', 0))) { // load template if (($zoo_items = $this->zoo->module->getItems($params)) && !empty($zoo_items)) { // set renderer $renderer = $this->zoo->renderer->create('item')->addPath(array($this->zoo->path->path('component.site:'), $this->widgetkit['path']->path('zoowidgets:'.$widget->type))); // init cache $cache = $this->zoo->cache->create($this->zoo->path->path('cache:') . '/geocode_cache'); // get center marker $i = 0; $widget_items = array(); if ($location = $params->get('location', false)) { try { if ($coordinates = $this->zoo->googlemaps->locate($location, $cache)) { // add item title $widget_items[$i]['title'] = 'TEST'; $widget_items[$i]['lat'] = $coordinates['lat']; $widget_items[$i]['lng'] = $coordinates['lng']; // default icon $widget_items[$i]['icon'] = $params->get('main_icon'); // add item popup $widget_items[$i]['popup'] = $this->zoo->googlemaps->stripText($params->get('marker_text', '')); $i++; } } catch (GooglemapsHelperException $e) { echo "
({$e})
\n"; } } foreach ($zoo_items as $item) { // if there is no center marker, show popup for item if ($i == 0 && $widget->settings['popup'] == 0) { $settings = $widget->settings; $settings['popup'] = 1; $widget->settings = $settings; } // location $elements = $item->getElements(); foreach ($elements as $element) { if (($element->getElementType() == 'googlemaps') && $element->hasValue()) { try { if ($coordinates = $this->zoo->googlemaps->locate($element->get('location'), $cache)) { // add item title $widget_items[$i]['title'] = $item->name; $widget_items[$i]['lat'] = $coordinates['lat']; $widget_items[$i]['lng'] = $coordinates['lng']; // default icon $widget_items[$i]['icon'] = $params->get('icon'); // add item popup $widget_items[$i]['popup'] = $renderer->render('item.'.$params->get('layout'), compact('item', 'params')); } } catch (GooglemapsHelperException $e) { echo "
({$e})
\n"; } } } $i++; } $widget->items = $widget_items; // save location to geocode cache if ($cache) $cache->save(); } } } } } // instantiate ZooMap new ZooMap(); system/widgetkit_zoo/widgets/map/map.xml000066600000006233150771657550014526 0ustar00 system/widgetkit_zoo/widgets/map/renderer/item/metadata.xml000066600000001303150771657550020266 0ustar00 Article This is the article layout to render an item in the widgetkit themes. Image This is the image layout to render an item image in the widgetkit themes. Article 2 This is an alternative layout to render an item in the widgetkit themes. UIkit This is an UIkit layout to render an item in the module themes. system/widgetkit_zoo/widgets/map/renderer/item/article2.php000066600000003262150771657550020210 0ustar00get('media_position', 'top'); ?>
checkPosition('media')) : ?>
renderPosition('media'); ?>
checkPosition('title')) : ?>

renderPosition('title'); ?>

checkPosition('meta')) : ?>

renderPosition('meta', array('style' => 'comma')); ?>

checkPosition('media')) : ?>
renderPosition('media'); ?>
checkPosition('description')) : ?>
renderPosition('description', array('style' => 'block')); ?>
checkPosition('media')) : ?>
renderPosition('media'); ?>
checkPosition('links')) : ?>
system/widgetkit_zoo/widgets/map/renderer/item/positions.xml000066600000001714150771657550020543 0ustar00 Title Media Meta Description Links Media Title Media Meta Description Links Title Media Meta Description Links system/widgetkit_zoo/widgets/map/renderer/item/positions.config000066600000025131150771657550021207 0ustar00 { "blog.article.article": { "title": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } }, "media": { "0": { "showlabel": "0", "altlabel": "", "width": "200", "height": "150", "link_to_item": "1", "element": "c26feca6-b2d4-47eb-a74d-b067aaae5b90" } }, "meta": { "0": { "showlabel": "1", "altlabel": "", "element": "_itemauthor" } }, "description": { "1": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "first", "element": "2e3c9e69-1f9e-4647-8d13-4e88094d2790" } }, "links": { "0": { "showlabel": "0", "altlabel": "", "element": "_itemlink" }, "1": { "showlabel": "0", "altlabel": "", "single_comment_text": "%s Comment", "multiple_comments_text": "%s Comments", "no_comments_text": "No Comments", "element": "_itemcommentslink" } } }, "business.company.article": { "title": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } }, "media": { "0": { "showlabel": "0", "altlabel": "", "width": "200", "height": "150", "link_to_item": "1", "element": "ffcc1c50-8dbd-4115-b463-b43bdcd44a57" } }, "meta": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "separator=[ ]", "element": "ed9cdd4c-ae8b-4ecb-bca7-e12a5153bc02" } }, "description": { "0": { "showlabel": "0", "altlabel": "", "rating_disabled": "1", "show_message": "0", "element": "cf6dd846-5774-47aa-8ca7-c1623c06e130" }, "1": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "first", "element": "a77f06fc-1561-453c-a429-8dd05cdc29f5" } }, "links": { "0": { "showlabel": "0", "altlabel": "", "element": "_itemlink" }, "1": { "showlabel": "0", "altlabel": "", "single_comment_text": "%s Comment", "multiple_comments_text": "%s Comments", "no_comments_text": "No Comments", "element": "_itemcommentslink" } } }, "cookbook.recipe.article": { "title": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } }, "media": { "0": { "showlabel": "0", "altlabel": "", "width": "200", "height": "150", "link_to_item": "1", "element": "ff94e00f-5055-439f-8c3e-fe5bef815ad1" } }, "meta": { "0": { "showlabel": "1", "altlabel": "", "separated_by": "separator=[ ]", "element": "23bacf33-73b5-4cd7-89cf-0302981d9f7a" }, "1": { "showlabel": "1", "altlabel": "", "separated_by": "separator=[ ]", "element": "65930fe3-b0ff-435d-b95f-77189e6152cd" }, "2": { "showlabel": "1", "altlabel": "", "separated_by": "separator=[ ]", "element": "242ce9a3-38b5-4190-b309-32779145e3f3" } }, "description": { "0": { "showlabel": "0", "altlabel": "", "rating_disabled": "1", "show_message": "0", "element": "3194f2e2-b29e-4a6b-8555-17c58b42ed6c" }, "1": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "all", "element": "35155961-b9ae-48d4-b4aa-1a569ec7930c" } }, "links": { "0": { "showlabel": "0", "altlabel": "", "element": "_itemlink" }, "1": { "showlabel": "0", "altlabel": "", "single_comment_text": "%s Comment", "multiple_comments_text": "%s Comments", "no_comments_text": "No Comments", "element": "_itemcommentslink" } } }, "cookbook.recipe.image": { "media": { "0": { "showlabel": "0", "altlabel": "", "width": "400", "height": "250", "link_to_item": "1", "element": "ff94e00f-5055-439f-8c3e-fe5bef815ad1" } } }, "blog.article.image": { "media": { "0": { "showlabel": "0", "altlabel": "", "width": "400", "height": "250", "link_to_item": "1", "element": "c26feca6-b2d4-47eb-a74d-b067aaae5b90" } } }, "blog.author.article": { "title": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } }, "media": { "0": { "showlabel": "0", "altlabel": "", "width": "150", "height": "170", "link_to_item": "1", "element": "ffefb4ed-8d5d-452a-8794-ea82c013384e" } }, "description": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "first", "element": "14c0dd9f-ae3c-4eb2-8e22-4e9294ad3120" } }, "links": { "0": { "showlabel": "0", "altlabel": "", "element": "_itemlink" } } }, "business.employee.article": { "title": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } }, "media": { "0": { "showlabel": "0", "altlabel": "", "width": "150", "height": "170", "link_to_item": "1", "element": "96624fe5-ff5a-4f1b-800e-a125e3980d43" } }, "meta": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "separator=[ ]", "element": "507fbea1-7974-4a67-aec8-3649cc41a067" }, "1": { "showlabel": "0", "altlabel": "", "order": "", "separated_by": "separator=[ ]", "layout": "", "link_to_item": "1", "element": "9f6a2113-ff5b-4974-9c19-5cb8eafb41ef" } }, "description": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "first", "element": "241905cc-36d4-4611-a1d5-fadfe280f70e" } }, "links": { "0": { "showlabel": "0", "altlabel": "", "element": "_itemlink" } } }, "business.company.image": { "media": { "0": { "showlabel": "0", "altlabel": "", "width": "400", "height": "250", "link_to_item": "1", "element": "ffcc1c50-8dbd-4115-b463-b43bdcd44a57" } } }, "documentation.page.article": { "meta": { "0": { "showlabel": "1", "altlabel": "Written by", "separated_by": "separator=[ ]", "element": "6bc47900-08c1-45ab-a4a2-ed74a58e1d5e" }, "1": { "showlabel": "1", "altlabel": "Published on", "date_format": "%A, %d %B %Y", "custom_format": "", "element": "_itemcreated" }, "2": { "showlabel": "1", "altlabel": "Posted in", "linked": "1", "separated_by": "separator=[ ]", "element": "_itemcategory" } }, "description": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "all", "element": "32a20413-8157-462f-8acc-6abe123f5fc3" } }, "links": { "0": { "showlabel": "0", "altlabel": "", "element": "_itemlink" }, "1": { "showlabel": "0", "altlabel": "", "single_comment_text": "%s Comment", "multiple_comments_text": "%s Comments", "no_comments_text": "No Comments", "element": "_itemcommentslink" } } }, "download.file.article": { "title": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } }, "media": { "0": { "showlabel": "0", "altlabel": "", "display": "imagelink", "download_name": "Download {filename}", "element": "f85c494b-2b32-4109-b8c1-083cca2b7db6" } }, "meta": { "0": { "showlabel": "1", "altlabel": "", "separated_by": "separator=[ ]", "element": "dbb6e295-9609-4fcc-a527-bc6eac248a6a" } }, "description": { "0": { "showlabel": "0", "altlabel": "", "rating_disabled": "1", "show_message": "0", "element": "c2f19082-507f-4778-9ddb-aa2d6889d6be" }, "1": { "showlabel": "0", "altlabel": "", "separated_by": "separator=[ ]", "element": "b9e826b5-e671-4fe8-a447-bf08c8c6b8e4" } }, "links": { "0": { "showlabel": "0", "altlabel": "", "element": "_itemlink" }, "1": { "showlabel": "0", "altlabel": "", "single_comment_text": "%s Comment", "multiple_comments_text": "%s Comments", "no_comments_text": "No Comments", "element": "_itemcommentslink" } } }, "movie.movie.article": { "title": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } }, "media": { "0": { "showlabel": "0", "altlabel": "", "width": "170", "height": "240", "link_to_item": "1", "element": "540aa2ad-9a8d-454d-b915-605b884e76d5" } }, "meta": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "separator=[ ]", "element": "40405a26-d781-4f80-86f6-bc8587c59755" }, "1": { "showlabel": "0", "altlabel": "", "separated_by": "separator=[ ]", "date_format": "%A, %d %B %Y", "custom_format": "", "element": "8a220e32-6975-41ec-9c26-4f73f18d47d3" } }, "description": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "all", "element": "b40b44c8-a289-46b6-a6da-9f9824714762" } }, "links": { "0": { "showlabel": "0", "altlabel": "", "element": "_itemlink" }, "1": { "showlabel": "0", "altlabel": "", "single_comment_text": "%s Comment", "multiple_comments_text": "%s Comments", "no_comments_text": "No Comments", "element": "_itemcommentslink" } } }, "movie.person.article": { "title": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } }, "media": { "0": { "showlabel": "0", "altlabel": "", "width": "150", "height": "170", "link_to_item": "1", "element": "93d283c0-eee0-473e-bf68-e5ebc3c3338e" } }, "meta": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "separator=[ ]", "date_format": "%A, %d %B %Y", "custom_format": "", "element": "01487dbf-e63a-446e-a099-b07be96570a3" }, "1": { "showlabel": "0", "altlabel": "", "separated_by": "separator=[ ]", "element": "f34a0b21-d430-4e19-a0d4-bc2820958b76" } }, "description": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "first", "element": "a552a157-ce11-4b11-ad34-5de19e065d53" } }, "links": { "0": { "showlabel": "0", "altlabel": "", "element": "_itemlink" } } }, "page.page.article": { "title": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } } } }system/widgetkit_zoo/widgets/map/renderer/item/article.php000066600000003262150771657550020126 0ustar00get('media_position', 'top'); ?>
checkPosition('media')) : ?>
renderPosition('media'); ?>
checkPosition('title')) : ?>

renderPosition('title'); ?>

checkPosition('meta')) : ?>

renderPosition('meta', array('style' => 'comma')); ?>

checkPosition('media')) : ?>
renderPosition('media'); ?>
checkPosition('description')) : ?>
renderPosition('description', array('style' => 'block')); ?>
checkPosition('media')) : ?>
renderPosition('media'); ?>
checkPosition('links')) : ?>
system/widgetkit_zoo/widgets/map/renderer/item/image.php000066600000000547150771657550017570 0ustar00 checkPosition('media')) : ?> renderPosition('media'); ?> Article This is the article layout to render an item in the widgetkit themes. Image This is the image layout to render an item image in the widgetkit themes. Article 2 This is an alternative layout to render an item in the widgetkit themes. UIkit This is an UIkit layout to render an item in the module themes. system/widgetkit_zoo/widgets/accordion/renderer/item/article2.php000066600000003262150771657550021374 0ustar00get('media_position', 'top'); ?>
checkPosition('media')) : ?>
renderPosition('media'); ?>
checkPosition('title')) : ?>

renderPosition('title'); ?>

checkPosition('meta')) : ?>

renderPosition('meta', array('style' => 'comma')); ?>

checkPosition('media')) : ?>
renderPosition('media'); ?>
checkPosition('description')) : ?>
renderPosition('description', array('style' => 'block')); ?>
checkPosition('media')) : ?>
renderPosition('media'); ?>
checkPosition('links')) : ?>
system/widgetkit_zoo/widgets/accordion/renderer/item/positions.xml000066600000002126150771657550021725 0ustar00 Title Media Meta Description Links Caption Media Caption Title Media Meta Description Links Caption Title Media Meta Description Links system/widgetkit_zoo/widgets/accordion/renderer/item/positions.config000066600000025131150771657550022373 0ustar00 { "blog.article.article": { "title": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } }, "media": { "0": { "showlabel": "0", "altlabel": "", "width": "200", "height": "150", "link_to_item": "1", "element": "c26feca6-b2d4-47eb-a74d-b067aaae5b90" } }, "meta": { "0": { "showlabel": "1", "altlabel": "", "element": "_itemauthor" } }, "description": { "1": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "first", "element": "2e3c9e69-1f9e-4647-8d13-4e88094d2790" } }, "links": { "0": { "showlabel": "0", "altlabel": "", "element": "_itemlink" }, "1": { "showlabel": "0", "altlabel": "", "single_comment_text": "%s Comment", "multiple_comments_text": "%s Comments", "no_comments_text": "No Comments", "element": "_itemcommentslink" } } }, "business.company.article": { "title": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } }, "media": { "0": { "showlabel": "0", "altlabel": "", "width": "200", "height": "150", "link_to_item": "1", "element": "ffcc1c50-8dbd-4115-b463-b43bdcd44a57" } }, "meta": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "separator=[ ]", "element": "ed9cdd4c-ae8b-4ecb-bca7-e12a5153bc02" } }, "description": { "0": { "showlabel": "0", "altlabel": "", "rating_disabled": "1", "show_message": "0", "element": "cf6dd846-5774-47aa-8ca7-c1623c06e130" }, "1": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "first", "element": "a77f06fc-1561-453c-a429-8dd05cdc29f5" } }, "links": { "0": { "showlabel": "0", "altlabel": "", "element": "_itemlink" }, "1": { "showlabel": "0", "altlabel": "", "single_comment_text": "%s Comment", "multiple_comments_text": "%s Comments", "no_comments_text": "No Comments", "element": "_itemcommentslink" } } }, "cookbook.recipe.article": { "title": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } }, "media": { "0": { "showlabel": "0", "altlabel": "", "width": "200", "height": "150", "link_to_item": "1", "element": "ff94e00f-5055-439f-8c3e-fe5bef815ad1" } }, "meta": { "0": { "showlabel": "1", "altlabel": "", "separated_by": "separator=[ ]", "element": "23bacf33-73b5-4cd7-89cf-0302981d9f7a" }, "1": { "showlabel": "1", "altlabel": "", "separated_by": "separator=[ ]", "element": "65930fe3-b0ff-435d-b95f-77189e6152cd" }, "2": { "showlabel": "1", "altlabel": "", "separated_by": "separator=[ ]", "element": "242ce9a3-38b5-4190-b309-32779145e3f3" } }, "description": { "0": { "showlabel": "0", "altlabel": "", "rating_disabled": "1", "show_message": "0", "element": "3194f2e2-b29e-4a6b-8555-17c58b42ed6c" }, "1": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "all", "element": "35155961-b9ae-48d4-b4aa-1a569ec7930c" } }, "links": { "0": { "showlabel": "0", "altlabel": "", "element": "_itemlink" }, "1": { "showlabel": "0", "altlabel": "", "single_comment_text": "%s Comment", "multiple_comments_text": "%s Comments", "no_comments_text": "No Comments", "element": "_itemcommentslink" } } }, "cookbook.recipe.image": { "media": { "0": { "showlabel": "0", "altlabel": "", "width": "400", "height": "250", "link_to_item": "1", "element": "ff94e00f-5055-439f-8c3e-fe5bef815ad1" } } }, "blog.article.image": { "media": { "0": { "showlabel": "0", "altlabel": "", "width": "400", "height": "250", "link_to_item": "1", "element": "c26feca6-b2d4-47eb-a74d-b067aaae5b90" } } }, "blog.author.article": { "title": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } }, "media": { "0": { "showlabel": "0", "altlabel": "", "width": "150", "height": "170", "link_to_item": "1", "element": "ffefb4ed-8d5d-452a-8794-ea82c013384e" } }, "description": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "first", "element": "14c0dd9f-ae3c-4eb2-8e22-4e9294ad3120" } }, "links": { "0": { "showlabel": "0", "altlabel": "", "element": "_itemlink" } } }, "business.employee.article": { "title": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } }, "media": { "0": { "showlabel": "0", "altlabel": "", "width": "150", "height": "170", "link_to_item": "1", "element": "96624fe5-ff5a-4f1b-800e-a125e3980d43" } }, "meta": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "separator=[ ]", "element": "507fbea1-7974-4a67-aec8-3649cc41a067" }, "1": { "showlabel": "0", "altlabel": "", "order": "", "separated_by": "separator=[ ]", "layout": "", "link_to_item": "1", "element": "9f6a2113-ff5b-4974-9c19-5cb8eafb41ef" } }, "description": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "first", "element": "241905cc-36d4-4611-a1d5-fadfe280f70e" } }, "links": { "0": { "showlabel": "0", "altlabel": "", "element": "_itemlink" } } }, "business.company.image": { "media": { "0": { "showlabel": "0", "altlabel": "", "width": "400", "height": "250", "link_to_item": "1", "element": "ffcc1c50-8dbd-4115-b463-b43bdcd44a57" } } }, "documentation.page.article": { "meta": { "0": { "showlabel": "1", "altlabel": "Written by", "separated_by": "separator=[ ]", "element": "6bc47900-08c1-45ab-a4a2-ed74a58e1d5e" }, "1": { "showlabel": "1", "altlabel": "Published on", "date_format": "%A, %d %B %Y", "custom_format": "", "element": "_itemcreated" }, "2": { "showlabel": "1", "altlabel": "Posted in", "linked": "1", "separated_by": "separator=[ ]", "element": "_itemcategory" } }, "description": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "all", "element": "32a20413-8157-462f-8acc-6abe123f5fc3" } }, "links": { "0": { "showlabel": "0", "altlabel": "", "element": "_itemlink" }, "1": { "showlabel": "0", "altlabel": "", "single_comment_text": "%s Comment", "multiple_comments_text": "%s Comments", "no_comments_text": "No Comments", "element": "_itemcommentslink" } } }, "download.file.article": { "title": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } }, "media": { "0": { "showlabel": "0", "altlabel": "", "display": "imagelink", "download_name": "Download {filename}", "element": "f85c494b-2b32-4109-b8c1-083cca2b7db6" } }, "meta": { "0": { "showlabel": "1", "altlabel": "", "separated_by": "separator=[ ]", "element": "dbb6e295-9609-4fcc-a527-bc6eac248a6a" } }, "description": { "0": { "showlabel": "0", "altlabel": "", "rating_disabled": "1", "show_message": "0", "element": "c2f19082-507f-4778-9ddb-aa2d6889d6be" }, "1": { "showlabel": "0", "altlabel": "", "separated_by": "separator=[ ]", "element": "b9e826b5-e671-4fe8-a447-bf08c8c6b8e4" } }, "links": { "0": { "showlabel": "0", "altlabel": "", "element": "_itemlink" }, "1": { "showlabel": "0", "altlabel": "", "single_comment_text": "%s Comment", "multiple_comments_text": "%s Comments", "no_comments_text": "No Comments", "element": "_itemcommentslink" } } }, "movie.movie.article": { "title": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } }, "media": { "0": { "showlabel": "0", "altlabel": "", "width": "170", "height": "240", "link_to_item": "1", "element": "540aa2ad-9a8d-454d-b915-605b884e76d5" } }, "meta": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "separator=[ ]", "element": "40405a26-d781-4f80-86f6-bc8587c59755" }, "1": { "showlabel": "0", "altlabel": "", "separated_by": "separator=[ ]", "date_format": "%A, %d %B %Y", "custom_format": "", "element": "8a220e32-6975-41ec-9c26-4f73f18d47d3" } }, "description": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "all", "element": "b40b44c8-a289-46b6-a6da-9f9824714762" } }, "links": { "0": { "showlabel": "0", "altlabel": "", "element": "_itemlink" }, "1": { "showlabel": "0", "altlabel": "", "single_comment_text": "%s Comment", "multiple_comments_text": "%s Comments", "no_comments_text": "No Comments", "element": "_itemcommentslink" } } }, "movie.person.article": { "title": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } }, "media": { "0": { "showlabel": "0", "altlabel": "", "width": "150", "height": "170", "link_to_item": "1", "element": "93d283c0-eee0-473e-bf68-e5ebc3c3338e" } }, "meta": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "separator=[ ]", "date_format": "%A, %d %B %Y", "custom_format": "", "element": "01487dbf-e63a-446e-a099-b07be96570a3" }, "1": { "showlabel": "0", "altlabel": "", "separated_by": "separator=[ ]", "element": "f34a0b21-d430-4e19-a0d4-bc2820958b76" } }, "description": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "first", "element": "a552a157-ce11-4b11-ad34-5de19e065d53" } }, "links": { "0": { "showlabel": "0", "altlabel": "", "element": "_itemlink" } } }, "page.page.article": { "title": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } } } }system/widgetkit_zoo/widgets/accordion/renderer/item/article.php000066600000003262150771657550021312 0ustar00get('media_position', 'top'); ?>
checkPosition('media')) : ?>
renderPosition('media'); ?>
checkPosition('title')) : ?>

renderPosition('title'); ?>

checkPosition('meta')) : ?>

renderPosition('meta', array('style' => 'comma')); ?>

checkPosition('media')) : ?>
renderPosition('media'); ?>
checkPosition('description')) : ?>
renderPosition('description', array('style' => 'block')); ?>
checkPosition('media')) : ?>
renderPosition('media'); ?>
checkPosition('links')) : ?>
system/widgetkit_zoo/widgets/accordion/renderer/item/image.php000066600000000547150771657550020754 0ustar00 checkPosition('media')) : ?> renderPosition('media'); ?> system/widgetkit_zoo/widgets/slideshow/slideshow.php000066600000000477150771657550017171 0ustar00 Article This is the article layout to render an item in the widgetkit themes. Image This is the image layout to render an item image in the widgetkit themes. Article 2 This is an alternative layout to render an item in the widgetkit themes. UIkit This is an UIkit layout to render an item in the module themes. system/widgetkit_zoo/widgets/slideshow/renderer/item/article2.php000066600000003262150771657550021434 0ustar00get('media_position', 'top'); ?>
checkPosition('media')) : ?>
renderPosition('media'); ?>
checkPosition('title')) : ?>

renderPosition('title'); ?>

checkPosition('meta')) : ?>

renderPosition('meta', array('style' => 'comma')); ?>

checkPosition('media')) : ?>
renderPosition('media'); ?>
checkPosition('description')) : ?>
renderPosition('description', array('style' => 'block')); ?>
checkPosition('media')) : ?>
renderPosition('media'); ?>
checkPosition('links')) : ?>
system/widgetkit_zoo/widgets/slideshow/renderer/item/positions.xml000066600000002362150771657550021767 0ustar00 Title Media Meta Description Links Caption Navigation Media Caption Navigation Title Media Meta Description Links Caption Navigation Title Media Meta Description Links system/widgetkit_zoo/widgets/slideshow/renderer/item/positions.config000066600000031612150771657550022434 0ustar00 { "blog.article.article": { "title": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } }, "media": { "0": { "showlabel": "0", "altlabel": "", "width": "", "height": "", "link_to_item": "1", "element": "c26feca6-b2d4-47eb-a74d-b067aaae5b90" } }, "meta": { "0": { "showlabel": "1", "altlabel": "", "element": "_itemauthor" } }, "description": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "first", "element": "2e3c9e69-1f9e-4647-8d13-4e88094d2790" } }, "links": { "0": { "showlabel": "0", "altlabel": "", "element": "_itemlink" }, "1": { "showlabel": "0", "altlabel": "", "single_comment_text": "%s Comment", "multiple_comments_text": "%s Comments", "no_comments_text": "No Comments", "element": "_itemcommentslink" } } }, "business.company.article": { "title": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } }, "media": { "0": { "showlabel": "0", "altlabel": "", "width": "", "height": "", "link_to_item": "1", "element": "ffcc1c50-8dbd-4115-b463-b43bdcd44a57" } }, "meta": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "separator=[ ]", "element": "ed9cdd4c-ae8b-4ecb-bca7-e12a5153bc02" } }, "description": { "0": { "showlabel": "0", "altlabel": "", "rating_disabled": "1", "show_message": "0", "element": "cf6dd846-5774-47aa-8ca7-c1623c06e130" }, "1": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "first", "element": "a77f06fc-1561-453c-a429-8dd05cdc29f5" } }, "links": { "0": { "showlabel": "0", "altlabel": "", "element": "_itemlink" }, "1": { "showlabel": "0", "altlabel": "", "single_comment_text": "%s Comment", "multiple_comments_text": "%s Comments", "no_comments_text": "No Comments", "element": "_itemcommentslink" } } }, "cookbook.recipe.article": { "title": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } }, "media": { "0": { "showlabel": "0", "altlabel": "", "width": "", "height": "", "link_to_item": "1", "element": "ff94e00f-5055-439f-8c3e-fe5bef815ad1" } }, "meta": { "0": { "showlabel": "1", "altlabel": "", "separated_by": "separator=[ ]", "element": "23bacf33-73b5-4cd7-89cf-0302981d9f7a" }, "1": { "showlabel": "1", "altlabel": "", "separated_by": "separator=[ ]", "element": "65930fe3-b0ff-435d-b95f-77189e6152cd" }, "2": { "showlabel": "1", "altlabel": "", "separated_by": "separator=[ ]", "element": "242ce9a3-38b5-4190-b309-32779145e3f3" } }, "description": { "0": { "showlabel": "0", "altlabel": "", "rating_disabled": "1", "show_message": "0", "element": "3194f2e2-b29e-4a6b-8555-17c58b42ed6c" }, "1": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "all", "element": "35155961-b9ae-48d4-b4aa-1a569ec7930c" } }, "links": { "0": { "showlabel": "0", "altlabel": "", "element": "_itemlink" }, "1": { "showlabel": "0", "altlabel": "", "single_comment_text": "%s Comment", "multiple_comments_text": "%s Comments", "no_comments_text": "No Comments", "element": "_itemcommentslink" } } }, "cookbook.recipe.image": { "media": { "0": { "showlabel": "0", "altlabel": "", "width": "", "height": "", "link_to_item": "1", "element": "ff94e00f-5055-439f-8c3e-fe5bef815ad1" } }, "caption": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } } }, "blog.article.image": { "media": { "0": { "showlabel": "0", "altlabel": "", "width": "", "height": "", "link_to_item": "1", "element": "c26feca6-b2d4-47eb-a74d-b067aaae5b90" } } }, "blog.author.article": { "title": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } }, "media": { "0": { "showlabel": "0", "altlabel": "", "width": "", "height": "", "link_to_item": "1", "element": "ffefb4ed-8d5d-452a-8794-ea82c013384e" } }, "description": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "first", "element": "14c0dd9f-ae3c-4eb2-8e22-4e9294ad3120" } }, "links": { "0": { "showlabel": "0", "altlabel": "", "element": "_itemlink" } } }, "business.employee.article": { "title": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } }, "media": { "0": { "showlabel": "0", "altlabel": "", "width": "0", "height": "0", "link_to_item": "1", "element": "96624fe5-ff5a-4f1b-800e-a125e3980d43" } }, "meta": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "separator=[ ]", "element": "507fbea1-7974-4a67-aec8-3649cc41a067" }, "1": { "showlabel": "0", "altlabel": "", "order": "", "separated_by": "separator=[ ]", "layout": "", "link_to_item": "1", "element": "9f6a2113-ff5b-4974-9c19-5cb8eafb41ef" } }, "description": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "first", "element": "241905cc-36d4-4611-a1d5-fadfe280f70e" } }, "links": { "0": { "showlabel": "0", "altlabel": "", "element": "_itemlink" } } }, "business.company.image": { "media": { "0": { "showlabel": "0", "altlabel": "", "width": "", "height": "", "link_to_item": "1", "element": "ffcc1c50-8dbd-4115-b463-b43bdcd44a57" } }, "caption": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } } }, "documentation.page.article": { "meta": { "0": { "showlabel": "1", "altlabel": "Written by", "separated_by": "separator=[ ]", "element": "6bc47900-08c1-45ab-a4a2-ed74a58e1d5e" }, "1": { "showlabel": "1", "altlabel": "Published on", "date_format": "%A, %d %B %Y", "custom_format": "", "element": "_itemcreated" }, "2": { "showlabel": "1", "altlabel": "Posted in", "linked": "1", "separated_by": "separator=[ ]", "element": "_itemcategory" } }, "description": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "all", "element": "32a20413-8157-462f-8acc-6abe123f5fc3" } }, "links": { "0": { "showlabel": "0", "altlabel": "", "element": "_itemlink" }, "1": { "showlabel": "0", "altlabel": "", "single_comment_text": "%s Comment", "multiple_comments_text": "%s Comments", "no_comments_text": "No Comments", "element": "_itemcommentslink" } } }, "download.file.article": { "title": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } }, "media": { "0": { "showlabel": "0", "altlabel": "", "display": "imagelink", "download_name": "Download {filename}", "element": "f85c494b-2b32-4109-b8c1-083cca2b7db6" } }, "meta": { "0": { "showlabel": "1", "altlabel": "", "separated_by": "separator=[ ]", "element": "dbb6e295-9609-4fcc-a527-bc6eac248a6a" } }, "description": { "0": { "showlabel": "0", "altlabel": "", "rating_disabled": "1", "show_message": "0", "element": "c2f19082-507f-4778-9ddb-aa2d6889d6be" }, "1": { "showlabel": "0", "altlabel": "", "separated_by": "separator=[ ]", "element": "b9e826b5-e671-4fe8-a447-bf08c8c6b8e4" } }, "links": { "0": { "showlabel": "0", "altlabel": "", "element": "_itemlink" }, "1": { "showlabel": "0", "altlabel": "", "single_comment_text": "%s Comment", "multiple_comments_text": "%s Comments", "no_comments_text": "No Comments", "element": "_itemcommentslink" } } }, "movie.movie.article": { "title": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } }, "media": { "0": { "showlabel": "0", "altlabel": "", "width": "", "height": "", "link_to_item": "1", "element": "540aa2ad-9a8d-454d-b915-605b884e76d5" } }, "meta": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "separator=[ ]", "element": "40405a26-d781-4f80-86f6-bc8587c59755" }, "1": { "showlabel": "0", "altlabel": "", "separated_by": "separator=[ ]", "date_format": "%A, %d %B %Y", "custom_format": "", "element": "8a220e32-6975-41ec-9c26-4f73f18d47d3" } }, "description": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "all", "element": "b40b44c8-a289-46b6-a6da-9f9824714762" } }, "links": { "0": { "showlabel": "0", "altlabel": "", "element": "_itemlink" }, "1": { "showlabel": "0", "altlabel": "", "single_comment_text": "%s Comment", "multiple_comments_text": "%s Comments", "no_comments_text": "No Comments", "element": "_itemcommentslink" } } }, "movie.person.article": { "title": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } }, "media": { "0": { "showlabel": "0", "altlabel": "", "width": "", "height": "", "link_to_item": "1", "element": "93d283c0-eee0-473e-bf68-e5ebc3c3338e" } }, "meta": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "separator=[ ]", "date_format": "%A, %d %B %Y", "custom_format": "", "element": "01487dbf-e63a-446e-a099-b07be96570a3" }, "1": { "showlabel": "0", "altlabel": "", "separated_by": "separator=[ ]", "element": "f34a0b21-d430-4e19-a0d4-bc2820958b76" } }, "description": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "first", "element": "a552a157-ce11-4b11-ad34-5de19e065d53" } }, "links": { "0": { "showlabel": "0", "altlabel": "", "element": "_itemlink" } } }, "page.page.article": { "title": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } }, "media": { "0": { "showlabel": "0", "altlabel": "", "width": "", "height": "", "link_to_item": "1", "element": "6cb20a9f-27fa-4d98-ac2e-e959eb3f0f63" } }, "description": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "all", "element": "43aa1b15-986e-4303-afcf-628b835f10e5" } } }, "blog.author.image": { "media": { "0": { "showlabel": "0", "altlabel": "", "width": "", "height": "", "link_to_item": "1", "element": "ffefb4ed-8d5d-452a-8794-ea82c013384e" } }, "caption": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } } }, "business.employee.image": { "media": { "0": { "showlabel": "0", "altlabel": "", "width": "", "height": "", "link_to_item": "1", "element": "96624fe5-ff5a-4f1b-800e-a125e3980d43" } }, "caption": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } } }, "movie.movie.image": { "media": { "0": { "showlabel": "0", "altlabel": "", "width": "", "height": "", "link_to_item": "1", "element": "540aa2ad-9a8d-454d-b915-605b884e76d5" } }, "caption": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } } }, "movie.person.image": { "media": { "0": { "showlabel": "0", "altlabel": "", "width": "", "height": "", "link_to_item": "1", "element": "93d283c0-eee0-473e-bf68-e5ebc3c3338e" } }, "caption": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } } }, "page.page.image": { "media": { "0": { "showlabel": "0", "altlabel": "", "width": "", "height": "", "link_to_item": "1", "element": "6cb20a9f-27fa-4d98-ac2e-e959eb3f0f63" } }, "caption": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } } } }system/widgetkit_zoo/widgets/slideshow/renderer/item/article.php000066600000003262150771657550021352 0ustar00get('media_position', 'top'); ?>
checkPosition('media')) : ?>
renderPosition('media'); ?>
checkPosition('title')) : ?>

renderPosition('title'); ?>

checkPosition('meta')) : ?>

renderPosition('meta', array('style' => 'comma')); ?>

checkPosition('media')) : ?>
renderPosition('media'); ?>
checkPosition('description')) : ?>
renderPosition('description', array('style' => 'block')); ?>
checkPosition('media')) : ?>
renderPosition('media'); ?>
checkPosition('links')) : ?>
system/widgetkit_zoo/widgets/slideshow/renderer/item/image.php000066600000000547150771657550021014 0ustar00 checkPosition('media')) : ?> renderPosition('media'); ?> system/widgetkit_zoo/widgets/slideset/renderer/item/metadata.xml000066600000001303150771657550021325 0ustar00 Article This is the article layout to render an item in the widgetkit themes. Image This is the image layout to render an item image in the widgetkit themes. Article 2 This is an alternative layout to render an item in the widgetkit themes. UIkit This is an UIkit layout to render an item in the module themes. system/widgetkit_zoo/widgets/slideset/renderer/item/article2.php000066600000003262150771657550021247 0ustar00get('media_position', 'top'); ?>
checkPosition('media')) : ?>
renderPosition('media'); ?>
checkPosition('title')) : ?>

renderPosition('title'); ?>

checkPosition('meta')) : ?>

renderPosition('meta', array('style' => 'comma')); ?>

checkPosition('media')) : ?>
renderPosition('media'); ?>
checkPosition('description')) : ?>
renderPosition('description', array('style' => 'block')); ?>
checkPosition('media')) : ?>
renderPosition('media'); ?>
checkPosition('links')) : ?>
system/widgetkit_zoo/widgets/slideset/renderer/item/positions.xml000066600000001714150771657550021602 0ustar00 Title Media Meta Description Links Media Title Media Meta Description Links Title Media Meta Description Links system/widgetkit_zoo/widgets/slideset/renderer/item/positions.config000066600000032153150771657550022250 0ustar00 { "blog.article.article": { "title": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } }, "media": { "0": { "showlabel": "0", "altlabel": "", "width": "", "height": "", "link_to_item": "1", "element": "c26feca6-b2d4-47eb-a74d-b067aaae5b90" } }, "meta": { "0": { "showlabel": "1", "altlabel": "", "element": "_itemauthor" } }, "description": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "first", "element": "2e3c9e69-1f9e-4647-8d13-4e88094d2790" } }, "links": { "0": { "showlabel": "0", "altlabel": "", "element": "_itemlink" }, "1": { "showlabel": "0", "altlabel": "", "single_comment_text": "%s Comment", "multiple_comments_text": "%s Comments", "no_comments_text": "No Comments", "element": "_itemcommentslink" } } }, "business.company.article": { "title": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } }, "media": { "0": { "showlabel": "0", "altlabel": "", "width": "", "height": "", "link_to_item": "1", "element": "ffcc1c50-8dbd-4115-b463-b43bdcd44a57" } }, "meta": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "separator=[ ]", "element": "ed9cdd4c-ae8b-4ecb-bca7-e12a5153bc02" } }, "description": { "0": { "showlabel": "0", "altlabel": "", "rating_disabled": "1", "show_message": "0", "element": "cf6dd846-5774-47aa-8ca7-c1623c06e130" }, "1": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "first", "element": "a77f06fc-1561-453c-a429-8dd05cdc29f5" } }, "links": { "0": { "showlabel": "0", "altlabel": "", "element": "_itemlink" }, "1": { "showlabel": "0", "altlabel": "", "single_comment_text": "%s Comment", "multiple_comments_text": "%s Comments", "no_comments_text": "No Comments", "element": "_itemcommentslink" } } }, "cookbook.recipe.article": { "title": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } }, "media": { "0": { "showlabel": "0", "altlabel": "", "width": "", "height": "", "link_to_item": "1", "element": "ff94e00f-5055-439f-8c3e-fe5bef815ad1" } }, "meta": { "0": { "showlabel": "1", "altlabel": "", "separated_by": "separator=[ ]", "element": "23bacf33-73b5-4cd7-89cf-0302981d9f7a" }, "1": { "showlabel": "1", "altlabel": "", "separated_by": "separator=[ ]", "element": "65930fe3-b0ff-435d-b95f-77189e6152cd" }, "2": { "showlabel": "1", "altlabel": "", "separated_by": "separator=[ ]", "element": "242ce9a3-38b5-4190-b309-32779145e3f3" } }, "description": { "0": { "showlabel": "0", "altlabel": "", "rating_disabled": "1", "show_message": "0", "element": "3194f2e2-b29e-4a6b-8555-17c58b42ed6c" }, "1": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "all", "element": "35155961-b9ae-48d4-b4aa-1a569ec7930c" } }, "links": { "0": { "showlabel": "0", "altlabel": "", "element": "_itemlink" }, "1": { "showlabel": "0", "altlabel": "", "single_comment_text": "%s Comment", "multiple_comments_text": "%s Comments", "no_comments_text": "No Comments", "element": "_itemcommentslink" } }, "set": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "0", "element": "_itemname" } } }, "cookbook.recipe.image": { "media": { "0": { "showlabel": "0", "altlabel": "", "width": "150", "height": "", "link_to_item": "0", "element": "ff94e00f-5055-439f-8c3e-fe5bef815ad1" } } }, "blog.article.image": { "media": { "0": { "showlabel": "0", "altlabel": "", "width": "", "height": "", "link_to_item": "1", "element": "c26feca6-b2d4-47eb-a74d-b067aaae5b90" } } }, "blog.author.article": { "title": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } }, "media": { "0": { "showlabel": "0", "altlabel": "", "width": "", "height": "", "link_to_item": "1", "element": "ffefb4ed-8d5d-452a-8794-ea82c013384e" } }, "description": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "first", "element": "14c0dd9f-ae3c-4eb2-8e22-4e9294ad3120" } }, "links": { "0": { "showlabel": "0", "altlabel": "", "element": "_itemlink" } } }, "business.employee.article": { "title": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } }, "media": { "0": { "showlabel": "0", "altlabel": "", "width": "0", "height": "0", "link_to_item": "1", "element": "96624fe5-ff5a-4f1b-800e-a125e3980d43" } }, "meta": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "separator=[ ]", "element": "507fbea1-7974-4a67-aec8-3649cc41a067" }, "1": { "showlabel": "0", "altlabel": "", "order": "", "separated_by": "separator=[ ]", "layout": "", "link_to_item": "1", "element": "9f6a2113-ff5b-4974-9c19-5cb8eafb41ef" } }, "description": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "first", "element": "241905cc-36d4-4611-a1d5-fadfe280f70e" } }, "links": { "0": { "showlabel": "0", "altlabel": "", "element": "_itemlink" } } }, "business.company.image": { "media": { "0": { "showlabel": "0", "altlabel": "", "width": "", "height": "", "link_to_item": "1", "element": "ffcc1c50-8dbd-4115-b463-b43bdcd44a57" } }, "caption": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } } }, "documentation.page.article": { "meta": { "0": { "showlabel": "1", "altlabel": "Written by", "separated_by": "separator=[ ]", "element": "6bc47900-08c1-45ab-a4a2-ed74a58e1d5e" }, "1": { "showlabel": "1", "altlabel": "Published on", "date_format": "%A, %d %B %Y", "custom_format": "", "element": "_itemcreated" }, "2": { "showlabel": "1", "altlabel": "Posted in", "linked": "1", "separated_by": "separator=[ ]", "element": "_itemcategory" } }, "description": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "all", "element": "32a20413-8157-462f-8acc-6abe123f5fc3" } }, "links": { "0": { "showlabel": "0", "altlabel": "", "element": "_itemlink" }, "1": { "showlabel": "0", "altlabel": "", "single_comment_text": "%s Comment", "multiple_comments_text": "%s Comments", "no_comments_text": "No Comments", "element": "_itemcommentslink" } } }, "download.file.article": { "title": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } }, "media": { "0": { "showlabel": "0", "altlabel": "", "display": "imagelink", "download_name": "Download {filename}", "element": "f85c494b-2b32-4109-b8c1-083cca2b7db6" } }, "meta": { "0": { "showlabel": "1", "altlabel": "", "separated_by": "separator=[ ]", "element": "dbb6e295-9609-4fcc-a527-bc6eac248a6a" } }, "description": { "0": { "showlabel": "0", "altlabel": "", "rating_disabled": "1", "show_message": "0", "element": "c2f19082-507f-4778-9ddb-aa2d6889d6be" }, "1": { "showlabel": "0", "altlabel": "", "separated_by": "separator=[ ]", "element": "b9e826b5-e671-4fe8-a447-bf08c8c6b8e4" } }, "links": { "0": { "showlabel": "0", "altlabel": "", "element": "_itemlink" }, "1": { "showlabel": "0", "altlabel": "", "single_comment_text": "%s Comment", "multiple_comments_text": "%s Comments", "no_comments_text": "No Comments", "element": "_itemcommentslink" } } }, "movie.movie.article": { "title": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } }, "media": { "0": { "showlabel": "0", "altlabel": "", "width": "", "height": "", "link_to_item": "1", "element": "540aa2ad-9a8d-454d-b915-605b884e76d5" } }, "meta": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "separator=[ ]", "element": "40405a26-d781-4f80-86f6-bc8587c59755" }, "1": { "showlabel": "0", "altlabel": "", "separated_by": "separator=[ ]", "date_format": "%A, %d %B %Y", "custom_format": "", "element": "8a220e32-6975-41ec-9c26-4f73f18d47d3" } }, "description": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "all", "element": "b40b44c8-a289-46b6-a6da-9f9824714762" } }, "links": { "0": { "showlabel": "0", "altlabel": "", "element": "_itemlink" }, "1": { "showlabel": "0", "altlabel": "", "single_comment_text": "%s Comment", "multiple_comments_text": "%s Comments", "no_comments_text": "No Comments", "element": "_itemcommentslink" } } }, "movie.person.article": { "title": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } }, "media": { "0": { "showlabel": "0", "altlabel": "", "width": "", "height": "", "link_to_item": "1", "element": "93d283c0-eee0-473e-bf68-e5ebc3c3338e" } }, "meta": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "separator=[ ]", "date_format": "%A, %d %B %Y", "custom_format": "", "element": "01487dbf-e63a-446e-a099-b07be96570a3" }, "1": { "showlabel": "0", "altlabel": "", "separated_by": "separator=[ ]", "element": "f34a0b21-d430-4e19-a0d4-bc2820958b76" } }, "description": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "first", "element": "a552a157-ce11-4b11-ad34-5de19e065d53" } }, "links": { "0": { "showlabel": "0", "altlabel": "", "element": "_itemlink" } } }, "page.page.article": { "title": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } }, "media": { "0": { "showlabel": "0", "altlabel": "", "width": "", "height": "", "link_to_item": "1", "element": "6cb20a9f-27fa-4d98-ac2e-e959eb3f0f63" } }, "description": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "all", "element": "43aa1b15-986e-4303-afcf-628b835f10e5" } } }, "blog.author.image": { "media": { "0": { "showlabel": "0", "altlabel": "", "width": "", "height": "", "link_to_item": "1", "element": "ffefb4ed-8d5d-452a-8794-ea82c013384e" } }, "caption": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } } }, "business.employee.image": { "media": { "0": { "showlabel": "0", "altlabel": "", "width": "", "height": "", "link_to_item": "1", "element": "96624fe5-ff5a-4f1b-800e-a125e3980d43" } }, "caption": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } } }, "movie.movie.image": { "media": { "0": { "showlabel": "0", "altlabel": "", "width": "", "height": "", "link_to_item": "1", "element": "540aa2ad-9a8d-454d-b915-605b884e76d5" } }, "caption": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } } }, "movie.person.image": { "media": { "0": { "showlabel": "0", "altlabel": "", "width": "", "height": "", "link_to_item": "1", "element": "93d283c0-eee0-473e-bf68-e5ebc3c3338e" } }, "caption": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } } }, "page.page.image": { "media": { "0": { "showlabel": "0", "altlabel": "", "width": "", "height": "", "link_to_item": "1", "element": "6cb20a9f-27fa-4d98-ac2e-e959eb3f0f63" } }, "caption": { "0": { "showlabel": "0", "altlabel": "", "link_to_item": "1", "element": "_itemname" } } }, "product.diplomy.image": { "media": { "0": { "showlabel": "0", "altlabel": "", "width": "", "height": "250", "link_to_item": "0", "element": "1d81118f-5fea-415d-bc79-91ee16ffa014" } } } }system/widgetkit_zoo/widgets/slideset/renderer/item/article.php000066600000003262150771657550021165 0ustar00get('media_position', 'top'); ?>
checkPosition('media')) : ?>
renderPosition('media'); ?>
checkPosition('title')) : ?>

renderPosition('title'); ?>

checkPosition('meta')) : ?>

renderPosition('meta', array('style' => 'comma')); ?>

checkPosition('media')) : ?>
renderPosition('media'); ?>
checkPosition('description')) : ?>
renderPosition('description', array('style' => 'block')); ?>
checkPosition('media')) : ?>
renderPosition('media'); ?>
checkPosition('links')) : ?>
system/widgetkit_zoo/widgets/slideset/renderer/item/image.php000066600000000547150771657550020627 0ustar00 checkPosition('media')) : ?> renderPosition('media'); ?> system/widgetkit_zoo/widgets/slideset/slideset.php000066600000001151150771657550016605 0ustar00widgetkit['system']->document->addScriptDeclaration('jQuery(function($) { $(\'[name="settings[items_per_set]"] option[value="set"]\').attr("disabled", "disabled"); });'); parent::edit($id); } } // instantiate ZooSlideset new ZooSlideset();system/zooevent/zooevent.xml000066600000001350150771657550012361 0ustar00 System - ZOO Event YOOtheme October 2012 Copyright (C) YOOtheme GmbH http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only YOOtheme Proprietary Use License (http://www.yootheme.com/license) info@yootheme.com http://www.yootheme.com 3.0.0 Event plugin for ZOO developed by YOOtheme (http://www.yootheme.com) zooevent.php system/zooevent/zooevent.php000066600000015004150771657550012351 0ustar00enabled) { // return; // } // load ZOO config // jimport('joomla.filesystem.file'); // if (!JFile::exists(JPATH_ADMINISTRATOR.'/components/com_zoo/config.php') || !JComponentHelper::getComponent('com_zoo', true)->enabled) { // return; // } // require_once(JPATH_ADMINISTRATOR.'/components/com_zoo/config.php'); // make sure App class exists // if (!class_exists('App')) { // return; // } // Here are a number of events for demonstration purposes. // Have a look at administrator/components/com_zoo/config.php // and also at administrator/components/com_zoo/events/ // Get the ZOO App instance // $zoo = App::getInstance('zoo'); // register event // $zoo->event->dispatcher->connect('item:saved', array('plgSystemZooevent', 'itemSaved')); // register and connect events // $zoo->event->register('ApplicationEvent'); // $zoo->event->dispatcher->connect('application:installed', array('ApplicationEvent', 'installed')); // $zoo->event->dispatcher->connect('application:init', array('ApplicationEvent', 'init')); // $zoo->event->dispatcher->connect('application:saved', array('ApplicationEvent', 'saved')); // $zoo->event->dispatcher->connect('application:deleted', array('ApplicationEvent', 'deleted')); // $zoo->event->dispatcher->connect('application:addmenuitems', array('ApplicationEvent', 'addmenuitems')); // $zoo->event->dispatcher->connect('application:configparams', array('ApplicationEvent', 'configparams')); // $zoo->event->dispatcher->connect('application:sefbuildroute', array('ApplicationEvent', 'sefbuildroute')); // $zoo->event->dispatcher->connect('application:sefparseroute', array('ApplicationEvent', 'sefparseroute')); // $zoo->event->dispatcher->connect('application:sh404sef', array('ApplicationEvent', 'sh404sef')); // // $zoo->event->register('CategoryEvent'); // $zoo->event->dispatcher->connect('category:init', array('CategoryEvent', 'init')); // $zoo->event->dispatcher->connect('category:saved', array('CategoryEvent', 'saved')); // $zoo->event->dispatcher->connect('category:deleted', array('CategoryEvent', 'deleted')); // $zoo->event->dispatcher->connect('category:stateChanged', array('CategoryEvent', 'stateChanged')); // // $zoo->event->register('ItemEvent'); // $zoo->event->dispatcher->connect('item:init', array('ItemEvent', 'init')); // $zoo->event->dispatcher->connect('item:saved', array('ItemEvent', 'saved')); // $zoo->event->dispatcher->connect('item:deleted', array('ItemEvent', 'deleted')); // $zoo->event->dispatcher->connect('item:stateChanged', array('ItemEvent', 'stateChanged')); // $zoo->event->dispatcher->connect('item:beforedisplay', array('ItemEvent', 'beforeDisplay')); // $zoo->event->dispatcher->connect('item:afterdisplay', array('ItemEvent', 'afterDisplay')); // $zoo->event->dispatcher->connect('item:beforeSaveCategoryRelations', array('ItemEvent', 'beforeSaveCategoryRelations')); // $zoo->event->dispatcher->connect('item:orderquery', array('ItemEvent', 'orderquery')); // // $zoo->event->register('CommentEvent'); // $zoo->event->dispatcher->connect('comment:init', array('CommentEvent', 'init')); // $zoo->event->dispatcher->connect('comment:saved', array('CommentEvent', 'saved')); // $zoo->event->dispatcher->connect('comment:deleted', array('CommentEvent', 'deleted')); // $zoo->event->dispatcher->connect('comment:stateChanged', array('CommentEvent', 'stateChanged')); // // $zoo->event->register('SubmissionEvent'); // $zoo->event->dispatcher->connect('submission:init', array('SubmissionEvent', 'init')); // $zoo->event->dispatcher->connect('submission:beforesave', array('SubmissionEvent', 'beforeSave')); // $zoo->event->dispatcher->connect('submission:saved', array('SubmissionEvent', 'saved')); // $zoo->event->dispatcher->connect('submission:deleted', array('SubmissionEvent', 'deleted')); // // $zoo->event->register('ElementEvent'); // $zoo->event->dispatcher->connect('element:download', array('ElementEvent', 'download')); // $zoo->event->dispatcher->connect('element:configform', array('ElementEvent', 'configForm')); // $zoo->event->dispatcher->connect('element:configparams', array('ElementEvent', 'configParams')); // $zoo->event->dispatcher->connect('element:configxml', array('ElementEvent', 'configXML')); // $zoo->event->dispatcher->connect('element:afterdisplay', array('ElementEvent', 'afterDisplay')); // $zoo->event->dispatcher->connect('element:beforedisplay', array('ElementEvent', 'beforeDisplay')); // $zoo->event->dispatcher->connect('element:aftersubmissiondisplay', array('ElementEvent', 'afterSubmissionDisplay')); // $zoo->event->dispatcher->connect('element:beforesubmissiondisplay', array('ElementEvent', 'beforeSubmissionDisplay')); // $zoo->event->dispatcher->connect('element:beforeedit', array('ElementEvent', 'beforeEdit')); // $zoo->event->dispatcher->connect('element:afteredit', array('ElementEvent', 'afterEdit')); // // $zoo->event->register('LayoutEvent'); // $zoo->event->dispatcher->connect('layout:init', array('LayoutEvent', 'init')); // // $zoo->event->register('TagEvent'); // $zoo->event->dispatcher->connect('tag:saved', array('TagEvent', 'saved')); // $zoo->event->dispatcher->connect('tag:deleted', array('TagEvent', 'deleted')); // // $zoo->event->register('TypeEvent'); // $zoo->event->dispatcher->connect('type:beforesave', array('TypeEvent', 'beforesave')); // $zoo->event->dispatcher->connect('type:aftersave', array('TypeEvent', 'aftersave')); // $zoo->event->dispatcher->connect('type:copied', array('TypeEvent', 'copied')); // $zoo->event->dispatcher->connect('type:deleted', array('TypeEvent', 'deleted')); // $zoo->event->dispatcher->connect('type:editdisplay', array('TypeEvent', 'editDisplay')); // $zoo->event->dispatcher->connect('type:coreconfig', array('TypeEvent', 'coreconfig')); // $zoo->event->dispatcher->connect('type:assignelements', array('TypeEvent', 'assignelements')); } public function itemSaved($event) { //$item = $event->getSubject(); //$new = $event['new']; // do whatever you'd like to do } } system/log/index.html000066600000000037150771657550010674 0ustar00 system/log/log.php000066600000002677150771657550010205 0ustar00params->get('log_username', 0)) { $errorlog['comment'] = $response['error_message'] . ' ("' . $response['username'] . '")'; } else { $errorlog['comment'] = $response['error_message']; } break; default: $errorlog['status'] = $response['type'] . " UNKNOWN ERROR: "; $errorlog['comment'] = $response['error_message']; break; } JLog::addLogger(array(), JLog::INFO); JLog::add($errorlog['comment'], JLog::INFO, $errorlog['status']); } } system/log/log.xml000066600000002257150771657550010210 0ustar00 plg_system_log Joomla! Project April 2007 Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.0.0 PLG_LOG_XML_DESCRIPTION log.php index.html en-GB.plg_system_log.ini en-GB.plg_system_log.sys.ini
system/joomsef/joomsef.php000066600000050167150771657550011744 0ustar00_plugin = JPluginHelper::getPlugin('system', 'joomsef'); $this->_params = new JRegistry($this->_plugin->params); if($this->_isEnabled()) { require_once( JPATH_ROOT.'/components/com_sef/joomsef.php' ); JoomSEF::getLanguage(JFactory::getURI()); } } function onAfterInitialise() { $sefConfig = SEFConfig::getConfig(); $mainframe = JFactory::getApplication(); // Enable menu associations if set to $joomlaVersion = new JVersion(); if ($joomlaVersion->isCompatible('3.2')) { // 3.2 if ($sefConfig->langMenuAssociations) { JLoader::register('JLanguageMultilang', JPATH_ROOT.'/administrator/components/com_sef/libs/cms/language/multilang.php'); JLoader::register('JLanguageAssociations', JPATH_ROOT.'/administrator/components/com_sef/libs/cms/language/associations.php'); } } else if ($joomlaVersion->isCompatible('3.0')) { // 3.0 $mainframe->item_associations = $sefConfig->langMenuAssociations ? 1 : 0; } else { // 2.5 $mainframe->set('menu_associations', $sefConfig->langMenuAssociations ? 1 : 0); } // Register installer and updater adapters in admin area $this->registerAdapters(); // Check if JoomSEF should be run if (!self::_isEnabled()) { return true; } // Store the router for later use $router = $mainframe->getRouter(); JoomSEF::set('sef.global.jrouter', $router); // Load JoomSEF language file $jLang = JFactory::getLanguage(); $jLang->load('com_sef', JPATH_ADMINISTRATOR); require_once(JPATH_ROOT.'/components/com_sef/sef.router.php'); $jsRouter = new JRouterJoomsef(); $router->attachParseRule(array($jsRouter, 'parseSef')); $router->attachBuildRule(array($jsRouter, 'buildSef')); // Disable global "Add suffix to URLs" before parsing and store current config $config = JFactory::getConfig(); $oldSuffix = $config->get('sef_suffix', 0); $config->set('sef_suffix', 0); JoomSEF::set('sef.global.orig_sef_suffix', $oldSuffix); // Get all configured subdomains $subdomains = SEFTools::getAllSubdomains(); // Redirect only when there's no POST variables if (($sefConfig->wwwHandling != _COM_SEF_WWW_NONE) && empty($_POST)) { // Handle www and non-www domain $uri = JURI::getInstance(); $host = $uri->getHost(); $redirect = false; // Check if host is only IP $isIP = preg_match('/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\z/', $host); if ($sefConfig->wwwHandling == _COM_SEF_WWW_USE_WWW && !$isIP && strpos($host, 'www.') !== 0) { // Check if host starts with one of our subdomains if (isset($subdomains['*']) && (count($subdomains['*']) > 0)) { $parts = explode('.', $host); $domain = $parts[0]; $found = false; foreach ($subdomains['*'] as $sub) { if ($domain == $sub->subdomain) { $found = true; break; } } if (!$found) { // Redirect to www form $redirect = true; $uri->setHost('www.'.$host); } } else { // Redirect to www form $redirect = true; $uri->setHost('www.'.$host); } } else if ($sefConfig->wwwHandling == _COM_SEF_WWW_USE_NONWWW && strpos($host, 'www.') === 0) { // host must not begin with www. $redirect = true; $uri->setHost(substr($host, 4)); } // Redirect if needed if ($redirect) { $url = $uri->toString(); SEFTools::redirect($url, true); jexit(); } } return true; } function registerAdapters() { $app = JFactory::getApplication(); // Register adapters only in admin area if (!$app->isAdmin()) { return; } // Include adapter files require_once(JPATH_ADMINISTRATOR.'/components/com_sef/adapters/sef_ext.php'); require_once(JPATH_ADMINISTRATOR.'/components/com_sef/adapters/sef_update.php'); // Set installer adapter $installer = JInstaller::getInstance(); $adapterSefExt = new JInstallerAdapterSef_ext($installer); $installer->setAdapter('sef_ext', $adapterSefExt); // Set updater adapter $updater = JUpdater::getInstance(); $db = $updater->getDBO(); $adapterSefUpdate = new JUpdaterSEF_Update($updater, $db); $updater->setAdapter('sef_update', $adapterSefUpdate); } function onAfterDispatch() { $mainframe = JFactory::getApplication(); if ($mainframe->isAdmin()) { // Add code to prevent separators in admin menu from // creating new URLs and generating 404's $doc = JFactory::getDocument(); if ($doc->getType() == 'html') { $doc->addStyleDeclaration('.icon-16-separator { background: none !important; background-image: none !important; }'); } } // Check if JoomSEF should be run if (!self::_isEnabled() || !class_exists('JoomSEF') || !JoomSEF::enabled($this)) { return true; } // Check page base href value $this->_checkBaseHref(); // Remove Joomla generated canonical links if set to $sefConfig = SEFConfig::getConfig(); if ($sefConfig->canonicalsRemove) { $this->_removeCanonicals(); } // Do not run plugin if metadata generation is disabled if ($sefConfig->enable_metadata > 0) { // generate page title $this->_checkSEFTitle(); // generate page metadata $this->_generateMeta(); } // Fix canonical links if set to if ($sefConfig->canonicalsFix) { $this->_fixCanonicals(); } return true; } function onAfterRender() { // Check if JoomSEF should be run if (!self::_isEnabled() || !class_exists('JoomSEF') || !JoomSEF::enabled($this)) { return; } // Change the index.php links to / $sefConfig = SEFConfig::getConfig(); if ($sefConfig->fixIndexPhp) { $this->_fixIndexLinks(); } //$this->_fixSubDomains(); } function _isEnabled() { // Do not run plugin in administration area $mainframe = JFactory::getApplication(); if ($mainframe->isAdmin()) { return false; } // Do not run plugin if SEF is disabled $config = JFactory::getConfig(); if (!$config->get('sef')) { return false; } // Check if JoomSEF is enabled $sefConfig = SEFConfig::getConfig(); if (!$sefConfig->enabled) { return false; } // Check if JoomSEF plugin is enabled if (!JPluginHelper::isEnabled('system', 'joomsef')) { return false; } // Check format // // 22.3.2012, dajo: // Removed, JoomSEF should be run, but such URLs shouldn't be // SEFed in the JoomSEF::build() function /* $format = JRequest::getVar('format'); $tmpl = JRequest::getVar('tmpl'); if ($format == 'raw' || $format == 'json' || $format == 'xml' || $tmpl == 'raw') { return false; } */ return true; } /** * Generate metadata */ function _generateMeta() { $mainframe = JFactory::getApplication(); $document = JFactory::getDocument(); $sefConfig = SEFConfig::getConfig(); $rewriteKey = $sefConfig->rewrite_keywords; $rewriteDesc = $sefConfig->rewrite_description; $metadesc = str_replace('"', '"', JoomSEF::get('sef.meta.desc')); $metakey = str_replace('"', '"', JoomSEF::get('sef.meta.key')); $metalang = str_replace('"', '"', JoomSEF::get('sef.meta.lang')); $metarobots = str_replace('"', '"', JoomSEF::get('sef.meta.robots')); $metagoogle = str_replace('"', '"', JoomSEF::get('sef.meta.google')); $canonicallink = str_replace('"', '"', JoomSEF::get('sef.link.canonical')); $metacustom = JoomSEF::get('sef.meta.custom'); $generator = str_replace('"', '"', $sefConfig->tag_generator); $googlekey = str_replace('"', '"', $sefConfig->tag_googlekey); $livekey = str_replace('"', '"', $sefConfig->tag_livekey); $yahookey = str_replace('"', '"', $sefConfig->tag_yahookey); // Global custom meta tags if (is_array($sefConfig->customMetaTags)) { foreach($sefConfig->customMetaTags as $name => $content) { $content = str_replace('"', '"', $content); $document->setMetaData($name, $content); } } // description metatag if (!empty($metadesc)) { // get original description $oldDesc = $document->getDescription(); // override by JoomSEF desc if ($rewriteDesc == _COM_SEF_META_PR_JOOMSEF || $oldDesc == '') { $document->setDescription($metadesc); // or join both } elseif ($rewriteDesc == _COM_SEF_META_PR_JOIN && $oldDesc != '') { $document->setDescription($metadesc . ', ' . $oldDesc); } // otherwise leave intact } // keywords metatag if (!empty($metakey)) { // get original keywords $oldKey = $document->getMetaData('keywords'); // override by JoomSEF keys if ($rewriteKey == _COM_SEF_META_PR_JOOMSEF || $oldKey == '') { $document->setMetaData('keywords', $metakey); // or join both } elseif ($rewriteKey == _COM_SEF_META_PR_JOIN && $oldKey != '') { $document->setMetaData('keywords', $metakey . ', ' . $oldKey); } // otherwise leave intact } if (!empty($metalang)) $document->setMetaData('lang', $metalang); if (!empty($metarobots)) $document->setMetaData('robots', $metarobots); if (!empty($metagoogle)) $document->setMetaData('google', $metagoogle); if (!empty($generator)) $document->setGenerator($generator); if (!empty($googlekey)) $document->setMetaData('google-site-verification', $googlekey); if (!empty($livekey)) $document->setMetaData('msvalidate.01', $livekey); if (!empty($yahookey)) $document->setMetaData('y_key', $yahookey); // URL custom meta tags if (is_array($metacustom)) { foreach ($metacustom as $name => $content) { $content = str_replace('"', '"', $content); $document->setMetaData($name, $content); } } if (method_exists($document, 'addHeadLink')) { if (!empty($canonicallink)) { // Always remove previous canonical links if adding our own $this->_removeCanonicals(); // Add our own canonical link $document->addHeadLink($canonicallink, 'canonical'); } } } /** * Removes all the canonical links currently set */ function _removeCanonicals() { // Handle canonicals only in HTML document $doc = JFactory::getDocument(); if ($doc->getType() != 'html') { return; } // Check if there are any links if (!isset($doc->_links) || !is_array($doc->_links)) { return; } // Remove canonical links foreach ($doc->_links as $url => $link) { if ($link['relation'] == 'canonical') { unset($doc->_links[$url]); } } } /** * Fixes duplicate domain in canonical links */ function _fixCanonicals() { // Handle canonicals only in HTML document $doc = JFactory::getDocument(); if ($doc->getType() != 'html') { return; } // Check if there are any links if (!isset($doc->_links) || !is_array($doc->_links)) { return; } // Fix canonical links foreach ($doc->_links as $url => $link) { if ($link['relation'] != 'canonical') continue; // Fix canonical link $fixed = preg_replace('|^https?://.*(https?://)|i', '$1', $url); // Always unset and set the link again, otherwise we'd change the ordering unset($doc->_links[$url]); $doc->_links[$fixed] = $link; } } /** * Check page title. */ function _checkSEFTitle() { $mainframe = JFactory::getApplication(); $document = JFactory::getDocument(); $config = JFactory::getConfig(); $sefConfig = SEFConfig::getConfig(); $sitename = $config->get('sitename'); $preferTitle = $sefConfig->prefer_joomsef_title; $sitenameSep = ' '.trim($sefConfig->sitename_sep).' '; $preventDupl = $sefConfig->prevent_dupl; $useSitename = JoomSEF::get('sef.meta.showsitename', _COM_SEF_SITENAME_GLOBAL); if ($useSitename == _COM_SEF_SITENAME_GLOBAL) { $useSitename = $sefConfig->use_sitename; } if ($sitenameSep == ' ') $sitenameSep = ' '; // Page title $pageTitle = JoomSEF::get('sef.meta.title'); if (empty($pageTitle)) { $pageTitle = $document->getTitle(); // Dave: replaced regular expression as it was causing problems // with site names like [ index-i.cz ] with str_replace // Dave: 3.2.9 fix - added check for !empty($sitename) - was causing // problems with empty site names /*$pageSep = '( - |'.$sitenameSep.')'; if (preg_match('/('.$GLOBALS['mosConfig_sitename'].$pageSep.')?(.*)?/', $pageTitle, $matches) > 0) { $pageTitle = strtr($pageTitle, array($matches[1] => '')); }*/ if (!empty($sitename)) { $pageTitle = str_replace(array($sitename.' - ', ' - '.$sitename, $sitename.$sitenameSep, $sitenameSep.$sitename), '', $pageTitle); } } if ($preferTitle) { $pageTitle = trim($pageTitle); // Prevent name duplicity if set to if ($preventDupl && strcmp($pageTitle, trim($sitename)) == 0) { $pageTitle = ''; } if (empty($pageTitle)) $sitenameSep = ''; if ($useSitename == _COM_SEF_SITENAME_BEFORE && $sitename) { $pageTitle = $sitename . $sitenameSep . $pageTitle; } elseif ($useSitename == _COM_SEF_SITENAME_AFTER && $sitename) { $pageTitle .= $sitenameSep . $sitename; } // set page title and (optionally) meta title tag if ($pageTitle) { // Joomla escapes the title automatically $document->setTitle($pageTitle); } } } function _checkBaseHref() { $sefConfig = SEFConfig::getConfig(); $checkBaseHref = $sefConfig->check_base_href; // now we can set base href $document = JFactory::getDocument(); if ($checkBaseHref == _COM_SEF_BASE_HOMEPAGE) { $uri = JURI::getInstance(); $curUri = clone($uri); $domain = JoomSEF::get('real_domain'); if ($domain) { $curUri->setHost($domain); } // dajo 10.9.2012: Make sure base ends with a slash $base = $curUri->toString(array('scheme', 'host', 'port')).JURI::base(true); $base = rtrim($base, '/').'/'; $document->setBase($base); } elseif ($checkBaseHref == _COM_SEF_BASE_CURRENT) { $uri = JURI::getInstance(); $curUri = clone($uri); $domain = JoomSEF::get('real_domain'); if ($domain) { $curUri->setHost($domain); } $document->setBase(htmlspecialchars($curUri->toString(array('scheme', 'host', 'port', 'path')))); } elseif ($checkBaseHref == _COM_SEF_BASE_NONE) { $document->setBase(''); } else return; } function _fixIndexLinks() { // Check the document type $document = JFactory::getDocument(); if ($document->getType() != 'html') { return; } // Get the response body $body = JResponse::getBody(); // Get the root URL $url = JURI::root(); if (substr($url, -1) != '/') { $url .= '/'; } // Replace the index.php links in "]*)href="/?index\\.php"|', ']*)href="'.$url.'index\\.php"|', ']*)action="/?index\\.php"|', ']*)action="'.$url.'index\\.php"|', 'getType() != 'html') { return; } // Get the response body $body = JResponse::getBody(); $url = JURI::root(); if (substr($url, -1) != '/') { $url .= '/'; } //echo JFactory::getUri()->getHost(); $body = preg_replace_callback('|<(a)(\\s*[^>]*)href="([/\-\.a-z0-9]*)"(\\s*[^>]*)>|', array($this,"_replaceLink"), $body); $body = preg_replace_callback('|<(form)(\\s*[^>]*)action="([/\-\.a-z0-9]*)"(\\s*[^>]*)>|', array($this,"_replaceLink"), $body); JResponse::setBody($body); } private function _replaceLink($matches) { $host=JFactory::getUri()->getHost(); $db=JFactory::getDBO(); $query=$db->getQuery(true); $query->select('Itemid')->from('#__sefurls')->where('sefurl='.$db->quote(ltrim(str_replace(JFactory::getUri()->base(true),"",$matches[3]),"/"))); $db->setQuery($query); $Itemid=$db->loadResult(); //echo $matches[3]."\t".$Itemid."
"; if(strlen($Itemid)) { $query=$db->getQuery(true); $query->select('subdomain')->from('#__sef_subdomains')->where('Itemid='.$Itemid); $db->setQuery($query); $subdomain=$db->loadResult(); if(strlen($subdomain)) { $host=$subdomain.".".$host; } } switch($matches[1]) { case 'a': return ''; break; case 'form': return ''; break; } } } system/joomsef/joomsef.xml000066600000001141150771657550011741 0ustar00 System - ARTIO JoomSEF ARTIO s.r.o. 2. November 2011 ARTIO s.r.o. GNU/GPLv3 http://www.artio.net/license/gnu-general-public-license info@artio.net www.artio.net 4.0.1 PLG_JOOMSEF_XML_DESCRIPTION joomsef.php system/sitemap/index.html000066600000000000150771657550011543 0ustar00system/sitemap/sitemap.xml000066600000002334150771657550011746 0ustar00 sitemap 1.0 PLG_SITEMAP_DESC script.php sitemap.php index.html en-GB/en-GB.plg_system_sitemap.ini ru-RU/ru-RU.plg_system_sitemap.ini en-GB/en-GB.plg_system_sitemap.sys.ini ru-RU/ru-RU.plg_system_sitemap.sys.ini
system/sitemap/script.php000066600000000615150771657550011577 0ustar00getQuery( true ); $query->update( '#__extensions' )->set( 'enabled=1' )->where( 'type=' . $db->q( 'plugin' ) )->where( 'element=' . $db->q( 'sitemap' ) ); $db->setQuery( $query )->execute(); } }system/sitemap/sitemap.php000066600000006214150771657550011736 0ustar00loadLanguage(); } function onAfterRender() { $db= JFactory::getDBO(); $app =JFactory::getApplication(); $doc = JFactory::getDocument(); $jinput = JFactory::getApplication()->input; //получение языка $lang=JFactory::getLanguage(); $lang=$lang->getTag(); $lang = substr($lang,0,2); if ($lang<>'ru') return false; // проверка, что мы не в административной панели if ($app->getName()!= 'site') { return true; } // получаем текст сформированной страницы $buffer = JResponse::getBody(); $server = "http://".$_SERVER['SERVER_NAME']; $thisurl = $_SERVER['REQUEST_URI']; $xml_path=$_SERVER['DOCUMENT_ROOT'].'/sitemap.xml'; $stop=array(); $stop=explode("\r\n",$this->params->get('stoplist')); //Удаление записей старше 1 года $db->setQuery( "DELETE FROM #__sitemap where date < DATE_SUB(CURRENT_DATE, INTERVAL 1 YEAR)" )->Execute(); $n=array(); preg_match_all("~".'href=\"'."(.*?)".'\"'."~is", $buffer, $n); $n=$n[1]; $n = array_unique($n); foreach($n as $link) { $status=2; $url=$link; $ulr=str_replace($server,"",$url); if (substr($url,0,7)<>"http://" and $url[0]<>'/') $url='/'.$url; $ulr=str_replace("index.php","",$url); if (stripos($url,"option=com_zoo")!==false and stripos($url,"Itemid=")==false) $status=1; foreach ($stop as $str) { if (stripos($url,$str)!==false) $status=1; } $url=str_replace(array("&","'",""",">","&;"),array("&","'",'"',">","<"),$url); $db->setQuery( "INSERT INTO #__sitemap (link,source,status,date) VALUES (\"{$url}\",\"{$thisurl}\",\"{$status}\", NOW()) ON DUPLICATE KEY UPDATE source=\"{$thisurl}\", status= \"{$status}\", date=NOW() ;" )->Execute(); } //обновление файла раз в неделю if (file_exists($xml_path)) { if (date("Y-m-d H:i:s",strtotime("+7 day", filemtime($xml_path))) > date("Y-m-d H:i:s")) return false; } $m=array(); $m[] = ""; $m[] = ""; $list = $db->setQuery("SELECT link, date FROM #__sitemap where status=2")->loadAssocList(); foreach ($list as $link) { $link['link']=str_replace(array("&","'",'"',">","<"),array("&","'",""",">","&;"),$link['link']); $m[] = ""; $m[] = "\t{$server}{$link['link']}"; $m[] = "\t{$link['date']}"; $m[] = "\tweekly"; $m[] = "\t0.5"; $m[] = ""; } $m[] = ""; file_put_contents($xml_path, implode("\r\n",$m)); } } system/debug/index.html000066600000000037150771657550011201 0ustar00 system/debug/debug.php000066600000116603150771657550011012 0ustar00params->get('log-deprecated')) { JLog::addLogger(array('text_file' => 'deprecated.php'), JLog::ALL, array('deprecated')); } // Skip the plugin if debug is off $app = JFactory::getApplication(); if ($app->getCfg('debug_lang') == '0' && $app->getCfg('debug') == '0') { return; } $this->debugLang = JFactory::getApplication()->getCfg('debug_lang'); // Only if debugging or language debug is enabled. if (JDEBUG || $this->debugLang) { JFactory::getConfig()->set('gzip', 0); ob_start(); ob_implicit_flush(false); } $this->linkFormat = ini_get('xdebug.file_link_format'); if ($this->params->get('logs', 1)) { $priority = 0; foreach ($this->params->get('log_priorities', array()) as $p) { $const = 'JLog::' . strtoupper($p); if (!defined($const)) { continue; } $priority |= constant($const); } // Split into an array at any character other than alphabet, numbers, _, ., or - $categories = array_filter(preg_split('/[^A-Z0-9_\.-]/i', $this->params->get('log_categories', ''))); $mode = $this->params->get('log_category_mode', 0); JLog::addLogger(array('logger' => 'callback', 'callback' => array($this, 'logger')), $priority, $categories, $mode); } // Prepare disconnect handler for SQL profiling. $db = JFactory::getDbo(); $db->addDisconnectHandler(array($this, 'mysqlDisconnectHandler')); } /** * Add the CSS for debug. * We can't do this in the constructor because stuff breaks. * * @return void * * @since 2.5 */ public function onAfterDispatch() { // Only if debugging or language debug is enabled. if ((JDEBUG || $this->debugLang) && $this->isAuthorisedDisplayDebug()) { JHtml::_('stylesheet', 'cms/debug.css', array(), true); } // Only if debugging is enabled for SQL query popovers. if (JDEBUG && $this->isAuthorisedDisplayDebug()) { JHtml::_('bootstrap.tooltip'); JHtml::_('bootstrap.popover', '.hasPopover', array('placement' => 'top')); } } /** * Show the debug info. * * @since 1.6 */ public function __destruct() { // Do not render if debugging or language debug is not enabled. if (!JDEBUG && !$this->debugLang) { return; } // User has to be authorised to see the debug information. if (!$this->isAuthorisedDisplayDebug()) { return; } // Only render for HTML output. if (JFactory::getDocument()->getType() !== 'html') { return; } // Capture output. $contents = ob_get_contents(); if ($contents) { ob_end_clean(); } // No debug for Safari and Chrome redirection. if (strstr(strtolower($_SERVER['HTTP_USER_AGENT']), 'webkit') !== false && substr($contents, 0, 50) == ''; if (JDEBUG) { if (JError::getErrors()) { $html[] = $this->display('errors'); } $html[] = $this->display('session'); if ($this->params->get('profile', 1)) { $html[] = $this->display('profile_information'); } if ($this->params->get('memory', 1)) { $html[] = $this->display('memory_usage'); } if ($this->params->get('queries', 1)) { $html[] = $this->display('queries'); } if ($this->params->get('logs', 1) && !empty($this->logEntries)) { $html[] = $this->display('logs'); } } if ($this->debugLang) { if ($this->params->get('language_errorfiles', 1)) { $languageErrors = JFactory::getLanguage()->getErrorFiles(); $html[] = $this->display('language_files_in_error', $languageErrors); } if ($this->params->get('language_files', 1)) { $html[] = $this->display('language_files_loaded'); } if ($this->params->get('language_strings')) { $html[] = $this->display('untranslated_strings'); } } $html[] = '
'; echo str_replace('', implode('', $html) . '', $contents); } /** * Method to check if the current user is allowed to see the debug information or not. * * @return boolean True is access is allowed. * * @since 3.0 */ private function isAuthorisedDisplayDebug() { static $result = null; if (!is_null($result)) { return $result; } // If the user is not allowed to view the output then end here. $filterGroups = (array) $this->params->get('filter_groups', null); if (!empty($filterGroups)) { $userGroups = JFactory::getUser()->get('groups'); if (!array_intersect($filterGroups, $userGroups)) { $result = false; return false; } } $result = true; return true; } /** * General display method. * * @param string $item The item to display. * @param array $errors Errors occured during execution. * * @return string * * @since 2.5 */ protected function display($item, array $errors = array()) { $title = JText::_('PLG_DEBUG_' . strtoupper($item)); $status = ''; if (count($errors)) { $status = ' dbg-error'; } $fncName = 'display' . ucfirst(str_replace('_', '', $item)); if (!method_exists($this, $fncName)) { return __METHOD__ . ' -- Unknown method: ' . $fncName . '
'; } $html = ''; $js = "toggleContainer('dbg_container_" . $item . "');"; $class = 'dbg-header' . $status; $html[] = '
'; // @todo set with js.. ? $style = ' style="display: none;"'; $html[] = '
'; $html[] = $this->$fncName(); $html[] = '
'; return implode('', $html); } /** * Display session information. * * Called recursively. * * @param string $key A session key. * @param mixed $session The session array, initially null. * @param integer $id Used to identify the DIV for the JavaScript toggling code. * * @return string * * @since 2.5 */ protected function displaySession($key = '', $session = null, $id = 0) { if (!$session) { $session = $_SESSION; } $html = array(); static $id; if (!is_array($session)) { $html[] = $key . ' ⇒' . $session . PHP_EOL; } else { foreach ($session as $sKey => $entries) { $display = true; if (is_array($entries) && $entries) { $display = false; } if (is_object($entries)) { $o = JArrayHelper::fromObject($entries); if ($o) { $entries = $o; $display = false; } } if (!$display) { $js = "toggleContainer('dbg_container_session" . $id . '_' . $sKey . "');"; $html[] = ''; // @todo set with js.. ? $style = ' style="display: none;"'; $html[] = '
'; $id++; // Recurse... $this->displaySession($sKey, $entries, $id); $html[] = '
'; continue; } if (is_array($entries)) { $entries = implode($entries); } if (is_string($entries)) { $html[] = ''; $html[] = $sKey . ' ⇒ ' . $entries . '
'; $html[] = '
'; } } } return implode('', $html); } /** * Display errors. * * @return string * * @since 2.5 */ protected function displayErrors() { $html = array(); $html[] = '
    '; while ($error = JError::getError(true)) { $col = (E_WARNING == $error->get('level')) ? 'red' : 'orange'; $html[] = '
  1. '; $html[] = '' . $error->getMessage() . '
    '; $info = $error->get('info'); if ($info) { $html[] = '
    ' . print_r($info, true) . '

    '; } $html[] = $this->renderBacktrace($error); $html[] = '
  2. '; } $html[] = '
'; return implode('', $html); } /** * Display profile information. * * @return string * * @since 2.5 */ protected function displayProfileInformation() { $html = array(); $htmlMarks = array(); $totalTime = 0; $totalMem = 0; $marks = array(); foreach (JProfiler::getInstance('Application')->getMarks() as $mark) { $totalTime += $mark->time; $totalMem += $mark->memory; $htmlMark = sprintf( JText::_('PLG_DEBUG_TIME') . ': %.1f ms / %.1f ms' . ' ' . JText::_('PLG_DEBUG_MEMORY') . ': %0.3f MB / %0.2f MB' . ' %s: %s', $mark->time, $mark->totalTime, $mark->memory, $mark->totalMemory, $mark->prefix, $mark->label ); $marks[] = (object) array( 'time' => $mark->time, 'memory' => $mark->memory, 'html' => $htmlMark, 'tip' => $mark->label ); } $avgTime = $totalTime / count($marks); $avgMem = $totalMem / count($marks); foreach ($marks as $mark) { if ($mark->time > $avgTime * 1.5) { $barClass = 'bar-danger'; $labelClass = 'label-important'; } elseif ($mark->time < $avgTime / 1.5) { $barClass = 'bar-success'; $labelClass = 'label-success'; } else { $barClass = 'bar-warning'; $labelClass = 'label-warning'; } if ($mark->memory > $avgMem * 1.5) { $barClassMem = 'bar-danger'; $labelClassMem = 'label-important'; } elseif ($mark->memory < $avgMem / 1.5) { $barClassMem = 'bar-success'; $labelClassMem = 'label-success'; } else { $barClassMem = 'bar-warning'; $labelClassMem = 'label-warning'; } $bars[] = (object) array( 'width' => round($mark->time / ($totalTime / 100), 4), 'class' => $barClass, 'tip' => $mark->tip ); $barsMem[] = (object) array( 'width' => round($mark->memory / ($totalMem / 100), 4), 'class' => $barClassMem, 'tip' => $mark->tip ); $htmlMarks[] = '
' . str_replace('label-time', $labelClass, str_replace('label-memory', $labelClassMem, $mark->html)) . '
'; } $html[] = '

' . JText::_('PLG_DEBUG_TIME') . '

'; $html[] = $this->renderBars($bars, 'profile'); $html[] = '

' . JText::_('PLG_DEBUG_MEMORY') . '

'; $html[] = $this->renderBars($barsMem, 'profile'); $html[] = '
' . implode('', $htmlMarks) . '
'; $db = JFactory::getDbo(); $log = $db->getLog(); if ($log) { $timings = $db->getTimings(); if ($timings) { $totalQueryTime = 0.0; $lastStart = null; foreach ($timings as $k => $v) { if (!($k % 2)) { $lastStart = $v; } else { $totalQueryTime += $v - $lastStart; } } $totalQueryTime = $totalQueryTime * 1000; if ($totalQueryTime > ($totalTime * 0.25)) { $labelClass = 'label-important'; } elseif ($totalQueryTime < ($totalTime * 0.15)) { $labelClass = 'label-success'; } else { $labelClass = 'label-warning'; } $html[] = '
' . JText::sprintf( 'PLG_DEBUG_QUERIES_TIME', sprintf('%.1f ms', $totalQueryTime) ) . '
'; } } return implode('', $html); } /** * Display memory usage. * * @return string * * @since 2.5 */ protected function displayMemoryUsage() { $bytes = memory_get_usage(); return '' . JHtml::_('number.bytes', $bytes) . '' . ' (' . number_format($bytes, 0, JText::_('DECIMALS_SEPARATOR'), JText::_('THOUSANDS_SEPARATOR')) . ' ' . JText::_('PLG_DEBUG_BYTES') . ')'; } /** * Display logged queries. * * @return string * * @since 2.5 */ protected function displayQueries() { $db = JFactory::getDbo(); $log = $db->getLog(); if (!$log) { return null; } $timings = $db->getTimings(); $callStacks = $db->getCallStacks(); $db->setDebug(false); $selectQueryTypeTicker = array(); $otherQueryTypeTicker = array(); $timing = array(); $maxtime = 0; if (isset($timings[0])) { $startTime = $timings[0]; $endTime = $timings[count($timings) - 1]; $totalBargraphTime = $endTime - $startTime; if ($totalBargraphTime > 0) { foreach ($log as $id => $query) { if (isset($timings[$id * 2 + 1])) { // Compute the query time: $timing[$k] = array( queryTime, timeBetweenQueries ). $timing[$id] = array(($timings[$id * 2 + 1] - $timings[$id * 2]) * 1000, $id > 0 ? ($timings[$id * 2] - $timings[$id * 2 - 1]) * 1000 : 0); $maxtime = max($maxtime, $timing[$id]['0']); } } } } else { $startTime = null; $totalBargraphTime = 1; } $bars = array(); $info = array(); $totalQueryTime = 0; $duplicates = array(); foreach ($log as $id => $query) { $did = md5($query); if (!isset($duplicates[$did])) { $duplicates[$did] = array(); } $duplicates[$did][] = $id; if ($timings && isset($timings[$id * 2 + 1])) { // Compute the query time. $queryTime = ($timings[$id * 2 + 1] - $timings[$id * 2]) * 1000; $totalQueryTime += $queryTime; // Run an EXPLAIN EXTENDED query on the SQL query if possible. $hasWarnings = false; $hasWarningsInProfile = false; if (isset($this->explains[$id])) { $explain = $this->tableToHtml($this->explains[$id], $hasWarnings); } else { $explain = JText::sprintf('PLG_DEBUG_QUERY_EXPLAIN_NOT_POSSIBLE', htmlspecialchars($query)); } // Run a SHOW PROFILE query. $profile = ''; if (in_array($db->name, array('mysqli', 'mysql'))) { if (isset($this->sqlShowProfileEach[$id])) { $profileTable = $this->sqlShowProfileEach[$id]; $profile = $this->tableToHtml($profileTable, $hasWarningsInProfile); } } // How heavy should the string length count: 0 - 1. $ratio = 0.5; $timeScore = $queryTime / ((strlen($query) + 1) * $ratio) * 200; // Determine color of bargraph depending on query speed and presence of warnings in EXPLAIN. if ($timeScore > 10) { $barClass = 'bar-danger'; $labelClass = 'label-important'; } elseif ($hasWarnings || $timeScore > 5) { $barClass = 'bar-warning'; $labelClass = 'label-warning'; } else { $barClass = 'bar-success'; $labelClass = 'label-success'; } // Computes bargraph as follows: Position begin and end of the bar relatively to whole execution time. $prevBar = ($id && isset($bars[$id - 1])) ? $bars[$id - 1] : 0; $barPre = round($timing[$id][1] / ($totalBargraphTime * 10), 4); $barWidth = round($timing[$id][0] / ($totalBargraphTime * 10), 4); $minWidth = 0.3; if ($barWidth < $minWidth) { $barPre -= ($minWidth - $barWidth); if ($barPre < 0) { $minWidth += $barPre; $barPre = 0; } $barWidth = $minWidth; } $bars[$id] = (object) array( 'class' => $barClass, 'width' => $barWidth, 'pre' => $barPre, 'tip' => sprintf('%.2f ms', $queryTime) ); $info[$id] = (object) array( 'class' => $labelClass, 'explain' => $explain, 'profile' => $profile, 'hasWarnings' => $hasWarnings ); } } // Remove single queries from $duplicates. $total_duplicates = 0; foreach ($duplicates as $did => $dups) { if (count($dups) < 2) { unset($duplicates[$did]); } else { $total_duplicates += count($dups); } } // Fix first bar width. $minWidth = 0.3; if ($bars[0]->width < $minWidth && isset($bars[1])) { $bars[1]->pre -= ($minWidth - $bars[0]->width); if ($bars[1]->pre < 0) { $minWidth += $bars[1]->pre; $bars[1]->pre = 0; } $bars[0]->width = $minWidth; } $memoryUsageNow = memory_get_usage(); $list = array(); foreach ($log as $id => $query) { // Start query type ticker additions. $fromStart = stripos($query, 'from'); $whereStart = stripos($query, 'where', $fromStart); if ($whereStart === false) { $whereStart = stripos($query, 'order by', $fromStart); } if ($whereStart === false) { $whereStart = strlen($query) - 1; } $fromString = substr($query, 0, $whereStart); $fromString = str_replace("\t", " ", $fromString); $fromString = str_replace("\n", " ", $fromString); $fromString = trim($fromString); // Initialise the select/other query type counts the first time. if (!isset($selectQueryTypeTicker[$fromString])) { $selectQueryTypeTicker[$fromString] = 0; } if (!isset($otherQueryTypeTicker[$fromString])) { $otherQueryTypeTicker[$fromString] = 0; } // Increment the count. if (stripos($query, 'select') === 0) { $selectQueryTypeTicker[$fromString] = $selectQueryTypeTicker[$fromString] + 1; unset($otherQueryTypeTicker[$fromString]); } else { $otherQueryTypeTicker[$fromString] = $otherQueryTypeTicker[$fromString] + 1; unset($selectQueryTypeTicker[$fromString]); } $text = $this->highlightQuery($query); if ($timings && isset($timings[$id * 2 + 1])) { // Compute the query time. $queryTime = ($timings[$id * 2 + 1] - $timings[$id * 2]) * 1000; // Timing. Formats the output for the query time with EXPLAIN query results as tooltip. $htmlTiming = '
' . JText::sprintf('PLG_DEBUG_QUERY_TIME', sprintf('%.2f ms', $timing[$id]['0'])); if ($timing[$id]['1']) { $htmlTiming .= ' ' . JText::sprintf('PLG_DEBUG_QUERY_AFTER_LAST', sprintf('%.2f ms', $timing[$id]['1'])); } $htmlTiming .= ''; if (isset($callStacks[$id][0]['memory'])) { $memoryUsed = $callStacks[$id][0]['memory'][1] - $callStacks[$id][0]['memory'][0]; $memoryBeforeQuery = $callStacks[$id][0]['memory'][0]; // Determine colour of query memory usage. if ($memoryUsed > 0.1 * $memoryUsageNow) { $labelClass = 'label-important'; } elseif ($memoryUsed > 0.05 * $memoryUsageNow) { $labelClass = 'label-warning'; } else { $labelClass = 'label-success'; } $htmlTiming .= ' ' . '' . JText::sprintf('PLG_DEBUG_MEMORY_USED_FOR_QUERY', sprintf('%.3f MB', $memoryUsed / 1048576), sprintf('%.3f MB', $memoryBeforeQuery / 1048576) ) . ''; if ($callStacks[$id][0]['memory'][2] !== null) { // Determine colour of number or results. $resultsReturned = $callStacks[$id][0]['memory'][2]; if ($resultsReturned > 3000) { $labelClass = 'label-important'; } elseif ($resultsReturned > 1000) { $labelClass = 'label-warning'; } elseif ($resultsReturned == 0) { $labelClass = ''; } else { $labelClass = 'label-success'; } $htmlResultsReturned = '' . (int) $resultsReturned . ''; $htmlTiming .= ' ' . '' . JText::sprintf('PLG_DEBUG_ROWS_RETURNED_BY_QUERY', $htmlResultsReturned) . ''; } } $htmlTiming .= '
'; // Bar. $htmlBar = $this->renderBars($bars, 'query', $id); // Profile query. $title = JText::_('PLG_DEBUG_PROFILE'); if (!$info[$id]->profile) { $title = '' . $title . ''; } $htmlProfile = ($info[$id]->profile ? $info[$id]->profile : JText::_('PLG_DEBUG_NO_PROFILE')); // Backtrace and call stack. $htmlCallStack = ''; if (isset($callStacks[$id])) { $htmlCallStackElements = array(); foreach ($callStacks[$id] as $functionCall) { if (isset($functionCall['file']) && isset($functionCall['line']) && (strpos($functionCall['file'], '/libraries/joomla/database/') === false)) { $htmlFile = htmlspecialchars($functionCall['file']); $htmlLine = htmlspecialchars($functionCall['line']); $htmlCallStackElements[] = '' . $this->formatLink($htmlFile, $htmlLine) . ''; } } $htmlCallStack = '
' . implode('
', $htmlCallStackElements) . '
'; if (!$this->linkFormat) { $htmlCallStack .= ''; } } $htmlAccordions = JHtml::_( 'bootstrap.startAccordion', 'dbg_query_' . $id, array( 'active' => ($info[$id]->hasWarnings ? ('dbg_query_explain_' . $id) : '') ) ); $htmlAccordions .= JHtml::_('bootstrap.addSlide', 'dbg_query_' . $id, JText::_('PLG_DEBUG_EXPLAIN'), 'dbg_query_explain_' . $id) . $info[$id]->explain . JHtml::_('bootstrap.endSlide'); $htmlAccordions .= JHtml::_('bootstrap.addSlide', 'dbg_query_' . $id, $title, 'dbg_query_profile_' . $id) . $htmlProfile . JHtml::_('bootstrap.endSlide'); if ($htmlCallStack) { $htmlAccordions .= JHtml::_('bootstrap.addSlide', 'dbg_query_' . $id, JText::_('PLG_DEBUG_CALL_STACK'), 'dbg_query_callstack_' . $id) . $htmlCallStack . JHtml::_('bootstrap.endSlide'); } $htmlAccordions .= JHtml::_('bootstrap.endAccordion'); $did = md5($query); if (isset($duplicates[$did])) { $dups = array(); foreach ($duplicates[$did] as $dup) { if ($dup != $id) { $dups[] = '#' . ($dup + 1) . ''; } } $htmlQuery = '
' . JText::_('PLG_DEBUG_QUERY_DUPLICATES') . ': ' . implode('  ', $dups) . '
' . '
' . $text . '
'; } else { $htmlQuery = '
' . $text . '
'; } $list[] = '' . $htmlTiming . $htmlBar . $htmlQuery . $htmlAccordions; } else { $list[] = '
' . $text . '
'; } } $totalTime = 0; foreach (JProfiler::getInstance('Application')->getMarks() as $mark) { $totalTime += $mark->time; } if ($totalQueryTime > ($totalTime * 0.25)) { $labelClass = 'label-important'; } elseif ($totalQueryTime < ($totalTime * 0.15)) { $labelClass = 'label-success'; } else { $labelClass = 'label-warning'; } $html = array(); $html[] = '

' . JText::sprintf('PLG_DEBUG_QUERIES_LOGGED', $this->totalQueries) . sprintf(' %.1f ms', ($totalQueryTime)) . '


'; if ($total_duplicates) { $html[] = '
' . '

' . JText::sprintf('PLG_DEBUG_QUERY_DUPLICATES_TOTAL_NUMBER', $total_duplicates) . '

'; foreach ($duplicates as $dups) { $links = array(); foreach ($dups as $dup) { $links[] = '#' . ($dup + 1) . ''; } $html[] = '
' . JText::sprintf('PLG_DEBUG_QUERY_DUPLICATES_NUMBER', count($links)) . ': ' . implode('  ', $links) . '
'; } $html[] = '
'; } $html[] = '
  1. ' . implode('
  2. ', $list) . '
'; if (!$this->params->get('query_types', 1)) { return implode('', $html); } // Get the totals for the query types. $totalSelectQueryTypes = count($selectQueryTypeTicker); $totalOtherQueryTypes = count($otherQueryTypeTicker); $totalQueryTypes = $totalSelectQueryTypes + $totalOtherQueryTypes; $html[] = '

' . JText::sprintf('PLG_DEBUG_QUERY_TYPES_LOGGED', $totalQueryTypes) . '

'; if ($totalSelectQueryTypes) { $html[] = '
' . JText::_('PLG_DEBUG_SELECT_QUERIES') . '
'; arsort($selectQueryTypeTicker); $list = array(); foreach ($selectQueryTypeTicker as $query => $occurrences) { $list[] = '
'
					. JText::sprintf('PLG_DEBUG_QUERY_TYPE_AND_OCCURRENCES', $this->highlightQuery($query), $occurrences)
					. '
'; } $html[] = '
  1. ' . implode('
  2. ', $list) . '
'; } if ($totalOtherQueryTypes) { $html[] = '
' . JText::_('PLG_DEBUG_OTHER_QUERIES') . '
'; arsort($otherQueryTypeTicker); $list = array(); foreach ($otherQueryTypeTicker as $query => $occurrences) { $list[] = '
'
					. JText::sprintf('PLG_DEBUG_QUERY_TYPE_AND_OCCURRENCES', $this->highlightQuery($query), $occurrences)
					. '
'; } $html[] = '
  1. ' . implode('
  2. ', $list) . '
'; } return implode('', $html); } /** * Render bars. * * @param array &$bars Array of bar data. * @param string $class Optional class for items. * @param integer $id Id of the bar to highlight. * * @return string * * @since 3.1.2 */ protected function renderBars(&$bars, $class = '', $id = null) { $html = array(); foreach ($bars as $i => $bar) { if (isset($bar->pre) && $bar->pre) { $html[] = '
'; } $barClass = trim('bar dbg-bar ' . (isset($bar->class) ? $bar->class : '')); if ($id !== null && $i == $id) { $barClass .= ' dbg-bar-active'; } $tip = ''; if (isset($bar->tip) && $bar->tip) { $barClass .= ' hasTooltip'; $tip = JHtml::tooltipText($bar->tip, '', 0); } $html[] = ''; } return '
' . implode('', $html) . '
'; } /** * Render array as HTML table. * * @param array $table Array to be rendered. * @param boolean &$hasWarnings Changes value to true if warnings are displayed, otherwise untouched. * * @return string * * @since 3.1.2 */ protected function tableToHtml($table, &$hasWarnings) { if (!$table) { return null; } $html = array(); $html[] = ''; foreach (array_keys($table[0]) as $k) { $html[] = ''; } $html[] = ''; $durations = array(); foreach ($table as $tr) { if (isset($tr['Duration'])) { $durations[] = $tr['Duration']; } } rsort($durations, SORT_NUMERIC); foreach ($table as $tr) { $html[] = ''; foreach ($tr as $k => $td) { if ($td === null) { // Display null's as 'NULL'. $td = 'NULL'; } // Treat special columns. if ($k == 'Duration') { if ($td >= 0.001 && ($td == $durations[0] || (isset($durations[1]) && $td == $durations[1]))) { // Duration column with duration value of more than 1 ms and within 2 top duration in SQL engine: Highlight warning. $html[] = ''; } $html[] = ''; } $html[] = '
' . htmlspecialchars($k) . '
'; $hasWarnings = true; } else { $html[] = ''; } // Display duration in milliseconds with the unit instead of seconds. $html[] = sprintf('%.1f ms', $td * 1000); } elseif ($k == 'Error') { // An error in the EXPLAIN query occured, display it instead of the result (means original query had syntax error most probably). $html[] = '' . htmlspecialchars($td); $hasWarnings = true; } elseif ($k == 'key') { if ($td === 'NULL') { // Displays query parts which don't use a key with warning. $html[] = '' . '' . JText::_('PLG_DEBUG_WARNING_NO_INDEX') . '' . ''; $hasWarnings = true; } else { $html[] = '' . htmlspecialchars($td) . ''; } } elseif ($k == 'Extra') { $htmlTd = htmlspecialchars($td); // Replace spaces with   (non-breaking spaces) for less tall tables displayed. $htmlTd = preg_replace('/([^;]) /', '\1 ', $htmlTd); // Displays warnings for "Using filesort". $htmlTdWithWarnings = str_replace('Using filesort', '' . JText::_('PLG_DEBUG_WARNING_USING_FILESORT') . '', $htmlTd); if ($htmlTdWithWarnings !== $htmlTd) { $hasWarnings = true; } $html[] = '' . $htmlTdWithWarnings; } else { $html[] = '' . htmlspecialchars($td); } $html[] = '
'; return implode('', $html); } /** * Disconnect handler for database to collect profiling and explain information. * * @param JDatabaseDriver &$db Database object. * * @return void * * @since 3.1.2 */ public function mysqlDisconnectHandler(&$db) { $db->setDebug(false); $this->totalQueries = $db->getCount(); $dbVersion5037 = (strncmp($db->name, 'mysql', 5) == 0) && version_compare($db->getVersion(), '5.0.37', '>='); if ($dbVersion5037) { try { // Check if profiling is enabled. $db->setQuery("SHOW VARIABLES LIKE 'have_profiling'"); $hasProfiling = $db->loadResult(); if ($hasProfiling) { // Run a SHOW PROFILE query. $db->setQuery('SHOW PROFILES'); $this->sqlShowProfiles = $db->loadAssocList(); if ($this->sqlShowProfiles) { foreach ($this->sqlShowProfiles as $qn) { // Run SHOW PROFILE FOR QUERY for each query where a profile is available (max 100). $db->setQuery('SHOW PROFILE FOR QUERY ' . (int) ($qn['Query_ID'])); $this->sqlShowProfileEach[(int) ($qn['Query_ID'] - 1)] = $db->loadAssocList(); } } } else { $this->sqlShowProfileEach[0] = array(array('Error' => 'MySql have_profiling = off')); } } catch (Exception $e) { $this->sqlShowProfileEach[0] = array(array('Error' => $e->getMessage())); } } if (in_array($db->name, array('mysqli', 'mysql', 'postgresql'))) { $log = $db->getLog(); foreach ($log as $k => $query) { $dbVersion56 = (strncmp($db->name, 'mysql', 5) == 0) && version_compare($db->getVersion(), '5.6', '>='); if ((stripos($query, 'select') === 0) || ($dbVersion56 && ((stripos($query, 'delete') === 0) || (stripos($query, 'update') === 0)))) { try { $db->setQuery('EXPLAIN ' . ($dbVersion56 ? 'EXTENDED ' : '') . $query); $this->explains[$k] = $db->loadAssocList(); } catch (Exception $e) { $this->explains[$k] = array(array('Error' => $e->getMessage())); } } } } } /** * Displays errors in language files. * * @return string * * @since 2.5 */ protected function displayLanguageFilesInError() { $errorfiles = JFactory::getLanguage()->getErrorFiles(); if (!count($errorfiles)) { return '

' . JText::_('JNONE') . '

'; } $html = array(); $html[] = '
    '; foreach ($errorfiles as $file => $error) { $html[] = '
  • ' . $this->formatLink($file) . str_replace($file, '', $error) . '
  • '; } $html[] = '
'; return implode('', $html); } /** * Display loaded language files. * * @return string * * @since 2.5 */ protected function displayLanguageFilesLoaded() { $html = array(); $html[] = '
    '; foreach (JFactory::getLanguage()->getPaths() as /* $extension => */ $files) { foreach ($files as $file => $status) { $html[] = '
  • '; $html[] = ($status) ? JText::_('PLG_DEBUG_LANG_LOADED') : JText::_('PLG_DEBUG_LANG_NOT_LOADED'); $html[] = ' : '; $html[] = $this->formatLink($file); $html[] = '
  • '; } } $html[] = '
'; return implode('', $html); } /** * Display untranslated language strings. * * @return string * * @since 2.5 */ protected function displayUntranslatedStrings() { $stripFirst = $this->params->get('strip-first'); $stripPref = $this->params->get('strip-prefix'); $stripSuff = $this->params->get('strip-suffix'); $orphans = JFactory::getLanguage()->getOrphans(); if (!count($orphans)) { return '

' . JText::_('JNONE') . '

'; } ksort($orphans, SORT_STRING); $guesses = array(); foreach ($orphans as $key => $occurance) { if (is_array($occurance) && isset($occurance[0])) { $info = $occurance[0]; $file = ($info['file']) ? $info['file'] : ''; if (!isset($guesses[$file])) { $guesses[$file] = array(); } // Prepare the key. if (($pos = strpos($info['string'], '=')) > 0) { $parts = explode('=', $info['string']); $key = $parts[0]; $guess = $parts[1]; } else { $guess = str_replace('_', ' ', $info['string']); if ($stripFirst) { $parts = explode(' ', $guess); if (count($parts) > 1) { array_shift($parts); $guess = implode(' ', $parts); } } $guess = trim($guess); if ($stripPref) { $guess = trim(preg_replace(chr(1) . '^' . $stripPref . chr(1) . 'i', '', $guess)); } if ($stripSuff) { $guess = trim(preg_replace(chr(1) . $stripSuff . '$' . chr(1) . 'i', '', $guess)); } } $key = trim(strtoupper($key)); $key = preg_replace('#\s+#', '_', $key); $key = preg_replace('#\W#', '', $key); // Prepare the text. $guesses[$file][] = $key . '="' . $guess . '"'; } } $html = array(); foreach ($guesses as $file => $keys) { $html[] = "\n\n# " . ($file ? $this->formatLink($file) : JText::_('PLG_DEBUG_UNKNOWN_FILE')) . "\n\n"; $html[] = implode("\n", $keys); } return '
' . implode('', $html) . '
'; } /** * Simple highlight for SQL queries. * * @param string $query The query to highlight. * * @return string * * @since 2.5 */ protected function highlightQuery($query) { $newlineKeywords = '#\b(FROM|LEFT|INNER|OUTER|WHERE|SET|VALUES|ORDER|GROUP|HAVING|LIMIT|ON|AND|CASE)\b#i'; $query = htmlspecialchars($query, ENT_QUOTES); $query = preg_replace($newlineKeywords, '
  \\0', $query); $regex = array( // Tables are identified by the prefix. '/(=)/' => '$1', // All uppercase words have a special meaning. '/(?)([A-Z_]{2,})(?!\w)/x' => '$1', // Tables are identified by the prefix. '/(' . JFactory::getDbo()->getPrefix() . '[a-z_0-9]+)/' => '$1' ); $query = preg_replace(array_keys($regex), array_values($regex), $query); $query = str_replace('*', '*', $query); return $query; } /** * Render the backtrace. * * Stolen from JError to prevent it's removal. * * @param Exception $error The Exception object to be rendered. * * @return string Rendered backtrace. * * @since 2.5 */ protected function renderBacktrace($error) { $backtrace = $error->getTrace(); $html = array(); if (is_array($backtrace)) { $j = 1; $html[] = ''; $html[] = ''; $html[] = ''; $html[] = ''; $html[] = ''; $html[] = ''; $html[] = ''; $html[] = ''; $html[] = ''; for ($i = count($backtrace) - 1; $i >= 0; $i--) { $link = ' '; if (isset($backtrace[$i]['file'])) { $link = $this->formatLink($backtrace[$i]['file'], $backtrace[$i]['line']); } $html[] = ''; $html[] = ''; if (isset($backtrace[$i]['class'])) { $html[] = ''; } else { $html[] = ''; } $html[] = ''; $html[] = ''; $j++; } $html[] = '
Call stack
#FunctionLocation
' . $j . '' . $backtrace[$i]['class'] . $backtrace[$i]['type'] . $backtrace[$i]['function'] . '()' . $backtrace[$i]['function'] . '()' . $link . '
'; } return implode('', $html); } /** * Replaces the Joomla! root with "JROOT" to improve readability. * Formats a link with a special value xdebug.file_link_format * from the php.ini file. * * @param string $file The full path to the file. * @param string $line The line number. * * @return string * * @since 2.5 */ protected function formatLink($file, $line = '') { $link = str_replace(JPATH_ROOT, 'JROOT', $file); $link .= ($line) ? ':' . $line : ''; if ($this->linkFormat) { $href = $this->linkFormat; $href = str_replace('%f', $file, $href); $href = str_replace('%l', $line, $href); $html = '' . $link . ''; } else { $html = $link; } return $html; } /** * Store log messages so they can be displayed later. * This function is passed log entries by JLogLoggerCallback. * * @param JLogEntry $entry A log entry. * * @return void * * @since 3.1 */ public function logger(JLogEntry $entry) { $this->logEntries[] = $entry; } /** * Display log messages. * * @return string * * @since 3.1 */ protected function displayLogs() { $priorities = array( JLog::EMERGENCY => 'EMERGENCY', JLog::ALERT => 'ALERT', JLog::CRITICAL => 'CRITICAL', JLog::ERROR => 'ERROR', JLog::WARNING => 'WARNING', JLog::NOTICE => 'NOTICE', JLog::INFO => 'INFO', JLog::DEBUG => 'DEBUG' ); $out = array(); foreach ($this->logEntries as $entry) { $out[] = '
' . $priorities[$entry->priority] . ' - ' . $entry->category . '
' . $entry->message . ''; } return implode('

', $out); } } system/debug/debug.xml000066600000013473150771657550011024 0ustar00 plg_system_debug Joomla! Project December 2006 Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org 3.0.0 PLG_DEBUG_XML_DESCRIPTION debug.php index.html en-GB.plg_system_debug.ini en-GB.plg_system_debug.sys.ini
system/redirect/redirect.php000066600000007374150771657550012244 0ustar00isAdmin() and ($error->getCode() == 404)) { // Get the full current URI. $uri = JUri::getInstance(); $current = rawurldecode($uri->toString(array('scheme', 'host', 'port', 'path', 'query', 'fragment'))); // Attempt to ignore idiots. if ((strpos($current, 'mosConfig_') !== false) || (strpos($current, '=http://') !== false)) { // Render the error page. JError::customErrorPage($error); } // See if the current url exists in the database as a redirect. $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select($db->quoteName('new_url')) ->select($db->quoteName('published')) ->from($db->quoteName('#__redirect_links')) ->where($db->quoteName('old_url') . ' = ' . $db->quote($current)); $db->setQuery($query, 0, 1); $link = $db->loadObject(); // If a redirect exists and is published, permanently redirect. if ($link and ($link->published == 1)) { $app->redirect($link->new_url, true); } else { $referer = empty($_SERVER['HTTP_REFERER']) ? '' : $_SERVER['HTTP_REFERER']; $query = $db->getQuery(true) ->select($db->quoteName('id')) ->from($db->quoteName('#__redirect_links')) ->where($db->quoteName('old_url') . ' = ' . $db->quote($current)); $db->setQuery($query); $res = $db->loadResult(); if (!$res) { // If not, add the new url to the database. $columns = array( $db->quoteName('old_url'), $db->quoteName('new_url'), $db->quoteName('referer'), $db->quoteName('comment'), $db->quoteName('hits'), $db->quoteName('published'), $db->quoteName('created_date') ); $query->clear() ->insert($db->quoteName('#__redirect_links'), false) ->columns($columns) ->values( $db->quote($current) . ', ' . $db->quote('') . ' ,' . $db->quote($referer) . ', ' . $db->quote('') . ',1,0, ' . $db->quote(JFactory::getDate()->toSql()) ); $db->setQuery($query); $db->execute(); } else { // Existing error url, increase hit counter. $query->clear() ->update($db->quoteName('#__redirect_links')) ->set($db->quoteName('hits') . ' = ' . $db->quoteName('hits') . ' + 1') ->where('id = ' . (int) $res); $db->setQuery($query); $db->execute(); } // Render the error page. JError::customErrorPage($error); } } else { // Render the error page. JError::customErrorPage($error); } } } system/redirect/index.html000066600000000037150771657550011714 0ustar00 system/redirect/redirect.xml000066600000001472150771657550012246 0ustar00 plg_system_redirect Joomla! Project April 2009 Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.0.0 PLG_REDIRECT_XML_DESCRIPTION redirect.php index.html en-GB.plg_system_redirect.ini en-GB.plg_system_redirect.sys.ini system/mobiletemplate/mobiletemplate.xml000066600000005207150771657550014652 0ustar00 plg_system_mobiletemplate nhuang nhuang@nhuang.com http://www.nhuang.com 2014-4-9 Nhuang All rights reserved. GNU General Public License version 2 or later 1.2.0 PLG_SYSTEM_MOBILETEMPLATE_XML_DESCRIPTION mobiletemplate.php en-GB.plg_system_mobiletemplate.ini en-GB.plg_system_mobiletemplate.sys.ini
system/mobiletemplate/mobiletemplate.php000066600000012266150771657550014644 0ustar00isAdmin()){ return; } $mobile_style=$this->params->get('mobile_style','iPhone|iPod|BlackBerry|Pre|Palm|Googlebot-Mobile|mobi|Safari Mobile|Windows Mobile|Android|Opera Mini|mobile'); //$mobile_style = 'iPhone|iPod|BlackBerry|Pre|Palm|Googlebot-Mobile|mobi|Safari Mobile|Windows Mobile|Android|Opera Mini|mobile'; $mobile_array = explode('|',$mobile_style); $is =false; $filter = $this->params->get('filter',array()); $prip=$this->params->get('mob_ip_en','0'); $prus=$this->params->get('mob_us_en','0'); if ($prus=="1") { foreach ($mobile_array as $mobile) { if (preg_match("/$mobile/i",$_SERVER['HTTP_USER_AGENT'])) { $is =true; break; } } foreach($filter as $f_word){ if (preg_match("/$f_word/i",$_SERVER['HTTP_USER_AGENT'])) { $is =false; } } } if ($prip=="1") { $iplist = explode("\r\n",$this->params->get('mob_ip','')); if (count($iplist)<>0) { foreach($iplist as $ip) { if(trim($ip)==$_SERVER['REMOTE_ADDR']) { $is=true; break; } } } } if ($is) { $template_name = $this->params->get('template_name','mobiletemplate'); $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select($db->qn('template')); $query->select($db->qn('params')); $query->from($db->qn('#__template_styles')); $query->where($db->qn('client_id'). ' = 0'); $query->where($db->qn('template'). ' = "'.$template_name.'"'); $query->order($db->qn('id')); $db->setQuery( $query ); $row = $db->loadObject(); if(!$row || empty($row->template)){ return; } if(is_dir(JPATH_THEMES."/".$row->template)){ $app->setTemplate($row->template, (new JRegistry($row->params))); } } } public function onContentPrepare($context, &$article, &$params, $page = 0){ $app = JFactory::getApplication(); if ( $app->isAdmin()) { return; } //find the {IfMobile} and {EndIfMobile} pair and see if there is work to do $matches = array(); preg_match_all('/.*?{IfMobile.*?}(?s).*?(?-s){EndIfMobile}.*?/im', $article->text, $matches, PREG_OFFSET_CAPTURE); if(!empty($matches) && !empty($matches[0])){ //get the mobile parameters $isMobile = $app->getUserState('cmobile.ismobile', false); $isDevice = $app->getUserState('cmobile.isdevice', false); $mobileDevice = new JRegistry($app->getUserState('cmobile.device', '{}')); $replacePositionShift = 0; foreach($matches[0] as $i => $match){ $originalText = $match[0]; $replacePosition = $match[1]; $replaceLength = strlen($originalText); $mobileParts = $nonMobileParts = $conditions = array(); preg_match('/{IfMobile(.*?)}(.*?)(?:{Else.*?Mobile(?:.*?)}|{EndIfMobile})/is', $originalText, $mobileParts, PREG_OFFSET_CAPTURE); //TODO: ElseIf statemenets preg_match('/{ElseMobile}(.*?){EndIfMobile}/is', $originalText, $nonMobileParts, PREG_OFFSET_CAPTURE); $statementPos = $mobileParts[0][1]; $statementLength = (strpos($originalText, '{EndIfMobile}') + strlen('{EndIfMobile}')) - $statementPos; $newText = ''; $done = false; if($isMobile || $isDevice){ //its a mobile device, get the mobile part of the content $content = $mobileParts[2][0]; $contentPosition = $mobileParts[2][1]; $replace = false; //check if there are conditions, and see if they are met before replacing if(isset($mobileParts[1][0]) && trim($mobileParts[1][0]) != ''){ //mobile condition $conditions = explode(',', trim($mobileParts[1][0])); if(trim($conditions[0]) === 'isdevice' && $isDevice){ $replace = true; } //first part is the device elseif($isMobile && $mobileDevice->get('name') === trim($conditions[0])){ //conditions are met, replace the text $replace = true; } }elseif($isMobile){ //no condition, just mobile enabled $replace = true; } if($replace){ //replace the text $newText = $content; $done = true; } } if((!$isMobile && !$isDevice) || !$done){ //not a mobile device, or conditions not met. Get the non mobile part of the content if(!empty($nonMobileParts)){ $content = $nonMobileParts[1][0]; $contentPosition = $nonMobileParts[1][1]; $newText = $content; } } //replace the newText in the original content $originalText = substr_replace($originalText, $newText, $statementPos, $statementLength); $article->text = substr_replace($article->text, $originalText, ($replacePosition - $replacePositionShift), $replaceLength); //keep track of the changing positions after replacing content $replacePositionShift += ($replaceLength - strlen($originalText)); } } } } system/remember/remember.php000066600000003577150771657550012237 0ustar00app->isAdmin()) { return; } // Check for a cookie if user is not logged in if (JFactory::getUser()->get('guest')) { $cookieName = JUserHelper::getShortHashedUserAgent(); // Check for the cookie if ($this->app->input->cookie->get($cookieName)) { $this->app->login(array('username' => ''), array('silent' => true)); } } } /** * Imports the authentication plugin on user logout to make sure that the cookie is destroyed. * * @param array $user Holds the user data. * @param array $options Array holding options (remember, autoregister, group). * * @return boolean */ public function onUserLogout($user, $options) { // No remember me for admin if ($this->app->isAdmin()) { return true; } $cookieName = JUserHelper::getShortHashedUserAgent(); // Check for the cookie if ($this->app->input->cookie->get($cookieName)) { // Make sure authentication group is loaded to process onUserAfterLogout event JPluginHelper::importPlugin('authentication'); } return true; } } system/remember/remember.xml000066600000001472150771657550012240 0ustar00 plg_system_remember Joomla! Project April 2007 Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.0.0 PLG_REMEMBER_XML_DESCRIPTION remember.php index.html en-GB.plg_system_remember.ini en-GB.plg_system_remember.sys.ini system/remember/index.html000066600000000037150771657550011711 0ustar00 system/widgetkit_system/widgetkit_system.php000066600000001071150771657550015624 0ustar00 System - Widgetkit YOOtheme May 2011 Copyright (C) 2007 - 2011 YOOtheme GmbH YOOtheme Proprietary Use License (http://www.yootheme.com/license) info@yootheme.com http://www.yootheme.com 1.0.0 Plugin for Widgetkit developed by YOOtheme (http://www.yootheme.com) widgetkit_system.php system/p3p/index.html000066600000000037150771657550010615 0ustar00 system/p3p/p3p.php000066600000001632150771657550010035 0ustar00params->get('header', 'NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM'); $header = trim($header); // Bail out on empty header (why would anyone do that?!). if ( empty($header) ) { return; } // Replace any existing P3P headers in the response. JFactory::getApplication()->setHeader('P3P', 'CP="' . $header . '"', true); } } system/p3p/p3p.xml000066600000002114150771657550010042 0ustar00 plg_system_p3p Joomla! Project September 2010 Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.0.0 PLG_P3P_XML_DESCRIPTION p3p.php index.html en-GB.plg_system_p3p.ini en-GB.plg_system_p3p.sys.ini
system/languagefilter/languagefilter.php000066600000044053150771657550014617 0ustar00getRouter(); if ($app->isSite()) { // Setup language data. self::$mode_sef = ($router->getMode() == JROUTER_MODE_SEF) ? true : false; self::$sefs = JLanguageHelper::getLanguages('sef'); self::$lang_codes = JLanguageHelper::getLanguages('lang_code'); self::$default_lang = JComponentHelper::getParams('com_languages')->get('site', 'en-GB'); self::$default_sef = self::$lang_codes[self::$default_lang]->sef; self::$homes = MultilangstatusHelper::getHomes(); $user = JFactory::getUser(); $levels = $user->getAuthorisedViewLevels(); foreach (self::$sefs as $sef => &$language) { if (isset($language->access) && $language->access && !in_array($language->access, $levels)) { unset(self::$sefs[$sef]); } } $app->setLanguageFilter(true); jimport('joomla.environment.uri'); $uri = JUri::getInstance(); if (self::$mode_sef) { // Get the route path from the request. $path = JString::substr($uri->toString(), JString::strlen($uri->base())); // Apache mod_rewrite is Off. $path = JFactory::getConfig()->get('sef_rewrite') ? $path : JString::substr($path, 10); // Trim any spaces or slashes from the ends of the path and explode into segments. $path = JString::trim($path, '/ '); $parts = explode('/', $path); // The language segment is always at the beginning of the route path if it exists. $sef = $uri->getVar('lang'); if (!empty($parts) && empty($sef)) { $sef = reset($parts); } } else { $sef = $uri->getVar('lang'); } if (isset(self::$sefs[$sef])) { $lang_code = self::$sefs[$sef]->lang_code; // Create a cookie. $conf = JFactory::getConfig(); $cookie_domain = $conf->get('config.cookie_domain', ''); $cookie_path = $conf->get('config.cookie_path', '/'); setcookie(JApplication::getHash('language'), $lang_code, $this->getLangCookieTime(), $cookie_path, $cookie_domain); $app->input->cookie->set(JApplication::getHash('language'), $lang_code); // Set the request var. $app->input->set('language', $lang_code); } } parent::__construct($subject, $config); // Detect browser feature. if ($app->isSite()) { $app->setDetectBrowser($this->params->get('detect_browser', '1') == '1'); } } } /** * After initialise. * * @return void * * @since 1.6 */ public function onAfterInitialise() { $app = JFactory::getApplication(); $app->item_associations = $this->params->get('item_associations', 0); if ($app->isSite()) { self::$tag = JFactory::getLanguage()->getTag(); $router = $app->getRouter(); // Attach build rules for language SEF. $router->attachBuildRule(array($this, 'buildRule')); // Attach parse rules for language SEF. $router->attachParseRule(array($this, 'parseRule')); // Add custom site name. $languages = JLanguageHelper::getLanguages('lang_code'); if (isset($languages[self::$tag]) && $languages[self::$tag]->sitename) { JFactory::getConfig()->set('sitename', $languages[self::$tag]->sitename); } } } /** * Add build rule to router. * * @param JRouter &$router JRouter object. * @param JUri &$uri JUri object. * * @return void * * @since 1.6 */ public function buildRule(&$router, &$uri) { $sef = $uri->getVar('lang'); if (empty($sef)) { $sef = self::$lang_codes[self::$tag]->sef; } elseif (!isset(self::$sefs[$sef])) { $sef = self::$default_sef; } $Itemid = $uri->getVar('Itemid'); if (!is_null($Itemid)) { if ($item = JFactory::getApplication()->getMenu()->getItem($Itemid)) { if ($item->home && $uri->getVar('option') != 'com_search') { $link = $item->link; $parts = JString::parse_url($link); if (isset ($parts['query']) && strpos($parts['query'], '&')) { $parts['query'] = str_replace('&', '&', $parts['query']); } parse_str($parts['query'], $vars); // Test if the url contains same vars as in menu link. $test = true; foreach ($uri->getQuery(true) as $key => $value) { if (!in_array($key, array('format', 'Itemid', 'lang')) && !(isset($vars[$key]) && $vars[$key] == $value)) { $test = false; break; } } if ($test) { foreach ($vars as $key => $value) { $uri->delVar($key); } $uri->delVar('Itemid'); } } } else { $uri->delVar('Itemid'); } } if (self::$mode_sef) { $uri->delVar('lang'); if ($this->params->get('remove_default_prefix', 0) == 0 || $sef != self::$default_sef || $sef != self::$lang_codes[self::$tag]->sef || $this->params->get('detect_browser', 1) && JLanguageHelper::detectLanguage() != self::$tag && !self::$cookie) { $uri->setPath($uri->getPath() . '/' . $sef . '/'); } else { $uri->setPath($uri->getPath()); } } else { $uri->setVar('lang', $sef); } } /** * Add parse rule to router. * * @param JRouter &$router JRouter object. * @param JUri &$uri JUri object. * * @return void * * @since 1.6 */ public function parseRule(&$router, &$uri) { $app = JFactory::getApplication(); $lang_code = $app->input->cookie->getString(JApplication::getHash('language')); // No cookie - let's try to detect browser language or use site default. if (!$lang_code) { if ($this->params->get('detect_browser', 1)) { $lang_code = JLanguageHelper::detectLanguage(); } else { $lang_code = self::$default_lang; } } if (self::$mode_sef) { $path = $uri->getPath(); $parts = explode('/', $path); $sef = $parts[0]; // Redirect only if not in post. if (!empty($lang_code) && ($app->input->getMethod() != "POST" || count($app->input->post) == 0)) { if ($this->params->get('remove_default_prefix', 0) == 0) { // Redirect if sef does not exist. if (!isset(self::$sefs[$sef])) { // Use the current language sef or the default one. $sef = isset(self::$lang_codes[$lang_code]) ? self::$lang_codes[$lang_code]->sef : self::$default_sef; $uri->setPath($sef . '/' . $path); if ($app->getCfg('sef_rewrite')) { $app->redirect($uri->base() . $uri->toString(array('path', 'query', 'fragment'))); } else { $path = $uri->toString(array('path', 'query', 'fragment')); $app->redirect($uri->base() . 'index.php' . ($path ? ('/' . $path) : '')); } } } else { // Redirect if sef does not exist and language is not the default one. if (!isset(self::$sefs[$sef]) && $lang_code != self::$default_lang) { $sef = isset(self::$lang_codes[$lang_code]) && empty($path) ? self::$lang_codes[$lang_code]->sef : self::$default_sef; $uri->setPath($sef . '/' . $path); if ($app->getCfg('sef_rewrite')) { $app->redirect($uri->base() . $uri->toString(array('path', 'query', 'fragment'))); } else { $path = $uri->toString(array('path', 'query', 'fragment')); $app->redirect($uri->base() . 'index.php' . ($path ? ('/' . $path) : '')); } } // Redirect if sef is the default one. elseif (isset(self::$sefs[$sef]) && self::$default_lang == self::$sefs[$sef]->lang_code && (!$this->params->get('detect_browser', 1) || JLanguageHelper::detectLanguage() == self::$tag || self::$cookie) ) { array_shift($parts); $uri->setPath(implode('/', $parts)); if ($app->getCfg('sef_rewrite')) { $app->redirect($uri->base() . $uri->toString(array('path', 'query', 'fragment'))); } else { $path = $uri->toString(array('path', 'query', 'fragment')); $app->redirect($uri->base() . 'index.php' . ($path ? ('/' . $path) : '')); } } } } $lang_code = isset(self::$sefs[$sef]) ? self::$sefs[$sef]->lang_code : ''; if ($lang_code && JLanguage::exists($lang_code)) { array_shift($parts); $uri->setPath(implode('/', $parts)); } } else { $sef = $uri->getVar('lang'); if (!isset(self::$sefs[$sef])) { $sef = isset(self::$lang_codes[$lang_code]) ? self::$lang_codes[$lang_code]->sef : self::$default_sef; $uri->setVar('lang', $sef); if ($app->input->getMethod() != "POST" || count($app->input->post) == 0) { $app->redirect(JUri::base(true) . '/index.php?' . $uri->getQuery()); } } } $array = array('lang' => $sef); return $array; } /** * Before store user method. * * Method is called before user data is stored in the database. * * @param array $user Holds the old user data. * @param boolean $isnew True if a new user is stored. * @param array $new Holds the new user data. * * @return void * * @since 1.6 */ public function onUserBeforeSave($user, $isnew, $new) { if ($this->params->get('automatic_change', '1') == '1' && key_exists('params', $user)) { $registry = new JRegistry; $registry->loadString($user['params']); self::$_user_lang_code = $registry->get('language'); if (empty(self::$_user_lang_code)) { self::$_user_lang_code = self::$default_lang; } } } /** * After store user method. * * Method is called after user data is stored in the database. * * @param array $user Holds the new user data. * @param boolean $isnew True if a new user is stored. * @param boolean $success True if user was succesfully stored in the database. * @param string $msg Message. * * @return void * * @since 1.6 */ public function onUserAfterSave($user, $isnew, $success, $msg) { if ($this->params->get('automatic_change', '1') == '1' && key_exists('params', $user) && $success) { $registry = new JRegistry; $registry->loadString($user['params']); $lang_code = $registry->get('language'); if (empty($lang_code)) { $lang_code = self::$default_lang; } $app = JFactory::getApplication(); if ($lang_code == self::$_user_lang_code || !isset(self::$lang_codes[$lang_code])) { if ($app->isSite()) { $app->setUserState('com_users.edit.profile.redirect', null); } } else { if ($app->isSite()) { $app->setUserState('com_users.edit.profile.redirect', 'index.php?Itemid=' . $app->getMenu()->getDefault($lang_code)->id . '&lang=' . self::$lang_codes[$lang_code]->sef); self::$tag = $lang_code; // Create a cookie. $conf = JFactory::getConfig(); $cookie_domain = $conf->get('config.cookie_domain', ''); $cookie_path = $conf->get('config.cookie_path', '/'); setcookie(JApplication::getHash('language'), $lang_code, $this->getLangCookieTime(), $cookie_path, $cookie_domain); } } } } /** * Method to handle any login logic and report back to the subject. * * @param array $user Holds the user data. * @param array $options Array holding options (remember, autoregister, group). * * @return boolean True on success. * * @since 1.5 */ public function onUserLogin($user, $options = array()) { $app = JFactory::getApplication(); $menu = $app->getMenu(); if ($app->isSite() && $this->params->get('automatic_change', 1)) { // Load associations. $assoc = JLanguageAssociations::isEnabled(); if ($assoc) { $active = $menu->getActive(); if ($active) { $associations = MenusHelper::getAssociations($active->id); } } $lang_code = $user['language']; if (empty($lang_code)) { $lang_code = self::$default_lang; } if ($lang_code != self::$tag) { // Change language. self::$tag = $lang_code; // Create a cookie. $conf = JFactory::getConfig(); $cookie_domain = $conf->get('config.cookie_domain', ''); $cookie_path = $conf->get('config.cookie_path', '/'); setcookie(JApplication::getHash('language'), $lang_code, $this->getLangCookieTime(), $cookie_path, $cookie_domain); // Change the language code. JFactory::getLanguage()->setLanguage($lang_code); // Change the redirect (language has changed). if (isset($associations[$lang_code]) && $menu->getItem($associations[$lang_code])) { $itemid = $associations[$lang_code]; $app->setUserState('users.login.form.return', 'index.php?&Itemid=' . $itemid); } else { $itemid = isset(self::$homes[$lang_code]) ? self::$homes[$lang_code]->id : self::$homes['*']->id; $app->setUserState('users.login.form.return', 'index.php?&Itemid=' . $itemid); } } } } /** * Method to add alternative meta tags for associated menu items. * * @return void * * @since 1.7 */ public function onAfterDispatch() { $app = JFactory::getApplication(); $doc = JFactory::getDocument(); $menu = $app->getMenu(); $server = JUri::getInstance()->toString(array('scheme', 'host', 'port')); $option = $app->input->get('option'); $eName = JString::ucfirst(JString::str_ireplace('com_', '', $option)); if ($app->isSite() && $this->params->get('alternate_meta') && $doc->getType() == 'html') { // Get active menu item. $active = $menu->getActive(); // Load menu associations. if ($active) { // Get menu item link. if ($app->getCfg('sef')) { $active_link = JRoute::_('index.php?Itemid=' . $active->id, false); } else { $active_link = JRoute::_($active->link . '&Itemid=' . $active->id, false); } if ($active_link == JUri::base(true) . '/') { $active_link .= 'index.php'; } // Get current link. $current_link = JUri::getInstance()->toString(array('path', 'query')); if ($current_link == JUri::base(true) . '/') { $current_link .= 'index.php'; } // Check the exact menu item's URL. if ($active_link == $current_link) { $associations = MenusHelper::getAssociations($active->id); unset($associations[$active->language]); } } // Load component associations. $cName = JString::ucfirst($eName . 'HelperAssociation'); JLoader::register($cName, JPath::clean(JPATH_COMPONENT_SITE . '/helpers/association.php')); if (class_exists($cName) && is_callable(array($cName, 'getAssociations'))) { $cassociations = call_user_func(array($cName, 'getAssociations')); $lang_code = $app->input->cookie->getString(JApplication::getHash('language')); // No cookie - let's try to detect browser language or use site default. if (!$lang_code) { if ($this->params->get('detect_browser', 1)) { $lang_code = JLanguageHelper::detectLanguage(); } else { $lang_code = self::$default_lang; } } unset($cassociations[$lang_code]); } // Handle the default associations. if ((!empty($associations) || !empty($cassociations)) && $this->params->get('item_associations')) { foreach (JLanguageHelper::getLanguages() as $language) { if (!JLanguage::exists($language->lang_code)) { continue; } if (isset($cassociations[$language->lang_code])) { $link = JRoute::_($cassociations[$language->lang_code] . '&lang=' . $language->sef); $doc->addHeadLink($server . $link, 'alternate', 'rel', array('hreflang' => $language->lang_code)); } elseif (isset($associations[$language->lang_code])) { $item = $menu->getItem($associations[$language->lang_code]); if ($item) { if ($app->getCfg('sef')) { $link = JRoute::_('index.php?Itemid=' . $item->id . '&lang=' . $language->sef); } else { $link = JRoute::_($item->link . '&Itemid=' . $item->id . '&lang=' . $language->sef); } $doc->addHeadLink($server . $link, 'alternate', 'rel', array('hreflang' => $language->lang_code)); } } } } // Link to the home page of each language. elseif ($active && $active->home) { foreach (JLanguageHelper::getLanguages() as $language) { if (!JLanguage::exists($language->lang_code)) { continue; } $item = $menu->getDefault($language->lang_code); if ($item && $item->language != $active->language && $item->language != '*') { if ($app->getCfg('sef')) { $link = JRoute::_('index.php?Itemid=' . $item->id . '&lang=' . $language->sef); } else { $link = JRoute::_($item->link . '&Itemid=' . $item->id . '&lang=' . $language->sef); } $doc->addHeadLink($server . $link, 'alternate', 'rel', array('hreflang' => $language->lang_code)); } } } } } /** * Get the language cookie settings. * * @return string The cookie time. * * @since 3.0.4 */ private function getLangCookieTime() { if ($this->params->get('lang_cookie', 1) == 1) { $lang_cookie = time() + 365 * 86400; } else { $lang_cookie = 0; } return $lang_cookie; } } system/languagefilter/languagefilter.xml000066600000006003150771657550014621 0ustar00 plg_system_languagefilter Joomla! Project July 2010 Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.0.0 PLG_SYSTEM_LANGUAGEFILTER_XML_DESCRIPTION languagefilter.php index.html en-GB.plg_system_languagefilter.ini en-GB.plg_system_languagefilter.sys.ini
system/languagefilter/index.html000066600000000037150771657550013104 0ustar00 system/zoofinder/zoofinder.xml000066600000004152150771657550012640 0ustar00 zoofinder 1.0 PLG_ZOOFINDER_DESC script.php zoofinder.php index.html en-GB/en-GB.plg_system_zoofinder.ini ru-RU/ru-RU.plg_system_zoofinder.ini en-GB/en-GB.plg_system_zoofinder.sys.ini ru-RU/ru-RU.plg_system_zoofinder.sys.ini
system/zoofinder/index.html000066600000000000150771657550012100 0ustar00system/zoofinder/script.php000066600000000602150771657550012130 0ustar00getQuery( true ); $query->update( '#__extensions' )->set( 'enabled=1' )->where( 'type=' . $db->q( 'plugin' ) )->where( 'element=' . $db->q( 'zoofinder' ) ); $db->setQuery( $query )->execute(); } }system/zoofinder/zoofinder.php000066600000034675150771657550012644 0ustar00loadLanguage(); } function onAfterRender() { require_once( $_SERVER['DOCUMENT_ROOT'].'/libraries/phpmorphy/src/common.php'); $dir = $_SERVER['DOCUMENT_ROOT'].'/libraries/phpmorphy/dicts'; $lang = 'ru_RU'; $opts = array( 'storage' => PHPMORPHY_STORAGE_MEM); try { $morphy = new phpMorphy($dir, $lang, $opts); } catch(phpMorphy_Exception $e) { die('Error occured while creating phpMorphy instance: ' . $e->getMessage()); } $db= JFactory::getDBO(); $doc = JFactory::getDocument(); $app =JFactory::getApplication(); $jinput = JFactory::getApplication()->input; $item_id=$jinput->get( 'item_id', 0,'INT' ); $mat_id=''; if ($jinput->get( 'option', '' )=="com_content") { $mat_id=$jinput->get( 'id', 0,'INT' ); } // проверка, что мы не в административной панели if ($app->getName()!= 'site') { return true; } //prepare params $zoo_types=explode("\r\n", $this->params->get('zootypes')); $type_name=array(); foreach($zoo_types as $type) { $mtype=explode("|", $type); $type_name[]=$mtype[0]; } $type_name = array_unique($type_name); $temp=explode("\r\n", $this->params->get('fixwords')); $fixwords=array(); foreach($temp as $word) { $tmp=explode("|", $word); if (isset($tmp[1])) {$fixwords[$tmp[0]]=$tmp[1];} } unset($temp,$tmp); $temp=explode("\r\n", mb_strtoupper($this->params->get('pluswords'))); $pluswords=array(); foreach($temp as $word) { $tmp=explode("|", $word); if (isset($tmp[1])) {$pluswords[$tmp[0]]=$tmp[1];} } unset($temp,$tmp); foreach ($type_name as $type) $sql_type[]="i.type=\"".$type."\""; $sql_type=implode(" or ", $sql_type); if ($sql_type) $sql_type=' ('.$sql_type.') '; $livetime=$this->params->get('livetime'); if ($this->params->get('zooenabled')=="Да") { $zoo_items=Array(); $b=true; //текущий материал принудительно /*if ($item_id) { $zoo_items[]=$item_id; $b=false; }*/ //текущий материал если отсутствует или устарел if ($item_id) { $item = $db->setQuery(" SELECT id FROM jos_zoo_finders where type=1 and matid={$item_id} and date > DATE_SUB(CURRENT_DATE, INTERVAL {$livetime} DAY)")->loadAssoc(); if ($item['id']=="") { $zoo_items[]=$item_id; $b=false;} } //материал из индекса но устаревший. if ($b) { $old = $db->setQuery(" SELECT f.matid matid FROM jos_zoo_finders f, jos_zoo_item i where f.matid=i.id and f.type=1 and i.publish_up and {$sql_type} and f.date < DATE_SUB(CURRENT_DATE, INTERVAL {$livetime} DAY) ORDER BY i.modified DESC limit 1")->loadAssoc(); if ($old['matid']) { $zoo_items[]=$old[matid]; $b=false;} } //материал отсутствующий в индексе if ($b) { $noindex = $db->setQuery("SELECT i.id FROM jos_zoo_item i left JOIN jos_zoo_finders f ON f.matid=i.id where f.matid is NULL and i.publish_up and {$sql_type} ORDER BY i.modified DESC limit 1 ")->loadAssoc(); if ($noindex['id']<>"") { $zoo_items[]=$noindex['id']; $b=false;} } /*SELECT i.id FROM jos_zoo_item i left JOIN jos_zoo_finders f ON f.matid=i.id where f.matid is NULL and i.publish_up and (i.type="news" or i.type="product" or i.type="proektnyj-opyt") ORDER BY i.modified DESC*/ } //indexing zoo if ($zoo_items and $this->params->get('zooenabled')=="Да") { foreach ($zoo_items as $item) { $zoo_item_fields = $db->setQuery('SELECT *, year(created) year FROM jos_zoo_item where id='.$item)->loadAssoc(); if ($zoo_item_fields) { //создание записи finders $mat = $db->setQuery("SELECT id FROM jos_zoo_finders WHERE type=\"1\" and matid=\"{$item}\"")->loadAssoc(); if ($mat[id]) { $db->setQuery("UPDATE jos_zoo_finders SET date=NOW() where type=\"1\" and matid=\"{$item}\"")->Execute(); $last=$mat[id]; } else { $db->setQuery("INSERT INTO jos_zoo_finders (id,type,matid,date) VALUES(NULL,\"1\",\"{$item}\",NOW())")->Execute(); $mat = $db->setQuery("SELECT id FROM jos_zoo_finders WHERE type=\"1\" and matid=\"{$item}\"")->loadAssoc(); $last=$mat[id]; } $a=json_decode($zoo_item_fields['elements'],true); $buf=''; $buf.=$zoo_item_fields['name'].' '; foreach($zoo_types as $type) { $mtype=explode("|", $type); if ($zoo_item_fields['type']==$mtype[0]) { $buf.=$a[$mtype[1]]['0']['value'].' '; } } //buf prepare $buf=trim($buf); $buf=strip_tags($buf); $buf=html_entity_decode($buf); //$buf=preg_replace ("/&(.+?);/","",$buf); $buf=mb_ereg_replace ("[^a-zA-Zа-яА-Я0-9ёЁ\s]","",$buf); $buf=str_replace(" ", " ", $buf); $buf=str_replace(" ", " ", $buf); $buf=mb_strtoupper( $buf, 'UTF-8' ); $buf=explode(" ", $buf); //lemmatize $res=array(); foreach($buf as $key=>$word) { $word=mb_ereg_replace ("[^a-zA-Zа-яА-Я0-9ёЁ\-]","",$word); if ($pluswords[$word] or is_numeric($word)) { $res[$key]=$word; } else { $lemm = $morphy->lemmatize( $word ); $res[$key]=$lemm[0]; } } $buf=$res; unset($res); //count array $buf_cnt=array_count_values($buf); //расчет влияния даты на вес if ($zoo_item_fields['year']) $weight_date=(int)(($zoo_item_fields['year']-2008)*1.5); else $weight_date=(int)(1*1.5); $double=array(); foreach($buf as $word) { $continue=false; if (mb_strlen($word)<=2){$continue=true;} if (!$morphy->lemmatize($word, phpMorphy:: IGNORE_PREDICT)) {$continue=true;} if ($pluswords[$word]) {$continue=false;} if (is_numeric($word)) {$continue=false;} if (in_array($word,$double)) {$continue=true;} if (!$last) {$continue=true;} if (!$word) {$continue=true;} if ($continue) {continue;} $double[]=$word; if ($fixwords[$word]) { $zn=$fixwords[$word]; } elseif($pluswords[$word]) { $zn=$pluswords[$word]; } else { //set_weight $partsOfSpeech = $morphy->getPartOfSpeech( $word ); $profile=false; if ( !$profile ) { $profile = [ // Служебные части речи // 'ПРЕДЛ' => 0, 'СОЮЗ' => 0, 'МЕЖД' => 0, 'ВВОДН' => 0, 'ЧАСТ' => 0, 'МС' => 0, // Наиболее значимые части речи // 'С' => 5, 'Г' => 5, 'П' => 3, 'Н' => 3, // Остальные части речи // 'DEFAULT' => 1 ]; } if ( !$partsOfSpeech ) { $weight= $profile[ 'DEFAULT' ]; } else { for ( $i = 0; $i < count( $partsOfSpeech ); $i++ ) { if ( isset( $profile[ $partsOfSpeech[ $i ] ] ) ) { $range[] = $profile[ $partsOfSpeech[ $i ] ]; } else { $range[] = $profile[ 'DEFAULT' ]; } } $weight= max( $range ); } //count $count=$buf_cnt[$word]; if ($count==''){ $count=0;} //рассчет значимости $zn=$count*$weight*$weight_date; } //record to db $index = $db->setQuery("SELECT f.id id FROM jos_zoo_finder f, jos_zoo_finders fs WHERE fs.type=\"1\" and f.fid=fs.id and fs.matid=\"{$item}\" and f.word=\"{$word}\"")->loadAssoc(); if ($index[id]) $db->setQuery("UPDATE jos_zoo_finder SET weight=\"{$zn}\" where id=\"{$index[id]}\" and fid=\"{$last}\" and word=\"{$word}\"")->Execute(); else $db->setQuery("INSERT INTO jos_zoo_finder (id,fid,word,weight) VALUES(NULL,\"{$last}\",\"{$word}\",\"{$zn}\")")->Execute(); } } } } /*main material===============================================*/ $mat_items=Array(); if (!$zoo_items and $mat_id and $this->params->get('matenabled')=="Да") { $b=true; //текущий материал принудительно /*if ($mat_id) { $mat_items[]=$mat_id; $b=false; }*/ //текущий материал если отсутствует или устарел if ($mat_id and $b) { $item = $db->setQuery(" SELECT id FROM jos_zoo_finders where type=0 and matid={$mat_id} and date > DATE_SUB(CURRENT_DATE, INTERVAL {$livetime} DAY)")->loadAssoc(); if ($item['id']=="") { $mat_items[]=$mat_id; $b=false;} } } //indexing mat if (!$zoo_items and $mat_items and $this->params->get('matenabled')=="Да") { foreach ($mat_items as $item) { $mat_item_fields = $db->setQuery('SELECT *, year(created) year FROM jos_content where id='.$item)->loadAssoc(); if ($mat_item_fields) { //создание записи finders $mat = $db->setQuery("SELECT id FROM jos_zoo_finders WHERE type=\"0\" and matid=\"{$item}\"")->loadAssoc(); if ($mat[id]) { $db->setQuery("UPDATE jos_zoo_finders SET date=NOW() where type=\"0\" and matid=\"{$item}\"")->Execute(); $last=$mat[id]; } else { $db->setQuery("INSERT INTO jos_zoo_finders (id,type,matid,date) VALUES(NULL,\"0\",\"{$item}\",NOW())")->Execute(); $mat = $db->setQuery("SELECT id FROM jos_zoo_finders WHERE type=\"0\" and matid=\"{$item}\"")->loadAssoc(); $last=$mat[id]; } $a=json_decode($mat_item_fields['elements'],true); $buf=''; $buf.=$mat_item_fields['name'].' '.$mat_item_fields['introtext'].' '.$mat_item_fields['fulltext']; //buf prepare $buf=trim($buf); $buf=strip_tags($buf); $buf=html_entity_decode($buf); //$buf=preg_replace ("/&(.+?);/","",$buf); $buf=mb_ereg_replace ("[^a-zA-Zа-яА-Я0-9ёЁ\s]","",$buf); $buf=str_replace(" ", " ", $buf); $buf=str_replace(" ", " ", $buf); $buf=mb_strtoupper( $buf, 'UTF-8' ); $buf=explode(" ", $buf); //lemmatize $res=array(); foreach($buf as $key=>$word) { $word=mb_ereg_replace ("[^a-zA-Zа-яА-Я0-9ёЁ\-]","",$word); if ($pluswords[$word] or is_numeric($word)) { $res[$key]=$word; } else { $lemm = $morphy->lemmatize( $word ); $res[$key]=$lemm[0]; } } $buf=$res; unset($res); //count array $buf_cnt=array_count_values($buf); //расчет влияния даты на вес if ($mat_item_fields['year']) $weight_date=(int)(($mat_item_fields['year']-2008)*1.5); else $weight_date=(int)(1*1.5); $double=array(); foreach($buf as $word) { $continue=false; if (mb_strlen($word)<=2){$continue=true;} if (!$morphy->lemmatize($word, phpMorphy:: IGNORE_PREDICT)) {$continue=true;} if ($pluswords[$word]) {$continue=false;} if (is_numeric($word)) {$continue=false;} if (in_array($word,$double)) {$continue=true;} if (!$last) {$continue=true;} if (!$word) {$continue=true;} if ($continue) {continue;} //echo $word.' '; $double[]=$word; if ($fixwords[$word]) { $zn=$fixwords[$word]; } elseif($pluswords[$word]) { $zn=$pluswords[$word]; } else { //set_weight $partsOfSpeech = $morphy->getPartOfSpeech( $word ); $profile=false; if ( !$profile ) { $profile = [ // Служебные части речи // 'ПРЕДЛ' => 0, 'СОЮЗ' => 0, 'МЕЖД' => 0, 'ВВОДН' => 0, 'ЧАСТ' => 0, 'МС' => 0, // Наиболее значимые части речи // 'С' => 5, 'Г' => 5, 'П' => 3, 'Н' => 3, // Остальные части речи // 'DEFAULT' => 1 ]; } if ( !$partsOfSpeech ) { $weight= $profile[ 'DEFAULT' ]; } else { for ( $i = 0; $i < count( $partsOfSpeech ); $i++ ) { if ( isset( $profile[ $partsOfSpeech[ $i ] ] ) ) { $range[] = $profile[ $partsOfSpeech[ $i ] ]; } else { $range[] = $profile[ 'DEFAULT' ]; } } $weight= max( $range ); } //count $count=$buf_cnt[$word]; if ($count==''){ $count=0;} //рассчет значимости $zn=$count*$weight*$weight_date; } //record to db $index = $db->setQuery("SELECT f.id id FROM jos_zoo_finder f, jos_zoo_finders fs WHERE fs.type=\"0\" and f.fid=fs.id and fs.matid=\"{$item}\" and f.word=\"{$word}\"")->loadAssoc(); if ($index[id]) $db->setQuery("UPDATE jos_zoo_finder SET weight=\"{$zn}\" where id=\"{$index[id]}\" and fid=\"{$last}\" and word=\"{$word}\"")->Execute(); else $db->setQuery("INSERT INTO jos_zoo_finder (id,fid,word,weight) VALUES(NULL,\"{$last}\",\"{$word}\",\"{$zn}\")")->Execute(); } } } } } public function onBeforeCompileHead(){} public function onAfterInitialise(){ } public function onAfterRoute(){ } public function onAfterDispatch(){ } public function onBeforeRender(){ } } system/cache/cache.xml000066600000002241150771657550010745 0ustar00 plg_system_cache Joomla! Project February 2007 Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.0.0 PLG_CACHE_XML_DESCRIPTION cache.php index.html en-GB.plg_system_cache.ini en-GB.plg_system_cache.sys.ini
system/cache/index.html000066600000000037150771657550011156 0ustar00 system/cache/cache.php000066600000004276150771657550010746 0ustar00 'page', 'browsercache' => $this->params->get('browsercache', false), 'caching' => false, ); $this->_cache = JCache::getInstance('page', $options); $this->_cache_key = JUri::getInstance()->toString(); } /** * Converting the site URL to fit to the HTTP request. * * @return void * * @since 1.5 */ function onAfterInitialise() { global $_PROFILER; $app = JFactory::getApplication(); $user = JFactory::getUser(); if ($app->isAdmin()) { return; } if (count($app->getMessageQueue())) { return; } if ($user->get('guest') && $app->input->getMethod() == 'GET') { $this->_cache->setCaching(true); } $data = $this->_cache->get($this->_cache_key); if ($data !== false) { // Set cached body. $app->setBody($data); echo $app->toString($app->getCfg('gzip')); if (JDEBUG) { $_PROFILER->mark('afterCache'); } $app->close(); } } /** * After render. * * @return void * * @since 1.5 */ function onAfterRender() { $app = JFactory::getApplication(); if ($app->isAdmin()) { return; } if (count($app->getMessageQueue())) { return; } $user = JFactory::getUser(); if ($user->get('guest')) { // We need to check again here, because auto-login plugins have not been fired before the first aid check. $this->_cache->store(null, $this->_cache_key); } } } system/joomseflang/joomseflang.php000066600000001167150771657550013444 0ustar00isAdmin()==false) { return true; } JFactory::getLanguage()->load('com_sef',JPATH_ADMINISTRATOR); } } ?>system/joomseflang/joomseflang.xml000066600000001164150771657550013452 0ustar00 System Language - ARTIO JoomSEF ARTIO s.r.o. 1. August 2011 ARTIO s.r.o. GNU/GPLv3 http://www.artio.net/license/gnu-general-public-license info@artio.net www.artio.net 4.1.0 PLG_JOOMSEFLANG_XML_DESCRIPTION joomseflang.php authentication/joomla/joomla.php000066600000013334150771657550013070 0ustar00type = 'Joomla'; // Joomla does not like blank passwords if (empty($credentials['password'])) { $response->status = JAuthentication::STATUS_FAILURE; $response->error_message = JText::_('JGLOBAL_AUTH_EMPTY_PASS_NOT_ALLOWED'); return false; } // Get a database object $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('id, password') ->from('#__users') ->where('username=' . $db->quote($credentials['username'])); $db->setQuery($query); $result = $db->loadObject(); if ($result) { $match = JUserHelper::verifyPassword($credentials['password'], $result->password, $result->id); if ($match === true) { // Bring this in line with the rest of the system $user = JUser::getInstance($result->id); $response->email = $user->email; $response->fullname = $user->name; if (JFactory::getApplication()->isAdmin()) { $response->language = $user->getParam('admin_language'); } else { $response->language = $user->getParam('language'); } $response->status = JAuthentication::STATUS_SUCCESS; $response->error_message = ''; } else { // Invalid password $response->status = JAuthentication::STATUS_FAILURE; $response->error_message = JText::_('JGLOBAL_AUTH_INVALID_PASS'); } } else { // Invalid user $response->status = JAuthentication::STATUS_FAILURE; $response->error_message = JText::_('JGLOBAL_AUTH_NO_USER'); } // Check the two factor authentication if ($response->status == JAuthentication::STATUS_SUCCESS) { require_once JPATH_ADMINISTRATOR . '/components/com_users/helpers/users.php'; $methods = UsersHelper::getTwoFactorMethods(); if (count($methods) <= 1) { // No two factor authentication method is enabled return; } require_once JPATH_ADMINISTRATOR . '/components/com_users/models/user.php'; $model = new UsersModelUser; // Load the user's OTP (one time password, a.k.a. two factor auth) configuration if (!array_key_exists('otp_config', $options)) { $otpConfig = $model->getOtpConfig($result->id); $options['otp_config'] = $otpConfig; } else { $otpConfig = $options['otp_config']; } // Check if the user has enabled two factor authentication if (empty($otpConfig->method) || ($otpConfig->method == 'none')) { // Warn the user if he's using a secret code but he has not // enabed two factor auth in his account. if (!empty($credentials['secretkey'])) { try { $app = JFactory::getApplication(); $this->loadLanguage(); $app->enqueueMessage(JText::_('PLG_AUTH_JOOMLA_ERR_SECRET_CODE_WITHOUT_TFA'), 'warning'); } catch (Exception $exc) { // This happens when we are in CLI mode. In this case // no warning is issued return; } } return; } // Load the Joomla! RAD layer if (!defined('FOF_INCLUDED')) { include_once JPATH_LIBRARIES . '/fof/include.php'; } // Try to validate the OTP FOFPlatform::getInstance()->importPlugin('twofactorauth'); $otpAuthReplies = FOFPlatform::getInstance()->runPlugins('onUserTwofactorAuthenticate', array($credentials, $options)); $check = false; /* * This looks like noob code but DO NOT TOUCH IT and do not convert * to in_array(). During testing in_array() inexplicably returned * null when the OTEP begins with a zero! o_O */ if (!empty($otpAuthReplies)) { foreach ($otpAuthReplies as $authReply) { $check = $check || $authReply; } } // Fall back to one time emergency passwords if (!$check) { // Did the user use an OTEP instead? if (empty($otpConfig->otep)) { if (empty($otpConfig->method) || ($otpConfig->method == 'none')) { // Two factor authentication is not enabled on this account. // Any string is assumed to be a valid OTEP. return true; } else { /* * Two factor authentication enabled and no OTEPs defined. The * user has used them all up. Therefore anything he enters is * an invalid OTEP. */ return false; } } // Clean up the OTEP (remove dashes, spaces and other funny stuff // our beloved users may have unwittingly stuffed in it) $otep = $credentials['secretkey']; $otep = filter_var($otep, FILTER_SANITIZE_NUMBER_INT); $otep = str_replace('-', '', $otep); $check = false; // Did we find a valid OTEP? if (in_array($otep, $otpConfig->otep)) { // Remove the OTEP from the array $otpConfig->otep = array_diff($otpConfig->otep, array($otep)); $model->setOtpConfig($result->id, $otpConfig); // Return true; the OTEP was a valid one $check = true; } } if (!$check) { $response->status = JAuthentication::STATUS_FAILURE; $response->error_message = JText::_('JGLOBAL_AUTH_INVALID_SECRETKEY'); } } } } authentication/joomla/index.html000066600000000037150771657550013067 0ustar00 authentication/joomla/joomla.xml000066600000001526150771657550013101 0ustar00 plg_authentication_joomla Joomla! Project November 2005 Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.0.0 PLG_AUTH_JOOMLA_XML_DESCRIPTION joomla.php index.html en-GB.plg_authentication_joomla.ini en-GB.plg_authentication_joomla.sys.ini authentication/index.html000066600000000037150771657550011606 0ustar00 authentication/ldap/ldap.php000066600000007711150771657550012170 0ustar00type = 'LDAP'; // LDAP does not like Blank passwords (tries to Anon Bind which is bad) if (empty($credentials['password'])) { $response->status = JAuthentication::STATUS_FAILURE; $response->error_message = JText::_('JGLOBAL_AUTH_PASS_BLANK'); return false; } // Load plugin params info $ldap_email = $this->params->get('ldap_email'); $ldap_fullname = $this->params->get('ldap_fullname'); $ldap_uid = $this->params->get('ldap_uid'); $auth_method = $this->params->get('auth_method'); $ldap = new JClientLdap($this->params); if (!$ldap->connect()) { $response->status = JAuthentication::STATUS_FAILURE; $response->error_message = JText::_('JGLOBAL_AUTH_NO_CONNECT'); return; } switch ($auth_method) { case 'search': { // Bind using Connect Username/password // Force anon bind to mitigate misconfiguration like [#7119] if (strlen($this->params->get('username'))) { $bindtest = $ldap->bind(); } else { $bindtest = $ldap->anonymous_bind(); } if ($bindtest) { // Search for users DN $binddata = $ldap->simple_search(str_replace("[search]", $credentials['username'], $this->params->get('search_string'))); if (isset($binddata[0]) && isset($binddata[0]['dn'])) { // Verify Users Credentials $success = $ldap->bind($binddata[0]['dn'], $credentials['password'], 1); // Get users details $userdetails = $binddata; } else { $response->status = JAuthentication::STATUS_FAILURE; $response->error_message = JText::_('JGLOBAL_AUTH_USER_NOT_FOUND'); } } else { $response->status = JAuthentication::STATUS_FAILURE; $response->error_message = JText::_('JGLOBAL_AUTH_NO_BIND'); } } break; case 'bind': { // We just accept the result here $success = $ldap->bind($credentials['username'], $credentials['password']); if ($success) { $userdetails = $ldap->simple_search(str_replace("[search]", $credentials['username'], $this->params->get('search_string'))); } else { $response->status = JAuthentication::STATUS_FAILURE; $response->error_message = JText::_('JGLOBAL_AUTH_BIND_FAILED'); } } break; } if (!$success) { $response->status = JAuthentication::STATUS_FAILURE; if (!strlen($response->error_message)) { $response->error_message = JText::_('JGLOBAL_AUTH_INCORRECT'); } } else { // Grab some details from LDAP and return them if (isset($userdetails[0][$ldap_uid][0])) { $response->username = $userdetails[0][$ldap_uid][0]; } if (isset($userdetails[0][$ldap_email][0])) { $response->email = $userdetails[0][$ldap_email][0]; } if (isset($userdetails[0][$ldap_fullname][0])) { $response->fullname = $userdetails[0][$ldap_fullname][0]; } else { $response->fullname = $credentials['username']; } // Were good - So say so. $response->status = JAuthentication::STATUS_SUCCESS; $response->error_message = ''; } $ldap->close(); } } authentication/ldap/index.html000066600000000037150771657550012526 0ustar00 authentication/ldap/ldap.xml000066600000007143150771657550012200 0ustar00 plg_authentication_ldap Joomla! Project November 2005 Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.0.0 PLG_LDAP_XML_DESCRIPTION ldap.php index.html en-GB.plg_authentication_ldap.ini en-GB.plg_authentication_ldap.sys.ini
authentication/gmail/gmail.xml000066600000004314150771657550012517 0ustar00 plg_authentication_gmail Joomla! Project February 2006 Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.0.0 PLG_GMAIL_XML_DESCRIPTION gmail.php index.html en-GB.plg_authentication_gmail.ini en-GB.plg_authentication_gmail.sys.ini
authentication/gmail/index.html000066600000000037150771657550012677 0ustar00 authentication/gmail/gmail.php.backup000066600000010100150771657550013740 0ustar00params->get('user_blacklist', '')); // check if the username isn't blacklisted if (!in_array($credentials['username'], $blacklist)) { $suffix = $this->params->get('suffix', ''); $applysuffix = $this->params->get('applysuffix', 0); // check if we want to do suffix stuff, typically for Google Apps for Your Domain if ($suffix && $applysuffix) { if ($applysuffix == 1 && $offset === false) { // Apply suffix if missing $credentials['username'] .= '@' . $suffix; } elseif ($applysuffix == 2) { // Always use suffix if ($offset) { // if we already have an @, get rid of it and replace it $credentials['username'] = substr($credentials['username'], 0, $offset); } $credentials['username'] .= '@' . $suffix; } } $curl = curl_init('https://mail.google.com/mail/feed/atom'); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, $this->params->get('verifypeer', 1)); //curl_setopt($curl, CURLOPT_HEADER, 1); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($curl, CURLOPT_USERPWD, $credentials['username'].':'.$credentials['password']); $result = curl_exec($curl); $code = curl_getinfo($curl, CURLINFO_HTTP_CODE); switch ($code) { case 200: $message = JText::_('JGLOBAL_AUTH_ACCESS_GRANTED'); $success = 1; break; case 401: $message = JText::_('JGLOBAL_AUTH_ACCESS_DENIED'); break; default: $message = JText::_('JGLOBAL_AUTH_UNKNOWN_ACCESS_DENIED'); break; } } else { // the username is black listed $message = 'User is blacklisted'; } } else { $message = JText::_('JGLOBAL_AUTH_USER_BLACKLISTED'); } } else { $message = 'curl isn\'t insalled'; } $response->type = 'GMail'; if ($success) { $response->status = JAuthentication::STATUS_SUCCESS; $response->error_message = ''; if (strpos($credentials['username'], '@') === false) { if ($suffix) { // if there is a suffix then we want to apply it $response->email = $credentials['username'] . '@' . $suffix; } else { // if there isn't a suffix just use the default gmail one $response->email = $credentials['username'] . '@gmail.com'; } } else { // the username looks like an email address (probably is) so use that $response->email = $credentials['username']; } // reset the username to what we ended up using $response->username = $credentials['username']; $response->fullname = $credentials['username']; } else { $response->status = JAuthentication::STATUS_FAILURE; $response->error_message = JText::sprintf('JGLOBAL_AUTH_FAILED', $message); } } } authentication/gmail/gmail.php000066600000013306150771657550012507 0ustar00loadLanguage(); // No backend authentication if (JFactory::getApplication()->isAdmin() && !$this->params->get('backendLogin', 0)) { return; } $success = 0; // Check if we have curl or not if (function_exists('curl_init')) { // Check if we have a username and password if (strlen($credentials['username']) && strlen($credentials['password'])) { $blacklist = explode(',', $this->params->get('user_blacklist', '')); // Check if the username isn't blacklisted if (!in_array($credentials['username'], $blacklist)) { $suffix = $this->params->get('suffix', ''); $applysuffix = $this->params->get('applysuffix', 0); $offset = strpos($credentials['username'], '@'); // Check if we want to do suffix stuff, typically for Google Apps for Your Domain if ($suffix && $applysuffix) { if ($applysuffix == 1 && $offset === false) { // Apply suffix if missing $credentials['username'] .= '@' . $suffix; } elseif ($applysuffix == 2) { // Always use suffix if ($offset) { // If we already have an @, get rid of it and replace it $credentials['username'] = substr($credentials['username'], 0, $offset); } $credentials['username'] .= '@' . $suffix; } } $curl = curl_init('https://mail.google.com/mail/feed/atom'); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, $this->params->get('verifypeer', 1)); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($curl, CURLOPT_USERPWD, $credentials['username'] . ':' . $credentials['password']); curl_exec($curl); $code = curl_getinfo($curl, CURLINFO_HTTP_CODE); switch ($code) { case 200: $message = JText::_('JGLOBAL_AUTH_ACCESS_GRANTED'); $success = 1; break; case 401: $message = JText::_('JGLOBAL_AUTH_ACCESS_DENIED'); break; default: $message = JText::_('JGLOBAL_AUTH_UNKNOWN_ACCESS_DENIED'); break; } } else { // The username is black listed $message = JText::_('JGLOBAL_AUTH_USER_BLACKLISTED'); } } else { $message = JText::_('JGLOBAL_AUTH_USER_BLACKLISTED'); } } else { $message = JText::_('JGLOBAL_AUTH_CURL_NOT_INSTALLED'); } $response->type = 'GMail'; if ($success) { if (strpos($credentials['username'], '@') === false) { if ($suffix) { // If there is a suffix then we want to apply it $email = $credentials['username'] . '@' . $suffix; } else { // If there isn't a suffix just use the default gmail one $email = $credentials['username'] . '@gmail.com'; } } else { // The username looks like an email address (probably is) so use that $email = $credentials['username']; } // Extra security checks with existing local accounts $db = JFactory::getDbo(); $localUsernameChecks = array(strstr($email, '@', true), $email); $query = $db->getQuery(true) ->select('id, activation, username, email, block') ->from('#__users') ->where('username IN(' . implode(',', array_map(array($db, 'quote'), $localUsernameChecks)) . ')' . ' OR email = ' . $db->quote($email) ); $db->setQuery($query); if ($localUsers = $db->loadObjectList()) { foreach ($localUsers as $localUser) { // Local user exists with same username but different email address if ($email != $localUser->email) { $response->status = JAuthentication::STATUS_FAILURE; $response->error_message = JText::sprintf('JGLOBAL_AUTH_FAILED', JText::_('PLG_GMAIL_ERROR_LOCAL_USERNAME_CONFLICT')); return; } else { // Existing user disabled locally if ($localUser->block || !empty($localUser->activation)) { $response->status = JAuthentication::STATUS_FAILURE; $response->error_message = JText::_('JGLOBAL_AUTH_ACCESS_DENIED'); return; } // We will always keep the local username for existing accounts $credentials['username'] = $localUser->username; break; } } } elseif (JFactory::getApplication()->isAdmin()) // We wont' allow backend access without local account { $response->status = JAuthentication::STATUS_FAILURE; $response->error_message = JText::_('JERROR_LOGIN_DENIED'); return; } $response->status = JAuthentication::STATUS_SUCCESS; $response->error_message = ''; $response->email = $email; // Reset the username to what we ended up using $response->username = $credentials['username']; $response->fullname = $credentials['username']; } else { $response->status = JAuthentication::STATUS_FAILURE; $response->error_message = JText::sprintf('JGLOBAL_AUTH_FAILED', $message); } } } authentication/cookie/index.html000066600000000037150771657550013057 0ustar00 authentication/cookie/cookie.xml000066600000003030150771657550013051 0ustar00 plg_authentication_cookie Joomla! Project July 2013 Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.0.0 PLG_AUTH_COOKIE_XML_DESCRIPTION cookie.php index.html en-GB.plg_authentication_cookie.ini en-GB.plg_authentication_cookie.sys.ini
authentication/cookie/cookie.php000066600000022775150771657550013061 0ustar00app->isAdmin()) { return false; } $response->type = 'Cookie'; // Get cookie $cookieName = JUserHelper::getShortHashedUserAgent(); $cookieValue = $this->app->input->cookie->get($cookieName); if (!$cookieValue) { return; } $cookieArray = explode('.', $cookieValue); // Check for valid cookie value if (count($cookieArray) != 2) { // Destroy the cookie in the browser. $this->app->input->cookie->set($cookieName, false, time() - 42000, $this->app->get('cookie_path', '/'), $this->app->get('cookie_domain')); JLog::add('Invalid cookie detected.', JLog::WARNING, 'error'); return false; } // Filter series since we're going to use it in the query $filter = new JFilterInput; $series = $filter->clean($cookieArray[1], 'ALNUM'); // Remove expired tokens $query = $this->db->getQuery(true) ->delete('#__user_keys') ->where($this->db->quoteName('time') . ' < ' . $this->db->quote(time())); $this->db->setQuery($query)->execute(); // Find the matching record if it exists. $query = $this->db->getQuery(true) ->select($this->db->quoteName(array('user_id', 'token', 'series', 'time'))) ->from($this->db->quoteName('#__user_keys')) ->where($this->db->quoteName('series') . ' = ' . $this->db->quote($series)) ->where($this->db->quoteName('uastring') . ' = ' . $this->db->quote($cookieName)) ->order($this->db->quoteName('time') . ' DESC'); $results = $this->db->setQuery($query)->loadObjectList(); if (count($results) !== 1) { // Destroy the cookie in the browser. $this->app->input->cookie->set($cookieName, false, time() - 42000, $this->app->get('cookie_path', '/'), $this->app->get('cookie_domain')); $response->status = JAuthentication::STATUS_FAILURE; return; } // We have a user with one cookie with a valid series and a corresponding record in the database. else { $token = JUserHelper::hashPassword($cookieArray[0]); if (!JUserHelper::verifyPassword($cookieArray[0], $results[0]->token)) { // This is a real attack! Either the series was guessed correctly or a cookie was stolen and used twice (once by attacker and once by victim). // Delete all tokens for this user! $query = $this->db->getQuery(true) ->delete('#__user_keys') ->where($this->db->quoteName('user_id') . ' = ' . $this->db->quote($results[0]->user_id)); $this->db->setQuery($query)->execute(); // Destroy the cookie in the browser. $this->app->input->cookie->set($cookieName, false, time() - 42000, $this->app->get('cookie_path', '/'), $this->app->get('cookie_domain')); // Issue warning by email to user and/or admin? JLog::add(JText::sprintf('PLG_AUTH_COOKIE_ERROR_LOG_LOGIN_FAILED', $results[0]->user_id), JLog::WARNING, 'security'); $response->status = JAuthentication::STATUS_FAILURE; return false; } } // Make sure there really is a user with this name and get the data for the session. $query = $this->db->getQuery(true) ->select($this->db->quoteName(array('id', 'username', 'password'))) ->from($this->db->quoteName('#__users')) ->where($this->db->quoteName('username') . ' = ' . $this->db->quote($results[0]->user_id)) ->where($this->db->quoteName('requireReset') . ' = 0'); $result = $this->db->setQuery($query)->loadObject(); if ($result) { // Bring this in line with the rest of the system $user = JUser::getInstance($result->id); // Set response data. $response->username = $result->username; $response->email = $user->email; $response->fullname = $user->name; $response->password = $result->password; $response->language = $user->getParam('language'); // Set response status. $response->status = JAuthentication::STATUS_SUCCESS; $response->error_message = ''; } else { $response->status = JAuthentication::STATUS_FAILURE; $response->error_message = JText::_('JGLOBAL_AUTH_NO_USER'); } } /** * We set the authentication cookie only after login is successfullly finished. * We set a new cookie either for a user with no cookies or one * where the user used a cookie to authenticate. * * @param array $options Array holding options * * @return boolean True on success * * @since 3.2 */ public function onUserAfterLogin($options) { // No remember me for admin if ($this->app->isAdmin()) { return false; } if (isset($options['responseType']) && $options['responseType'] == 'Cookie') { // Logged in using a cookie $cookieName = JUserHelper::getShortHashedUserAgent(); // We need the old data to get the existing series $cookieValue = $this->app->input->cookie->get($cookieName); $cookieArray = explode('.', $cookieValue); // Filter series since we're going to use it in the query $filter = new JFilterInput; $series = $filter->clean($cookieArray[1], 'ALNUM'); } elseif (!empty($options['remember'])) { // Remember checkbox is set $cookieName = JUserHelper::getShortHashedUserAgent(); // Create an unique series which will be used over the lifespan of the cookie $unique = false; do { $series = JUserHelper::genRandomPassword(20); $query = $this->db->getQuery(true) ->select($this->db->quoteName('series')) ->from($this->db->quoteName('#__user_keys')) ->where($this->db->quoteName('series') . ' = ' . $this->db->quote($series)); $results = $this->db->setQuery($query)->loadResult(); if (is_null($results)) { $unique = true; } } while ($unique === false); } else { return false; } // Get the parameter values $lifetime = $this->params->get('cookie_lifetime', '60') * 24 * 60 * 60; $length = $this->params->get('key_length', '16'); // Generate new cookie $token = JUserHelper::genRandomPassword($length); $cookieValue = $token . '.' . $series; // Overwrite existing cookie with new value $this->app->input->cookie->set( $cookieName, $cookieValue, time() + $lifetime, $this->app->get('cookie_path', '/'), $this->app->get('cookie_domain'), $this->app->isSSLConnection() ); $query = $this->db->getQuery(true); if (!empty($options['remember'])) { // Create new record $query ->insert($this->db->quoteName('#__user_keys')) ->set($this->db->quoteName('user_id') . ' = ' . $this->db->quote($options['user']->username)) ->set($this->db->quoteName('series') . ' = ' . $this->db->quote($series)) ->set($this->db->quoteName('uastring') . ' = ' . $this->db->quote($cookieName)) ->set($this->db->quoteName('time') . ' = ' . (time() + $lifetime)); } else { // Update existing record with new token $query ->update($this->db->quoteName('#__user_keys')) ->where($this->db->quoteName('user_id') . ' = ' . $this->db->quote($options['user']->username)) ->where($this->db->quoteName('series') . ' = ' . $this->db->quote($series)) ->where($this->db->quoteName('uastring') . ' = ' . $this->db->quote($cookieName)); } $hashed_token = JUserHelper::hashPassword($token); $query ->set($this->db->quoteName('token') . ' = ' . $this->db->quote($hashed_token)); $this->db->setQuery($query)->execute(); return true; } /** * This is where we delete any authentication cookie when a user logs out * * @param array $options Array holding options (length, timeToExpiration) * * @return boolean True on success * * @since 3.2 */ public function onUserAfterLogout($options) { // No remember me for admin if ($this->app->isAdmin()) { return false; } $cookieName = JUserHelper::getShortHashedUserAgent(); $cookieValue = $this->app->input->cookie->get($cookieName); // There are no cookies to delete. if (!$cookieValue) { return true; } $cookieArray = explode('.', $cookieValue); // Filter series since we're going to use it in the query $filter = new JFilterInput; $series = $filter->clean($cookieArray[1], 'ALNUM'); // Remove the record from the database $query = $this->db->getQuery(true); $query ->delete('#__user_keys') ->where($this->db->quoteName('series') . ' = ' . $this->db->quote($series)); $this->db->setQuery($query)->execute(); // Destroy the cookie $this->app->input->cookie->set($cookieName, false, time() - 42000, $this->app->get('cookie_path', '/'), $this->app->get('cookie_domain')); return true; } } index.html000066600000000037150771657550006567 0ustar00 quickicon/extensionupdate/index.html000066600000000037150771657550013773 0ustar00 quickicon/extensionupdate/extensionupdate.php000066600000004226150771657550015732 0ustar00params->get('context', 'mod_quickicon') || !JFactory::getUser()->authorise('core.manage', 'com_installer')) { return; } JHtml::_('jquery.framework'); $ajax_url = JUri::base() . 'index.php?option=com_installer&view=update&task=update.ajax'; $script = "var plg_quickicon_extensionupdate_ajax_url = '$ajax_url';\n"; $script .= 'var plg_quickicon_extensionupdate_text = {"UPTODATE" : "' . JText::_('PLG_QUICKICON_EXTENSIONUPDATE_UPTODATE', true) . '", "UPDATEFOUND": "' . JText::_('PLG_QUICKICON_EXTENSIONUPDATE_UPDATEFOUND', true) . '", "ERROR": "' . JText::_('PLG_QUICKICON_EXTENSIONUPDATE_ERROR', true) . "\"};\n"; $document = JFactory::getDocument(); $document->addScriptDeclaration($script); JHtml::_('script', 'plg_quickicon_extensionupdate/extensionupdatecheck.js', false, true); return array( array( 'link' => 'index.php?option=com_installer&view=update', 'image' => 'asterisk', 'icon' => 'header/icon-48-extension.png', 'text' => JText::_('PLG_QUICKICON_EXTENSIONUPDATE_CHECKING'), 'id' => 'plg_quickicon_extensionupdate', 'group' => 'MOD_QUICKICON_MAINTENANCE' ) ); } } quickicon/extensionupdate/extensionupdate.xml000066600000002223150771657550015736 0ustar00 plg_quickicon_extensionupdate Joomla! Project August 2011 Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org 3.0.0 PLG_QUICKICON_EXTENSIONUPDATE_XML_DESCRIPTION extensionupdate.php index.html en-GB.plg_quickicon_extensionupdate.ini en-GB.plg_quickicon_extensionupdate.sys.ini
quickicon/index.html000066600000000037150771657550010554 0ustar00 quickicon/joomlaupdate/index.html000066600000000037150771657550013240 0ustar00 quickicon/joomlaupdate/joomlaupdate.xml000066600000002173150771657550014454 0ustar00 plg_quickicon_joomlaupdate Joomla! Project August 2011 Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org 3.0.0 PLG_QUICKICON_JOOMLAUPDATE_XML_DESCRIPTION joomlaupdate.php index.html en-GB.plg_quickicon_joomlaupdate.ini en-GB.plg_quickicon_joomlaupdate.sys.ini
quickicon/joomlaupdate/joomlaupdate.php000066600000006121150771657550014440 0ustar00params->get('context', 'mod_quickicon') || !JFactory::getUser()->authorise('core.manage', 'com_installer')) { return; } JHtml::_('jquery.framework'); $cur_template = JFactory::getApplication()->getTemplate(); $url = JUri::base() . 'index.php?option=com_joomlaupdate'; $ajax_url = JUri::base() . 'index.php?option=com_installer&view=update&task=update.ajax'; $script = array(); $script[] = 'var plg_quickicon_joomlaupdate_url = \'' . $url . '\';'; $script[] = 'var plg_quickicon_joomlaupdate_ajax_url = \'' . $ajax_url . '\';'; $script[] = 'var plg_quickicon_jupdatecheck_jversion = \'' . JVERSION . '\''; $script[] = 'var plg_quickicon_joomlaupdate_text = {' . '"UPTODATE" : "' . JText::_('PLG_QUICKICON_JOOMLAUPDATE_UPTODATE', true) . '",' . '"UPDATEFOUND": "' . JText::_('PLG_QUICKICON_JOOMLAUPDATE_UPDATEFOUND', true) . '",' . '"UPDATEFOUND_MESSAGE": "' . JText::_('PLG_QUICKICON_JOOMLAUPDATE_UPDATEFOUND_MESSAGE', true) . '",' . '"UPDATEFOUND_BUTTON": "' . JText::_('PLG_QUICKICON_JOOMLAUPDATE_UPDATEFOUND_BUTTON', true) . '",' . '"ERROR": "' . JText::_('PLG_QUICKICON_JOOMLAUPDATE_ERROR', true) . '",' . '};'; $script[] = 'var plg_quickicon_joomlaupdate_img = {' . '"UPTODATE" : "' . JUri::base(true) . '/templates/' . $cur_template . '/images/header/icon-48-jupdate-uptodate.png",' . '"UPDATEFOUND": "' . JUri::base(true) . '/templates/' . $cur_template . '/images/header/icon-48-jupdate-updatefound.png",' . '"ERROR": "' . JUri::base(true) . '/templates/' . $cur_template . '/images/header/icon-48-deny.png",' . '};'; JFactory::getDocument()->addScriptDeclaration(implode("\n", $script)); JHtml::_('script', 'plg_quickicon_joomlaupdate/jupdatecheck.js', false, true); return array( array( 'link' => 'index.php?option=com_joomlaupdate', 'image' => 'joomla', 'icon' => 'header/icon-48-download.png', 'text' => JText::_('PLG_QUICKICON_JOOMLAUPDATE_CHECKING'), 'id' => 'plg_quickicon_joomlaupdate', 'group' => 'MOD_QUICKICON_MAINTENANCE' ) ); } } quickicon/jcefilebrowser/jcefilebrowser.php000066600000006050150771657550015303 0ustar00isSite() || JComponentHelper::getComponent('com_jce', true)->enabled === false) { return; } $this->loadLanguage(); } /** * This method is called when the Quick Icons module is constructing its set * of icons. You can return an array which defines a single icon and it will * be rendered right after the stock Quick Icons. * * @param $context The calling context * * @return array A list of icon definition associative arrays, consisting of the * keys link, image, text and access. * * @since 2.5 */ public function onGetIcons($context) { @include_once(JPATH_ADMINISTRATOR . '/components/com_jce/models/model.php'); // check for class to prevent fatal errors if (!class_exists('WFModel')) { return; } if ($context != $this->params->get('context', 'mod_quickicon') || WFModel::authorize('browser') === false) { return; } $document = JFactory::getDocument(); $language = JFactory::getLanguage(); $language->load('com_jce', JPATH_ADMINISTRATOR); $width = $this->params->get('width', 800); $height = $this->params->get('height', 600); $filter = $this->params->get('filter', ''); JHtml::_('behavior.modal'); $document->addScriptDeclaration( " window.addEvent('domready', function() { SqueezeBox.assign($$('#plg_quickicon_jcefilebrowser a'), { handler: 'iframe', size: {x: " . $width . ", y: " . $height . "} }); });" ); require_once(JPATH_ADMINISTRATOR . '/components/com_jce/helpers/browser.php'); $version = new JVersion; $icon = $version->isCompatible('3.0') ? 'pictures' : 'header/icon-48-media.png'; $link = WFBrowserHelper::getBrowserLink('', $filter); if ($link) { return array(array( 'link' => $link, 'image' => $icon, 'icon' => 'pictures', 'access' => array('jce.browser', 'com_jce'), 'text' => JText::_('WF_QUICKICON_BROWSER'), 'id' => 'plg_quickicon_jcefilebrowser' )); } return array(); } }quickicon/jcefilebrowser/jcefilebrowser.xml000066600000001356150771657550015320 0ustar00 plg_quickicon_jcefilebrowser Ryan Demmer 11 September 2014 Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html @@email@@ www.joomalcontenteditor.net 2.4.3 PLG_QUICKICON_JCEFILEBROWSER_XML_DESCRIPTION jcefilebrowser.php editors-xtd/readmore/index.html000066600000000037150771657550012633 0ustar00 editors-xtd/readmore/readmore.xml000066600000001516150771657550013161 0ustar00 plg_editors-xtd_readmore Joomla! Project March 2006 Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.0.0 PLG_READMORE_XML_DESCRIPTION readmore.php index.html en-GB.plg_editors-xtd_readmore.ini en-GB.plg_editors-xtd_readmore.sys.ini editors-xtd/readmore/readmore.php000066600000003302150771657550013143 0ustar00_subject->getContent($name); $present = JText::_('PLG_READMORE_ALREADY_EXISTS', true); $js = " function insertReadmore(editor) { var content = $getContent if (content.match(//i)) { alert('$present'); return false; } else { jInsertEditorText('
', editor); } } "; $doc->addScriptDeclaration($js); $button = new JObject; $button->modal = false; $button->class = 'btn'; $button->onclick = 'insertReadmore(\'' . $name . '\');return false;'; $button->text = JText::_('PLG_READMORE_BUTTON_READMORE'); $button->name = 'arrow-down'; // @TODO: The button writer needs to take into account the javascript directive // $button->link', 'javascript:void(0)'); $button->link = '#'; return $button; } } editors-xtd/pagebreak/index.html000066600000000037150771657550012756 0ustar00 editors-xtd/pagebreak/pagebreak.xml000066600000001540150771657550013424 0ustar00 plg_editors-xtd_pagebreak Joomla! Project August 2004 Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.0.0 PLG_EDITORSXTD_PAGEBREAK_XML_DESCRIPTION pagebreak.php index.html en-GB.plg_editors-xtd_pagebreak.ini en-GB.plg_editors-xtd_pagebreak.sys.ini editors-xtd/pagebreak/pagebreak.php000066600000002317150771657550013416 0ustar00modal = true; $button->class = 'btn'; $button->link = $link; $button->text = JText::_('PLG_EDITORSXTD_PAGEBREAK_BUTTON_PAGEBREAK'); $button->name = 'copy'; $button->options = "{handler: 'iframe', size: {x: 500, y: 300}}"; return $button; } } editors-xtd/index.html000066600000000037150771657550011035 0ustar00 editors-xtd/image/index.html000066600000000037150771657550012117 0ustar00 editors-xtd/image/image.xml000066600000001474150771657550011734 0ustar00 plg_editors-xtd_image Joomla! Project August 2004 Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.0.0 PLG_IMAGE_XML_DESCRIPTION image.php index.html en-GB.plg_editors-xtd_image.ini en-GB.plg_editors-xtd_image.sys.ini editors-xtd/image/image.php000066600000004016150771657550011716 0ustar00input->get('option'); if ($asset == '') { $asset = $extension; } if ( $user->authorise('core.edit', $asset) || $user->authorise('core.create', $asset) || (count($user->getAuthorisedCategories($asset, 'core.create')) > 0) || ($user->authorise('core.edit.own', $asset) && $author == $user->id) || (count($user->getAuthorisedCategories($extension, 'core.edit')) > 0) || (count($user->getAuthorisedCategories($extension, 'core.edit.own')) > 0 && $author == $user->id)) { $link = 'index.php?option=com_media&view=images&tmpl=component&e_name=' . $name . '&asset=' . $asset . '&author=' . $author; JHtml::_('behavior.modal'); $button = new JObject; $button->modal = true; $button->class = 'btn'; $button->link = $link; $button->text = JText::_('PLG_IMAGE_BUTTON_IMAGE'); $button->name = 'picture'; $button->options = "{handler: 'iframe', size: {x: 800, y: 500}}"; return $button; } else { return false; } } } editors-xtd/article/article.xml000066600000001512150771657550012627 0ustar00 plg_editors-xtd_article Joomla! Project October 2009 Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.0.0 PLG_ARTICLE_XML_DESCRIPTION article.php index.html en-GB.plg_editors-xtd_article.ini en-GB.plg_editors-xtd_article.sys.ini editors-xtd/article/index.html000066600000000037150771657550012460 0ustar00 editors-xtd/article/article.php000066600000003653150771657550012626 0ustar00' + title + ''; jInsertEditorText(tag, '" . $name . "'); SqueezeBox.close(); }"; $doc = JFactory::getDocument(); $doc->addScriptDeclaration($js); JHtml::_('behavior.modal'); /* * Use the built-in element view to select the article. * Currently uses blank class. */ $link = 'index.php?option=com_content&view=articles&layout=modal&tmpl=component&' . JSession::getFormToken() . '=1'; $button = new JObject; $button->modal = true; $button->class = 'btn'; $button->link = $link; $button->text = JText::_('PLG_ARTICLE_BUTTON_ARTICLE'); $button->name = 'file-add'; $button->options = "{handler: 'iframe', size: {x: 800, y: 500}}"; return $button; } } search/contacts/contacts.php000066600000011747150771657550012216 0ustar00 'PLG_SEARCH_CONTACTS_CONTACTS' ); return $areas; } /** * Search content (contacts). * * The SQL must return the following fields that are used in a common display * routine: href, title, section, created, text, browsernav. * * @param string $text Target search string. * @param string $phrase Matching option (possible values: exact|any|all). Default is "any". * @param string $ordering Ordering option (possible values: newest|oldest|popular|alpha|category). Default is "newest". * @param string $areas An array if the search is to be restricted to areas or null to search all areas. * * @return array Search results. * * @since 1.6 */ public function onContentSearch($text, $phrase = '', $ordering = '', $areas = null) { require_once JPATH_SITE . '/components/com_contact/helpers/route.php'; $db = JFactory::getDbo(); $app = JFactory::getApplication(); $user = JFactory::getUser(); $groups = implode(',', $user->getAuthorisedViewLevels()); if (is_array($areas)) { if (!array_intersect($areas, array_keys($this->onContentSearchAreas()))) { return array(); } } $sContent = $this->params->get('search_content', 1); $sArchived = $this->params->get('search_archived', 1); $limit = $this->params->def('search_limit', 50); $state = array(); if ($sContent) { $state[] = 1; } if ($sArchived) { $state[] = 2; } if (empty($state)) { return array(); } $text = trim($text); if ($text == '') { return array(); } $section = JText::_('PLG_SEARCH_CONTACTS_CONTACTS'); switch ($ordering) { case 'alpha': $order = 'a.name ASC'; break; case 'category': $order = 'c.title ASC, a.name ASC'; break; case 'popular': case 'newest': case 'oldest': default: $order = 'a.name DESC'; } $text = $db->quote('%' . $db->escape($text, true) . '%', false); $query = $db->getQuery(true); // SQLSRV changes. $case_when = ' CASE WHEN '; $case_when .= $query->charLength('a.alias', '!=', '0'); $case_when .= ' THEN '; $a_id = $query->castAsChar('a.id'); $case_when .= $query->concatenate(array($a_id, 'a.alias'), ':'); $case_when .= ' ELSE '; $case_when .= $a_id . ' END as slug'; $case_when1 = ' CASE WHEN '; $case_when1 .= $query->charLength('c.alias', '!=', '0'); $case_when1 .= ' THEN '; $c_id = $query->castAsChar('c.id'); $case_when1 .= $query->concatenate(array($c_id, 'c.alias'), ':'); $case_when1 .= ' ELSE '; $case_when1 .= $c_id . ' END as catslug'; $query->select( 'a.name AS title, \'\' AS created, a.con_position, a.misc, ' . $case_when . ',' . $case_when1 . ', ' . $query->concatenate(array("a.name", "a.con_position", "a.misc"), ",") . ' AS text,' . $query->concatenate(array($db->quote($section), "c.title"), " / ") . ' AS section,' . '\'2\' AS browsernav' ); $query->from('#__contact_details AS a') ->join('INNER', '#__categories AS c ON c.id = a.catid') ->where( '(a.name LIKE ' . $text . ' OR a.misc LIKE ' . $text . ' OR a.con_position LIKE ' . $text . ' OR a.address LIKE ' . $text . ' OR a.suburb LIKE ' . $text . ' OR a.state LIKE ' . $text . ' OR a.country LIKE ' . $text . ' OR a.postcode LIKE ' . $text . ' OR a.telephone LIKE ' . $text . ' OR a.fax LIKE ' . $text . ') AND a.published IN (' . implode(',', $state) . ') AND c.published=1 ' . ' AND a.access IN (' . $groups . ') AND c.access IN (' . $groups . ')' ) ->group('a.id, a.con_position, a.misc, c.alias, c.id') ->order($order); // Filter by language. if ($app->isSite() && JLanguageMultilang::isEnabled()) { $tag = JFactory::getLanguage()->getTag(); $query->where('a.language in (' . $db->quote($tag) . ',' . $db->quote('*') . ')') ->where('c.language in (' . $db->quote($tag) . ',' . $db->quote('*') . ')'); } $db->setQuery($query, 0, $limit); $rows = $db->loadObjectList(); if ($rows) { foreach ($rows as $key => $row) { $rows[$key]->href = ContactHelperRoute::getContactRoute($row->slug, $row->catslug); $rows[$key]->text = $row->title; $rows[$key]->text .= ($row->con_position) ? ', ' . $row->con_position : ''; $rows[$key]->text .= ($row->misc) ? ', ' . $row->misc : ''; } } return $rows; } } search/contacts/index.html000066600000000037150771657550011652 0ustar00 search/contacts/contacts.xml000066600000003241150771657550012215 0ustar00 plg_search_contacts Joomla! Project November 2005 Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.0.0 PLG_SEARCH_CONTACTS_XML_DESCRIPTION contacts.php index.html en-GB.plg_search_contacts.ini en-GB.plg_search_contacts.sys.ini
search/tags/tags.xml000066600000002600150771657550010453 0ustar00 plg_search_tags Joomla! Project March 2014 Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.0.0 PLG_SEARCH_TAGS_XML_DESCRIPTION tags.php index.html en-GB.plg_search_tags.ini en-GB.plg_search_tags.sys.ini
search/tags/index.html000066600000000034150771657550010767 0ustar00search/tags/tags.php000066600000011553150771657550010451 0ustar00 'PLG_SEARCH_TAGS_TAGS' ); return $areas; } /** * Search content (tags). * * The SQL must return the following fields that are used in a common display * routine: href, title, section, created, text, browsernav. * * @param string $text Target search string. * @param string $phrase Matching option (possible values: exact|any|all). Default is "any". * @param string $ordering Ordering option (possible values: newest|oldest|popular|alpha|category). Default is "newest". * @param string $areas An array if the search is to be restricted to areas or null to search all areas. * * @return array Search results. * * @since 3.3 */ public function onContentSearch($text, $phrase = '', $ordering = '', $areas = null) { $db = JFactory::getDbo(); $query = $db->getQuery(true); $app = JFactory::getApplication(); $user = JFactory::getUser(); $section = JText::_('PLG_SEARCH_TAGS_TAGS'); $limit = $this->params->def('search_limit', 50); if (is_array($areas)) { if (!array_intersect($areas, array_keys($this->onContentSearchAreas()))) { return array(); } } $text = trim($text); if ($text == '') { return array(); } $text = $db->quote('%' . $db->escape($text, true) . '%', false); switch ($ordering) { case 'alpha': $order = 'a.title ASC'; break; case 'newest': $order = 'a.created_time DESC'; break; case 'oldest': $order = 'a.created_time ASC'; break; case 'popular': default: $order = 'a.title DESC'; } $query->select('a.id, a.title, a.alias, a.note, a.published, a.access' . ', a.checked_out, a.checked_out_time, a.created_user_id' . ', a.path, a.parent_id, a.level, a.lft, a.rgt' . ', a.language, a.created_time AS created, a.note, a.description'); $case_when_item_alias = ' CASE WHEN '; $case_when_item_alias .= $query->charLength('a.alias', '!=', '0'); $case_when_item_alias .= ' THEN '; $a_id = $query->castAsChar('a.id'); $case_when_item_alias .= $query->concatenate(array($a_id, 'a.alias'), ':'); $case_when_item_alias .= ' ELSE '; $case_when_item_alias .= $a_id . ' END as slug'; $query->select($case_when_item_alias); $query->from('#__tags AS a'); $query->where('a.alias <> ' . $db->quote('root')); $query->where('(a.title LIKE ' . $text . ' OR a.alias LIKE ' . $text . ')'); if (!$user->authorise('core.admin')) { $groups = implode(',', $user->getAuthorisedViewLevels()); $query->where('a.access IN (' . $groups . ')'); } if ($app->isSite() && JLanguageMultilang::isEnabled()) { $tag = JFactory::getLanguage()->getTag(); $query->where('a.language in (' . $db->quote($tag) . ',' . $db->quote('*') . ')'); } $query->order($order); $db->setQuery($query, 0, $limit); $rows = $db->loadObjectList(); if ($rows) { require_once JPATH_ROOT . '/components/com_tags/helpers/route.php'; foreach ($rows as $key => $row) { $rows[$key]->href = TagsHelperRoute::getTagRoute($row->id); $rows[$key]->text .= ($row->description != "" ? $row->description : $row->title); $rows[$key]->text .= $row->note; $rows[$key]->section = $section; $rows[$key]->created = $row->created; $rows[$key]->browsernav = 0; } } if (!$this->params->get('show_tagged_items')) { return $rows; } else { $final_items = $rows; JModelLegacy::addIncludePath(JPATH_SITE . '/components/com_tags/models'); $tag_model = JModelLegacy::getInstance('Tag', 'TagsModel'); $tag_model->getState(); foreach ($rows as $key => $row) { $tag_model->setState('tag.id', $row->id); $tagged_items = $tag_model->getItems(); if ($tagged_items) { foreach($tagged_items as $k => $item) { $new_item = new stdClass; $new_item->href = $item->link; $new_item->title = $item->core_title; $new_item->text = $item->core_body; $new_item->section = JText::sprintf('PLG_SEARCH_TAGS_ITEM_TAGGED_WITH', $item->content_type_title, $row->title); $new_item->created = $item->displayDate; $new_item->browsernav = 0; $final_items[] = $new_item; } } } return $final_items; } } } search/index.html000066600000000037150771657550010034 0ustar00 search/categories/index.html000066600000000037150771657550012161 0ustar00 search/categories/categories.php000066600000011532150771657550013024 0ustar00 'PLG_SEARCH_CATEGORIES_CATEGORIES' ); return $areas; } /** * Search content (categories). * * The SQL must return the following fields that are used in a common display * routine: href, title, section, created, text, browsernav. * * @param string $text Target search string. * @param string $phrase Matching option (possible values: exact|any|all). Default is "any". * @param string $ordering Ordering option (possible values: newest|oldest|popular|alpha|category). Default is "newest". * @param mixed $areas An array if the search is to be restricted to areas or null to search all areas. * * @return array Search results. * * @since 1.6 */ public function onContentSearch($text, $phrase = '', $ordering = '', $areas = null) { $db = JFactory::getDbo(); $user = JFactory::getUser(); $app = JFactory::getApplication(); $groups = implode(',', $user->getAuthorisedViewLevels()); $searchText = $text; if (is_array($areas)) { if (!array_intersect($areas, array_keys($this->onContentSearchAreas()))) { return array(); } } $sContent = $this->params->get('search_content', 1); $sArchived = $this->params->get('search_archived', 1); $limit = $this->params->def('search_limit', 50); $state = array(); if ($sContent) { $state[] = 1; } if ($sArchived) { $state[] = 2; } if (empty($state)) { return array(); } $text = trim($text); if ($text == '') { return array(); } /* TODO: The $where variable does not seem to be used at all switch ($phrase) { case 'exact': $text = $db->quote('%' . $db->escape($text, true) . '%', false); $wheres2 = array(); $wheres2[] = 'a.title LIKE ' . $text; $wheres2[] = 'a.description LIKE ' . $text; $where = '(' . implode(') OR (', $wheres2) . ')'; break; case 'any': case 'all'; default: $words = explode(' ', $text); $wheres = array(); foreach ($words as $word) { $word = $db->quote('%' . $db->escape($word, true) . '%', false); $wheres2 = array(); $wheres2[] = 'a.title LIKE ' . $word; $wheres2[] = 'a.description LIKE ' . $word; $wheres[] = implode(' OR ', $wheres2); } $where = '(' . implode(($phrase == 'all' ? ') AND (' : ') OR ('), $wheres) . ')'; break; } */ switch ($ordering) { case 'alpha': $order = 'a.title ASC'; break; case 'category': case 'popular': case 'newest': case 'oldest': default: $order = 'a.title DESC'; } $text = $db->quote('%' . $db->escape($text, true) . '%', false); $query = $db->getQuery(true); // SQLSRV changes. $case_when = ' CASE WHEN '; $case_when .= $query->charLength('a.alias', '!=', '0'); $case_when .= ' THEN '; $a_id = $query->castAsChar('a.id'); $case_when .= $query->concatenate(array($a_id, 'a.alias'), ':'); $case_when .= ' ELSE '; $case_when .= $a_id . ' END as slug'; $query->select('a.title, a.description AS text, \'\' AS created, \'2\' AS browsernav, a.id AS catid, ' . $case_when) ->from('#__categories AS a') ->where( '(a.title LIKE ' . $text . ' OR a.description LIKE ' . $text . ') AND a.published IN (' . implode(',', $state) . ') AND a.extension = ' . $db->quote('com_content') . 'AND a.access IN (' . $groups . ')' ) ->group('a.id, a.title, a.description, a.alias') ->order($order); if ($app->isSite() && JLanguageMultilang::isEnabled()) { $query->where('a.language in (' . $db->quote(JFactory::getLanguage()->getTag()) . ',' . $db->quote('*') . ')'); } $db->setQuery($query, 0, $limit); $rows = $db->loadObjectList(); $return = array(); if ($rows) { $count = count($rows); for ($i = 0; $i < $count; $i++) { $rows[$i]->href = ContentHelperRoute::getCategoryRoute($rows[$i]->slug); $rows[$i]->section = JText::_('JCATEGORY'); } foreach ($rows as $category) { if (searchHelper::checkNoHTML($category, $searchText, array('name', 'title', 'text'))) { $return[] = $category; } } } return $return; } } search/categories/categories.xml000066600000003256150771657550013041 0ustar00 plg_search_categories Joomla! Project November 2005 Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.0.0 PLG_SEARCH_CATEGORIES_XML_DESCRIPTION categories.php index.html en-GB.plg_search_categories.ini en-GB.plg_search_categories.sys.ini
search/newsfeeds/index.html000066600000000037150771657550012017 0ustar00 search/newsfeeds/newsfeeds.php000066600000011656150771657550012527 0ustar00 'PLG_SEARCH_NEWSFEEDS_NEWSFEEDS' ); return $areas; } /** * Search content (newsfeeds). * * The SQL must return the following fields that are used in a common display * routine: href, title, section, created, text, browsernav. * * @param string $text Target search string. * @param string $phrase Matching option (possible values: exact|any|all). Default is "any". * @param string $ordering Ordering option (possible values: newest|oldest|popular|alpha|category). Default is "newest". * @param mixed $areas An array if the search it to be restricted to areas or null to search all areas. * * @return array Search results. * * @since 1.6 */ public function onContentSearch($text, $phrase = '', $ordering = '', $areas = null) { $db = JFactory::getDbo(); $app = JFactory::getApplication(); $user = JFactory::getUser(); $groups = implode(',', $user->getAuthorisedViewLevels()); if (is_array($areas)) { if (!array_intersect($areas, array_keys($this->onContentSearchAreas()))) { return array(); } } $sContent = $this->params->get('search_content', 1); $sArchived = $this->params->get('search_archived', 1); $limit = $this->params->def('search_limit', 50); $state = array(); if ($sContent) { $state[] = 1; } if ($sArchived) { $state[] = 2; } if (empty($state)) { return array(); } $text = trim($text); if ($text == '') { return array(); } switch ($phrase) { case 'exact': $text = $db->quote('%' . $db->escape($text, true) . '%', false); $wheres2 = array(); $wheres2[] = 'a.name LIKE ' . $text; $wheres2[] = 'a.link LIKE ' . $text; $where = '(' . implode(') OR (', $wheres2) . ')'; break; case 'all': case 'any': default: $words = explode(' ', $text); $wheres = array(); foreach ($words as $word) { $word = $db->quote('%' . $db->escape($word, true) . '%', false); $wheres2 = array(); $wheres2[] = 'a.name LIKE ' . $word; $wheres2[] = 'a.link LIKE ' . $word; $wheres[] = implode(' OR ', $wheres2); } $where = '(' . implode(($phrase == 'all' ? ') AND (' : ') OR ('), $wheres) . ')'; break; } switch ($ordering) { case 'alpha': $order = 'a.name ASC'; break; case 'category': $order = 'c.title ASC, a.name ASC'; break; case 'oldest': case 'popular': case 'newest': default: $order = 'a.name ASC'; } $searchNewsfeeds = JText::_('PLG_SEARCH_NEWSFEEDS_NEWSFEEDS'); $query = $db->getQuery(true); // SQLSRV changes. $case_when = ' CASE WHEN '; $case_when .= $query->charLength('a.alias', '!=', '0'); $case_when .= ' THEN '; $a_id = $query->castAsChar('a.id'); $case_when .= $query->concatenate(array($a_id, 'a.alias'), ':'); $case_when .= ' ELSE '; $case_when .= $a_id . ' END as slug'; $case_when1 = ' CASE WHEN '; $case_when1 .= $query->charLength('c.alias', '!=', '0'); $case_when1 .= ' THEN '; $c_id = $query->castAsChar('c.id'); $case_when1 .= $query->concatenate(array($c_id, 'c.alias'), ':'); $case_when1 .= ' ELSE '; $case_when1 .= $c_id . ' END as catslug'; $query->select('a.name AS title, \'\' AS created, a.link AS text, ' . $case_when . "," . $case_when1) ->select($query->concatenate(array($db->quote($searchNewsfeeds), 'c.title'), " / ") . ' AS section') ->select('\'1\' AS browsernav') ->from('#__newsfeeds AS a') ->join('INNER', '#__categories as c ON c.id = a.catid') ->where('(' . $where . ') AND a.published IN (' . implode(',', $state) . ') AND c.published = 1 AND c.access IN (' . $groups . ')') ->order($order); // Filter by language. if ($app->isSite() && JLanguageMultilang::isEnabled()) { $tag = JFactory::getLanguage()->getTag(); $query->where('a.language in (' . $db->quote($tag) . ',' . $db->quote('*') . ')') ->where('c.language in (' . $db->quote($tag) . ',' . $db->quote('*') . ')'); } $db->setQuery($query, 0, $limit); $rows = $db->loadObjectList(); if ($rows) { foreach ($rows as $key => $row) { $rows[$key]->href = 'index.php?option=com_newsfeeds&view=newsfeed&catid=' . $row->catslug . '&id=' . $row->slug; } } return $rows; } } search/newsfeeds/newsfeeds.xml000066600000003251150771657550012530 0ustar00 plg_search_newsfeeds Joomla! Project November 2005 Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.0.0 PLG_SEARCH_NEWSFEEDS_XML_DESCRIPTION newsfeeds.php index.html en-GB.plg_search_newsfeeds.ini en-GB.plg_search_newsfeeds.sys.ini
search/zoosearch/changelog.php000066600000001051150771657550012471 0ustar00 Changelog ------------ 2.1.0 ^ changes to building item link 2.0.1 # fixes to search in multiple elements + added the menu itemid to the items link 2.0.0 + Initial Release * -> Security Fix # -> Bug Fix $ -> Language fix or change + -> Addition ^ -> Change - -> Removed ! -> Notesearch/zoosearch/file.script.php000066600000001543150771657550012772 0ustar00filesystem->readDirectoryFiles($parent->getParent()->getPath('source'), $parent->getParent()->getPath('source').'/', '/(positions\.(config|xml)|metadata\.xml)$/', true) as $file) { JFile::delete($file); } } } public function postflight($type, $parent) {} }search/zoosearch/renderer/index.html000066600000000036150771657550013636 0ustar00search/zoosearch/renderer/item/metadata.xml000066600000000337150771657550015105 0ustar00 Default An item is rendered with the default layout in all default module themes. search/zoosearch/renderer/item/default.php000066600000000510150771657550014731 0ustar00renderPosition('description');search/zoosearch/renderer/item/positions.xml000066600000000237150771657550015353 0ustar00 Description search/zoosearch/renderer/item/index.html000066600000000036150771657550014574 0ustar00search/zoosearch/renderer/item/positions.config000066600000005331150771657550016020 0ustar00 { "blog.article.default": { "description": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "separator=[ ]", "element": "08795744-c2dc-4a68-8252-4e21c4c4c774" }, "1": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "all", "element": "2e3c9e69-1f9e-4647-8d13-4e88094d2790" } } }, "business.company.default": { "description": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "all", "element": "1a85a7a6-2aba-4480-925b-6b97d311ee6c" } } }, "blog.author.default": { "description": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "all", "element": "14c0dd9f-ae3c-4eb2-8e22-4e9294ad3120" } } }, "business.employee.default": { "description": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "all", "element": "241905cc-36d4-4611-a1d5-fadfe280f70e" } } }, "cookbook.recipe.default": { "description": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "all", "element": "35155961-b9ae-48d4-b4aa-1a569ec7930c" } } }, "download.file.default": { "description": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "separator=[ ]", "element": "b9e826b5-e671-4fe8-a447-bf08c8c6b8e4" }, "1": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "all", "element": "c5121091-6f63-43ad-a86a-136025fe6da0" } } }, "movie.movie.default": { "description": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "all", "element": "b40b44c8-a289-46b6-a6da-9f9824714762" } } }, "movie.person.default": { "description": { "0": { "showlabel": "0", "altlabel": "", "separated_by": "tag=[
%s<\/div>]", "display": "all", "element": "a552a157-ce11-4b11-ad34-5de19e065d53" } } }, "product.product.default": { "description": { "0": { "showlabel": "0", "altlabel": "", "width": "", "height": "", "link_to_item": "1", "element": "57172c66-27cb-442d-a964-19f64f744a3b" }, "1": { "showlabel": "0", "altlabel": "", "date_format": "%A, %d %B %Y", "custom_format": "", "separated_by": "separator=[ ]", "element": "667ea4d6-3745-40b5-b2a2-41fdc13b9a47" }, "2": { "showlabel": "0", "altlabel": "", "separated_by": "separator=[ ]", "element": "aed9068f-8fd9-4c38-89d1-83187a602ac5" } } } }search/zoosearch/zoosearch.php000066600000014642150771657550012551 0ustar00enabled) { return; } parent::__construct($subject, $params); // load config jimport('joomla.filesystem.file'); if (!JFile::exists(JPATH_ADMINISTRATOR.'/components/com_zoo/config.php') || !JComponentHelper::getComponent('com_zoo', true)->enabled) { return; } require_once(JPATH_ADMINISTRATOR.'/components/com_zoo/config.php'); $this->app = App::getInstance('zoo'); } /* Function: onSearchAreas Get search areas. Returns: Array - Search areas */ public function onSearchAreas() { static $areas = array(); return $areas; } /* Function: onSearch Get search results. The sql must return the following fields that are used in a common display routine: href, title, section, created, text, browsernav Parameters: $text - Target search string $phrase - Matching option, exact|any|all $ordering - Ordering option, newest|oldest|popular|alpha|category $areas - An array if the search it to be restricted to areas, null if search all Returns: Array - Search results */ public function onContentSearch($text, $phrase = '', $ordering = '', $areas = null) { $db = $this->app->database; // init vars $now = $db->Quote($this->app->date->create()->toSQL()); $null = $db->Quote($db->getNullDate()); $text = trim($text); // return empty array, if no search text provided if (empty($text)) { return array(); } // get plugin info $plugin = JPluginHelper::getPlugin('search', 'zoosearch'); $params = $this->app->parameter->create($plugin->params); $fulltext = $params->get('search_fulltext', 0) && strlen($text) > 3 && intval($db->getVersion()) >= 4; $limit = $params->get('search_limit', 50); $elements = array(); foreach ($this->app->application->groups() as $application) { foreach($application->getTypes() as $type) { foreach ($type->getElements() as $element) { if (!$element->canAccess()) { $elements[] = $db->Quote($element->identifier); } } } } $access = $elements ? 'NOT element_id in ('.implode(',', $elements).')' : '1'; // prepare search query switch ($phrase) { case 'exact': if ($fulltext) { $text = $db->escape($text); $where[] = "MATCH(a.name) AGAINST ('\"{$text}\"' IN BOOLEAN MODE)"; $where[] = "MATCH(b.value) AGAINST ('\"{$text}\"' IN BOOLEAN MODE) AND $access"; $where[] = "MATCH(c.name) AGAINST ('\"{$text}\"' IN BOOLEAN MODE)"; $where = implode(" OR ", $where); } else { $text = $db->Quote('%'.$db->escape($text, true).'%', false); $like = array(); $like[] = 'a.name LIKE '.$text; $like[] = "b.value LIKE $text AND $access"; $like[] = 'c.name LIKE '.$text; $where = '(' .implode(') OR (', $like).')'; } break; case 'all': case 'any': default: if ($fulltext) { $text = $db->escape($text); $where[] = "MATCH(a.name) AGAINST ('{$text}' IN BOOLEAN MODE)"; $where[] = "MATCH(b.value) AGAINST ('{$text}' IN BOOLEAN MODE) AND $access"; $where[] = "MATCH(c.name) AGAINST ('{$text}' IN BOOLEAN MODE)"; $where = implode(" OR ", $where); } else { $words = explode(' ', $text); $wheres = array(); foreach ($words as $word) { $word = $db->Quote('%'.$db->escape($word, true).'%', false); $like = array(); $like[] = 'a.name LIKE '.$word; $like[] = 'EXISTS (SELECT value FROM '.ZOO_TABLE_SEARCH.' WHERE a.id = item_id AND value LIKE '.$word.' AND '.$access.')'; $like[] = 'EXISTS (SELECT name FROM '.ZOO_TABLE_TAG.' WHERE a.id = item_id AND name LIKE '.$word.')'; $wheres[] = implode(' OR ', $like); } $where = '('.implode(($phrase == 'all' ? ') AND (' : ') OR ('), $wheres).')'; } } // set search ordering switch ($ordering) { case 'newest': $order = 'a.created DESC'; break; case 'oldest': $order = 'a.created ASC'; break; case 'popular': $order = 'a.hits DESC'; break; case 'alpha': case 'category': default: $order = 'a.name ASC'; } // set query options $select = "DISTINCT a.*"; $from = ZOO_TABLE_ITEM." AS a" ." LEFT JOIN ".ZOO_TABLE_SEARCH." AS b ON a.id = b.item_id" ." LEFT JOIN ".ZOO_TABLE_TAG." AS c ON a.id = c.item_id"; $conditions = array("(".$where.")" ." AND a.searchable = 1" ." AND a." . $this->app->user->getDBAccessString() ." AND (a.state = 1" ." AND (a.publish_up = ".$null." OR a.publish_up <= ".$now.")" ." AND (a.publish_down = ".$null." OR a.publish_down >= ".$now."))"); // execute query $items = $this->app->table->item->all(compact('select', 'from', 'conditions', 'order', 'limit')); // create search result rows $rows = array(); if (!empty($items)) { // set renderer $renderer = $this->app->renderer->create('item')->addPath(array($this->app->path->path('component.site:'), $this->app->path->path('plugins:search/zoosearch/'))); foreach ($items as $item) { $row = new stdClass(); $row->title = $item->name; $row->text = $renderer->render('item.default', array('item' => $item)); $row->href = $this->app->route->item($item); $row->created = $item->created; $row->section = ''; $row->browsernav = 2; $rows[] = $row; } } return $rows; } public function registerZOOEvents() { if ($this->app) { $this->app->event->dispatcher->connect('type:assignelements', array($this, 'assignElements')); } } public function assignElements() { $this->app->system->application->enqueueMessage(JText::_('Only text based elements are allowed in the search layouts'), 'notice'); } }search/zoosearch/zoosearch.xml000066600000002540150771657550012554 0ustar00 Search - ZOO YOOtheme October 2012 Copyright (C) YOOtheme GmbH http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only YOOtheme Proprietary Use License (http://www.yootheme.com/license) info@yootheme.com http://www.yootheme.com 3.0.0 Search plugin for ZOO developed by YOOtheme (http://www.yootheme.com) zoosearch.php changelog.php file.script.php renderer file.script.php
search/weblinks/weblinks.php000066600000012534150771657550012211 0ustar00 'PLG_SEARCH_WEBLINKS_WEBLINKS' ); return $areas; } /** * Search content (weblinks). * * The SQL must return the following fields that are used in a common display * routine: href, title, section, created, text, browsernav * * @param string $text Target search string. * @param string $phrase Matching option (possible values: exact|any|all). Default is "any". * @param string $ordering Ordering option (possible values: newest|oldest|popular|alpha|category). Default is "newest". * @param mixed $areas An array if the search it to be restricted to areas or null to search all areas. * * @return array Search results. * * @since 1.6 */ public function onContentSearch($text, $phrase = '', $ordering = '', $areas = null) { $db = JFactory::getDbo(); $app = JFactory::getApplication(); $user = JFactory::getUser(); $groups = implode(',', $user->getAuthorisedViewLevels()); $searchText = $text; if (is_array($areas)) { if (!array_intersect($areas, array_keys($this->onContentSearchAreas()))) { return array(); } } $sContent = $this->params->get('search_content', 1); $sArchived = $this->params->get('search_archived', 1); $limit = $this->params->def('search_limit', 50); $state = array(); if ($sContent) { $state[] = 1; } if ($sArchived) { $state[] = 2; } if (empty($state)) { return array(); } $text = trim($text); if ($text == '') { return array(); } $searchWeblinks = JText::_('PLG_SEARCH_WEBLINKS'); switch ($phrase) { case 'exact': $text = $db->quote('%' . $db->escape($text, true) . '%', false); $wheres2 = array(); $wheres2[] = 'a.url LIKE ' . $text; $wheres2[] = 'a.description LIKE ' . $text; $wheres2[] = 'a.title LIKE ' . $text; $where = '(' . implode(') OR (', $wheres2) . ')'; break; case 'all': case 'any': default: $words = explode(' ', $text); $wheres = array(); foreach ($words as $word) { $word = $db->quote('%' . $db->escape($word, true) . '%', false); $wheres2 = array(); $wheres2[] = 'a.url LIKE ' . $word; $wheres2[] = 'a.description LIKE ' . $word; $wheres2[] = 'a.title LIKE ' . $word; $wheres[] = implode(' OR ', $wheres2); } $where = '(' . implode(($phrase == 'all' ? ') AND (' : ') OR ('), $wheres) . ')'; break; } switch ($ordering) { case 'oldest': $order = 'a.created ASC'; break; case 'popular': $order = 'a.hits DESC'; break; case 'alpha': $order = 'a.title ASC'; break; case 'category': $order = 'c.title ASC, a.title ASC'; break; case 'newest': default: $order = 'a.created DESC'; } $query = $db->getQuery(true); // SQLSRV changes. $case_when = ' CASE WHEN '; $case_when .= $query->charLength('a.alias', '!=', '0'); $case_when .= ' THEN '; $a_id = $query->castAsChar('a.id'); $case_when .= $query->concatenate(array($a_id, 'a.alias'), ':'); $case_when .= ' ELSE '; $case_when .= $a_id . ' END as slug'; $case_when1 = ' CASE WHEN '; $case_when1 .= $query->charLength('c.alias', '!=', '0'); $case_when1 .= ' THEN '; $c_id = $query->castAsChar('c.id'); $case_when1 .= $query->concatenate(array($c_id, 'c.alias'), ':'); $case_when1 .= ' ELSE '; $case_when1 .= $c_id . ' END as catslug'; $query->select('a.title AS title, \'\' AS created, a.url, a.description AS text, ' . $case_when . "," . $case_when1) ->select($query->concatenate(array($db->quote($searchWeblinks), 'c.title'), " / ") . ' AS section') ->select('\'1\' AS browsernav') ->from('#__weblinks AS a') ->join('INNER', '#__categories as c ON c.id = a.catid') ->where('(' . $where . ') AND a.state IN (' . implode(',', $state) . ') AND c.published = 1 AND c.access IN (' . $groups . ')') ->order($order); // Filter by language. if ($app->isSite() && JLanguageMultilang::isEnabled()) { $tag = JFactory::getLanguage()->getTag(); $query->where('a.language in (' . $db->quote($tag) . ',' . $db->quote('*') . ')') ->where('c.language in (' . $db->quote($tag) . ',' . $db->quote('*') . ')'); } $db->setQuery($query, 0, $limit); $rows = $db->loadObjectList(); $return = array(); if ($rows) { foreach ($rows as $key => $row) { $rows[$key]->href = WeblinksHelperRoute::getWeblinkRoute($row->slug, $row->catslug); } foreach ($rows as $weblink) { if (searchHelper::checkNoHTML($weblink, $searchText, array('url', 'text', 'title'))) { $return[] = $weblink; } } } return $return; } } search/weblinks/index.html000066600000000037150771657550011652 0ustar00 search/weblinks/weblinks.xml000066600000003241150771657550012215 0ustar00 plg_search_weblinks Joomla! Project November 2005 Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.0.0 PLG_SEARCH_WEBLINKS_XML_DESCRIPTION weblinks.php index.html en-GB.plg_search_weblinks.ini en-GB.plg_search_weblinks.sys.ini
search/content/index.html000066600000000037150771657550011506 0ustar00 search/content/content.xml000066600000003316150771657550011710 0ustar00 plg_search_content Joomla! Project November 2005 Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.0.0 PLG_SEARCH_CONTENT_XML_DESCRIPTION content.php index.html en-GB.plg_search_content.ini en-GB.plg_search_content.sys.ini
search/content/content.php000066600000021121150771657550011671 0ustar00 'JGLOBAL_ARTICLES' ); return $areas; } /** * Search content (articles). * The SQL must return the following fields that are used in a common display * routine: href, title, section, created, text, browsernav. * * @param string $text Target search string. * @param string $phrase Matching option (possible values: exact|any|all). Default is "any". * @param string $ordering Ordering option (possible values: newest|oldest|popular|alpha|category). Default is "newest". * @param mixed $areas An array if the search it to be restricted to areas or null to search all areas. * * @return array Search results. * * @since 1.6 */ public function onContentSearch($text, $phrase = '', $ordering = '', $areas = null) { $db = JFactory::getDbo(); $app = JFactory::getApplication(); $user = JFactory::getUser(); $groups = implode(',', $user->getAuthorisedViewLevels()); $tag = JFactory::getLanguage()->getTag(); require_once JPATH_SITE . '/components/com_content/helpers/route.php'; require_once JPATH_ADMINISTRATOR . '/components/com_search/helpers/search.php'; $searchText = $text; if (is_array($areas)) { if (!array_intersect($areas, array_keys($this->onContentSearchAreas()))) { return array(); } } $sContent = $this->params->get('search_content', 1); $sArchived = $this->params->get('search_archived', 1); $limit = $this->params->def('search_limit', 50); $nullDate = $db->getNullDate(); $date = JFactory::getDate(); $now = $date->toSql(); $text = trim($text); if ($text == '') { return array(); } switch ($phrase) { case 'exact': $text = $db->quote('%' . $db->escape($text, true) . '%', false); $wheres2 = array(); $wheres2[] = 'a.title LIKE ' . $text; $wheres2[] = 'a.introtext LIKE ' . $text; $wheres2[] = 'a.fulltext LIKE ' . $text; $wheres2[] = 'a.metakey LIKE ' . $text; $wheres2[] = 'a.metadesc LIKE ' . $text; $where = '(' . implode(') OR (', $wheres2) . ')'; break; case 'all': case 'any': default: $words = explode(' ', $text); $wheres = array(); foreach ($words as $word) { $word = $db->quote('%' . $db->escape($word, true) . '%', false); $wheres2 = array(); $wheres2[] = 'a.title LIKE ' . $word; $wheres2[] = 'a.introtext LIKE ' . $word; $wheres2[] = 'a.fulltext LIKE ' . $word; $wheres2[] = 'a.metakey LIKE ' . $word; $wheres2[] = 'a.metadesc LIKE ' . $word; $wheres[] = implode(' OR ', $wheres2); } $where = '(' . implode(($phrase == 'all' ? ') AND (' : ') OR ('), $wheres) . ')'; break; } switch ($ordering) { case 'oldest': $order = 'a.created ASC'; break; case 'popular': $order = 'a.hits DESC'; break; case 'alpha': $order = 'a.title ASC'; break; case 'category': $order = 'c.title ASC, a.title ASC'; break; case 'newest': default: $order = 'a.created DESC'; break; } $rows = array(); $query = $db->getQuery(true); // Search articles. if ($sContent && $limit > 0) { $query->clear(); // SQLSRV changes. $case_when = ' CASE WHEN '; $case_when .= $query->charLength('a.alias', '!=', '0'); $case_when .= ' THEN '; $a_id = $query->castAsChar('a.id'); $case_when .= $query->concatenate(array($a_id, 'a.alias'), ':'); $case_when .= ' ELSE '; $case_when .= $a_id . ' END as slug'; $case_when1 = ' CASE WHEN '; $case_when1 .= $query->charLength('c.alias', '!=', '0'); $case_when1 .= ' THEN '; $c_id = $query->castAsChar('c.id'); $case_when1 .= $query->concatenate(array($c_id, 'c.alias'), ':'); $case_when1 .= ' ELSE '; $case_when1 .= $c_id . ' END as catslug'; $query->select('a.title AS title, a.metadesc, a.metakey, a.created AS created') ->select($query->concatenate(array('a.introtext', 'a.fulltext')) . ' AS text') ->select('c.title AS section, ' . $case_when . ',' . $case_when1 . ', ' . '\'2\' AS browsernav') ->from('#__content AS a') ->join('INNER', '#__categories AS c ON c.id=a.catid') ->where( '(' . $where . ') AND a.state=1 AND c.published = 1 AND a.access IN (' . $groups . ') ' . 'AND c.access IN (' . $groups . ') ' . 'AND (a.publish_up = ' . $db->quote($nullDate) . ' OR a.publish_up <= ' . $db->quote($now) . ') ' . 'AND (a.publish_down = ' . $db->quote($nullDate) . ' OR a.publish_down >= ' . $db->quote($now) . ')' ) ->group('a.id, a.title, a.metadesc, a.metakey, a.created, a.introtext, a.fulltext, c.title, a.alias, c.alias, c.id') ->order($order); // Filter by language. if ($app->isSite() && JLanguageMultilang::isEnabled()) { $query->where('a.language in (' . $db->quote($tag) . ',' . $db->quote('*') . ')') ->where('c.language in (' . $db->quote($tag) . ',' . $db->quote('*') . ')'); } $db->setQuery($query, 0, $limit); $list = $db->loadObjectList(); $limit -= count($list); if (isset($list)) { foreach ($list as $key => $item) { $list[$key]->href = ContentHelperRoute::getArticleRoute($item->slug, $item->catslug); } } $rows[] = $list; } // Search archived content. if ($sArchived && $limit > 0) { $query->clear(); // SQLSRV changes. $case_when = ' CASE WHEN '; $case_when .= $query->charLength('a.alias', '!=', '0'); $case_when .= ' THEN '; $a_id = $query->castAsChar('a.id'); $case_when .= $query->concatenate(array($a_id, 'a.alias'), ':'); $case_when .= ' ELSE '; $case_when .= $a_id . ' END as slug'; $case_when1 = ' CASE WHEN '; $case_when1 .= $query->charLength('c.alias', '!=', '0'); $case_when1 .= ' THEN '; $c_id = $query->castAsChar('c.id'); $case_when1 .= $query->concatenate(array($c_id, 'c.alias'), ':'); $case_when1 .= ' ELSE '; $case_when1 .= $c_id . ' END as catslug'; $query->select( 'a.title AS title, a.metadesc, a.metakey, a.created AS created, ' . $query->concatenate(array("a.introtext", "a.fulltext")) . ' AS text,' . $case_when . ',' . $case_when1 . ', ' . 'c.title AS section, \'2\' AS browsernav' ); // .'CONCAT_WS("/", c.title) AS section, \'2\' AS browsernav' ); $query->from('#__content AS a') ->join('INNER', '#__categories AS c ON c.id=a.catid AND c.access IN (' . $groups . ')') ->where( '(' . $where . ') AND a.state = 2 AND c.published = 1 AND a.access IN (' . $groups . ') AND c.access IN (' . $groups . ') ' . 'AND (a.publish_up = ' . $db->quote($nullDate) . ' OR a.publish_up <= ' . $db->quote($now) . ') ' . 'AND (a.publish_down = ' . $db->quote($nullDate) . ' OR a.publish_down >= ' . $db->quote($now) . ')' ) ->order($order); // Filter by language. if ($app->isSite() && JLanguageMultilang::isEnabled()) { $query->where('a.language in (' . $db->quote($tag) . ',' . $db->quote('*') . ')') ->where('c.language in (' . $db->quote($tag) . ',' . $db->quote('*') . ')'); } $db->setQuery($query, 0, $limit); $list3 = $db->loadObjectList(); // Find an itemid for archived to use if there isn't another one. $item = $app->getMenu()->getItems('link', 'index.php?option=com_content&view=archive', true); $itemid = isset($item->id) ? '&Itemid=' . $item->id : ''; if (isset($list3)) { foreach ($list3 as $key => $item) { $date = JFactory::getDate($item->created); $created_month = $date->format("n"); $created_year = $date->format("Y"); $list3[$key]->href = JRoute::_('index.php?option=com_content&view=archive&year=' . $created_year . '&month=' . $created_month . $itemid); } } $rows[] = $list3; } $results = array(); if (count($rows)) { foreach ($rows as $row) { $new_row = array(); foreach ($row as $article) { if (SearchHelper::checkNoHTML($article, $searchText, array('text', 'title', 'metadesc', 'metakey'))) { $new_row[] = $article; } } $results = array_merge($results, (array) $new_row); } } return $results; } } content/widgetkit_content/widgetkit_content.php000066600000001765150771657550016240 0ustar00text, $matches); if (count($matches[1])) { // load widgetkit require_once(JPATH_ADMINISTRATOR.'/components/com_widgetkit/widgetkit.php'); // get widgetkit $widgetkit = Widgetkit::getInstance(); // render output foreach ($matches[1] as $i => $widget_id) { $output = $widgetkit['widget']->render($widget_id); $output = ($output === false) ? "Could not load widget with the id $widget_id." : $output; $article->text = str_replace($matches[0][$i], $output, $article->text); } } return ''; } }content/widgetkit_content/widgetkit_content.xml000066600000001253150771657550016241 0ustar00 Content - Widgetkit YOOtheme May 2011 Copyright (C) 2007 - 2011 YOOtheme GmbH YOOtheme Proprietary Use License (http://www.yootheme.com/license) info@yootheme.com http://www.yootheme.com 1.0.0 Plugin for Widgetkit developed by YOOtheme (http://www.yootheme.com) widgetkit_content.php content/pagebreak/index.html000066600000000037150771657550012162 0ustar00 content/pagebreak/pagebreak.xml000066600000005227150771657550012636 0ustar00 plg_content_pagebreak Joomla! Project November 2005 Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.0.0 PLG_CONTENT_PAGEBREAK_XML_DESCRIPTION pagebreak.php index.html en-GB.plg_content_pagebreak.ini en-GB.plg_content_pagebreak.sys.ini
content/pagebreak/pagebreak.php000066600000022236150771657550012624 0ustar00Usage: *
*
* or *
* or *
* or *
* * @package Joomla.Plugin * @subpackage Content.pagebreak * @since 1.6 */ class PlgContentPagebreak extends JPlugin { /** * Load the language file on instantiation. * * @var boolean * @since 3.1 */ protected $autoloadLanguage = true; /** * Plugin that adds a pagebreak into the text and truncates text at that point * * @param string $context The context of the content being passed to the plugin. * @param object &$row The article object. Note $article->text is also available * @param mixed &$params The article params * @param integer $page The 'page' number * * @return mixed Always returns void or true * * @since 1.6 */ public function onContentPrepare($context, &$row, &$params, $page = 0) { $canProceed = $context == 'com_content.article'; if (!$canProceed) { return; } $style = $this->params->get('style', 'pages'); // Expression to search for. $regex = '##iU'; $input = JFactory::getApplication()->input; $print = $input->getBool('print'); $showall = $input->getBool('showall'); if (!$this->params->get('enabled', 1)) { $print = true; } if ($print) { $row->text = preg_replace($regex, '
', $row->text); return true; } // Simple performance check to determine whether bot should process further. if (JString::strpos($row->text, 'class="system-pagebreak') === false) { return true; } $view = $input->getString('view'); $full = $input->getBool('fullview'); if (!$page) { $page = 0; } if ($params->get('intro_only') || $params->get('popup') || $full || $view != 'article') { $row->text = preg_replace($regex, '', $row->text); return; } // Find all instances of plugin and put in $matches. $matches = array(); preg_match_all($regex, $row->text, $matches, PREG_SET_ORDER); if (($showall && $this->params->get('showall', 1))) { $hasToc = $this->params->get('multipage_toc', 1); if ($hasToc) { // Display TOC. $page = 1; $this->_createToc($row, $matches, $page); } else { $row->toc = ''; } $row->text = preg_replace($regex, '
', $row->text); return true; } // Split the text around the plugin. $text = preg_split($regex, $row->text); // Count the number of pages. $n = count($text); // We have found at least one plugin, therefore at least 2 pages. if ($n > 1) { $title = $this->params->get('title', 1); $hasToc = $this->params->get('multipage_toc', 1); // Adds heading or title to Title. if ($title) { if ($page) { if ($page && @$matches[$page - 1][2]) { $attrs = JUtility::parseAttributes($matches[$page - 1][1]); if (@$attrs['title']) { $row->page_title = $attrs['title']; } } } } // Reset the text, we already hold it in the $text array. $row->text = ''; if ($style == 'pages') { // Display TOC. if ($hasToc) { $this->_createToc($row, $matches, $page); } else { $row->toc = ''; } // Traditional mos page navigation $pageNav = new JPagination($n, $page, 1); // Page counter. $row->text .= ''; // Page text. $text[$page] = str_replace('
', '', $text[$page]); $row->text .= $text[$page]; // $row->text .= '
'; $row->text .= '
'; // Adds navigation between pages to bottom of text. if ($hasToc) { $this->_createNavigation($row, $page, $n); } // Page links shown at bottom of page if TOC disabled. if (!$hasToc) { $row->text .= $pageNav->getPagesLinks(); } $row->text .= '
'; } else { $t[] = $text[0]; $t[] = (string) JHtml::_($style . '.start', 'article' . $row->id . '-' . $style); foreach ($text as $key => $subtext) { if ($key >= 1) { $match = $matches[$key - 1]; $match = (array) JUtility::parseAttributes($match[0]); if (isset($match['alt'])) { $title = stripslashes($match['alt']); } elseif (isset($match['title'])) { $title = stripslashes($match['title']); } else { $title = JText::sprintf('PLG_CONTENT_PAGEBREAK_PAGE_NUM', $key + 1); } $t[] = (string) JHtml::_($style . '.panel', $title, 'article' . $row->id . '-' . $style . $key); } $t[] = (string) $subtext; } $t[] = (string) JHtml::_($style . '.end'); $row->text = implode(' ', $t); } } return true; } /** * Creates a Table of Contents for the pagebreak * * @param object &$row The article object. Note $article->text is also available * @param array &$matches Array of matches of a regex in onContentPrepare * @param integer &$page The 'page' number * * @return void * * @since 1.6 */ protected function _createTOC(&$row, &$matches, &$page) { $heading = isset($row->title) ? $row->title : JText::_('PLG_CONTENT_PAGEBREAK_NO_TITLE'); $input = JFactory::getApplication()->input; $limitstart = $input->getUInt('limitstart', 0); $showall = $input->getInt('showall', 0); // TOC header. $row->toc = '
'; if ($this->params->get('article_index') == 1) { $headingtext = JText::_('PLG_CONTENT_PAGEBREAK_ARTICLE_INDEX'); if ($this->params->get('article_index_text')) { htmlspecialchars($headingtext = $this->params->get('article_index_text')); } $row->toc .= '

' . $headingtext . '

'; } // TOC first Page link. $class = ($limitstart === 0 && $showall === 0) ? 'toclink active' : 'toclink'; $row->toc .= '
'; } /** * Creates the navigation for the item * * @param object &$row The article object. Note $article->text is also available * @param int $page The total number of pages * @param int $n The page number * * @return void * * @since 1.6 */ protected function _createNavigation(&$row, $page, $n) { $pnSpace = ''; if (JText::_('JGLOBAL_LT') || JText::_('JGLOBAL_LT')) { $pnSpace = ' '; } if ($page < $n - 1) { $page_next = $page + 1; $link_next = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catid) . '&showall=&limitstart=' . ($page_next)); // Next >> $next = '' . JText::_('JNEXT') . $pnSpace . JText::_('JGLOBAL_GT') . JText::_('JGLOBAL_GT') . ''; } else { $next = JText::_('JNEXT'); } if ($page > 0) { $page_prev = $page - 1 == 0 ? '' : $page - 1; $link_prev = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catid) . '&showall=&limitstart=' . ($page_prev)); // << Prev $prev = '' . JText::_('JGLOBAL_LT') . JText::_('JGLOBAL_LT') . $pnSpace . JText::_('JPREV') . ''; } else { $prev = JText::_('JPREV'); } $row->text .= '
  • ' . $prev . '
  • ' . $next . '
'; } } content/geshi/geshi/geshi/php.php000066600000211517150771657550013050 0ustar00 'PHP', 'COMMENT_SINGLE' => array(1 => '//', 2 => '#'), 'COMMENT_MULTI' => array('/*' => '*/'), 'COMMENT_REGEXP' => array( //Heredoc and Nowdoc syntax 3 => '/<<<\s*?(\'?)([a-zA-Z0-9]+?)\1[^\n]*?\\n.*\\n\\2(?![a-zA-Z0-9])/siU', // phpdoc comments 4 => '#/\*\*(?![\*\/]).*\*/#sU', // Advanced # handling 2 => "/#.*?(?:(?=\?\>)|^)/smi" ), 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE, 'QUOTEMARKS' => array('"'), 'ESCAPE_CHAR' => '', 'ESCAPE_REGEXP' => array( //Simple Single Char Escapes 1 => "#\\\\[nfrtv\$\"\n\\\\]#i", //Hexadecimal Char Specs 2 => "#\\\\x[\da-fA-F]{1,2}#i", //Octal Char Specs 3 => "#\\\\[0-7]{1,3}#", //String Parsing of Variable Names 4 => "#\\$[a-z0-9_]+(?:\\[[a-z0-9_]+\\]|->[a-z0-9_]+)?|(?:\\{\\$|\\$\\{)[a-z0-9_]+(?:\\[('?)[a-z0-9_]*\\1\\]|->[a-z0-9_]+)*\\}#i", //Experimental extension supporting cascaded {${$var}} syntax 5 => "#\$[a-z0-9_]+(?:\[[a-z0-9_]+\]|->[a-z0-9_]+)?|(?:\{\$|\$\{)[a-z0-9_]+(?:\[('?)[a-z0-9_]*\\1\]|->[a-z0-9_]+)*\}|\{\$(?R)\}#i", //Format String support in ""-Strings 6 => "#%(?:%|(?:\d+\\\\\\\$)?\\+?(?:\x20|0|'.)?-?(?:\d+|\\*)?(?:\.\d+)?[bcdefFosuxX])#" ), 'HARDQUOTE' => array("'", "'"), 'HARDESCAPE' => array("'", "\\"), 'HARDCHAR' => "\\", 'NUMBERS' => GESHI_NUMBER_INT_BASIC | GESHI_NUMBER_OCT_PREFIX | GESHI_NUMBER_HEX_PREFIX | GESHI_NUMBER_FLT_SCI_ZERO, 'KEYWORDS' => array( 1 => array( 'as','break','case','continue','default','do','else','elseif', 'endfor','endforeach','endif','endswitch','endwhile','for', 'foreach','if','include','include_once','require','require_once', 'return','switch','throw','while', 'echo','print' ), 2 => array( '&new','</script>','<?php','<script language', 'class','const','declare','extends','function','global','interface', 'namespace','new','private','protected','public','self','use','var' ), 3 => array( 'abs','acos','acosh','addcslashes','addslashes','aggregate', 'aggregate_methods','aggregate_methods_by_list', 'aggregate_methods_by_regexp','aggregate_properties', 'aggregate_properties_by_list','aggregate_properties_by_regexp', 'aggregation_info','apache_child_terminate','apache_get_modules', 'apache_get_version','apache_getenv','apache_lookup_uri', 'apache_note','apache_request_headers','apache_response_headers', 'apache_setenv','array','array_change_key_case','array_chunk', 'array_combine','array_count_values','array_diff', 'array_diff_assoc','array_diff_key','array_diff_uassoc', 'array_diff_ukey','array_fill','array_fill_keys','array_filter', 'array_flip','array_intersect','array_intersect_assoc', 'array_intersect_key','array_intersect_uassoc', 'array_intersect_ukey','array_key_exists','array_keys','array_map', 'array_merge','array_merge_recursive','array_multisort','array_pad', 'array_pop','array_product','array_push','array_rand', 'array_reduce','array_reverse','array_search','array_shift', 'array_slice','array_splice','array_sum','array_udiff', 'array_udiff_assoc','array_udiff_uassoc','array_uintersect', 'array_uintersect_assoc','array_uintersect_uassoc','array_unique', 'array_unshift','array_values','array_walk','array_walk_recursive', 'arsort','asin','asinh','asort','assert','assert_options','atan', 'atan2','atanh','base_convert','base64_decode','base64_encode', 'basename','bcadd','bccomp','bcdiv','bcmod','bcmul', 'bcompiler_load','bcompiler_load_exe','bcompiler_parse_class', 'bcompiler_read','bcompiler_write_class','bcompiler_write_constant', 'bcompiler_write_exe_footer','bcompiler_write_file', 'bcompiler_write_footer','bcompiler_write_function', 'bcompiler_write_functions_from_file','bcompiler_write_header', 'bcompiler_write_included_filename','bcpow','bcpowmod','bcscale', 'bcsqrt','bcsub','bin2hex','bindec','bindtextdomain', 'bind_textdomain_codeset','bitset_empty','bitset_equal', 'bitset_excl','bitset_fill','bitset_from_array','bitset_from_hash', 'bitset_from_string','bitset_in','bitset_incl', 'bitset_intersection','bitset_invert','bitset_is_empty', 'bitset_subset','bitset_to_array','bitset_to_hash', 'bitset_to_string','bitset_union','blenc_encrypt','bzclose', 'bzcompress','bzdecompress','bzerrno','bzerror','bzerrstr', 'bzflush','bzopen','bzread','bzwrite','cal_days_in_month', 'cal_from_jd','cal_info','cal_to_jd','call_user_func', 'call_user_func_array','call_user_method','call_user_method_array', 'ceil','chdir','checkdate','checkdnsrr','chgrp','chmod','chop', 'chown','chr','chunk_split','class_exists','class_implements', 'class_parents','classkit_aggregate_methods', 'classkit_doc_comments','classkit_import','classkit_method_add', 'classkit_method_copy','classkit_method_redefine', 'classkit_method_remove','classkit_method_rename','clearstatcache', 'closedir','closelog','com_create_guid','com_event_sink', 'com_get_active_object','com_load_typelib','com_message_pump', 'com_print_typeinfo','compact','confirm_phpdoc_compiled', 'connection_aborted','connection_status','constant', 'convert_cyr_string','convert_uudecode','convert_uuencode','copy', 'cos','cosh','count','count_chars','cpdf_add_annotation', 'cpdf_add_outline','cpdf_arc','cpdf_begin_text','cpdf_circle', 'cpdf_clip','cpdf_close','cpdf_closepath', 'cpdf_closepath_fill_stroke','cpdf_closepath_stroke', 'cpdf_continue_text','cpdf_curveto','cpdf_end_text','cpdf_fill', 'cpdf_fill_stroke','cpdf_finalize','cpdf_finalize_page', 'cpdf_global_set_document_limits','cpdf_import_jpeg','cpdf_lineto', 'cpdf_moveto','cpdf_newpath','cpdf_open','cpdf_output_buffer', 'cpdf_page_init','cpdf_rect','cpdf_restore','cpdf_rlineto', 'cpdf_rmoveto','cpdf_rotate','cpdf_rotate_text','cpdf_save', 'cpdf_save_to_file','cpdf_scale','cpdf_set_action_url', 'cpdf_set_char_spacing','cpdf_set_creator','cpdf_set_current_page', 'cpdf_set_font','cpdf_set_font_directories', 'cpdf_set_font_map_file','cpdf_set_horiz_scaling', 'cpdf_set_keywords','cpdf_set_leading','cpdf_set_page_animation', 'cpdf_set_subject','cpdf_set_text_matrix','cpdf_set_text_pos', 'cpdf_set_text_rendering','cpdf_set_text_rise','cpdf_set_title', 'cpdf_set_viewer_preferences','cpdf_set_word_spacing', 'cpdf_setdash','cpdf_setflat','cpdf_setgray','cpdf_setgray_fill', 'cpdf_setgray_stroke','cpdf_setlinecap','cpdf_setlinejoin', 'cpdf_setlinewidth','cpdf_setmiterlimit','cpdf_setrgbcolor', 'cpdf_setrgbcolor_fill','cpdf_setrgbcolor_stroke','cpdf_show', 'cpdf_show_xy','cpdf_stringwidth','cpdf_stroke','cpdf_text', 'cpdf_translate','crack_check','crack_closedict', 'crack_getlastmessage','crack_opendict','crc32','create_function', 'crypt','ctype_alnum','ctype_alpha','ctype_cntrl','ctype_digit', 'ctype_graph','ctype_lower','ctype_print','ctype_punct', 'ctype_space','ctype_upper','ctype_xdigit','curl_close', 'curl_copy_handle','curl_errno','curl_error','curl_exec', 'curl_getinfo','curl_init','curl_multi_add_handle', 'curl_multi_close','curl_multi_exec','curl_multi_getcontent', 'curl_multi_info_read','curl_multi_init','curl_multi_remove_handle', 'curl_multi_select','curl_setopt','curl_setopt_array', 'curl_version','current','cvsclient_connect','cvsclient_log', 'cvsclient_login','cvsclient_retrieve','date','date_create', 'date_date_set','date_default_timezone_get', 'date_default_timezone_set','date_format','date_isodate_set', 'date_modify','date_offset_get','date_parse','date_sun_info', 'date_sunrise','date_sunset','date_time_set','date_timezone_get', 'date_timezone_set','db_id_list','dba_close','dba_delete', 'dba_exists','dba_fetch','dba_firstkey','dba_handlers','dba_insert', 'dba_key_split','dba_list','dba_nextkey','dba_open','dba_optimize', 'dba_popen','dba_replace','dba_sync','dbase_add_record', 'dbase_close','dbase_create','dbase_delete_record', 'dbase_get_header_info','dbase_get_record', 'dbase_get_record_with_names','dbase_numfields','dbase_numrecords', 'dbase_open','dbase_pack','dbase_replace_record', 'dbg_get_all_contexts','dbg_get_all_module_names', 'dbg_get_all_source_lines','dbg_get_context_name', 'dbg_get_module_name','dbg_get_profiler_results', 'dbg_get_source_context','dblist','dbmclose','dbmdelete', 'dbmexists','dbmfetch','dbmfirstkey','dbminsert','dbmnextkey', 'dbmopen','dbmreplace','dbx_close','dbx_compare','dbx_connect', 'dbx_error','dbx_escape_string','dbx_fetch_row','dbx_query', 'dbx_sort','dcgettext','dcngettext','deaggregate','debug_backtrace', 'debug_zval_dump','debugbreak','decbin','dechex','decoct','define', 'defined','define_syslog_variables','deg2rad','dgettext','die', 'dio_close','dio_open','dio_read','dio_seek','dio_stat','dio_write', 'dir','dirname','disk_free_space','disk_total_space', 'diskfreespace','dl','dngettext','docblock_token_name', 'docblock_tokenize','dom_import_simplexml','domxml_add_root', 'domxml_attributes','domxml_children','domxml_doc_add_root', 'domxml_doc_document_element','domxml_doc_get_element_by_id', 'domxml_doc_get_elements_by_tagname','domxml_doc_get_root', 'domxml_doc_set_root','domxml_doc_validate','domxml_doc_xinclude', 'domxml_dump_mem','domxml_dump_mem_file','domxml_dump_node', 'domxml_dumpmem','domxml_elem_get_attribute', 'domxml_elem_set_attribute','domxml_get_attribute','domxml_getattr', 'domxml_html_dump_mem','domxml_new_child','domxml_new_doc', 'domxml_new_xmldoc','domxml_node','domxml_node_add_namespace', 'domxml_node_attributes','domxml_node_children', 'domxml_node_get_content','domxml_node_has_attributes', 'domxml_node_new_child','domxml_node_set_content', 'domxml_node_set_namespace','domxml_node_unlink_node', 'domxml_open_file','domxml_open_mem','domxml_parser', 'domxml_parser_add_chunk','domxml_parser_cdata_section', 'domxml_parser_characters','domxml_parser_comment', 'domxml_parser_end','domxml_parser_end_document', 'domxml_parser_end_element','domxml_parser_entity_reference', 'domxml_parser_get_document','domxml_parser_namespace_decl', 'domxml_parser_processing_instruction', 'domxml_parser_start_document','domxml_parser_start_element', 'domxml_root','domxml_set_attribute','domxml_setattr', 'domxml_substitute_entities_default','domxml_unlink_node', 'domxml_version','domxml_xmltree','doubleval','each','easter_date', 'easter_days','empty','end','ereg','ereg_replace','eregi', 'eregi_replace','error_get_last','error_log','error_reporting', 'escapeshellarg','escapeshellcmd','eval','event_deschedule', 'event_dispatch','event_free','event_handle_signal', 'event_have_events','event_init','event_new','event_pending', 'event_priority_set','event_schedule','event_set','event_timeout', 'exec','exif_imagetype','exif_read_data','exif_tagname', 'exif_thumbnail','exit','exp','explode','expm1','extension_loaded', 'extract','ezmlm_hash','fbird_add_user','fbird_affected_rows', 'fbird_backup','fbird_blob_add','fbird_blob_cancel', 'fbird_blob_close','fbird_blob_create','fbird_blob_echo', 'fbird_blob_get','fbird_blob_import','fbird_blob_info', 'fbird_blob_open','fbird_close','fbird_commit','fbird_commit_ret', 'fbird_connect','fbird_db_info','fbird_delete_user','fbird_drop_db', 'fbird_errcode','fbird_errmsg','fbird_execute','fbird_fetch_assoc', 'fbird_fetch_object','fbird_fetch_row','fbird_field_info', 'fbird_free_event_handler','fbird_free_query','fbird_free_result', 'fbird_gen_id','fbird_maintain_db','fbird_modify_user', 'fbird_name_result','fbird_num_fields','fbird_num_params', 'fbird_param_info','fbird_pconnect','fbird_prepare','fbird_query', 'fbird_restore','fbird_rollback','fbird_rollback_ret', 'fbird_server_info','fbird_service_attach','fbird_service_detach', 'fbird_set_event_handler','fbird_trans','fbird_wait_event','fclose', 'fdf_add_doc_javascript','fdf_add_template','fdf_close', 'fdf_create','fdf_enum_values','fdf_errno','fdf_error','fdf_get_ap', 'fdf_get_attachment','fdf_get_encoding','fdf_get_file', 'fdf_get_flags','fdf_get_opt','fdf_get_status','fdf_get_value', 'fdf_get_version','fdf_header','fdf_next_field_name','fdf_open', 'fdf_open_string','fdf_remove_item','fdf_save','fdf_save_string', 'fdf_set_ap','fdf_set_encoding','fdf_set_file','fdf_set_flags', 'fdf_set_javascript_action','fdf_set_on_import_javascript', 'fdf_set_opt','fdf_set_status','fdf_set_submit_form_action', 'fdf_set_target_frame','fdf_set_value','fdf_set_version','feof', 'fflush','fgetc','fgetcsv','fgets','fgetss','file','file_exists', 'file_get_contents','file_put_contents','fileatime','filectime', 'filegroup','fileinode','filemtime','fileowner','fileperms', 'filepro','filepro_fieldcount','filepro_fieldname', 'filepro_fieldtype','filepro_fieldwidth','filepro_retrieve', 'filepro_rowcount','filesize','filetype','filter_has_var', 'filter_id','filter_input','filter_input_array','filter_list', 'filter_var','filter_var_array','finfo_buffer','finfo_close', 'finfo_file','finfo_open','finfo_set_flags','floatval','flock', 'floor','flush','fmod','fnmatch','fopen','fpassthru','fprintf', 'fputcsv','fputs','fread','frenchtojd','fribidi_charset_info', 'fribidi_get_charsets','fribidi_log2vis','fscanf','fseek', 'fsockopen','fstat','ftell','ftok','ftp_alloc','ftp_cdup', 'ftp_chdir','ftp_chmod','ftp_close','ftp_connect','ftp_delete', 'ftp_exec','ftp_fget','ftp_fput','ftp_get','ftp_get_option', 'ftp_login','ftp_mdtm','ftp_mkdir','ftp_nb_continue','ftp_nb_fget', 'ftp_nb_fput','ftp_nb_get','ftp_nb_put','ftp_nlist','ftp_pasv', 'ftp_put','ftp_pwd','ftp_quit','ftp_raw','ftp_rawlist','ftp_rename', 'ftp_rmdir','ftp_set_option','ftp_site','ftp_size', 'ftp_ssl_connect','ftp_systype','ftruncate','function_exists', 'func_get_arg','func_get_args','func_num_args','fwrite','gd_info', 'getallheaders','getcwd','getdate','getenv','gethostbyaddr', 'gethostbyname','gethostbynamel','getimagesize','getlastmod', 'getmxrr','getmygid','getmyinode','getmypid','getmyuid','getopt', 'getprotobyname','getprotobynumber','getrandmax','getrusage', 'getservbyname','getservbyport','gettext','gettimeofday','gettype', 'get_browser','get_cfg_var','get_class','get_class_methods', 'get_class_vars','get_current_user','get_declared_classes', 'get_defined_constants','get_defined_functions','get_defined_vars', 'get_extension_funcs','get_headers','get_html_translation_table', 'get_included_files','get_include_path','get_loaded_extensions', 'get_magic_quotes_gpc','get_magic_quotes_runtime','get_meta_tags', 'get_object_vars','get_parent_class','get_required_files', 'get_resource_type','glob','gmdate','gmmktime','gmp_abs','gmp_add', 'gmp_and','gmp_clrbit','gmp_cmp','gmp_com','gmp_div','gmp_div_q', 'gmp_div_qr','gmp_div_r','gmp_divexact','gmp_fact','gmp_gcd', 'gmp_gcdext','gmp_hamdist','gmp_init','gmp_intval','gmp_invert', 'gmp_jacobi','gmp_legendre','gmp_mod','gmp_mul','gmp_neg', 'gmp_nextprime','gmp_or','gmp_perfect_square','gmp_popcount', 'gmp_pow','gmp_powm','gmp_prob_prime','gmp_random','gmp_scan0', 'gmp_scan1','gmp_setbit','gmp_sign','gmp_sqrt','gmp_sqrtrem', 'gmp_strval','gmp_sub','gmp_xor','gmstrftime','gopher_parsedir', 'gregoriantojd','gzclose','gzcompress','gzdeflate','gzencode', 'gzeof','gzfile','gzgetc','gzgets','gzgetss','gzinflate','gzopen', 'gzpassthru','gzputs','gzread','gzrewind','gzseek','gztell', 'gzuncompress','gzwrite','hash','hash_algos','hash_file', 'hash_final','hash_hmac','hash_hmac_file','hash_init','hash_update', 'hash_update_file','hash_update_stream','header','headers_list', 'headers_sent','hebrev','hebrevc','hexdec','highlight_file', 'highlight_string','html_doc','html_doc_file','html_entity_decode', 'htmlentities','htmlspecialchars','htmlspecialchars_decode', 'http_build_cookie','http_build_query','http_build_str', 'http_build_url','http_cache_etag','http_cache_last_modified', 'http_chunked_decode','http_date','http_deflate','http_get', 'http_get_request_body','http_get_request_body_stream', 'http_get_request_headers','http_head','http_inflate', 'http_match_etag','http_match_modified','http_match_request_header', 'http_negotiate_charset','http_negotiate_content_type', 'http_negotiate_language','http_parse_cookie','http_parse_headers', 'http_parse_message','http_parse_params', 'http_persistent_handles_clean','http_persistent_handles_count', 'http_persistent_handles_ident','http_post_data','http_post_fields', 'http_put_data','http_put_file','http_put_stream','http_redirect', 'http_request','http_request_body_encode', 'http_request_method_exists','http_request_method_name', 'http_request_method_register','http_request_method_unregister', 'http_send_content_disposition','http_send_content_type', 'http_send_data','http_send_file','http_send_last_modified', 'http_send_status','http_send_stream','http_support', 'http_throttle','hypot','i18n_convert','i18n_discover_encoding', 'i18n_http_input','i18n_http_output','i18n_internal_encoding', 'i18n_ja_jp_hantozen','i18n_mime_header_decode', 'i18n_mime_header_encode','ibase_add_user','ibase_affected_rows', 'ibase_backup','ibase_blob_add','ibase_blob_cancel', 'ibase_blob_close','ibase_blob_create','ibase_blob_echo', 'ibase_blob_get','ibase_blob_import','ibase_blob_info', 'ibase_blob_open','ibase_close','ibase_commit','ibase_commit_ret', 'ibase_connect','ibase_db_info','ibase_delete_user','ibase_drop_db', 'ibase_errcode','ibase_errmsg','ibase_execute','ibase_fetch_assoc', 'ibase_fetch_object','ibase_fetch_row','ibase_field_info', 'ibase_free_event_handler','ibase_free_query','ibase_free_result', 'ibase_gen_id','ibase_maintain_db','ibase_modify_user', 'ibase_name_result','ibase_num_fields','ibase_num_params', 'ibase_param_info','ibase_pconnect','ibase_prepare','ibase_query', 'ibase_restore','ibase_rollback','ibase_rollback_ret', 'ibase_server_info','ibase_service_attach','ibase_service_detach', 'ibase_set_event_handler','ibase_trans','ibase_wait_event','iconv', 'iconv_get_encoding','iconv_mime_decode', 'iconv_mime_decode_headers','iconv_mime_encode', 'iconv_set_encoding','iconv_strlen','iconv_strpos','iconv_strrpos', 'iconv_substr','id3_get_frame_long_name','id3_get_frame_short_name', 'id3_get_genre_id','id3_get_genre_list','id3_get_genre_name', 'id3_get_tag','id3_get_version','id3_remove_tag','id3_set_tag', 'idate','ignore_user_abort','image_type_to_extension', 'image_type_to_mime_type','image2wbmp','imagealphablending', 'imageantialias','imagearc','imagechar','imagecharup', 'imagecolorallocate','imagecolorallocatealpha','imagecolorat', 'imagecolorclosest','imagecolorclosestalpha','imagecolordeallocate', 'imagecolorexact','imagecolorexactalpha','imagecolormatch', 'imagecolorresolve','imagecolorresolvealpha','imagecolorset', 'imagecolorsforindex','imagecolorstotal','imagecolortransparent', 'imageconvolution','imagecopy','imagecopymerge', 'imagecopymergegray','imagecopyresampled','imagecopyresized', 'imagecreate','imagecreatefromgd','imagecreatefromgd2', 'imagecreatefromgd2part','imagecreatefromgif','imagecreatefromjpeg', 'imagecreatefrompng','imagecreatefromstring','imagecreatefromwbmp', 'imagecreatefromxbm','imagecreatetruecolor','imagedashedline', 'imagedestroy','imageellipse','imagefill','imagefilledarc', 'imagefilledellipse','imagefilledpolygon','imagefilledrectangle', 'imagefilltoborder','imagefilter','imagefontheight', 'imagefontwidth','imageftbbox','imagefttext','imagegammacorrect', 'imagegd','imagegd2','imagegif','imagegrabscreen','imagegrabwindow', 'imageinterlace','imageistruecolor','imagejpeg','imagelayereffect', 'imageline','imageloadfont','imagepalettecopy','imagepng', 'imagepolygon','imagepsbbox','imagepsencodefont', 'imagepsextendfont','imagepsfreefont','imagepsloadfont', 'imagepsslantfont','imagepstext','imagerectangle','imagerotate', 'imagesavealpha','imagesetbrush','imagesetpixel','imagesetstyle', 'imagesetthickness','imagesettile','imagestring','imagestringup', 'imagesx','imagesy','imagetruecolortopalette','imagettfbbox', 'imagettftext','imagetypes','imagewbmp','imagexbm','imap_8bit', 'imap_alerts','imap_append','imap_base64','imap_binary','imap_body', 'imap_bodystruct','imap_check','imap_clearflag_full','imap_close', 'imap_create','imap_createmailbox','imap_delete', 'imap_deletemailbox','imap_errors','imap_expunge', 'imap_fetch_overview','imap_fetchbody','imap_fetchheader', 'imap_fetchstructure','imap_fetchtext','imap_get_quota', 'imap_get_quotaroot','imap_getacl','imap_getmailboxes', 'imap_getsubscribed','imap_header','imap_headerinfo','imap_headers', 'imap_last_error','imap_list','imap_listmailbox', 'imap_listsubscribed','imap_lsub','imap_mail','imap_mail_compose', 'imap_mail_copy','imap_mail_move','imap_mailboxmsginfo', 'imap_mime_header_decode','imap_msgno','imap_num_msg', 'imap_num_recent','imap_open','imap_ping','imap_qprint', 'imap_rename','imap_renamemailbox','imap_reopen', 'imap_rfc822_parse_adrlist','imap_rfc822_parse_headers', 'imap_rfc822_write_address','imap_savebody','imap_scan', 'imap_scanmailbox','imap_search','imap_set_quota','imap_setacl', 'imap_setflag_full','imap_sort','imap_status','imap_subscribe', 'imap_thread','imap_timeout','imap_uid','imap_undelete', 'imap_unsubscribe','imap_utf7_decode','imap_utf7_encode', 'imap_utf8','implode','import_request_variables','in_array', 'ini_alter','ini_get','ini_get_all','ini_restore','ini_set', 'intval','ip2long','iptcembed','iptcparse','isset','is_a', 'is_array','is_bool','is_callable','is_dir','is_double', 'is_executable','is_file','is_finite','is_float','is_infinite', 'is_int','is_integer','is_link','is_long','is_nan','is_null', 'is_numeric','is_object','is_readable','is_real','is_resource', 'is_scalar','is_soap_fault','is_string','is_subclass_of', 'is_uploaded_file','is_writable','is_writeable','iterator_apply', 'iterator_count','iterator_to_array','java_last_exception_clear', 'java_last_exception_get','jddayofweek','jdmonthname','jdtofrench', 'jdtogregorian','jdtojewish','jdtojulian','jdtounix','jewishtojd', 'join','jpeg2wbmp','json_decode','json_encode','juliantojd','key', 'key_exists','krsort','ksort','lcg_value','ldap_add','ldap_bind', 'ldap_close','ldap_compare','ldap_connect','ldap_count_entries', 'ldap_delete','ldap_dn2ufn','ldap_err2str','ldap_errno', 'ldap_error','ldap_explode_dn','ldap_first_attribute', 'ldap_first_entry','ldap_first_reference','ldap_free_result', 'ldap_get_attributes','ldap_get_dn','ldap_get_entries', 'ldap_get_option','ldap_get_values','ldap_get_values_len', 'ldap_list','ldap_mod_add','ldap_mod_del','ldap_mod_replace', 'ldap_modify','ldap_next_attribute','ldap_next_entry', 'ldap_next_reference','ldap_parse_reference','ldap_parse_result', 'ldap_read','ldap_rename','ldap_search','ldap_set_option', 'ldap_sort','ldap_start_tls','ldap_unbind','levenshtein', 'libxml_clear_errors','libxml_get_errors','libxml_get_last_error', 'libxml_set_streams_context','libxml_use_internal_errors','link', 'linkinfo','list','localeconv','localtime','log','log1p','log10', 'long2ip','lstat','ltrim','lzf_compress','lzf_decompress', 'lzf_optimized_for','magic_quotes_runtime','mail','max','mbereg', 'mberegi','mberegi_replace','mbereg_match','mbereg_replace', 'mbereg_search','mbereg_search_getpos','mbereg_search_getregs', 'mbereg_search_init','mbereg_search_pos','mbereg_search_regs', 'mbereg_search_setpos','mbregex_encoding','mbsplit','mbstrcut', 'mbstrlen','mbstrpos','mbstrrpos','mbsubstr','mb_check_encoding', 'mb_convert_case','mb_convert_encoding','mb_convert_kana', 'mb_convert_variables','mb_decode_mimeheader', 'mb_decode_numericentity','mb_detect_encoding','mb_detect_order', 'mb_encode_mimeheader','mb_encode_numericentity','mb_ereg', 'mb_eregi','mb_eregi_replace','mb_ereg_match','mb_ereg_replace', 'mb_ereg_search','mb_ereg_search_getpos','mb_ereg_search_getregs', 'mb_ereg_search_init','mb_ereg_search_pos','mb_ereg_search_regs', 'mb_ereg_search_setpos','mb_get_info','mb_http_input', 'mb_http_output','mb_internal_encoding','mb_language', 'mb_list_encodings','mb_output_handler','mb_parse_str', 'mb_preferred_mime_name','mb_regex_encoding','mb_regex_set_options', 'mb_send_mail','mb_split','mb_strcut','mb_strimwidth','mb_stripos', 'mb_stristr','mb_strlen','mb_strpos','mb_strrchr','mb_strrichr', 'mb_strripos','mb_strrpos','mb_strstr','mb_strtolower', 'mb_strtoupper','mb_strwidth','mb_substitute_character','mb_substr', 'mb_substr_count','mcrypt_cbc','mcrypt_cfb','mcrypt_create_iv', 'mcrypt_decrypt','mcrypt_ecb','mcrypt_enc_get_algorithms_name', 'mcrypt_enc_get_block_size','mcrypt_enc_get_iv_size', 'mcrypt_enc_get_key_size','mcrypt_enc_get_modes_name', 'mcrypt_enc_get_supported_key_sizes', 'mcrypt_enc_is_block_algorithm', 'mcrypt_enc_is_block_algorithm_mode','mcrypt_enc_is_block_mode', 'mcrypt_enc_self_test','mcrypt_encrypt','mcrypt_generic', 'mcrypt_generic_deinit','mcrypt_generic_end','mcrypt_generic_init', 'mcrypt_get_block_size','mcrypt_get_cipher_name', 'mcrypt_get_iv_size','mcrypt_get_key_size','mcrypt_list_algorithms', 'mcrypt_list_modes','mcrypt_module_close', 'mcrypt_module_get_algo_block_size', 'mcrypt_module_get_algo_key_size', 'mcrypt_module_get_supported_key_sizes', 'mcrypt_module_is_block_algorithm', 'mcrypt_module_is_block_algorithm_mode', 'mcrypt_module_is_block_mode','mcrypt_module_open', 'mcrypt_module_self_test','mcrypt_ofb','md5','md5_file', 'mdecrypt_generic','memcache_add','memcache_add_server', 'memcache_close','memcache_connect','memcache_debug', 'memcache_decrement','memcache_delete','memcache_flush', 'memcache_get','memcache_get_extended_stats', 'memcache_get_server_status','memcache_get_stats', 'memcache_get_version','memcache_increment','memcache_pconnect', 'memcache_replace','memcache_set','memcache_set_compress_threshold', 'memcache_set_server_params','memory_get_peak_usage', 'memory_get_usage','metaphone','mhash','mhash_count', 'mhash_get_block_size','mhash_get_hash_name','mhash_keygen_s2k', 'method_exists','microtime','mime_content_type','min', 'ming_keypress','ming_setcubicthreshold','ming_setscale', 'ming_useconstants','ming_useswfversion','mkdir','mktime', 'money_format','move_uploaded_file','msql','msql_affected_rows', 'msql_close','msql_connect','msql_create_db','msql_createdb', 'msql_data_seek','msql_db_query','msql_dbname','msql_drop_db', 'msql_dropdb','msql_error','msql_fetch_array','msql_fetch_field', 'msql_fetch_object','msql_fetch_row','msql_field_flags', 'msql_field_len','msql_field_name','msql_field_seek', 'msql_field_table','msql_field_type','msql_fieldflags', 'msql_fieldlen','msql_fieldname','msql_fieldtable','msql_fieldtype', 'msql_free_result','msql_freeresult','msql_list_dbs', 'msql_list_fields','msql_list_tables','msql_listdbs', 'msql_listfields','msql_listtables','msql_num_fields', 'msql_num_rows','msql_numfields','msql_numrows','msql_pconnect', 'msql_query','msql_regcase','msql_result','msql_select_db', 'msql_selectdb','msql_tablename','mssql_bind','mssql_close', 'mssql_connect','mssql_data_seek','mssql_execute', 'mssql_fetch_array','mssql_fetch_assoc','mssql_fetch_batch', 'mssql_fetch_field','mssql_fetch_object','mssql_fetch_row', 'mssql_field_length','mssql_field_name','mssql_field_seek', 'mssql_field_type','mssql_free_result','mssql_free_statement', 'mssql_get_last_message','mssql_guid_string','mssql_init', 'mssql_min_error_severity','mssql_min_message_severity', 'mssql_next_result','mssql_num_fields','mssql_num_rows', 'mssql_pconnect','mssql_query','mssql_result','mssql_rows_affected', 'mssql_select_db','mt_getrandmax','mt_rand','mt_srand','mysql', 'mysql_affected_rows','mysql_client_encoding','mysql_close', 'mysql_connect','mysql_createdb','mysql_create_db', 'mysql_data_seek','mysql_dbname','mysql_db_name','mysql_db_query', 'mysql_dropdb','mysql_drop_db','mysql_errno','mysql_error', 'mysql_escape_string','mysql_fetch_array','mysql_fetch_assoc', 'mysql_fetch_field','mysql_fetch_lengths','mysql_fetch_object', 'mysql_fetch_row','mysql_fieldflags','mysql_fieldlen', 'mysql_fieldname','mysql_fieldtable','mysql_fieldtype', 'mysql_field_flags','mysql_field_len','mysql_field_name', 'mysql_field_seek','mysql_field_table','mysql_field_type', 'mysql_freeresult','mysql_free_result','mysql_get_client_info', 'mysql_get_host_info','mysql_get_proto_info', 'mysql_get_server_info','mysql_info','mysql_insert_id', 'mysql_listdbs','mysql_listfields','mysql_listtables', 'mysql_list_dbs','mysql_list_fields','mysql_list_processes', 'mysql_list_tables','mysql_numfields','mysql_numrows', 'mysql_num_fields','mysql_num_rows','mysql_pconnect','mysql_ping', 'mysql_query','mysql_real_escape_string','mysql_result', 'mysql_selectdb','mysql_select_db','mysql_set_charset','mysql_stat', 'mysql_tablename','mysql_table_name','mysql_thread_id', 'mysql_unbuffered_query','mysqli_affected_rows','mysqli_autocommit', 'mysqli_bind_param','mysqli_bind_result','mysqli_change_user', 'mysqli_character_set_name','mysqli_client_encoding','mysqli_close', 'mysqli_commit','mysqli_connect','mysqli_connect_errno', 'mysqli_connect_error','mysqli_data_seek','mysqli_debug', 'mysqli_disable_reads_from_master','mysqli_disable_rpl_parse', 'mysqli_dump_debug_info','mysqli_embedded_server_end', 'mysqli_embedded_server_start','mysqli_enable_reads_from_master', 'mysqli_enable_rpl_parse','mysqli_errno','mysqli_error', 'mysqli_escape_string','mysqli_execute','mysqli_fetch', 'mysqli_fetch_array','mysqli_fetch_assoc','mysqli_fetch_field', 'mysqli_fetch_field_direct','mysqli_fetch_fields', 'mysqli_fetch_lengths','mysqli_fetch_object','mysqli_fetch_row', 'mysqli_field_count','mysqli_field_seek','mysqli_field_tell', 'mysqli_free_result','mysqli_get_charset','mysqli_get_client_info', 'mysqli_get_client_version','mysqli_get_host_info', 'mysqli_get_metadata','mysqli_get_proto_info', 'mysqli_get_server_info','mysqli_get_server_version', 'mysqli_get_warnings','mysqli_info','mysqli_init', 'mysqli_insert_id','mysqli_kill','mysqli_master_query', 'mysqli_more_results','mysqli_multi_query','mysqli_next_result', 'mysqli_num_fields','mysqli_num_rows','mysqli_options', 'mysqli_param_count','mysqli_ping','mysqli_prepare','mysqli_query', 'mysqli_real_connect','mysqli_real_escape_string', 'mysqli_real_query','mysqli_report','mysqli_rollback', 'mysqli_rpl_parse_enabled','mysqli_rpl_probe', 'mysqli_rpl_query_type','mysqli_select_db','mysqli_send_long_data', 'mysqli_send_query','mysqli_set_charset', 'mysqli_set_local_infile_default','mysqli_set_local_infile_handler', 'mysqli_set_opt','mysqli_slave_query','mysqli_sqlstate', 'mysqli_ssl_set','mysqli_stat','mysqli_stmt_affected_rows', 'mysqli_stmt_attr_get','mysqli_stmt_attr_set', 'mysqli_stmt_bind_param','mysqli_stmt_bind_result', 'mysqli_stmt_close','mysqli_stmt_data_seek','mysqli_stmt_errno', 'mysqli_stmt_error','mysqli_stmt_execute','mysqli_stmt_fetch', 'mysqli_stmt_field_count','mysqli_stmt_free_result', 'mysqli_stmt_get_warnings','mysqli_stmt_init', 'mysqli_stmt_insert_id','mysqli_stmt_num_rows', 'mysqli_stmt_param_count','mysqli_stmt_prepare','mysqli_stmt_reset', 'mysqli_stmt_result_metadata','mysqli_stmt_send_long_data', 'mysqli_stmt_sqlstate','mysqli_stmt_store_result', 'mysqli_store_result','mysqli_thread_id','mysqli_thread_safe', 'mysqli_use_result','mysqli_warning_count','natcasesort','natsort', 'new_xmldoc','next','ngettext','nl2br','nl_langinfo', 'ntuser_getdomaincontroller','ntuser_getusergroups', 'ntuser_getuserinfo','ntuser_getuserlist','number_format', 'ob_clean','ob_deflatehandler','ob_end_clean','ob_end_flush', 'ob_etaghandler','ob_flush','ob_get_clean','ob_get_contents', 'ob_get_flush','ob_get_length','ob_get_level','ob_get_status', 'ob_gzhandler','ob_iconv_handler','ob_implicit_flush', 'ob_inflatehandler','ob_list_handlers','ob_start','ob_tidyhandler', 'octdec','odbc_autocommit','odbc_binmode','odbc_close', 'odbc_close_all','odbc_columnprivileges','odbc_columns', 'odbc_commit','odbc_connect','odbc_cursor','odbc_data_source', 'odbc_do','odbc_error','odbc_errormsg','odbc_exec','odbc_execute', 'odbc_fetch_array','odbc_fetch_into','odbc_fetch_object', 'odbc_fetch_row','odbc_field_len','odbc_field_name', 'odbc_field_num','odbc_field_precision','odbc_field_scale', 'odbc_field_type','odbc_foreignkeys','odbc_free_result', 'odbc_gettypeinfo','odbc_longreadlen','odbc_next_result', 'odbc_num_fields','odbc_num_rows','odbc_pconnect','odbc_prepare', 'odbc_primarykeys','odbc_procedurecolumns','odbc_procedures', 'odbc_result','odbc_result_all','odbc_rollback','odbc_setoption', 'odbc_specialcolumns','odbc_statistics','odbc_tableprivileges', 'odbc_tables','opendir','openlog','openssl_csr_export', 'openssl_csr_export_to_file','openssl_csr_get_public_key', 'openssl_csr_get_subject','openssl_csr_new','openssl_csr_sign', 'openssl_error_string','openssl_free_key','openssl_get_privatekey', 'openssl_get_publickey','openssl_open','openssl_pkcs12_export', 'openssl_pkcs12_export_to_file','openssl_pkcs12_read', 'openssl_pkcs7_decrypt','openssl_pkcs7_encrypt', 'openssl_pkcs7_sign','openssl_pkcs7_verify','openssl_pkey_export', 'openssl_pkey_export_to_file','openssl_pkey_free', 'openssl_pkey_get_details','openssl_pkey_get_private', 'openssl_pkey_get_public','openssl_pkey_new', 'openssl_private_decrypt','openssl_private_encrypt', 'openssl_public_decrypt','openssl_public_encrypt','openssl_seal', 'openssl_sign','openssl_verify','openssl_x509_checkpurpose', 'openssl_x509_check_private_key','openssl_x509_export', 'openssl_x509_export_to_file','openssl_x509_free', 'openssl_x509_parse','openssl_x509_read','ord', 'output_add_rewrite_var','output_reset_rewrite_vars','overload', 'outputdebugstring','pack','parse_ini_file','parse_str','parse_url', 'parsekit_compile_file','parsekit_compile_string', 'parsekit_func_arginfo','parsekit_opcode_flags', 'parsekit_opcode_name','passthru','pathinfo','pclose', 'pdf_add_bookmark','pdf_add_launchlink','pdf_add_locallink', 'pdf_add_nameddest','pdf_add_note','pdf_add_pdflink', 'pdf_add_thumbnail','pdf_add_weblink','pdf_arc','pdf_arcn', 'pdf_attach_file','pdf_begin_font','pdf_begin_glyph', 'pdf_begin_page','pdf_begin_pattern','pdf_begin_template', 'pdf_circle','pdf_clip','pdf_close','pdf_close_image', 'pdf_close_pdi','pdf_close_pdi_page','pdf_closepath', 'pdf_closepath_fill_stroke','pdf_closepath_stroke','pdf_concat', 'pdf_continue_text','pdf_create_gstate','pdf_create_pvf', 'pdf_curveto','pdf_delete','pdf_delete_pvf','pdf_encoding_set_char', 'pdf_end_font','pdf_end_glyph','pdf_end_page','pdf_end_pattern', 'pdf_end_template','pdf_endpath','pdf_fill','pdf_fill_imageblock', 'pdf_fill_pdfblock','pdf_fill_stroke','pdf_fill_textblock', 'pdf_findfont','pdf_fit_image','pdf_fit_pdi_page', 'pdf_fit_textline','pdf_get_apiname','pdf_get_buffer', 'pdf_get_errmsg','pdf_get_errnum','pdf_get_parameter', 'pdf_get_pdi_parameter','pdf_get_pdi_value','pdf_get_value', 'pdf_initgraphics','pdf_lineto','pdf_load_font', 'pdf_load_iccprofile','pdf_load_image','pdf_makespotcolor', 'pdf_moveto','pdf_new','pdf_open_ccitt','pdf_open_file', 'pdf_open_image','pdf_open_image_file','pdf_open_pdi', 'pdf_open_pdi_page','pdf_place_image','pdf_place_pdi_page', 'pdf_process_pdi','pdf_rect','pdf_restore','pdf_rotate','pdf_save', 'pdf_scale','pdf_set_border_color','pdf_set_border_dash', 'pdf_set_border_style','pdf_set_gstate','pdf_set_info', 'pdf_set_parameter','pdf_set_text_pos','pdf_set_value', 'pdf_setcolor','pdf_setdash','pdf_setdashpattern','pdf_setflat', 'pdf_setfont','pdf_setlinecap','pdf_setlinejoin','pdf_setlinewidth', 'pdf_setmatrix','pdf_setmiterlimit','pdf_setpolydash','pdf_shading', 'pdf_shading_pattern','pdf_shfill','pdf_show','pdf_show_boxed', 'pdf_show_xy','pdf_skew','pdf_stringwidth','pdf_stroke', 'pdf_translate','pdo_drivers','pfsockopen','pg_affected_rows', 'pg_cancel_query','pg_clientencoding','pg_client_encoding', 'pg_close','pg_cmdtuples','pg_connect','pg_connection_busy', 'pg_connection_reset','pg_connection_status','pg_convert', 'pg_copy_from','pg_copy_to','pg_dbname','pg_delete','pg_end_copy', 'pg_errormessage','pg_escape_bytea','pg_escape_string','pg_exec', 'pg_execute','pg_fetch_all','pg_fetch_all_columns','pg_fetch_array', 'pg_fetch_assoc','pg_fetch_object','pg_fetch_result','pg_fetch_row', 'pg_fieldisnull','pg_fieldname','pg_fieldnum','pg_fieldprtlen', 'pg_fieldsize','pg_fieldtype','pg_field_is_null','pg_field_name', 'pg_field_num','pg_field_prtlen','pg_field_size','pg_field_table', 'pg_field_type','pg_field_type_oid','pg_free_result', 'pg_freeresult','pg_get_notify','pg_get_pid','pg_get_result', 'pg_getlastoid','pg_host','pg_insert','pg_last_error', 'pg_last_notice','pg_last_oid','pg_loclose','pg_locreate', 'pg_loexport','pg_loimport','pg_loopen','pg_loread','pg_loreadall', 'pg_lounlink','pg_lowrite','pg_lo_close','pg_lo_create', 'pg_lo_export','pg_lo_import','pg_lo_open','pg_lo_read', 'pg_lo_read_all','pg_lo_seek','pg_lo_tell','pg_lo_unlink', 'pg_lo_write','pg_meta_data','pg_numfields','pg_numrows', 'pg_num_fields','pg_num_rows','pg_options','pg_parameter_status', 'pg_pconnect','pg_ping','pg_port','pg_prepare','pg_put_line', 'pg_query','pg_query_params','pg_result','pg_result_error', 'pg_result_error_field','pg_result_seek','pg_result_status', 'pg_select','pg_send_execute','pg_send_prepare','pg_send_query', 'pg_send_query_params','pg_set_client_encoding', 'pg_set_error_verbosity','pg_setclientencoding','pg_trace', 'pg_transaction_status','pg_tty','pg_unescape_bytea','pg_untrace', 'pg_update','pg_version','php_egg_logo_guid','php_ini_loaded_file', 'php_ini_scanned_files','php_logo_guid','php_real_logo_guid', 'php_sapi_name','php_strip_whitespace','php_uname','phpcredits', 'phpdoc_xml_from_string','phpinfo','phpversion','pi','png2wbmp', 'pop3_close','pop3_delete_message','pop3_get_account_size', 'pop3_get_message','pop3_get_message_count', 'pop3_get_message_header','pop3_get_message_ids', 'pop3_get_message_size','pop3_get_message_sizes','pop3_open', 'pop3_undelete','popen','pos','posix_ctermid','posix_errno', 'posix_getcwd','posix_getegid','posix_geteuid','posix_getgid', 'posix_getgrgid','posix_getgrnam','posix_getgroups', 'posix_getlogin','posix_getpgid','posix_getpgrp','posix_getpid', 'posix_getppid','posix_getpwnam','posix_getpwuid','posix_getrlimit', 'posix_getsid','posix_getuid','posix_get_last_error','posix_isatty', 'posix_kill','posix_mkfifo','posix_setegid','posix_seteuid', 'posix_setgid','posix_setpgid','posix_setsid','posix_setuid', 'posix_strerror','posix_times','posix_ttyname','posix_uname','pow', 'preg_grep','preg_last_error','preg_match','preg_match_all', 'preg_quote','preg_replace','preg_replace_callback','preg_split', 'prev','print_r','printf','proc_close','proc_get_status', 'proc_open','proc_terminate','putenv','quoted_printable_decode', 'quotemeta','rad2deg','radius_acct_open','radius_add_server', 'radius_auth_open','radius_close','radius_config', 'radius_create_request','radius_cvt_addr','radius_cvt_int', 'radius_cvt_string','radius_demangle','radius_demangle_mppe_key', 'radius_get_attr','radius_get_vendor_attr','radius_put_addr', 'radius_put_attr','radius_put_int','radius_put_string', 'radius_put_vendor_addr','radius_put_vendor_attr', 'radius_put_vendor_int','radius_put_vendor_string', 'radius_request_authenticator','radius_send_request', 'radius_server_secret','radius_strerror','rand','range', 'rawurldecode','rawurlencode','read_exif_data','readdir','readfile', 'readgzfile','readlink','realpath','reg_close_key','reg_create_key', 'reg_enum_key','reg_enum_value','reg_get_value','reg_open_key', 'reg_set_value','register_shutdown_function', 'register_tick_function','rename','res_close','res_get','res_list', 'res_list_type','res_open','res_set','reset', 'restore_error_handler','restore_include_path','rewind','rewinddir', 'rmdir','round','rsort','rtrim','runkit_class_adopt', 'runkit_class_emancipate','runkit_constant_add', 'runkit_constant_redefine','runkit_constant_remove', 'runkit_default_property_add','runkit_function_add', 'runkit_function_copy','runkit_function_redefine', 'runkit_function_remove','runkit_function_rename','runkit_import', 'runkit_lint','runkit_lint_file','runkit_method_add', 'runkit_method_copy','runkit_method_redefine', 'runkit_method_remove','runkit_method_rename','runkit_object_id', 'runkit_return_value_used','runkit_sandbox_output_handler', 'runkit_superglobals','runkit_zval_inspect','scandir','sem_acquire', 'sem_get','sem_release','sem_remove','serialize', 'session_cache_expire','session_cache_limiter','session_commit', 'session_decode','session_destroy','session_encode', 'session_get_cookie_params','session_id','session_is_registered', 'session_module_name','session_name','session_regenerate_id', 'session_register','session_save_path','session_set_cookie_params', 'session_set_save_handler','session_start','session_unregister', 'session_unset','session_write_close','set_content', 'set_error_handler','set_file_buffer','set_include_path', 'set_magic_quotes_runtime','set_socket_blocking','set_time_limit', 'setcookie','setlocale','setrawcookie','settype','sha1','sha1_file', 'shell_exec','shmop_close','shmop_delete','shmop_open','shmop_read', 'shmop_size','shmop_write','shm_attach','shm_detach','shm_get_var', 'shm_put_var','shm_remove','shm_remove_var','show_source','shuffle', 'similar_text','simplexml_import_dom','simplexml_load_file', 'simplexml_load_string','sin','sinh','sizeof','sleep','smtp_close', 'smtp_cmd_data','smtp_cmd_mail','smtp_cmd_rcpt','smtp_connect', 'snmp_get_quick_print','snmp_get_valueretrieval','snmp_read_mib', 'snmp_set_quick_print','snmp_set_valueretrieval','snmp2_get', 'snmp2_getnext','snmp2_real_walk','snmp2_set','snmp2_walk', 'snmp3_get','snmp3_getnext','snmp3_real_walk','snmp3_set', 'snmp3_walk','snmpget','snmpgetnext','snmprealwalk','snmpset', 'snmpwalk','snmpwalkoid','socket_accept','socket_bind', 'socket_clear_error','socket_close','socket_connect', 'socket_create','socket_create_listen','socket_create_pair', 'socket_getopt','socket_getpeername','socket_getsockname', 'socket_get_option','socket_get_status','socket_iovec_add', 'socket_iovec_alloc','socket_iovec_delete','socket_iovec_fetch', 'socket_iovec_free','socket_iovec_set','socket_last_error', 'socket_listen','socket_read','socket_readv','socket_recv', 'socket_recvfrom','socket_recvmsg','socket_select','socket_send', 'socket_sendmsg','socket_sendto','socket_setopt','socket_set_block', 'socket_set_blocking','socket_set_nonblock','socket_set_option', 'socket_set_timeout','socket_shutdown','socket_strerror', 'socket_write','socket_writev','sort','soundex','spl_autoload', 'spl_autoload_call','spl_autoload_extensions', 'spl_autoload_functions','spl_autoload_register', 'spl_autoload_unregister','spl_classes','spl_object_hash','split', 'spliti','sprintf','sql_regcase','sqlite_array_query', 'sqlite_busy_timeout','sqlite_changes','sqlite_close', 'sqlite_column','sqlite_create_aggregate','sqlite_create_function', 'sqlite_current','sqlite_error_string','sqlite_escape_string', 'sqlite_exec','sqlite_factory','sqlite_fetch_all', 'sqlite_fetch_array','sqlite_fetch_column_types', 'sqlite_fetch_object','sqlite_fetch_single','sqlite_fetch_string', 'sqlite_field_name','sqlite_has_more','sqlite_has_prev', 'sqlite_last_error','sqlite_last_insert_rowid','sqlite_libencoding', 'sqlite_libversion','sqlite_next','sqlite_num_fields', 'sqlite_num_rows','sqlite_open','sqlite_popen','sqlite_prev', 'sqlite_query','sqlite_rewind','sqlite_seek','sqlite_single_query', 'sqlite_udf_decode_binary','sqlite_udf_encode_binary', 'sqlite_unbuffered_query','sqlite_valid','sqrt','srand','sscanf', 'ssh2_auth_hostbased_file','ssh2_auth_none','ssh2_auth_password', 'ssh2_auth_pubkey_file','ssh2_connect','ssh2_exec', 'ssh2_fetch_stream','ssh2_fingerprint','ssh2_forward_accept', 'ssh2_forward_listen','ssh2_methods_negotiated','ssh2_poll', 'ssh2_publickey_add','ssh2_publickey_init','ssh2_publickey_list', 'ssh2_publickey_remove','ssh2_scp_recv','ssh2_scp_send','ssh2_sftp', 'ssh2_sftp_lstat','ssh2_sftp_mkdir','ssh2_sftp_readlink', 'ssh2_sftp_realpath','ssh2_sftp_rename','ssh2_sftp_rmdir', 'ssh2_sftp_stat','ssh2_sftp_symlink','ssh2_sftp_unlink', 'ssh2_shell','ssh2_tunnel','stat','stats_absolute_deviation', 'stats_cdf_beta','stats_cdf_binomial','stats_cdf_cauchy', 'stats_cdf_chisquare','stats_cdf_exponential','stats_cdf_f', 'stats_cdf_gamma','stats_cdf_laplace','stats_cdf_logistic', 'stats_cdf_negative_binomial','stats_cdf_noncentral_chisquare', 'stats_cdf_noncentral_f','stats_cdf_noncentral_t', 'stats_cdf_normal','stats_cdf_poisson','stats_cdf_t', 'stats_cdf_uniform','stats_cdf_weibull','stats_covariance', 'stats_dens_beta','stats_dens_cauchy','stats_dens_chisquare', 'stats_dens_exponential','stats_dens_f','stats_dens_gamma', 'stats_dens_laplace','stats_dens_logistic','stats_dens_normal', 'stats_dens_pmf_binomial','stats_dens_pmf_hypergeometric', 'stats_dens_pmf_negative_binomial','stats_dens_pmf_poisson', 'stats_dens_t','stats_dens_uniform','stats_dens_weibull', 'stats_harmonic_mean','stats_kurtosis','stats_rand_gen_beta', 'stats_rand_gen_chisquare','stats_rand_gen_exponential', 'stats_rand_gen_f','stats_rand_gen_funiform','stats_rand_gen_gamma', 'stats_rand_gen_ipoisson','stats_rand_gen_iuniform', 'stats_rand_gen_noncenral_f','stats_rand_gen_noncentral_chisquare', 'stats_rand_gen_noncentral_t','stats_rand_gen_normal', 'stats_rand_gen_t','stats_rand_getsd','stats_rand_ibinomial', 'stats_rand_ibinomial_negative','stats_rand_ignlgi', 'stats_rand_phrase_to_seeds','stats_rand_ranf','stats_rand_setall', 'stats_skew','stats_standard_deviation','stats_stat_binomial_coef', 'stats_stat_correlation','stats_stat_factorial', 'stats_stat_independent_t','stats_stat_innerproduct', 'stats_stat_paired_t','stats_stat_percentile','stats_stat_powersum', 'stats_variance','strcasecmp','strchr','strcmp','strcoll','strcspn', 'stream_bucket_append','stream_bucket_make_writeable', 'stream_bucket_new','stream_bucket_prepend','stream_context_create', 'stream_context_get_default','stream_context_get_options', 'stream_context_set_default','stream_context_set_option', 'stream_context_set_params','stream_copy_to_stream', 'stream_encoding','stream_filter_append','stream_filter_prepend', 'stream_filter_register','stream_filter_remove', 'stream_get_contents','stream_get_filters','stream_get_line', 'stream_get_meta_data','stream_get_transports', 'stream_get_wrappers','stream_is_local', 'stream_notification_callback','stream_register_wrapper', 'stream_resolve_include_path','stream_select','stream_set_blocking', 'stream_set_timeout','stream_set_write_buffer', 'stream_socket_accept','stream_socket_client', 'stream_socket_enable_crypto','stream_socket_get_name', 'stream_socket_pair','stream_socket_recvfrom', 'stream_socket_sendto','stream_socket_server', 'stream_socket_shutdown','stream_supports_lock', 'stream_wrapper_register','stream_wrapper_restore', 'stream_wrapper_unregister','strftime','stripcslashes','stripos', 'stripslashes','strip_tags','stristr','strlen','strnatcasecmp', 'strnatcmp','strpbrk','strncasecmp','strncmp','strpos','strrchr', 'strrev','strripos','strrpos','strspn','strstr','strtok', 'strtolower','strtotime','strtoupper','strtr','strval', 'str_ireplace','str_pad','str_repeat','str_replace','str_rot13', 'str_split','str_shuffle','str_word_count','substr', 'substr_compare','substr_count','substr_replace','svn_add', 'svn_auth_get_parameter','svn_auth_set_parameter','svn_cat', 'svn_checkout','svn_cleanup','svn_client_version','svn_commit', 'svn_diff','svn_export','svn_fs_abort_txn','svn_fs_apply_text', 'svn_fs_begin_txn2','svn_fs_change_node_prop','svn_fs_check_path', 'svn_fs_contents_changed','svn_fs_copy','svn_fs_delete', 'svn_fs_dir_entries','svn_fs_file_contents','svn_fs_file_length', 'svn_fs_is_dir','svn_fs_is_file','svn_fs_make_dir', 'svn_fs_make_file','svn_fs_node_created_rev','svn_fs_node_prop', 'svn_fs_props_changed','svn_fs_revision_prop', 'svn_fs_revision_root','svn_fs_txn_root','svn_fs_youngest_rev', 'svn_import','svn_info','svn_log','svn_ls','svn_repos_create', 'svn_repos_fs','svn_repos_fs_begin_txn_for_commit', 'svn_repos_fs_commit_txn','svn_repos_hotcopy','svn_repos_open', 'svn_repos_recover','svn_status','svn_update','symlink', 'sys_get_temp_dir','syslog','system','tan','tanh','tempnam', 'textdomain','thread_get','thread_include','thread_lock', 'thread_lock_try','thread_mutex_destroy','thread_mutex_init', 'thread_set','thread_start','thread_unlock','tidy_access_count', 'tidy_clean_repair','tidy_config_count','tidy_diagnose', 'tidy_error_count','tidy_get_body','tidy_get_config', 'tidy_get_error_buffer','tidy_get_head','tidy_get_html', 'tidy_get_html_ver','tidy_get_output','tidy_get_release', 'tidy_get_root','tidy_get_status','tidy_getopt','tidy_is_xhtml', 'tidy_is_xml','tidy_parse_file','tidy_parse_string', 'tidy_repair_file','tidy_repair_string','tidy_warning_count','time', 'timezone_abbreviations_list','timezone_identifiers_list', 'timezone_name_from_abbr','timezone_name_get','timezone_offset_get', 'timezone_open','timezone_transitions_get','tmpfile', 'token_get_all','token_name','touch','trigger_error', 'transliterate','transliterate_filters_get','trim','uasort', 'ucfirst','ucwords','uksort','umask','uniqid','unixtojd','unlink', 'unpack','unregister_tick_function','unserialize','unset', 'urldecode','urlencode','user_error','use_soap_error_handler', 'usleep','usort','utf8_decode','utf8_encode','var_dump', 'var_export','variant_abs','variant_add','variant_and', 'variant_cast','variant_cat','variant_cmp', 'variant_date_from_timestamp','variant_date_to_timestamp', 'variant_div','variant_eqv','variant_fix','variant_get_type', 'variant_idiv','variant_imp','variant_int','variant_mod', 'variant_mul','variant_neg','variant_not','variant_or', 'variant_pow','variant_round','variant_set','variant_set_type', 'variant_sub','variant_xor','version_compare','virtual','vfprintf', 'vprintf','vsprintf','wddx_add_vars','wddx_deserialize', 'wddx_packet_end','wddx_packet_start','wddx_serialize_value', 'wddx_serialize_vars','win_beep','win_browse_file', 'win_browse_folder','win_create_link','win_message_box', 'win_play_wav','win_shell_execute','win32_create_service', 'win32_delete_service','win32_get_last_control_message', 'win32_ps_list_procs','win32_ps_stat_mem','win32_ps_stat_proc', 'win32_query_service_status','win32_scheduler_delete_task', 'win32_scheduler_enum_tasks','win32_scheduler_get_task_info', 'win32_scheduler_run','win32_scheduler_set_task_info', 'win32_set_service_status','win32_start_service', 'win32_start_service_ctrl_dispatcher','win32_stop_service', 'wordwrap','xml_error_string','xml_get_current_byte_index', 'xml_get_current_column_number','xml_get_current_line_number', 'xml_get_error_code','xml_parse','xml_parser_create', 'xml_parser_create_ns','xml_parser_free','xml_parser_get_option', 'xml_parser_set_option','xml_parse_into_struct', 'xml_set_character_data_handler','xml_set_default_handler', 'xml_set_element_handler','xml_set_end_namespace_decl_handler', 'xml_set_external_entity_ref_handler', 'xml_set_notation_decl_handler','xml_set_object', 'xml_set_processing_instruction_handler', 'xml_set_start_namespace_decl_handler', 'xml_set_unparsed_entity_decl_handler','xmldoc','xmldocfile', 'xmlrpc_decode','xmlrpc_decode_request','xmlrpc_encode', 'xmlrpc_encode_request','xmlrpc_get_type','xmlrpc_is_fault', 'xmlrpc_parse_method_descriptions', 'xmlrpc_server_add_introspection_data','xmlrpc_server_call_method', 'xmlrpc_server_create','xmlrpc_server_destroy', 'xmlrpc_server_register_introspection_callback', 'xmlrpc_server_register_method','xmlrpc_set_type','xmltree', 'xmlwriter_end_attribute','xmlwriter_end_cdata', 'xmlwriter_end_comment','xmlwriter_end_document', 'xmlwriter_end_dtd','xmlwriter_end_dtd_attlist', 'xmlwriter_end_dtd_element','xmlwriter_end_dtd_entity', 'xmlwriter_end_element','xmlwriter_end_pi','xmlwriter_flush', 'xmlwriter_full_end_element','xmlwriter_open_memory', 'xmlwriter_open_uri','xmlwriter_output_memory', 'xmlwriter_set_indent','xmlwriter_set_indent_string', 'xmlwriter_start_attribute','xmlwriter_start_attribute_ns', 'xmlwriter_start_cdata','xmlwriter_start_comment', 'xmlwriter_start_document','xmlwriter_start_dtd', 'xmlwriter_start_dtd_attlist','xmlwriter_start_dtd_element', 'xmlwriter_start_dtd_entity','xmlwriter_start_element', 'xmlwriter_start_element_ns','xmlwriter_start_pi','xmlwriter_text', 'xmlwriter_write_attribute','xmlwriter_write_attribute_ns', 'xmlwriter_write_cdata','xmlwriter_write_comment', 'xmlwriter_write_dtd','xmlwriter_write_dtd_attlist', 'xmlwriter_write_dtd_element','xmlwriter_write_dtd_entity', 'xmlwriter_write_element','xmlwriter_write_element_ns', 'xmlwriter_write_pi','xmlwriter_write_raw','xpath_eval', 'xpath_eval_expression','xpath_new_context','xpath_register_ns', 'xpath_register_ns_auto','xptr_eval','xptr_new_context','yp_all', 'yp_cat','yp_errno','yp_err_string','yp_first', 'yp_get_default_domain','yp_master','yp_match','yp_next','yp_order', 'zend_current_obfuscation_level','zend_get_cfg_var','zend_get_id', 'zend_loader_current_file','zend_loader_enabled', 'zend_loader_file_encoded','zend_loader_file_licensed', 'zend_loader_install_license','zend_loader_version', 'zend_logo_guid','zend_match_hostmasks','zend_obfuscate_class_name', 'zend_obfuscate_function_name','zend_optimizer_version', 'zend_runtime_obfuscate','zend_version','zip_close', 'zip_entry_close','zip_entry_compressedsize', 'zip_entry_compressionmethod','zip_entry_filesize','zip_entry_name', 'zip_entry_open','zip_entry_read','zip_open','zip_read', 'zlib_get_coding_type' ), 4 => array( 'DEFAULT_INCLUDE_PATH', 'DIRECTORY_SEPARATOR', 'E_ALL', 'E_COMPILE_ERROR', 'E_COMPILE_WARNING', 'E_CORE_ERROR', 'E_CORE_WARNING', 'E_ERROR', 'E_NOTICE', 'E_PARSE', 'E_STRICT', 'E_USER_ERROR', 'E_USER_NOTICE', 'E_USER_WARNING', 'E_WARNING', 'ENT_COMPAT','ENT_QUOTES','ENT_NOQUOTES', 'false', 'null', 'PEAR_EXTENSION_DIR', 'PEAR_INSTALL_DIR', 'PHP_BINDIR', 'PHP_CONFIG_FILE_PATH', 'PHP_DATADIR', 'PHP_EXTENSION_DIR', 'PHP_LIBDIR', 'PHP_LOCALSTATEDIR', 'PHP_OS', 'PHP_OUTPUT_HANDLER_CONT', 'PHP_OUTPUT_HANDLER_END', 'PHP_OUTPUT_HANDLER_START', 'PHP_SYSCONFDIR', 'PHP_VERSION', 'true', '__CLASS__', '__FILE__', '__FUNCTION__', '__LINE__', '__METHOD__' ) ), 'SYMBOLS' => array( 1 => array( '<'.'%', '<'.'%=', '%'.'>', '<'.'?', '<'.'?=', '?'.'>' ), 0 => array( '(', ')', '[', ']', '{', '}', '!', '@', '%', '&', '|', '/', '<', '>', '=', '-', '+', '*', '.', ':', ',', ';' ) ), 'CASE_SENSITIVE' => array( GESHI_COMMENTS => false, 1 => false, 2 => false, 3 => false, 4 => false ), 'STYLES' => array( 'KEYWORDS' => array( 1 => 'color: #b1b100;', 2 => 'color: #000000; font-weight: bold;', 3 => 'color: #990000;', 4 => 'color: #009900; font-weight: bold;' ), 'COMMENTS' => array( 1 => 'color: #666666; font-style: italic;', 2 => 'color: #666666; font-style: italic;', 3 => 'color: #0000cc; font-style: italic;', 4 => 'color: #009933; font-style: italic;', 'MULTI' => 'color: #666666; font-style: italic;' ), 'ESCAPE_CHAR' => array( 0 => 'color: #000099; font-weight: bold;', 1 => 'color: #000099; font-weight: bold;', 2 => 'color: #660099; font-weight: bold;', 3 => 'color: #660099; font-weight: bold;', 4 => 'color: #006699; font-weight: bold;', 5 => 'color: #006699; font-weight: bold; font-style: italic;', 6 => 'color: #009933; font-weight: bold;', 'HARD' => 'color: #000099; font-weight: bold;' ), 'BRACKETS' => array( 0 => 'color: #009900;' ), 'STRINGS' => array( 0 => 'color: #0000ff;', 'HARD' => 'color: #0000ff;' ), 'NUMBERS' => array( 0 => 'color: #cc66cc;', GESHI_NUMBER_OCT_PREFIX => 'color: #208080;', GESHI_NUMBER_HEX_PREFIX => 'color: #208080;', GESHI_NUMBER_FLT_SCI_ZERO => 'color:#800080;', ), 'METHODS' => array( 1 => 'color: #004000;', 2 => 'color: #004000;' ), 'SYMBOLS' => array( 0 => 'color: #339933;', 1 => 'color: #000000; font-weight: bold;' ), 'REGEXPS' => array( 0 => 'color: #000088;' ), 'SCRIPT' => array( 0 => '', 1 => '', 2 => '', 3 => '', 4 => '', 5 => '' ) ), 'URLS' => array( 1 => '', 2 => '', 3 => 'http://www.php.net/{FNAMEL}', 4 => '' ), 'OOLANG' => true, 'OBJECT_SPLITTERS' => array( 1 => '->', 2 => '::' ), 'REGEXPS' => array( //Variables 0 => "[\\$]{1,2}[a-zA-Z_][a-zA-Z0-9_]*" ), 'STRICT_MODE_APPLIES' => GESHI_MAYBE, 'SCRIPT_DELIMITERS' => array( 0 => array( '<'.'?php' => '?'.'>' ), 1 => array( '<'.'?' => '?'.'>' ), 2 => array( '<'.'%' => '%'.'>' ), 3 => array( '' ), 4 => "/(?P<\\?(?>php\b)?)(?:". "(?>[^\"'?\\/<]+)|". "\\?(?!>)|". "(?>'(?>[^'\\\\]|\\\\'|\\\\\\\|\\\\)*')|". "(?>\"(?>[^\"\\\\]|\\\\\"|\\\\\\\\|\\\\)*\")|". "(?>\\/\\*(?>[^\\*]|(?!\\*\\/)\\*)*\\*\\/)|". "\\/\\/(?>.*?$)|". "\\/(?=[^*\\/])|". "<(?!<<)|". "<<<(?P\w+)\s.*?\s\k". ")*(?P\\?>|\Z)/sm", 5 => "/(?P<%)(?:". "(?>[^\"'%\\/<]+)|". "%(?!>)|". "(?>'(?>[^'\\\\]|\\\\'|\\\\\\\|\\\\)*')|". "(?>\"(?>[^\\\"\\\\]|\\\\\"|\\\\\\\\|\\\\)*\")|". "(?>\\/\\*(?>[^\\*]|(?!\\*\\/)\\*)*\\*\\/)|". "\\/\\/(?>.*?$)|". "\\/(?=[^*\\/])|". "<(?!<<)|". "<<<(?P\w+)\s.*?\s\k". ")*(?P%>)/sm", ), 'HIGHLIGHT_STRICT_BLOCK' => array( 0 => true, 1 => true, 2 => true, 3 => true, 4 => true, 5 => true ), 'TAB_WIDTH' => 4 ); ?> content/geshi/geshi/geshi/mysql.php000066600000053441150771657550013426 0ustar00 'MySQL', //'COMMENT_SINGLE' => array(1 =>'--', 2 => '#'), // '--' MUST be folowed by whitespace,not necessarily a space 'COMMENT_SINGLE' => array( 1 =>'-- ', 2 => '#' ), 'COMMENT_REGEXP' => array( 1 => "/(?:--\s).*?$/", // double dash followed by any whitespace ), 'COMMENT_MULTI' => array('/*' => '*/'), 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE, // @@@ would be nice if this could be defined per group! 'QUOTEMARKS' => array("'", '"', '`'), 'ESCAPE_CHAR' => '\\', // by default only, can be specified 'ESCAPE_REGEXP' => array( 1 => "/[_%]/", // search wildcards ), 'NUMBERS' => GESHI_NUMBER_INT_BASIC | GESHI_NUMBER_OCT_PREFIX | GESHI_NUMBER_HEX_PREFIX | GESHI_NUMBER_FLT_NONSCI | GESHI_NUMBER_FLT_SCI_SHORT | GESHI_NUMBER_FLT_SCI_ZERO, 'KEYWORDS' => array( 1 => array( // Mix: statement keywords and keywords that don't fit in any other // category, or have multiple usage/meanings 'ACTION','ADD','AFTER','ALGORITHM','ALL','ALTER','ANALYZE','ANY', 'ASC','AS','BDB','BEGIN','BERKELEYDB','BINARY','BTREE','CALL', 'CASCADED','CASCADE','CHAIN','CHECK','COLUMNS','COLUMN','COMMENT', 'COMMIT','COMMITTED','CONSTRAINT','CONTAINS SQL','CONSISTENT', 'CONVERT','CREATE','CROSS','DATA','DATABASES', 'DECLARE','DEFINER','DELAYED','DELETE','DESCRIBE','DESC', 'DETERMINISTIC','DISABLE','DISCARD','DISTINCTROW','DISTINCT','DO', 'DROP','DUMPFILE','DUPLICATE KEY','ENABLE','ENCLOSED BY','ENGINE', 'ERRORS','ESCAPED BY','EXISTS','EXPLAIN','EXTENDED','FIELDS', 'FIRST','FOR EACH ROW','FORCE','FOREIGN KEY','FROM','FULL', 'FUNCTION','GLOBAL','GRANT','GROUP BY','HANDLER','HASH','HAVING', 'HELP','HIGH_PRIORITY','IF NOT EXISTS','IGNORE','IMPORT','INDEX', 'INFILE','INNER','INNODB','INOUT','INTO','INVOKER', 'ISOLATION LEVEL','JOIN','KEYS','KEY','KILL','LANGUAGE SQL','LAST', 'LIMIT','LINES','LOAD','LOCAL','LOCK','LOW_PRIORITY', 'MASTER_SERVER_ID','MATCH','MERGE','MIDDLEINT','MODIFIES SQL DATA', 'MODIFY','MRG_MYISAM','NATURAL','NEXT','NO SQL','NO','ON', 'OPTIMIZE','OPTIONALLY','OPTION','ORDER BY','OUTER','OUTFILE','OUT', 'PARTIAL','PREV','PRIMARY KEY','PRIVILEGES','PROCEDURE','PURGE', 'QUICK','READS SQL DATA','READ','REFERENCES','RELEASE','RENAME', 'REPEATABLE','REQUIRE','RESTRICT','RETURNS','REVOKE', 'ROLLBACK','ROUTINE','RTREE','SAVEPOINT','SELECT', 'SERIALIZABLE','SESSION','SET','SHARE MODE','SHOW','SIMPLE', 'SNAPSHOT','SOME','SONAME','SQL SECURITY','SQL_BIG_RESULT', 'SQL_BUFFER_RESULT','SQL_CACHE','SQL_CALC_FOUND_ROWS', 'SQL_NO_CACHE','SQL_SMALL_RESULT','SSL','START','STARTING BY', 'STATUS','STRAIGHT_JOIN','STRIPED','TABLESPACE','TABLES','TABLE', 'TEMPORARY','TEMPTABLE','TERMINATED BY','TO','TRANSACTIONS', 'TRANSACTION','TRIGGER','TYPES','TYPE','UNCOMMITTED','UNDEFINED', 'UNION','UNLOCK_TABLES','UPDATE','USAGE','USE','USER_RESOURCES', 'USING','VALUES','VALUE','VIEW','WARNINGS','WHERE','WITH ROLLUP', 'WITH','WORK','WRITE', ), 2 => array( //No ( must follow // Mix: statement keywords distinguished from functions by the same name "CURRENT_USER", "DATABASE", "IN", "INSERT", "DEFAULT", "REPLACE", "SCHEMA", "TRUNCATE" ), 3 => array( // Values (Constants) 'FALSE','NULL','TRUE', ), 4 => array( // Column Data Types 'BIGINT','BIT','BLOB','BOOLEAN','BOOL','CHARACTER VARYING', 'CHAR VARYING','DATETIME','DECIMAL','DEC','DOUBLE PRECISION', 'DOUBLE','ENUM','FIXED','FLOAT','GEOMETRYCOLLECTION','GEOMETRY', 'INTEGER','INT','LINESTRING','LONGBLOB','LONGTEXT','MEDIUMBLOB', 'MEDIUMINT','MEDIUMTEXT','MULTIPOINT','MULTILINESTRING', 'MULTIPOLYGON','NATIONAL CHARACTER','NATIONAL CHARACTER VARYING', 'NATIONAL CHAR VARYING','NATIONAL VARCHAR','NCHAR VARCHAR','NCHAR', 'NUMERIC','POINT','POLYGON','REAL','SERIAL', 'SMALLINT','TEXT','TIMESTAMP','TINYBLOB','TINYINT', 'TINYTEXT','VARBINARY','VARCHARACTER','VARCHAR', ), 5 => array( //No ( must follow // Column data types distinguished from functions by the same name "CHAR", "DATE", "TIME" ), 6 => array( // Table, Column & Index Attributes 'AUTO_INCREMENT','AVG_ROW_LENGTH','BOTH','CHECKSUM','CONNECTION', 'DATA DIRECTORY','DEFAULT NULL','DELAY_KEY_WRITE','FULLTEXT', 'INDEX DIRECTORY','INSERT_METHOD','LEADING','MAX_ROWS','MIN_ROWS', 'NOT NULL','PACK_KEYS','ROW_FORMAT','SERIAL DEFAULT VALUE','SIGNED', 'SPATIAL','TRAILING','UNIQUE','UNSIGNED','ZEROFILL' ), 7 => array( //No ( must follow // Column attribute distinguished from function by the same name "CHARSET" ), 8 => array( // Date and Time Unit Specifiers 'DAY_HOUR','DAY_MICROSECOND','DAY_MINUTE','DAY_SECOND', 'HOUR_MICROSECOND','HOUR_MINUTE','HOUR_SECOND', 'MINUTE_MICROSECOND','MINUTE_SECOND', 'SECOND_MICROSECOND','YEAR_MONTH' ), 9 => array( //No ( must follow // Date-time unit specifiers distinguished from functions by the same name "DAY", "HOUR", "MICROSECOND", "MINUTE", "MONTH", "QUARTER", "SECOND", "WEEK", "YEAR" ), 10 => array( // Operators (see also Symbols) 'AND','BETWEEN','CHARACTER SET','COLLATE','DIV','IS NOT NULL', 'IS NOT','IS NULL','IS','LIKE','NOT','OFFSET','OR','REGEXP','RLIKE', 'SOUNDS LIKE','XOR' ), 11 => array( //No ( must follow // Operator distinghuished from function by the same name "INTERVAL" ), 12 => array( // Control Flow (functions) 'CASE','ELSE','END','IFNULL','IF','NULLIF','THEN','WHEN', ), 13 => array( // String Functions 'ASCII','BIN','BIT_LENGTH','CHAR_LENGTH','CHARACTER_LENGTH', 'CONCAT_WS','CONCAT','ELT','EXPORT_SET','FIELD', 'FIND_IN_SET','FORMAT','HEX','INSTR','LCASE','LEFT','LENGTH', 'LOAD_FILE','LOCATE','LOWER','LPAD','LTRIM','MAKE_SET','MID', 'OCTET_LENGTH','ORD','POSITION','QUOTE','REPEAT','REVERSE', 'RIGHT','RPAD','RTRIM','SOUNDEX','SPACE','STRCMP','SUBSTRING_INDEX', 'SUBSTRING','TRIM','UCASE','UNHEX','UPPER', ), 14 => array( //A ( must follow // String functions distinguished from other keywords by the same name "INSERT", "REPLACE", "CHAR" ), 15 => array( // Numeric Functions 'ABS','ACOS','ASIN','ATAN2','ATAN','CEILING','CEIL', 'CONV','COS','COT','CRC32','DEGREES','EXP','FLOOR','LN','LOG10', 'LOG2','LOG','MOD','OCT','PI','POWER','POW','RADIANS','RAND', 'ROUND','SIGN','SIN','SQRT','TAN', ), 16 => array( //A ( must follow // Numeric function distinguished from other keyword by the same name "TRUNCATE" ), 17 => array( // Date and Time Functions 'ADDDATE','ADDTIME','CONVERT_TZ','CURDATE','CURRENT_DATE', 'CURRENT_TIME','CURRENT_TIMESTAMP','CURTIME','DATE_ADD', 'DATE_FORMAT','DATE_SUB','DATEDIFF','DAYNAME','DAYOFMONTH', 'DAYOFWEEK','DAYOFYEAR','EXTRACT','FROM_DAYS','FROM_UNIXTIME', 'GET_FORMAT','LAST_DAY','LOCALTIME','LOCALTIMESTAMP','MAKEDATE', 'MAKETIME','MONTHNAME','NOW','PERIOD_ADD', 'PERIOD_DIFF','SEC_TO_TIME','STR_TO_DATE','SUBDATE','SUBTIME', 'SYSDATE','TIME_FORMAT','TIME_TO_SEC', 'TIMESTAMPADD','TIMESTAMPDIFF','TO_DAYS', 'UNIX_TIMESTAMP','UTC_DATE','UTC_TIME','UTC_TIMESTAMP','WEEKDAY', 'WEEKOFYEAR','YEARWEEK', ), 18 => array( //A ( must follow // Date-time functions distinguished from other keywords by the same name "DATE", "DAY", "HOUR", "MICROSECOND", "MINUTE", "MONTH", "QUARTER", "SECOND", "TIME", "WEEK", "YEAR" ), 19 => array( // Comparison Functions 'COALESCE','GREATEST','ISNULL','LEAST', ), 20 => array( //A ( must follow // Comparison functions distinguished from other keywords by the same name "IN", "INTERVAL" ), 21 => array( // Encryption and Compression Functions 'AES_DECRYPT','AES_ENCRYPT','COMPRESS','DECODE','DES_DECRYPT', 'DES_ENCRYPT','ENCODE','ENCRYPT','MD5','OLD_PASSWORD','PASSWORD', 'SHA1','SHA','UNCOMPRESS','UNCOMPRESSED_LENGTH', ), 22 => array( // GROUP BY (aggregate) Functions 'AVG','BIT_AND','BIT_OR','BIT_XOR','COUNT','GROUP_CONCAT', 'MAX','MIN','STDDEV_POP','STDDEV_SAMP','STDDEV','STD','SUM', 'VAR_POP','VAR_SAMP','VARIANCE', ), 23 => array( // Information Functions 'BENCHMARK','COERCIBILITY','COLLATION','CONNECTION_ID', 'FOUND_ROWS','LAST_INSERT_ID','ROW_COUNT', 'SESSION_USER','SYSTEM_USER','USER','VERSION', ), 24 => array( //A ( must follow // Information functions distinguished from other keywords by the same name "CURRENT_USER", "DATABASE", "SCHEMA", "CHARSET" ), 25 => array( // Miscellaneous Functions 'ExtractValue','BIT_COUNT','GET_LOCK','INET_ATON','INET_NTOA', 'IS_FREE_LOCK','IS_USED_LOCK','MASTER_POS_WAIT','NAME_CONST', 'RELEASE_LOCK','SLEEP','UpdateXML','UUID', ), 26 => array( //A ( must follow // Miscellaneous function distinguished from other keyword by the same name "DEFAULT" ), 27 => array( // Geometry Functions 'Area','AsBinary','AsText','AsWKB','AsWKT','Boundary','Buffer', 'Centroid','Contains','ConvexHull','Crosses', 'Difference','Dimension','Disjoint','Distance', 'EndPoint','Envelope','Equals','ExteriorRing', 'GLength','GeomCollFromText','GeomCollFromWKB','GeomFromText', 'GeomFromWKB','GeometryCollectionFromText', 'GeometryCollectionFromWKB','GeometryFromText','GeometryFromWKB', 'GeometryN','GeometryType', 'InteriorRingN','Intersection','Intersects','IsClosed','IsEmpty', 'IsRing','IsSimple', 'LineFromText','LineFromWKB','LineStringFromText', 'LineStringFromWKB', 'MBRContains','MBRDisjoint','MBREqual','MBRIntersects', 'MBROverlaps','MBRTouches','MBRWithin','MLineFromText', 'MLineFromWKB','MPointFromText','MPointFromWKB','MPolyFromText', 'MPolyFromWKB','MultiLineStringFromText','MultiLineStringFromWKB', 'MultiPointFromText','MultiPointFromWKB','MultiPolygonFromText', 'MultiPolygonFromWKB', 'NumGeometries','NumInteriorRings','NumPoints', 'Overlaps', 'PointFromText','PointFromWKB','PointN','PointOnSurface', 'PolyFromText','PolyFromWKB','PolygonFromText','PolygonFromWKB', 'Related','SRID','StartPoint','SymDifference', 'Touches', 'Union', 'Within', 'X', 'Y', ), ), 'SYMBOLS' => array( 1 => array( /* Operators */ '=', ':=', // assignment operators '||', '&&', '!', // locical operators '=', '<=>', '>=', '>', '<=', '<', '<>', '!=', // comparison operators '|', '&', '^', '~', '<<', '>>', // bitwise operators '-', '+', '*', '/', '%', // numerical operators ), 2 => array( /* Other syntactical symbols */ '(', ')', ',', ';', ), ), 'CASE_SENSITIVE' => array( GESHI_COMMENTS => false, 1 => false, 2 => false, 3 => false, 4 => false, 5 => false, 6 => false, 7 => false, 8 => false, 9 => false, 10 => false, 11 => false, 12 => false, 13 => false, 13 => false, 14 => false, 15 => false, 16 => false, 17 => false, 18 => false, 19 => false, 20 => false, 21 => false, 22 => false, 23 => false, 24 => false, 25 => false, 26 => false, 27 => false, ), 'STYLES' => array( 'KEYWORDS' => array( 1 => 'color: #990099; font-weight: bold;', // mix 2 => 'color: #990099; font-weight: bold;', // mix 3 => 'color: #9900FF; font-weight: bold;', // constants 4 => 'color: #999900; font-weight: bold;', // column data types 5 => 'color: #999900; font-weight: bold;', // column data types 6 => 'color: #FF9900; font-weight: bold;', // attributes 7 => 'color: #FF9900; font-weight: bold;', // attributes 8 => 'color: #9900FF; font-weight: bold;', // date-time units 9 => 'color: #9900FF; font-weight: bold;', // date-time units 10 => 'color: #CC0099; font-weight: bold;', // operators 11 => 'color: #CC0099; font-weight: bold;', // operators 12 => 'color: #009900;', // control flow (functions) 13 => 'color: #000099;', // string functions 14 => 'color: #000099;', // string functions 15 => 'color: #000099;', // numeric functions 16 => 'color: #000099;', // numeric functions 17 => 'color: #000099;', // date-time functions 18 => 'color: #000099;', // date-time functions 19 => 'color: #000099;', // comparison functions 20 => 'color: #000099;', // comparison functions 21 => 'color: #000099;', // encryption functions 22 => 'color: #000099;', // aggregate functions 23 => 'color: #000099;', // information functions 24 => 'color: #000099;', // information functions 25 => 'color: #000099;', // miscellaneous functions 26 => 'color: #000099;', // miscellaneous functions 27 => 'color: #00CC00;', // geometry functions ), 'COMMENTS' => array( 'MULTI' => 'color: #808000; font-style: italic;', 1 => 'color: #808080; font-style: italic;', 2 => 'color: #808080; font-style: italic;' ), 'ESCAPE_CHAR' => array( 0 => 'color: #004000; font-weight: bold;', 1 => 'color: #008080; font-weight: bold;' // search wildcards ), 'BRACKETS' => array( 0 => 'color: #FF00FF;' ), 'STRINGS' => array( 0 => 'color: #008000;' ), 'NUMBERS' => array( 0 => 'color: #008080;' ), 'METHODS' => array( ), 'SYMBOLS' => array( 1 => 'color: #CC0099;', // operators 2 => 'color: #000033;', // syntax ), 'SCRIPT' => array( ), 'REGEXPS' => array( ) ), 'URLS' => array( 1 => 'http://search.mysql.com/search?site=refman-%35%31&q={FNAME}', 2 => 'http://search.mysql.com/search?site=refman-%35%31&q={FNAME}', 3 => 'http://search.mysql.com/search?site=refman-%35%31&q={FNAME}', 4 => 'http://search.mysql.com/search?site=refman-%35%31&q={FNAME}', 5 => 'http://search.mysql.com/search?site=refman-%35%31&q={FNAME}', 6 => 'http://search.mysql.com/search?site=refman-%35%31&q={FNAME}', 7 => 'http://search.mysql.com/search?site=refman-%35%31&q={FNAME}', 8 => 'http://search.mysql.com/search?site=refman-%35%31&q={FNAME}', 9 => 'http://search.mysql.com/search?site=refman-%35%31&q={FNAME}', 10 => 'http://dev.mysql.com/doc/refman/%35%2E%31/en/non-typed-operators.html', 11 => 'http://dev.mysql.com/doc/refman/%35%2E%31/en/non-typed-operators.html', 12 => 'http://dev.mysql.com/doc/refman/%35%2E%31/en/control-flow-functions.html', 13 => 'http://dev.mysql.com/doc/refman/%35%2E%31/en/string-functions.html', 14 => 'http://dev.mysql.com/doc/refman/%35%2E%31/en/string-functions.html', 15 => 'http://dev.mysql.com/doc/refman/%35%2E%31/en/numeric-functions.html', 16 => 'http://dev.mysql.com/doc/refman/%35%2E%31/en/numeric-functions.html', 17 => 'http://dev.mysql.com/doc/refman/%35%2E%31/en/date-and-time-functions.html', 18 => 'http://dev.mysql.com/doc/refman/%35%2E%31/en/date-and-time-functions.html', 19 => 'http://dev.mysql.com/doc/refman/%35%2E%31/en/comparison-operators.html', 20 => 'http://dev.mysql.com/doc/refman/%35%2E%31/en/comparison-operators.html', 21 => 'http://dev.mysql.com/doc/refman/%35%2E%31/en/encryption-functions.html', 22 => 'http://dev.mysql.com/doc/refman/%35%2E%31/en/group-by-functions-and-modifiers.html', 23 => 'http://dev.mysql.com/doc/refman/%35%2E%31/en/information-functions.html', 24 => 'http://dev.mysql.com/doc/refman/%35%2E%31/en/information-functions.html', 25 => 'http://dev.mysql.com/doc/refman/%35%2E%31/en/func-op-summary-ref.html', 26 => 'http://dev.mysql.com/doc/refman/%35%2E%31/en/func-op-summary-ref.html', 27 => 'http://dev.mysql.com/doc/refman/%35%2E%31/en/analysing-spatial-information.html', ), 'OOLANG' => false, 'OBJECT_SPLITTERS' => array( ), 'REGEXPS' => array( ), 'STRICT_MODE_APPLIES' => GESHI_NEVER, 'SCRIPT_DELIMITERS' => array( ), 'HIGHLIGHT_STRICT_BLOCK' => array( ), 'TAB_WIDTH' => 4, 'PARSER_CONTROL' => array( 'KEYWORDS' => array( 2 => array( 'DISALLOWED_AFTER' => '(?![\(\w])' ), 5 => array( 'DISALLOWED_AFTER' => '(?![\(\w])' ), 7 => array( 'DISALLOWED_AFTER' => '(?![\(\w])' ), 9 => array( 'DISALLOWED_AFTER' => '(?![\(\w])' ), 11 => array( 'DISALLOWED_AFTER' => '(?![\(\w])' ), 14 => array( 'DISALLOWED_AFTER' => '(?=\()' ), 16 => array( 'DISALLOWED_AFTER' => '(?=\()' ), 18 => array( 'DISALLOWED_AFTER' => '(?=\()' ), 20 => array( 'DISALLOWED_AFTER' => '(?=\()' ), 24 => array( 'DISALLOWED_AFTER' => '(?=\()' ), 26 => array( 'DISALLOWED_AFTER' => '(?=\()' ) ) ) ); ?> content/geshi/geshi/geshi/css.php000066600000023334150771657550013047 0ustar00 'CSS', 'COMMENT_SINGLE' => array(1 => '@'), 'COMMENT_MULTI' => array('/*' => '*/'), 'COMMENT_REGEXP' => array( 2 => "/(?<=\\()\\s*(?:(?:[a-z0-9]+?:\\/\\/)?[a-z0-9_\\-\\.\\/:]+?)?[a-z]+?\\.[a-z]+?(\\?[^\)]+?)?\\s*?(?=\\))/i" ), 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE, 'QUOTEMARKS' => array('"', "'"), 'ESCAPE_CHAR' => '', 'ESCAPE_REGEXP' => array( //Simple Single Char Escapes //1 => "#\\\\[nfrtv\$\"\n\\\\]#i", //Hexadecimal Char Specs 2 => "#\\\\[\da-fA-F]{1,6}\s?#i", //Unicode Char Specs //3 => "#\\\\u[\da-fA-F]{1,8}#i", ), 'KEYWORDS' => array( 1 => array( 'aqua', 'azimuth', 'background-attachment', 'background-color', 'background-image', 'background-position', 'background-repeat', 'background', 'black', 'blue', 'border-bottom-color', 'border-bottom-style', 'border-bottom-width', 'border-left-color', 'border-left-style', 'border-left-width', 'border-right', 'border-right-color', 'border-right-style', 'border-right-width', 'border-top-color', 'border-top-style', 'border-top-width','border-bottom', 'border-collapse', 'border-left', 'border-width', 'border-color', 'border-spacing', 'border-style', 'border-top', 'border', 'caption-side', 'clear', 'clip', 'color', 'content', 'counter-increment', 'counter-reset', 'cue-after', 'cue-before', 'cue', 'cursor', 'direction', 'display', 'elevation', 'empty-cells', 'float', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'font', 'line-height', 'letter-spacing', 'list-style', 'list-style-image', 'list-style-position', 'list-style-type', 'margin-bottom', 'margin-left', 'margin-right', 'margin-top', 'margin', 'marker-offset', 'marks', 'max-height', 'max-width', 'min-height', 'min-width', 'orphans', 'outline', 'outline-color', 'outline-style', 'outline-width', 'overflow', 'padding-bottom', 'padding-left', 'padding-right', 'padding-top', 'padding', 'page', 'page-break-after', 'page-break-before', 'page-break-inside', 'pause-after', 'pause-before', 'pause', 'pitch', 'pitch-range', 'play-during', 'position', 'quotes', 'richness', 'right', 'size', 'speak-header', 'speak-numeral', 'speak-punctuation', 'speak', 'speech-rate', 'stress', 'table-layout', 'text-align', 'text-decoration', 'text-indent', 'text-shadow', 'text-transform', 'top', 'unicode-bidi', 'vertical-align', 'visibility', 'voice-family', 'volume', 'white-space', 'widows', 'width', 'word-spacing', 'z-index', 'bottom', 'left', 'height' ), 2 => array( 'above', 'absolute', 'always', 'armenian', 'aural', 'auto', 'avoid', 'baseline', 'behind', 'below', 'bidi-override', 'blink', 'block', 'bold', 'bolder', 'both', 'capitalize', 'center-left', 'center-right', 'center', 'circle', 'cjk-ideographic', 'close-quote', 'collapse', 'condensed', 'continuous', 'crop', 'crosshair', 'cross', 'cursive', 'dashed', 'decimal-leading-zero', 'decimal', 'default', 'digits', 'disc', 'dotted', 'double', 'e-resize', 'embed', 'extra-condensed', 'extra-expanded', 'expanded', 'fantasy', 'far-left', 'far-right', 'faster', 'fast', 'fixed', 'fuchsia', 'georgian', 'gray', 'green', 'groove', 'hebrew', 'help', 'hidden', 'hide', 'higher', 'high', 'hiragana-iroha', 'hiragana', 'icon', 'inherit', 'inline-table', 'inline', 'inset', 'inside', 'invert', 'italic', 'justify', 'katakana-iroha', 'katakana', 'landscape', 'larger', 'large', 'left-side', 'leftwards', 'level', 'lighter', 'lime', 'line-through', 'list-item', 'loud', 'lower-alpha', 'lower-greek', 'lower-roman', 'lowercase', 'ltr', 'lower', 'low', 'maroon', 'medium', 'message-box', 'middle', 'mix', 'monospace', 'n-resize', 'narrower', 'navy', 'ne-resize', 'no-close-quote', 'no-open-quote', 'no-repeat', 'none', 'normal', 'nowrap', 'nw-resize', 'oblique', 'olive', 'once', 'open-quote', 'outset', 'outside', 'overline', 'pointer', 'portrait', 'purple', 'px', 'red', 'relative', 'repeat-x', 'repeat-y', 'repeat', 'rgb', 'ridge', 'right-side', 'rightwards', 's-resize', 'sans-serif', 'scroll', 'se-resize', 'semi-condensed', 'semi-expanded', 'separate', 'serif', 'show', 'silent', 'silver', 'slow', 'slower', 'small-caps', 'small-caption', 'smaller', 'soft', 'solid', 'spell-out', 'square', 'static', 'status-bar', 'super', 'sw-resize', 'table-caption', 'table-cell', 'table-column', 'table-column-group', 'table-footer-group', 'table-header-group', 'table-row', 'table-row-group', 'teal', 'text', 'text-bottom', 'text-top', 'thick', 'thin', 'transparent', 'ultra-condensed', 'ultra-expanded', 'underline', 'upper-alpha', 'upper-latin', 'upper-roman', 'uppercase', 'url', 'visible', 'w-resize', 'wait', 'white', 'wider', 'x-fast', 'x-high', 'x-large', 'x-loud', 'x-low', 'x-small', 'x-soft', 'xx-large', 'xx-small', 'yellow', 'yes' ) ), 'SYMBOLS' => array( '(', ')', '{', '}', ':', ';', '>', '+', '*', ',', '^', '=' ), 'CASE_SENSITIVE' => array( GESHI_COMMENTS => false, 1 => true, 2 => true ), 'STYLES' => array( 'KEYWORDS' => array( 1 => 'color: #000000; font-weight: bold;', 2 => 'color: #993333;' ), 'COMMENTS' => array( 1 => 'color: #a1a100;', 2 => 'color: #ff0000; font-style: italic;', 'MULTI' => 'color: #808080; font-style: italic;' ), 'ESCAPE_CHAR' => array( 0 => 'color: #000099; font-weight: bold;', //1 => 'color: #000099; font-weight: bold;', 2 => 'color: #000099; font-weight: bold;' //3 => 'color: #000099; font-weight: bold;' ), 'BRACKETS' => array( 0 => 'color: #00AA00;' ), 'STRINGS' => array( 0 => 'color: #ff0000;' ), 'NUMBERS' => array( 0 => 'color: #cc66cc;' ), 'METHODS' => array( ), 'SYMBOLS' => array( 0 => 'color: #00AA00;' ), 'SCRIPT' => array( ), 'REGEXPS' => array( 0 => 'color: #cc00cc;', 1 => 'color: #6666ff;', 2 => 'color: #3333ff;', 3 => 'color: #933;' ) ), 'URLS' => array( 1 => '', 2 => '' ), 'OOLANG' => false, 'OBJECT_SPLITTERS' => array( ), 'REGEXPS' => array( //DOM Node ID 0 => '\#[a-zA-Z0-9\-_]+(?:\\\\:[a-zA-Z0-9\-_]+)*', //CSS classname 1 => '\.(?!\d)[a-zA-Z0-9\-_]+(?:\\\\:[a-zA-Z0-9\-_]+)*\b(?=[\{\.#\s,:].|<\|)', //CSS Pseudo classes //note: & is needed for > (i.e. > ) 2 => '(? '[+\-]?(\d+|(\d*\.\d+))(em|ex|pt|px|cm|in|%)', ), 'STRICT_MODE_APPLIES' => GESHI_NEVER, 'SCRIPT_DELIMITERS' => array( ), 'HIGHLIGHT_STRICT_BLOCK' => array( ), 'TAB_WIDTH' => 4, 'PARSER_CONTROL' => array( 'KEYWORDS' => array( 'DISALLOWED_AFTER' => '(?![a-zA-Z0-9_\|%\\-&\.])' ) ) ); ?> content/geshi/geshi/geshi/javascript.php000066600000012145150771657550014423 0ustar00 'Javascript', 'COMMENT_SINGLE' => array(1 => '//'), 'COMMENT_MULTI' => array('/*' => '*/'), 'COMMENT_REGEXP' => array( //Regular Expressions 2 => "/(?<=[\\s^])(s|tr|y)\\/(?!\*)(?!\s)(?:\\\\.|(?!\n)[^\\/\\\\])+(? GESHI_CAPS_NO_CHANGE, 'QUOTEMARKS' => array("'", '"'), 'ESCAPE_CHAR' => '\\', 'KEYWORDS' => array( 1 => array( 'as', 'break', 'case', 'catch', 'continue', 'decodeURI', 'delete', 'do', 'else', 'encodeURI', 'eval', 'finally', 'for', 'if', 'in', 'is', 'item', 'instanceof', 'return', 'switch', 'this', 'throw', 'try', 'typeof', 'void', 'while', 'write', 'with' ), 2 => array( 'class', 'const', 'default', 'debugger', 'export', 'extends', 'false', 'function', 'import', 'namespace', 'new', 'null', 'package', 'private', 'protected', 'public', 'super', 'true', 'use', 'var' ), 3 => array( // common functions for Window object 'alert', 'back', 'blur', 'close', 'confirm', 'focus', 'forward', 'home', 'name', 'navigate', 'onblur', 'onerror', 'onfocus', 'onload', 'onmove', 'onresize', 'onunload', 'open', 'print', 'prompt', 'scroll', 'status', 'stop', ) ), 'SYMBOLS' => array( '(', ')', '[', ']', '{', '}', '+', '-', '*', '/', '%', '!', '@', '&', '|', '^', '<', '>', '=', ',', ';', '?', ':' ), 'CASE_SENSITIVE' => array( GESHI_COMMENTS => false, 1 => false, 2 => false, 3 => false ), 'STYLES' => array( 'KEYWORDS' => array( 1 => 'color: #000066; font-weight: bold;', 2 => 'color: #003366; font-weight: bold;', 3 => 'color: #000066;' ), 'COMMENTS' => array( 1 => 'color: #006600; font-style: italic;', 2 => 'color: #009966; font-style: italic;', 'MULTI' => 'color: #006600; font-style: italic;' ), 'ESCAPE_CHAR' => array( 0 => 'color: #000099; font-weight: bold;' ), 'BRACKETS' => array( 0 => 'color: #009900;' ), 'STRINGS' => array( 0 => 'color: #3366CC;' ), 'NUMBERS' => array( 0 => 'color: #CC0000;' ), 'METHODS' => array( 1 => 'color: #660066;' ), 'SYMBOLS' => array( 0 => 'color: #339933;' ), 'REGEXPS' => array( ), 'SCRIPT' => array( 0 => '', 1 => '', 2 => '', 3 => '' ) ), 'URLS' => array( 1 => '', 2 => '', 3 => '' ), 'OOLANG' => true, 'OBJECT_SPLITTERS' => array( 1 => '.' ), 'REGEXPS' => array( ), 'STRICT_MODE_APPLIES' => GESHI_MAYBE, 'SCRIPT_DELIMITERS' => array( 0 => array( '' ), 1 => array( '' ) ), 'HIGHLIGHT_STRICT_BLOCK' => array( 0 => true, 1 => true ) ); ?> content/geshi/geshi/geshi/html4strict.php000066600000015330150771657550014535 0ustar00 'HTML', 'COMMENT_SINGLE' => array(), 'COMMENT_MULTI' => array(), 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE, 'QUOTEMARKS' => array("'", '"'), 'ESCAPE_CHAR' => '', 'KEYWORDS' => array( 2 => array( 'a', 'abbr', 'acronym', 'address', 'applet', 'base', 'basefont', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'b', 'caption', 'center', 'cite', 'code', 'colgroup', 'col', 'dd', 'del', 'dfn', 'dir', 'div', 'dl', 'dt', 'em', 'fieldset', 'font', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'hr', 'html', 'iframe', 'ilayer', 'img', 'input', 'ins', 'isindex', 'i', 'kbd', 'label', 'legend', 'link', 'li', 'map', 'meta', 'noframes', 'noscript', 'object', 'ol', 'optgroup', 'option', 'param', 'pre', 'p', 'q', 'samp', 'script', 'select', 'small', 'span', 'strike', 'strong', 'style', 'sub', 'sup', 's', 'table', 'tbody', 'td', 'textarea', 'text', 'tfoot', 'thead', 'th', 'title', 'tr', 'tt', 'ul', 'u', 'var', ), 3 => array( 'abbr', 'accept-charset', 'accept', 'accesskey', 'action', 'align', 'alink', 'alt', 'archive', 'axis', 'background', 'bgcolor', 'border', 'cellpadding', 'cellspacing', 'char', 'charoff', 'charset', 'checked', 'cite', 'class', 'classid', 'clear', 'code', 'codebase', 'codetype', 'color', 'cols', 'colspan', 'compact', 'content', 'coords', 'data', 'datetime', 'declare', 'defer', 'dir', 'disabled', 'enctype', 'face', 'for', 'frame', 'frameborder', 'headers', 'height', 'href', 'hreflang', 'hspace', 'http-equiv', 'id', 'ismap', 'label', 'lang', 'language', 'link', 'longdesc', 'marginheight', 'marginwidth', 'maxlength', 'media', 'method', 'multiple', 'name', 'nohref', 'noresize', 'noshade', 'nowrap', 'object', 'onblur', 'onchange', 'onclick', 'ondblclick', 'onfocus', 'onkeydown', 'onkeypress', 'onkeyup', 'onload', 'onmousedown', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onreset', 'onselect', 'onsubmit', 'onunload', 'profile', 'prompt', 'readonly', 'rel', 'rev', 'rowspan', 'rows', 'rules', 'scheme', 'scope', 'scrolling', 'selected', 'shape', 'size', 'span', 'src', 'standby', 'start', 'style', 'summary', 'tabindex', 'target', 'text', 'title', 'type', 'usemap', 'valign', 'value', 'valuetype', 'version', 'vlink', 'vspace', 'width' ) ), 'SYMBOLS' => array( '/', '=' ), 'CASE_SENSITIVE' => array( GESHI_COMMENTS => false, 2 => false, 3 => false, ), 'STYLES' => array( 'KEYWORDS' => array( 2 => 'color: #000000; font-weight: bold;', 3 => 'color: #000066;' ), 'COMMENTS' => array( ), 'ESCAPE_CHAR' => array( 0 => 'color: #000099; font-weight: bold;' ), 'BRACKETS' => array( 0 => 'color: #66cc66;' ), 'STRINGS' => array( 0 => 'color: #ff0000;' ), 'NUMBERS' => array( 0 => 'color: #cc66cc;' ), 'METHODS' => array( ), 'SYMBOLS' => array( 0 => 'color: #66cc66;' ), 'SCRIPT' => array( -2 => 'color: #404040;', // CDATA -1 => 'color: #808080; font-style: italic;', // comments 0 => 'color: #00bbdd;', 1 => 'color: #ddbb00;', 2 => 'color: #009900;' ), 'REGEXPS' => array( ) ), 'URLS' => array( 2 => 'http://december.com/html/4/element/{FNAMEL}.html', 3 => '' ), 'OOLANG' => false, 'OBJECT_SPLITTERS' => array( ), 'REGEXPS' => array( ), 'STRICT_MODE_APPLIES' => GESHI_ALWAYS, 'SCRIPT_DELIMITERS' => array( -2 => array( ' ']]>' ), -1 => array( '' ), 0 => array( ' '>' ), 1 => array( '&' => ';' ), 2 => array( '<' => '>' ) ), 'HIGHLIGHT_STRICT_BLOCK' => array( -2 => false, -1 => false, 0 => false, 1 => false, 2 => true ), 'TAB_WIDTH' => 4, 'PARSER_CONTROL' => array( 'KEYWORDS' => array( 2 => array( 'DISALLOWED_BEFORE' => '(?<=<|<\/)', 'DISALLOWED_AFTER' => '(?=\s|\/|>)', ) ) ) ); ?> content/geshi/geshi/geshi/xml.php000066600000011202150771657550013046 0ustar00 'XML', 'COMMENT_SINGLE' => array(), 'COMMENT_MULTI' => array(), 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE, 'QUOTEMARKS' => array("'", '"'), 'ESCAPE_CHAR' => '', 'KEYWORDS' => array( ), 'SYMBOLS' => array( ), 'CASE_SENSITIVE' => array( GESHI_COMMENTS => false, ), 'STYLES' => array( 'KEYWORDS' => array( ), 'COMMENTS' => array( ), 'ESCAPE_CHAR' => array( 0 => 'color: #000099; font-weight: bold;' ), 'BRACKETS' => array( 0 => 'color: #66cc66;' ), 'STRINGS' => array( 0 => 'color: #ff0000;' ), 'NUMBERS' => array( 0 => 'color: #cc66cc;' ), 'METHODS' => array( ), 'SYMBOLS' => array( 0 => 'color: #66cc66;' ), 'SCRIPT' => array( -1 => 'color: #808080; font-style: italic;', // comments 0 => 'color: #00bbdd;', 1 => 'color: #ddbb00;', 2 => 'color: #339933;', 3 => 'color: #009900;' ), 'REGEXPS' => array( 0 => 'color: #000066;', 1 => 'color: #000000; font-weight: bold;', 2 => 'color: #000000; font-weight: bold;' ) ), 'URLS' => array( ), 'OOLANG' => false, 'OBJECT_SPLITTERS' => array( ), 'REGEXPS' => array( 0 => array(//attribute names GESHI_SEARCH => '([a-z_:][\w\-\.:]*)(=)', GESHI_REPLACE => '\\1', GESHI_MODIFIERS => 'i', GESHI_BEFORE => '', GESHI_AFTER => '\\2' ), 1 => array(//Initial header line GESHI_SEARCH => '(<[\/?|(\?xml)]?[a-z_:][\w\-\.:]*(\??>)?)', GESHI_REPLACE => '\\1', GESHI_MODIFIERS => 'i', GESHI_BEFORE => '', GESHI_AFTER => '' ), 2 => array(//Tag end markers GESHI_SEARCH => '(([\/|\?])?>)', GESHI_REPLACE => '\\1', GESHI_MODIFIERS => 'i', GESHI_BEFORE => '', GESHI_AFTER => '' ), ), 'STRICT_MODE_APPLIES' => GESHI_ALWAYS, 'SCRIPT_DELIMITERS' => array( -1 => array( '' ), 0 => array( ' '>' ), 1 => array( '&' => ';' ), 2 => array( ' ']]>' ), 3 => array( '<' => '>' ) ), 'HIGHLIGHT_STRICT_BLOCK' => array( -1 => false, 0 => false, 1 => false, 2 => false, 3 => true ), 'TAB_WIDTH' => 2, 'PARSER_CONTROL' => array( 'ENABLE_FLAGS' => array( 'NUMBERS' => GESHI_NEVER ) ) ); ?> content/geshi/geshi/geshi/ini.php000066600000007462150771657550013042 0ustar00 'INI', 'COMMENT_SINGLE' => array(0 => ';'), 'COMMENT_MULTI' => array(), 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE, 'QUOTEMARKS' => array('"'), 'ESCAPE_CHAR' => '', 'KEYWORDS' => array( ), 'SYMBOLS' => array( '[', ']', '=' ), 'CASE_SENSITIVE' => array( GESHI_COMMENTS => false ), 'STYLES' => array( 'KEYWORDS' => array( ), 'COMMENTS' => array( 0 => 'color: #666666; font-style: italic;' ), 'ESCAPE_CHAR' => array( 0 => '' ), 'BRACKETS' => array( 0 => '' ), 'STRINGS' => array( 0 => 'color: #933;' ), 'NUMBERS' => array( 0 => '' ), 'METHODS' => array( 0 => '' ), 'SYMBOLS' => array( 0 => 'color: #000066; font-weight:bold;' ), 'REGEXPS' => array( 0 => 'color: #000066; font-weight:bold;', 1 => 'color: #000099;', 2 => 'color: #660066;' ), 'SCRIPT' => array( 0 => '' ) ), 'URLS' => array( ), 'OOLANG' => false, 'OBJECT_SPLITTERS' => array( ), 'REGEXPS' => array( //Section names 0 => '\[.+\]', //Entry names 1 => array( GESHI_SEARCH => '^(\s*)([a-zA-Z0-9_\-]+)(\s*=)', GESHI_REPLACE => '\\2', GESHI_MODIFIERS => 'm', GESHI_BEFORE => '\\1', GESHI_AFTER => '\\3' ), //Entry values 2 => array( // Evil hackery to get around GeSHi bug: <>" and ; are added so s can be matched // Explicit match on variable names because if a comment is before the first < of the span // gets chewed up... GESHI_SEARCH => '([<>";a-zA-Z0-9_]+\s*)=(.*)', GESHI_REPLACE => '\\2', GESHI_MODIFIERS => '', GESHI_BEFORE => '\\1=', GESHI_AFTER => '' ) ), 'STRICT_MODE_APPLIES' => GESHI_NEVER, 'SCRIPT_DELIMITERS' => array( ), 'HIGHLIGHT_STRICT_BLOCK' => array( ) ); ?> content/geshi/geshi/geshi/index.html000066600000000037150771657550013536 0ustar00 content/geshi/geshi/geshi/diff.php000066600000013375150771657550013173 0ustar00 'Diff', 'COMMENT_SINGLE' => array(), 'COMMENT_MULTI' => array(), 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE, 'QUOTEMARKS' => array(), 'ESCAPE_CHAR' => ' ', 'KEYWORDS' => array( 1 => array( '\ No newline at end of file' ), // 2 => array( // '***************' /* This only seems to works in some cases? */ // ), ), 'SYMBOLS' => array( ), 'CASE_SENSITIVE' => array( 1 => false, // 2 => false ), 'STYLES' => array( 'KEYWORDS' => array( 1 => 'color: #aaaaaa; font-style: italic;', // 2 => 'color: #dd6611;', ), 'COMMENTS' => array( ), 'ESCAPE_CHAR' => array( 0 => '' ), 'BRACKETS' => array( 0 => '' ), 'STRINGS' => array( 0 => '' ), 'NUMBERS' => array( 0 => '' ), 'METHODS' => array( 0 => '' ), 'SYMBOLS' => array( 0 => '' ), 'SCRIPT' => array( 0 => '' ), 'REGEXPS' => array( 0 => 'color: #440088;', 1 => 'color: #991111;', 2 => 'color: #00b000;', 3 => 'color: #888822;', 4 => 'color: #888822;', 5 => 'color: #0011dd;', 6 => 'color: #440088;', 7 => 'color: #991111;', 8 => 'color: #00b000;', 9 => 'color: #888822;', ), ), 'URLS' => array( 1 => '', // 2 => '' ), 'OOLANG' => false, 'OBJECT_SPLITTERS' => array(), 'REGEXPS' => array( 0 => "[0-9,]+[acd][0-9,]+", //Removed lines 1 => array( GESHI_SEARCH => '(^|(?<=\A\s))\\<.*$', GESHI_REPLACE => '\\0', GESHI_MODIFIERS => 'm', GESHI_BEFORE => '', GESHI_AFTER => '' ), //Inserted lines 2 => array( GESHI_SEARCH => '(^|(?<=\A\s))\\>.*$', GESHI_REPLACE => '\\0', GESHI_MODIFIERS => 'm', GESHI_BEFORE => '', GESHI_AFTER => '' ), //Location line 3 => array( GESHI_SEARCH => '(^|(?<=\A\s))-{3}\\s.*$', GESHI_REPLACE => '\\0', GESHI_MODIFIERS => 'm', GESHI_BEFORE => '', GESHI_AFTER => '' ), //Inserted line 4 => array( GESHI_SEARCH => '(^|(?<=\A\s))(\\+){3}\\s.*$', GESHI_REPLACE => '\\0', GESHI_MODIFIERS => 'm', GESHI_BEFORE => '', GESHI_AFTER => '' ), //Modified line 5 => array( GESHI_SEARCH => '(^|(?<=\A\s))\\!.*$', GESHI_REPLACE => '\\0', GESHI_MODIFIERS => 'm', GESHI_BEFORE => '', GESHI_AFTER => '' ), //File specification 6 => array( GESHI_SEARCH => '(^|(?<=\A\s))[\\@]{2}.*$', GESHI_REPLACE => '\\0', GESHI_MODIFIERS => 'm', GESHI_BEFORE => '', GESHI_AFTER => '' ), //Removed line 7 => array( GESHI_SEARCH => '(^|(?<=\A\s))\\-.*$', GESHI_REPLACE => '\\0', GESHI_MODIFIERS => 'm', GESHI_BEFORE => '', GESHI_AFTER => '' ), //Inserted line 8 => array( GESHI_SEARCH => '(^|(?<=\A\s))\\+.*$', GESHI_REPLACE => '\\0', GESHI_MODIFIERS => 'm', GESHI_BEFORE => '', GESHI_AFTER => '' ), //File specification 9 => array( GESHI_SEARCH => '(^|(?<=\A\s))(\\*){3}\\s.*$', GESHI_REPLACE => '\\0', GESHI_MODIFIERS => 'm', GESHI_BEFORE => '', GESHI_AFTER => '' ), ), 'STRICT_MODE_APPLIES' => GESHI_NEVER, 'SCRIPT_DELIMITERS' => array( ), 'HIGHLIGHT_STRICT_BLOCK' => array( ) ); ?> content/geshi/geshi/geshi/php-brief.php000066600000037020150771657550014130 0ustar00 'PHP (brief)', 'COMMENT_SINGLE' => array(1 => '//', 2 => '#'), 'COMMENT_MULTI' => array('/*' => '*/'), //Heredoc and Nowdoc syntax 'COMMENT_REGEXP' => array(3 => '/<<<\s*?(\'?)([a-zA-Z0-9]+)\1[^\n]*?\\n.*\\n\\2(?![a-zA-Z0-9])/siU'), 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE, 'QUOTEMARKS' => array("'", '"'), 'ESCAPE_CHAR' => '\\', 'HARDQUOTE' => array("'", "'"), 'HARDESCAPE' => array("\'"), 'NUMBERS' => GESHI_NUMBER_INT_BASIC | GESHI_NUMBER_OCT_PREFIX | GESHI_NUMBER_HEX_PREFIX | GESHI_NUMBER_FLT_SCI_ZERO, 'KEYWORDS' => array( 1 => array( 'include', 'require', 'include_once', 'require_once', 'for', 'as', 'foreach', 'if', 'elseif', 'else', 'while', 'do', 'endwhile', 'endif', 'switch', 'case', 'endswitch', 'return', 'break' ), 2 => array( 'null', '__LINE__', '__FILE__', 'false', '<?php', 'true', 'var', 'default', 'function', 'class', 'new', '&new', 'public', 'private', 'interface', 'extends', 'const', 'self' ), 3 => array( 'func_num_args', 'func_get_arg', 'func_get_args', 'strlen', 'strcmp', 'strncmp', 'strcasecmp', 'strncasecmp', 'each', 'error_reporting', 'define', 'defined', 'trigger_error', 'user_error', 'set_error_handler', 'restore_error_handler', 'get_declared_classes', 'get_loaded_extensions', 'extension_loaded', 'get_extension_funcs', 'debug_backtrace', 'constant', 'bin2hex', 'sleep', 'usleep', 'time', 'mktime', 'gmmktime', 'strftime', 'gmstrftime', 'strtotime', 'date', 'gmdate', 'getdate', 'localtime', 'checkdate', 'flush', 'wordwrap', 'htmlspecialchars', 'htmlentities', 'html_entity_decode', 'md5', 'md5_file', 'crc32', 'getimagesize', 'image_type_to_mime_type', 'phpinfo', 'phpversion', 'phpcredits', 'strnatcmp', 'strnatcasecmp', 'substr_count', 'strspn', 'strcspn', 'strtok', 'strtoupper', 'strtolower', 'strpos', 'strrpos', 'strrev', 'hebrev', 'hebrevc', 'nl2br', 'basename', 'dirname', 'pathinfo', 'stripslashes', 'stripcslashes', 'strstr', 'stristr', 'strrchr', 'str_shuffle', 'str_word_count', 'strcoll', 'substr', 'substr_replace', 'quotemeta', 'ucfirst', 'ucwords', 'strtr', 'addslashes', 'addcslashes', 'rtrim', 'str_replace', 'str_repeat', 'count_chars', 'chunk_split', 'trim', 'ltrim', 'strip_tags', 'similar_text', 'explode', 'implode', 'setlocale', 'localeconv', 'parse_str', 'str_pad', 'chop', 'strchr', 'sprintf', 'printf', 'vprintf', 'vsprintf', 'sscanf', 'fscanf', 'parse_url', 'urlencode', 'urldecode', 'rawurlencode', 'rawurldecode', 'readlink', 'linkinfo', 'link', 'unlink', 'exec', 'system', 'escapeshellcmd', 'escapeshellarg', 'passthru', 'shell_exec', 'proc_open', 'proc_close', 'rand', 'srand', 'getrandmax', 'mt_rand', 'mt_srand', 'mt_getrandmax', 'base64_decode', 'base64_encode', 'abs', 'ceil', 'floor', 'round', 'is_finite', 'is_nan', 'is_infinite', 'bindec', 'hexdec', 'octdec', 'decbin', 'decoct', 'dechex', 'base_convert', 'number_format', 'fmod', 'ip2long', 'long2ip', 'getenv', 'putenv', 'getopt', 'microtime', 'gettimeofday', 'getrusage', 'uniqid', 'quoted_printable_decode', 'set_time_limit', 'get_cfg_var', 'magic_quotes_runtime', 'set_magic_quotes_runtime', 'get_magic_quotes_gpc', 'get_magic_quotes_runtime', 'import_request_variables', 'error_log', 'serialize', 'unserialize', 'memory_get_usage', 'var_dump', 'var_export', 'debug_zval_dump', 'print_r','highlight_file', 'show_source', 'highlight_string', 'ini_get', 'ini_get_all', 'ini_set', 'ini_alter', 'ini_restore', 'get_include_path', 'set_include_path', 'restore_include_path', 'setcookie', 'header', 'headers_sent', 'connection_aborted', 'connection_status', 'ignore_user_abort', 'parse_ini_file', 'is_uploaded_file', 'move_uploaded_file', 'intval', 'floatval', 'doubleval', 'strval', 'gettype', 'settype', 'is_null', 'is_resource', 'is_bool', 'is_long', 'is_float', 'is_int', 'is_integer', 'is_double', 'is_real', 'is_numeric', 'is_string', 'is_array', 'is_object', 'is_scalar', 'ereg', 'ereg_replace', 'eregi', 'eregi_replace', 'split', 'spliti', 'join', 'sql_regcase', 'dl', 'pclose', 'popen', 'readfile', 'rewind', 'rmdir', 'umask', 'fclose', 'feof', 'fgetc', 'fgets', 'fgetss', 'fread', 'fopen', 'fpassthru', 'ftruncate', 'fstat', 'fseek', 'ftell', 'fflush', 'fwrite', 'fputs', 'mkdir', 'rename', 'copy', 'tempnam', 'tmpfile', 'file', 'file_get_contents', 'stream_select', 'stream_context_create', 'stream_context_set_params', 'stream_context_set_option', 'stream_context_get_options', 'stream_filter_prepend', 'stream_filter_append', 'fgetcsv', 'flock', 'get_meta_tags', 'stream_set_write_buffer', 'set_file_buffer', 'set_socket_blocking', 'stream_set_blocking', 'socket_set_blocking', 'stream_get_meta_data', 'stream_register_wrapper', 'stream_wrapper_register', 'stream_set_timeout', 'socket_set_timeout', 'socket_get_status', 'realpath', 'fnmatch', 'fsockopen', 'pfsockopen', 'pack', 'unpack', 'get_browser', 'crypt', 'opendir', 'closedir', 'chdir', 'getcwd', 'rewinddir', 'readdir', 'dir', 'glob', 'fileatime', 'filectime', 'filegroup', 'fileinode', 'filemtime', 'fileowner', 'fileperms', 'filesize', 'filetype', 'file_exists', 'is_writable', 'is_writeable', 'is_readable', 'is_executable', 'is_file', 'is_dir', 'is_link', 'stat', 'lstat', 'chown', 'touch', 'clearstatcache', 'mail', 'ob_start', 'ob_flush', 'ob_clean', 'ob_end_flush', 'ob_end_clean', 'ob_get_flush', 'ob_get_clean', 'ob_get_length', 'ob_get_level', 'ob_get_status', 'ob_get_contents', 'ob_implicit_flush', 'ob_list_handlers', 'ksort', 'krsort', 'natsort', 'natcasesort', 'asort', 'arsort', 'sort', 'rsort', 'usort', 'uasort', 'uksort', 'shuffle', 'array_walk', 'count', 'end', 'prev', 'next', 'reset', 'current', 'key', 'min', 'max', 'in_array', 'array_search', 'extract', 'compact', 'array_fill', 'range', 'array_multisort', 'array_push', 'array_pop', 'array_shift', 'array_unshift', 'array_splice', 'array_slice', 'array_merge', 'array_merge_recursive', 'array_keys', 'array_values', 'array_count_values', 'array_reverse', 'array_reduce', 'array_pad', 'array_flip', 'array_change_key_case', 'array_rand', 'array_unique', 'array_intersect', 'array_intersect_assoc', 'array_diff', 'array_diff_assoc', 'array_sum', 'array_filter', 'array_map', 'array_chunk', 'array_key_exists', 'pos', 'sizeof', 'key_exists', 'assert', 'assert_options', 'version_compare', 'ftok', 'str_rot13', 'aggregate', 'session_name', 'session_module_name', 'session_save_path', 'session_id', 'session_regenerate_id', 'session_decode', 'session_register', 'session_unregister', 'session_is_registered', 'session_encode', 'session_start', 'session_destroy', 'session_unset', 'session_set_save_handler', 'session_cache_limiter', 'session_cache_expire', 'session_set_cookie_params', 'session_get_cookie_params', 'session_write_close', 'preg_match', 'preg_match_all', 'preg_replace', 'preg_replace_callback', 'preg_split', 'preg_quote', 'preg_grep', 'overload', 'ctype_alnum', 'ctype_alpha', 'ctype_cntrl', 'ctype_digit', 'ctype_lower', 'ctype_graph', 'ctype_print', 'ctype_punct', 'ctype_space', 'ctype_upper', 'ctype_xdigit', 'virtual', 'apache_request_headers', 'apache_note', 'apache_lookup_uri', 'apache_child_terminate', 'apache_setenv', 'apache_response_headers', 'apache_get_version', 'getallheaders', 'mysql_connect', 'mysql_pconnect', 'mysql_close', 'mysql_select_db', 'mysql_create_db', 'mysql_drop_db', 'mysql_query', 'mysql_unbuffered_query', 'mysql_db_query', 'mysql_list_dbs', 'mysql_list_tables', 'mysql_list_fields', 'mysql_list_processes', 'mysql_error', 'mysql_errno', 'mysql_affected_rows', 'mysql_insert_id', 'mysql_result', 'mysql_num_rows', 'mysql_num_fields', 'mysql_fetch_row', 'mysql_fetch_array', 'mysql_fetch_assoc', 'mysql_fetch_object', 'mysql_data_seek', 'mysql_fetch_lengths', 'mysql_fetch_field', 'mysql_field_seek', 'mysql_free_result', 'mysql_field_name', 'mysql_field_table', 'mysql_field_len', 'mysql_field_type', 'mysql_field_flags', 'mysql_escape_string', 'mysql_real_escape_string', 'mysql_stat', 'mysql_thread_id', 'mysql_client_encoding', 'mysql_get_client_info', 'mysql_get_host_info', 'mysql_get_proto_info', 'mysql_get_server_info', 'mysql_info', 'mysql', 'mysql_fieldname', 'mysql_fieldtable', 'mysql_fieldlen', 'mysql_fieldtype', 'mysql_fieldflags', 'mysql_selectdb', 'mysql_createdb', 'mysql_dropdb', 'mysql_freeresult', 'mysql_numfields', 'mysql_numrows', 'mysql_listdbs', 'mysql_listtables', 'mysql_listfields', 'mysql_db_name', 'mysql_dbname', 'mysql_tablename', 'mysql_table_name', 'pg_connect', 'pg_pconnect', 'pg_close', 'pg_connection_status', 'pg_connection_busy', 'pg_connection_reset', 'pg_host', 'pg_dbname', 'pg_port', 'pg_tty', 'pg_options', 'pg_ping', 'pg_query', 'pg_send_query', 'pg_cancel_query', 'pg_fetch_result', 'pg_fetch_row', 'pg_fetch_assoc', 'pg_fetch_array', 'pg_fetch_object', 'pg_fetch_all', 'pg_affected_rows', 'pg_get_result', 'pg_result_seek', 'pg_result_status', 'pg_free_result', 'pg_last_oid', 'pg_num_rows', 'pg_num_fields', 'pg_field_name', 'pg_field_num', 'pg_field_size', 'pg_field_type', 'pg_field_prtlen', 'pg_field_is_null', 'pg_get_notify', 'pg_get_pid', 'pg_result_error', 'pg_last_error', 'pg_last_notice', 'pg_put_line', 'pg_end_copy', 'pg_copy_to', 'pg_copy_from', 'pg_trace', 'pg_untrace', 'pg_lo_create', 'pg_lo_unlink', 'pg_lo_open', 'pg_lo_close', 'pg_lo_read', 'pg_lo_write', 'pg_lo_read_all', 'pg_lo_import', 'pg_lo_export', 'pg_lo_seek', 'pg_lo_tell', 'pg_escape_string', 'pg_escape_bytea', 'pg_unescape_bytea', 'pg_client_encoding', 'pg_set_client_encoding', 'pg_meta_data', 'pg_convert', 'pg_insert', 'pg_update', 'pg_delete', 'pg_select', 'pg_exec', 'pg_getlastoid', 'pg_cmdtuples', 'pg_errormessage', 'pg_numrows', 'pg_numfields', 'pg_fieldname', 'pg_fieldsize', 'pg_fieldtype', 'pg_fieldnum', 'pg_fieldprtlen', 'pg_fieldisnull', 'pg_freeresult', 'pg_result', 'pg_loreadall', 'pg_locreate', 'pg_lounlink', 'pg_loopen', 'pg_loclose', 'pg_loread', 'pg_lowrite', 'pg_loimport', 'pg_loexport', 'echo', 'print', 'global', 'static', 'exit', 'array', 'empty', 'eval', 'isset', 'unset', 'die' ) ), 'SYMBOLS' => array( 1 => array( '<%', '<%=', '%>', '' ), 0 => array( '(', ')', '[', ']', '{', '}', '!', '@', '%', '&', '|', '/', '<', '>', '=', '-', '+', '*', '.', ':', ',', ';' ) ), 'CASE_SENSITIVE' => array( GESHI_COMMENTS => false, 1 => false, 2 => false, 3 => false ), 'STYLES' => array( 'KEYWORDS' => array( 1 => 'color: #b1b100;', 2 => 'color: #000000; font-weight: bold;', 3 => 'color: #990000;' ), 'COMMENTS' => array( 1 => 'color: #666666; font-style: italic;', 2 => 'color: #666666; font-style: italic;', 3 => 'color: #0000cc; font-style: italic;', 'MULTI' => 'color: #666666; font-style: italic;' ), 'ESCAPE_CHAR' => array( 0 => 'color: #000099; font-weight: bold;', 'HARD' => 'color: #000099; font-weight: bold;' ), 'BRACKETS' => array( 0 => 'color: #009900;' ), 'STRINGS' => array( 0 => 'color: #0000ff;', 'HARD' => 'color: #0000ff;' ), 'NUMBERS' => array( 0 => 'color: #cc66cc;', GESHI_NUMBER_OCT_PREFIX => 'color: #208080;', GESHI_NUMBER_HEX_PREFIX => 'color: #208080;', GESHI_NUMBER_FLT_SCI_ZERO => 'color:#800080;', ), 'METHODS' => array( 1 => 'color: #004000;', 2 => 'color: #004000;' ), 'SYMBOLS' => array( 0 => 'color: #339933;', 1 => 'color: #000000; font-weight: bold;' ), 'REGEXPS' => array( 0 => 'color: #0000ff;' ), 'SCRIPT' => array( 0 => '', 1 => '', 2 => '', 3 => '', 4 => '', 5 => '' ) ), 'URLS' => array( 1 => '', 2 => '', 3 => 'http://www.php.net/{FNAMEL}' ), 'OOLANG' => true, 'OBJECT_SPLITTERS' => array( 1 => '->', 2 => '::' ), 'REGEXPS' => array( //Variables 0 => "[\\$]{1,2}[a-zA-Z_][a-zA-Z0-9_]*" ), 'STRICT_MODE_APPLIES' => GESHI_MAYBE, 'SCRIPT_DELIMITERS' => array( 0 => array( ' '?>' ), 1 => array( ' '?>' ), 2 => array( '<%' => '%>' ), 3 => array( '' ), 4 => "/(?P<\\?(?>php\b)?)(?:". "(?>[^\"'?\\/<]+)|". "\\?(?!>)|". "(?>'(?>[^'\\\\]|\\\\'|\\\\\\\|\\\\)*')|". "(?>\"(?>[^\"\\\\]|\\\\\"|\\\\\\\\|\\\\)*\")|". "(?>\\/\\*(?>[^\\*]|(?!\\*\\/)\\*)*\\*\\/)|". "\\/\\/(?>.*?$)|". "\\/(?=[^*\\/])|". "<(?!<<)|". "<<<(?P\w+)\s.*?\s\k". ")*(?P\\?>|\Z)/sm", 5 => "/(?P<%)(?:". "(?>[^\"'%\\/<]+)|". "%(?!>)|". "(?>'(?>[^'\\\\]|\\\\'|\\\\\\\|\\\\)*')|". "(?>\"(?>[^\\\"\\\\]|\\\\\"|\\\\\\\\|\\\\)*\")|". "(?>\\/\\*(?>[^\\*]|(?!\\*\\/)\\*)*\\*\\/)|". "\\/\\/(?>.*?$)|". "\\/(?=[^*\\/])|". "<(?!<<)|". "<<<(?P\w+)\s.*?\s\k". ")*(?P%>)/sm" ), 'HIGHLIGHT_STRICT_BLOCK' => array( 0 => true, 1 => true, 2 => true, 3 => true, 4 => true, 5 => true ), 'TAB_WIDTH' => 4 ); ?> content/geshi/geshi/geshi/sql.php000066600000015277150771657550013065 0ustar00 'SQL', 'COMMENT_SINGLE' => array(1 =>'--'), 'COMMENT_MULTI' => array('/*' => '*/'), 'CASE_KEYWORDS' => 1, 'QUOTEMARKS' => array("'", '"', '`'), 'ESCAPE_CHAR' => '\\', 'KEYWORDS' => array( 1 => array( 'ADD', 'ALL', 'ALTER', 'AND', 'AS', 'ASC', 'AUTO_INCREMENT', 'BEFORE', 'BEGIN', 'BETWEEN', 'BIGINT', 'BINARY', 'BLOB', 'BOOLEAN', 'BOTH', 'BY', 'CALL', 'CASE', 'CAST', 'CEIL', 'CEILING', 'CHANGE', 'CHAR', 'CHAR_LENGTH', 'CHARACTER', 'CHARACTER_LENGTH', 'CHECK', 'CLOB', 'COALESCE', 'COLLATE', 'COLUMN', 'COLUMNS', 'CONNECT', 'CONSTRAINT', 'CONVERT', 'COUNT', 'CREATE', 'CROSS', 'CURRENT', 'CURRENT_DATE', 'CURRENT_TIME', 'CURRENT_TIMESTAMP', 'CURRENT_USER', 'DATA', 'DATABASE', 'DATABASES', 'DATE', 'DAY', 'DEC', 'DECIMAL', 'DECLARE', 'DEFAULT', 'DELAYED', 'DELETE', 'DESC', 'DESCRIBE', 'DISTINCT', 'DOUBLE', 'DOMAIN', 'DROP', 'ELSE', 'ENCLOSED', 'END', 'ESCAPED', 'EXCEPT', 'EXEC', 'EXECUTE', 'EXISTS', 'EXP', 'EXPLAIN', 'EXTRACT', 'FALSE', 'FIELD', 'FIELDS', 'FILTER', 'FIRST', 'FLOAT', 'FLOOR', 'FLUSH', 'FOR', 'FOREIGN', 'FROM', 'FULL', 'FUNCTION', 'GET', 'GROUP', 'GROUPING', 'GO', 'GOTO', 'GRANT', 'GRANTED', 'HAVING', 'HOUR', 'IDENTIFIED', 'IDENTITY', 'IF', 'IGNORE', 'IN', 'INCREMENT', 'INDEX', 'INFILE', 'INNER', 'INOUT', 'INPUT', 'INSERT', 'INT', 'INTEGER', 'INTERSECT', 'INTERSECTION', 'INTERVAL', 'INTO', 'IS', 'JOIN', 'KEY', 'KEYS', 'KILL', 'LANGUAGE', 'LARGE', 'LAST', 'LEADING', 'LEFT', 'LENGTH', 'LIKE', 'LIMIT', 'LINES', 'LOAD', 'LOCAL', 'LOCK', 'LOW_PRIORITY', 'LOWER', 'MATCH', 'MAX', 'MERGE', 'MIN', 'MINUTE', 'MOD', 'MODIFIES', 'MODIFY', 'MONTH', 'NATIONAL', 'NATURAL', 'NCHAR', 'NEW', 'NEXT', 'NEXTVAL', 'NONE', 'NOT', 'NULL', 'NULLABLE', 'NULLIF', 'NULLS', 'NUMBER', 'NUMERIC', 'OF', 'OLD', 'ON', 'ONLY', 'OPEN', 'OPTIMIZE', 'OPTION', 'OPTIONALLY', 'OR', 'ORDER', 'OUT', 'OUTER', 'OUTFILE', 'OVER', 'POSITION', 'POWER', 'PRECISION', 'PREPARE', 'PRIMARY', 'PROCEDURAL', 'PROCEDURE', 'READ', 'REAL', 'REF', 'REFERENCES', 'REFERENCING', 'REGEXP', 'RENAME', 'REPLACE', 'RESULT', 'RETURN', 'RETURNS', 'REVOKE', 'RIGHT', 'RLIKE', 'ROLLBACK', 'ROW', 'ROW_NUMBER', 'ROWS', 'RESTRICT', 'ROLE', 'ROUTINE', 'ROW_COUNT', 'SAVEPOINT', 'SEARCH', 'SECOND', 'SECTION', 'SELECT', 'SELF', 'SEQUENCE', 'SESSION', 'SET', 'SETVAL', 'SHOW', 'SIMILAR', 'SIZE', 'SMALLINT', 'SOME', 'SONAME', 'SOURCE', 'SPACE', 'SQL', 'SQRT', 'START', 'STATUS', 'STRAIGHT_JOIN', 'STRUCTURE', 'STYLE', 'SUBSTRING', 'SUM', 'TABLE', 'TABLE_NAME', 'TABLES', 'TERMINATED', 'TEMPORARY', 'THEN', 'TIME', 'TIMESTAMP', 'TO', 'TRAILING', 'TRANSACTION', 'TRIGGER', 'TRIM', 'TRUE', 'TRUNCATE', 'TRUSTED', 'TYPE', 'UNDER', 'UNION', 'UNIQUE', 'UNKNOWN', 'UNLOCK', 'UNSIGNED', 'UPDATE', 'UPPER', 'USE', 'USER', 'USING', 'VALUE', 'VALUES', 'VARCHAR', 'VARIABLES', 'VARYING', 'VIEW', 'WHEN', 'WHERE', 'WITH', 'WITHIN', 'WITHOUT', 'WORK', 'WRITE', 'XOR', 'YEAR', 'ZEROFILL' ) ), 'SYMBOLS' => array( '(', ')', '=', '<', '>', '|', ',', '.', '+', '-', '*', '/' ), 'CASE_SENSITIVE' => array( GESHI_COMMENTS => false, 1 => false ), 'STYLES' => array( 'KEYWORDS' => array( 1 => 'color: #993333; font-weight: bold;' ), 'COMMENTS' => array( 1 => 'color: #808080; font-style: italic;', //2 => 'color: #808080; font-style: italic;', 'MULTI' => 'color: #808080; font-style: italic;' ), 'ESCAPE_CHAR' => array( 0 => 'color: #000099; font-weight: bold;' ), 'BRACKETS' => array( 0 => 'color: #66cc66;' ), 'STRINGS' => array( 0 => 'color: #ff0000;' ), 'NUMBERS' => array( 0 => 'color: #cc66cc;' ), 'METHODS' => array( ), 'SYMBOLS' => array( 0 => 'color: #66cc66;' ), 'SCRIPT' => array( ), 'REGEXPS' => array( ) ), 'URLS' => array( 1 => '' ), 'OOLANG' => false, 'OBJECT_SPLITTERS' => array( ), 'REGEXPS' => array( ), 'STRICT_MODE_APPLIES' => GESHI_NEVER, 'SCRIPT_DELIMITERS' => array( ), 'HIGHLIGHT_STRICT_BLOCK' => array( ) ); ?> content/geshi/geshi/index.html000066600000000037150771657550012437 0ustar00 content/geshi/geshi/geshi.php000066600000616540150771657550012266 0ustar00, Benny Baumann * @copyright (C) 2004 - 2007 Nigel McNie, (C) 2007 - 2008 Benny Baumann * @license http://gnu.org/copyleft/gpl.html GNU GPL * */ // // GeSHi Constants // You should use these constant names in your programs instead of // their values - you never know when a value may change in a future // version // /** The version of this GeSHi file */ define('GESHI_VERSION', '1.0.8.10'); // Define the root directory for the GeSHi code tree if (!defined('GESHI_ROOT')) { /** The root directory for GeSHi */ define('GESHI_ROOT', dirname(__FILE__) . DIRECTORY_SEPARATOR); } /** The language file directory for GeSHi @access private */ define('GESHI_LANG_ROOT', GESHI_ROOT . 'geshi' . DIRECTORY_SEPARATOR); // Define if GeSHi should be paranoid about security if (!defined('GESHI_SECURITY_PARANOID')) { /** Tells GeSHi to be paranoid about security settings */ define('GESHI_SECURITY_PARANOID', false); } // Line numbers - use with enable_line_numbers() /** Use no line numbers when building the result */ define('GESHI_NO_LINE_NUMBERS', 0); /** Use normal line numbers when building the result */ define('GESHI_NORMAL_LINE_NUMBERS', 1); /** Use fancy line numbers when building the result */ define('GESHI_FANCY_LINE_NUMBERS', 2); // Container HTML type /** Use nothing to surround the source */ define('GESHI_HEADER_NONE', 0); /** Use a "div" to surround the source */ define('GESHI_HEADER_DIV', 1); /** Use a "pre" to surround the source */ define('GESHI_HEADER_PRE', 2); /** Use a pre to wrap lines when line numbers are enabled or to wrap the whole code. */ define('GESHI_HEADER_PRE_VALID', 3); /** * Use a "table" to surround the source: * * * * * *
$header
$linenumbers
$code>
$footer
* * this is essentially only a workaround for Firefox, see sf#1651996 or take a look at * https://bugzilla.mozilla.org/show_bug.cgi?id=365805 * @note when linenumbers are disabled this is essentially the same as GESHI_HEADER_PRE */ define('GESHI_HEADER_PRE_TABLE', 4); // Capatalisation constants /** Lowercase keywords found */ define('GESHI_CAPS_NO_CHANGE', 0); /** Uppercase keywords found */ define('GESHI_CAPS_UPPER', 1); /** Leave keywords found as the case that they are */ define('GESHI_CAPS_LOWER', 2); // Link style constants /** Links in the source in the :link state */ define('GESHI_LINK', 0); /** Links in the source in the :hover state */ define('GESHI_HOVER', 1); /** Links in the source in the :active state */ define('GESHI_ACTIVE', 2); /** Links in the source in the :visited state */ define('GESHI_VISITED', 3); // Important string starter/finisher // Note that if you change these, they should be as-is: i.e., don't // write them as if they had been run through htmlentities() /** The starter for important parts of the source */ define('GESHI_START_IMPORTANT', ''); /** The ender for important parts of the source */ define('GESHI_END_IMPORTANT', ''); /**#@+ * @access private */ // When strict mode applies for a language /** Strict mode never applies (this is the most common) */ define('GESHI_NEVER', 0); /** Strict mode *might* apply, and can be enabled or disabled by {@link GeSHi->enable_strict_mode()} */ define('GESHI_MAYBE', 1); /** Strict mode always applies */ define('GESHI_ALWAYS', 2); // Advanced regexp handling constants, used in language files /** The key of the regex array defining what to search for */ define('GESHI_SEARCH', 0); /** The key of the regex array defining what bracket group in a matched search to use as a replacement */ define('GESHI_REPLACE', 1); /** The key of the regex array defining any modifiers to the regular expression */ define('GESHI_MODIFIERS', 2); /** The key of the regex array defining what bracket group in a matched search to put before the replacement */ define('GESHI_BEFORE', 3); /** The key of the regex array defining what bracket group in a matched search to put after the replacement */ define('GESHI_AFTER', 4); /** The key of the regex array defining a custom keyword to use for this regexp's html tag class */ define('GESHI_CLASS', 5); /** Used in language files to mark comments */ define('GESHI_COMMENTS', 0); /** Used to work around missing PHP features **/ define('GESHI_PHP_PRE_433', !(version_compare(PHP_VERSION, '4.3.3') === 1)); /** make sure we can call stripos **/ if (!function_exists('stripos')) { // the offset param of preg_match is not supported below PHP 4.3.3 if (GESHI_PHP_PRE_433) { /** * @ignore */ function stripos($haystack, $needle, $offset = null) { if (!is_null($offset)) { $haystack = substr($haystack, $offset); } if (preg_match('/'. preg_quote($needle, '/') . '/', $haystack, $match, PREG_OFFSET_CAPTURE)) { return $match[0][1]; } return false; } } else { /** * @ignore */ function stripos($haystack, $needle, $offset = null) { if (preg_match('/'. preg_quote($needle, '/') . '/', $haystack, $match, PREG_OFFSET_CAPTURE, $offset)) { return $match[0][1]; } return false; } } } /** some old PHP / PCRE subpatterns only support up to xxx subpatterns in regular expressions. Set this to false if your PCRE lib is up to date @see GeSHi->optimize_regexp_list() **/ define('GESHI_MAX_PCRE_SUBPATTERNS', 500); /** it's also important not to generate too long regular expressions be generous here... but keep in mind, that when reaching this limit we still have to close open patterns. 12k should do just fine on a 16k limit. @see GeSHi->optimize_regexp_list() **/ define('GESHI_MAX_PCRE_LENGTH', 12288); //Number format specification /** Basic number format for integers */ define('GESHI_NUMBER_INT_BASIC', 1); //Default integers \d+ /** Enhanced number format for integers like seen in C */ define('GESHI_NUMBER_INT_CSTYLE', 2); //Default C-Style \d+[lL]? /** Number format to highlight binary numbers with a suffix "b" */ define('GESHI_NUMBER_BIN_SUFFIX', 16); //[01]+[bB] /** Number format to highlight binary numbers with a prefix % */ define('GESHI_NUMBER_BIN_PREFIX_PERCENT', 32); //%[01]+ /** Number format to highlight binary numbers with a prefix 0b (C) */ define('GESHI_NUMBER_BIN_PREFIX_0B', 64); //0b[01]+ /** Number format to highlight octal numbers with a leading zero */ define('GESHI_NUMBER_OCT_PREFIX', 256); //0[0-7]+ /** Number format to highlight octal numbers with a prefix 0o (logtalk) */ define('GESHI_NUMBER_OCT_PREFIX_0O', 512); //0[0-7]+ /** Number format to highlight octal numbers with a leading @ (Used in HiSofts Devpac series). */ define('GESHI_NUMBER_OCT_PREFIX_AT', 1024); //@[0-7]+ /** Number format to highlight octal numbers with a suffix of o */ define('GESHI_NUMBER_OCT_SUFFIX', 2048); //[0-7]+[oO] /** Number format to highlight hex numbers with a prefix 0x */ define('GESHI_NUMBER_HEX_PREFIX', 4096); //0x[0-9a-fA-F]+ /** Number format to highlight hex numbers with a prefix $ */ define('GESHI_NUMBER_HEX_PREFIX_DOLLAR', 8192); //$[0-9a-fA-F]+ /** Number format to highlight hex numbers with a suffix of h */ define('GESHI_NUMBER_HEX_SUFFIX', 16384); //[0-9][0-9a-fA-F]*h /** Number format to highlight floating-point numbers without support for scientific notation */ define('GESHI_NUMBER_FLT_NONSCI', 65536); //\d+\.\d+ /** Number format to highlight floating-point numbers without support for scientific notation */ define('GESHI_NUMBER_FLT_NONSCI_F', 131072); //\d+(\.\d+)?f /** Number format to highlight floating-point numbers with support for scientific notation (E) and optional leading zero */ define('GESHI_NUMBER_FLT_SCI_SHORT', 262144); //\.\d+e\d+ /** Number format to highlight floating-point numbers with support for scientific notation (E) and required leading digit */ define('GESHI_NUMBER_FLT_SCI_ZERO', 524288); //\d+(\.\d+)?e\d+ //Custom formats are passed by RX array // Error detection - use these to analyse faults /** No sourcecode to highlight was specified * @deprecated */ define('GESHI_ERROR_NO_INPUT', 1); /** The language specified does not exist */ define('GESHI_ERROR_NO_SUCH_LANG', 2); /** GeSHi could not open a file for reading (generally a language file) */ define('GESHI_ERROR_FILE_NOT_READABLE', 3); /** The header type passed to {@link GeSHi->set_header_type()} was invalid */ define('GESHI_ERROR_INVALID_HEADER_TYPE', 4); /** The line number type passed to {@link GeSHi->enable_line_numbers()} was invalid */ define('GESHI_ERROR_INVALID_LINE_NUMBER_TYPE', 5); /**#@-*/ /** * The GeSHi Class. * * Please refer to the documentation for GeSHi 1.0.X that is available * at http://qbnz.com/highlighter/documentation.php for more information * about how to use this class. * * @package geshi * @author Nigel McNie , Benny Baumann * @copyright (C) 2004 - 2007 Nigel McNie, (C) 2007 - 2008 Benny Baumann */ class GeSHi { /**#@+ * @access private */ /** * The source code to highlight * @var string */ var $source = ''; /** * The language to use when highlighting * @var string */ var $language = ''; /** * The data for the language used * @var array */ var $language_data = array(); /** * The path to the language files * @var string */ var $language_path = GESHI_LANG_ROOT; /** * The error message associated with an error * @var string * @todo check err reporting works */ var $error = false; /** * Possible error messages * @var array */ var $error_messages = array( GESHI_ERROR_NO_SUCH_LANG => 'GeSHi could not find the language {LANGUAGE} (using path {PATH})', GESHI_ERROR_FILE_NOT_READABLE => 'The file specified for load_from_file was not readable', GESHI_ERROR_INVALID_HEADER_TYPE => 'The header type specified is invalid', GESHI_ERROR_INVALID_LINE_NUMBER_TYPE => 'The line number type specified is invalid' ); /** * Whether highlighting is strict or not * @var boolean */ var $strict_mode = false; /** * Whether to use CSS classes in output * @var boolean */ var $use_classes = false; /** * The type of header to use. Can be one of the following * values: * * - GESHI_HEADER_PRE: Source is outputted in a "pre" HTML element. * - GESHI_HEADER_DIV: Source is outputted in a "div" HTML element. * - GESHI_HEADER_NONE: No header is outputted. * * @var int */ var $header_type = GESHI_HEADER_PRE; /** * Array of permissions for which lexics should be highlighted * @var array */ var $lexic_permissions = array( 'KEYWORDS' => array(), 'COMMENTS' => array('MULTI' => true), 'REGEXPS' => array(), 'ESCAPE_CHAR' => true, 'BRACKETS' => true, 'SYMBOLS' => false, 'STRINGS' => true, 'NUMBERS' => true, 'METHODS' => true, 'SCRIPT' => true ); /** * The time it took to parse the code * @var double */ var $time = 0; /** * The content of the header block * @var string */ var $header_content = ''; /** * The content of the footer block * @var string */ var $footer_content = ''; /** * The style of the header block * @var string */ var $header_content_style = ''; /** * The style of the footer block * @var string */ var $footer_content_style = ''; /** * Tells if a block around the highlighted source should be forced * if not using line numbering * @var boolean */ var $force_code_block = false; /** * The styles for hyperlinks in the code * @var array */ var $link_styles = array(); /** * Whether important blocks should be recognised or not * @var boolean * @deprecated * @todo REMOVE THIS FUNCTIONALITY! */ var $enable_important_blocks = false; /** * Styles for important parts of the code * @var string * @deprecated * @todo As above - rethink the whole idea of important blocks as it is buggy and * will be hard to implement in 1.2 */ var $important_styles = 'font-weight: bold; color: red;'; // Styles for important parts of the code /** * Whether CSS IDs should be added to the code * @var boolean */ var $add_ids = false; /** * Lines that should be highlighted extra * @var array */ var $highlight_extra_lines = array(); /** * Styles of lines that should be highlighted extra * @var array */ var $highlight_extra_lines_styles = array(); /** * Styles of extra-highlighted lines * @var string */ var $highlight_extra_lines_style = 'background-color: #ffc;'; /** * The line ending * If null, nl2br() will be used on the result string. * Otherwise, all instances of \n will be replaced with $line_ending * @var string */ var $line_ending = null; /** * Number at which line numbers should start at * @var int */ var $line_numbers_start = 1; /** * The overall style for this code block * @var string */ var $overall_style = 'font-family:monospace;'; /** * The style for the actual code * @var string */ var $code_style = 'font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;'; /** * The overall class for this code block * @var string */ var $overall_class = ''; /** * The overall ID for this code block * @var string */ var $overall_id = ''; /** * Line number styles * @var string */ var $line_style1 = 'font-weight: normal; vertical-align:top;'; /** * Line number styles for fancy lines * @var string */ var $line_style2 = 'font-weight: bold; vertical-align:top;'; /** * Style for line numbers when GESHI_HEADER_PRE_TABLE is chosen * @var string */ var $table_linenumber_style = 'width:1px;text-align:right;margin:0;padding:0 2px;vertical-align:top;'; /** * Flag for how line numbers are displayed * @var boolean */ var $line_numbers = GESHI_NO_LINE_NUMBERS; /** * Flag to decide if multi line spans are allowed. Set it to false to make sure * each tag is closed before and reopened after each linefeed. * @var boolean */ var $allow_multiline_span = true; /** * The "nth" value for fancy line highlighting * @var int */ var $line_nth_row = 0; /** * The size of tab stops * @var int */ var $tab_width = 8; /** * Should we use language-defined tab stop widths? * @var int */ var $use_language_tab_width = false; /** * Default target for keyword links * @var string */ var $link_target = ''; /** * The encoding to use for entity encoding * NOTE: Used with Escape Char Sequences to fix UTF-8 handling (cf. SF#2037598) * @var string */ var $encoding = 'utf-8'; /** * Should keywords be linked? * @var boolean */ var $keyword_links = true; /** * Currently loaded language file * @var string * @since 1.0.7.22 */ var $loaded_language = ''; /** * Wether the caches needed for parsing are built or not * * @var bool * @since 1.0.8 */ var $parse_cache_built = false; /** * Work around for Suhosin Patch with disabled /e modifier * * Note from suhosins author in config file: *
* The /e modifier inside preg_replace() allows code execution. * Often it is the cause for remote code execution exploits. It is wise to * deactivate this feature and test where in the application it is used. * The developer using the /e modifier should be made aware that he should * use preg_replace_callback() instead *
* * @var array * @since 1.0.8 */ var $_kw_replace_group = 0; var $_rx_key = 0; /** * some "callback parameters" for handle_multiline_regexps * * @since 1.0.8 * @access private * @var string */ var $_hmr_before = ''; var $_hmr_replace = ''; var $_hmr_after = ''; var $_hmr_key = 0; /**#@-*/ /** * Creates a new GeSHi object, with source and language * * @param string The source code to highlight * @param string The language to highlight the source with * @param string The path to the language file directory. This * is deprecated! I've backported the auto path * detection from the 1.1.X dev branch, so now it * should be automatically set correctly. If you have * renamed the language directory however, you will * still need to set the path using this parameter or * {@link GeSHi->set_language_path()} * @since 1.0.0 */ function GeSHi($source = '', $language = '', $path = '') { if (!empty($source)) { $this->set_source($source); } if (!empty($language)) { $this->set_language($language); } $this->set_language_path($path); } /** * Returns an error message associated with the last GeSHi operation, * or false if no error has occured * * @return string|false An error message if there has been an error, else false * @since 1.0.0 */ function error() { if ($this->error) { //Put some template variables for debugging here ... $debug_tpl_vars = array( '{LANGUAGE}' => $this->language, '{PATH}' => $this->language_path ); $msg = str_replace( array_keys($debug_tpl_vars), array_values($debug_tpl_vars), $this->error_messages[$this->error]); return "
GeSHi Error: $msg (code {$this->error})
"; } return false; } /** * Gets a human-readable language name (thanks to Simon Patterson * for the idea :)) * * @return string The name for the current language * @since 1.0.2 */ function get_language_name() { if (GESHI_ERROR_NO_SUCH_LANG == $this->error) { return $this->language_data['LANG_NAME'] . ' (Unknown Language)'; } return $this->language_data['LANG_NAME']; } /** * Sets the source code for this object * * @param string The source code to highlight * @since 1.0.0 */ function set_source($source) { $this->source = $source; $this->highlight_extra_lines = array(); } /** * Sets the language for this object * * @note since 1.0.8 this function won't reset language-settings by default anymore! * if you need this set $force_reset = true * * @param string The name of the language to use * @since 1.0.0 */ function set_language($language, $force_reset = false) { if ($force_reset) { $this->loaded_language = false; } //Clean up the language name to prevent malicious code injection $language = preg_replace('#[^a-zA-Z0-9\-_]#', '', $language); $language = strtolower($language); //Retreive the full filename $file_name = $this->language_path . $language . '.php'; if ($file_name == $this->loaded_language) { // this language is already loaded! return; } $this->language = $language; $this->error = false; $this->strict_mode = GESHI_NEVER; //Check if we can read the desired file if (!is_readable($file_name)) { $this->error = GESHI_ERROR_NO_SUCH_LANG; return; } // Load the language for parsing $this->load_language($file_name); } /** * Sets the path to the directory containing the language files. Note * that this path is relative to the directory of the script that included * geshi.php, NOT geshi.php itself. * * @param string The path to the language directory * @since 1.0.0 * @deprecated The path to the language files should now be automatically * detected, so this method should no longer be needed. The * 1.1.X branch handles manual setting of the path differently * so this method will disappear in 1.2.0. */ function set_language_path($path) { if(strpos($path, ':')) { //Security Fix to prevent external directories using fopen wrappers. if(DIRECTORY_SEPARATOR == "\\") { if(!preg_match('#^[a-zA-Z]:#', $path) || false !== strpos($path, ':', 2)) { return; } } else { return; } } if(preg_match('#[^/a-zA-Z0-9_\.\-\\\s:]#', $path)) { //Security Fix to prevent external directories using fopen wrappers. return; } if(GESHI_SECURITY_PARANOID && false !== strpos($path, '/.')) { //Security Fix to prevent external directories using fopen wrappers. return; } if(GESHI_SECURITY_PARANOID && false !== strpos($path, '..')) { //Security Fix to prevent external directories using fopen wrappers. return; } if ($path) { $this->language_path = ('/' == $path[strlen($path) - 1]) ? $path : $path . '/'; $this->set_language($this->language); // otherwise set_language_path has no effect } } /** * Get supported langs or an associative array lang=>full_name. * @param boolean $longnames * @return array */ function get_supported_languages($full_names=false) { // return array $back = array(); // we walk the lang root $dir = dir($this->language_path); // foreach entry while (false !== ($entry = $dir->read())) { $full_path = $this->language_path.$entry; // Skip all dirs if (is_dir($full_path)) { continue; } // we only want lang.php files if (!preg_match('/^([^.]+)\.php$/', $entry, $matches)) { continue; } // Raw lang name is here $langname = $matches[1]; // We want the fullname too? if ($full_names === true) { if (false !== ($fullname = $this->get_language_fullname($langname))) { $back[$langname] = $fullname; // we go associative } } else { // just store raw langname $back[] = $langname; } } $dir->close(); return $back; } /** * Get full_name for a lang or false. * @param string $language short langname (html4strict for example) * @return mixed */ function get_language_fullname($language) { //Clean up the language name to prevent malicious code injection $language = preg_replace('#[^a-zA-Z0-9\-_]#', '', $language); $language = strtolower($language); // get fullpath-filename for a langname $fullpath = $this->language_path.$language.'.php'; // we need to get contents :S if (false === ($data = file_get_contents($fullpath))) { $this->error = sprintf('Geshi::get_lang_fullname() Unknown Language: %s', $language); return false; } // match the langname if (!preg_match('/\'LANG_NAME\'\s*=>\s*\'((?:[^\']|\\\')+)\'/', $data, $matches)) { $this->error = sprintf('Geshi::get_lang_fullname(%s): Regex can not detect language', $language); return false; } // return fullname for langname return stripcslashes($matches[1]); } /** * Sets the type of header to be used. * * If GESHI_HEADER_DIV is used, the code is surrounded in a "div".This * means more source code but more control over tab width and line-wrapping. * GESHI_HEADER_PRE means that a "pre" is used - less source, but less * control. Default is GESHI_HEADER_PRE. * * From 1.0.7.2, you can use GESHI_HEADER_NONE to specify that no header code * should be outputted. * * @param int The type of header to be used * @since 1.0.0 */ function set_header_type($type) { //Check if we got a valid header type if (!in_array($type, array(GESHI_HEADER_NONE, GESHI_HEADER_DIV, GESHI_HEADER_PRE, GESHI_HEADER_PRE_VALID, GESHI_HEADER_PRE_TABLE))) { $this->error = GESHI_ERROR_INVALID_HEADER_TYPE; return; } //Set that new header type $this->header_type = $type; } /** * Sets the styles for the code that will be outputted * when this object is parsed. The style should be a * string of valid stylesheet declarations * * @param string The overall style for the outputted code block * @param boolean Whether to merge the styles with the current styles or not * @since 1.0.0 */ function set_overall_style($style, $preserve_defaults = false) { if (!$preserve_defaults) { $this->overall_style = $style; } else { $this->overall_style .= $style; } } /** * Sets the overall classname for this block of code. This * class can then be used in a stylesheet to style this object's * output * * @param string The class name to use for this block of code * @since 1.0.0 */ function set_overall_class($class) { $this->overall_class = $class; } /** * Sets the overall id for this block of code. This id can then * be used in a stylesheet to style this object's output * * @param string The ID to use for this block of code * @since 1.0.0 */ function set_overall_id($id) { $this->overall_id = $id; } /** * Sets whether CSS classes should be used to highlight the source. Default * is off, calling this method with no arguments will turn it on * * @param boolean Whether to turn classes on or not * @since 1.0.0 */ function enable_classes($flag = true) { $this->use_classes = ($flag) ? true : false; } /** * Sets the style for the actual code. This should be a string * containing valid stylesheet declarations. If $preserve_defaults is * true, then styles are merged with the default styles, with the * user defined styles having priority * * Note: Use this method to override any style changes you made to * the line numbers if you are using line numbers, else the line of * code will have the same style as the line number! Consult the * GeSHi documentation for more information about this. * * @param string The style to use for actual code * @param boolean Whether to merge the current styles with the new styles * @since 1.0.2 */ function set_code_style($style, $preserve_defaults = false) { if (!$preserve_defaults) { $this->code_style = $style; } else { $this->code_style .= $style; } } /** * Sets the styles for the line numbers. * * @param string The style for the line numbers that are "normal" * @param string|boolean If a string, this is the style of the line * numbers that are "fancy", otherwise if boolean then this * defines whether the normal styles should be merged with the * new normal styles or not * @param boolean If set, is the flag for whether to merge the "fancy" * styles with the current styles or not * @since 1.0.2 */ function set_line_style($style1, $style2 = '', $preserve_defaults = false) { //Check if we got 2 or three parameters if (is_bool($style2)) { $preserve_defaults = $style2; $style2 = ''; } //Actually set the new styles if (!$preserve_defaults) { $this->line_style1 = $style1; $this->line_style2 = $style2; } else { $this->line_style1 .= $style1; $this->line_style2 .= $style2; } } /** * Sets whether line numbers should be displayed. * * Valid values for the first parameter are: * * - GESHI_NO_LINE_NUMBERS: Line numbers will not be displayed * - GESHI_NORMAL_LINE_NUMBERS: Line numbers will be displayed * - GESHI_FANCY_LINE_NUMBERS: Fancy line numbers will be displayed * * For fancy line numbers, the second parameter is used to signal which lines * are to be fancy. For example, if the value of this parameter is 5 then every * 5th line will be fancy. * * @param int How line numbers should be displayed * @param int Defines which lines are fancy * @since 1.0.0 */ function enable_line_numbers($flag, $nth_row = 5) { if (GESHI_NO_LINE_NUMBERS != $flag && GESHI_NORMAL_LINE_NUMBERS != $flag && GESHI_FANCY_LINE_NUMBERS != $flag) { $this->error = GESHI_ERROR_INVALID_LINE_NUMBER_TYPE; } $this->line_numbers = $flag; $this->line_nth_row = $nth_row; } /** * Sets wether spans and other HTML markup generated by GeSHi can * span over multiple lines or not. Defaults to true to reduce overhead. * Set it to false if you want to manipulate the output or manually display * the code in an ordered list. * * @param boolean Wether multiline spans are allowed or not * @since 1.0.7.22 */ function enable_multiline_span($flag) { $this->allow_multiline_span = (bool) $flag; } /** * Get current setting for multiline spans, see GeSHi->enable_multiline_span(). * * @see enable_multiline_span * @return bool */ function get_multiline_span() { return $this->allow_multiline_span; } /** * Sets the style for a keyword group. If $preserve_defaults is * true, then styles are merged with the default styles, with the * user defined styles having priority * * @param int The key of the keyword group to change the styles of * @param string The style to make the keywords * @param boolean Whether to merge the new styles with the old or just * to overwrite them * @since 1.0.0 */ function set_keyword_group_style($key, $style, $preserve_defaults = false) { //Set the style for this keyword group if (!$preserve_defaults) { $this->language_data['STYLES']['KEYWORDS'][$key] = $style; } else { $this->language_data['STYLES']['KEYWORDS'][$key] .= $style; } //Update the lexic permissions if (!isset($this->lexic_permissions['KEYWORDS'][$key])) { $this->lexic_permissions['KEYWORDS'][$key] = true; } } /** * Turns highlighting on/off for a keyword group * * @param int The key of the keyword group to turn on or off * @param boolean Whether to turn highlighting for that group on or off * @since 1.0.0 */ function set_keyword_group_highlighting($key, $flag = true) { $this->lexic_permissions['KEYWORDS'][$key] = ($flag) ? true : false; } /** * Sets the styles for comment groups. If $preserve_defaults is * true, then styles are merged with the default styles, with the * user defined styles having priority * * @param int The key of the comment group to change the styles of * @param string The style to make the comments * @param boolean Whether to merge the new styles with the old or just * to overwrite them * @since 1.0.0 */ function set_comments_style($key, $style, $preserve_defaults = false) { if (!$preserve_defaults) { $this->language_data['STYLES']['COMMENTS'][$key] = $style; } else { $this->language_data['STYLES']['COMMENTS'][$key] .= $style; } } /** * Turns highlighting on/off for comment groups * * @param int The key of the comment group to turn on or off * @param boolean Whether to turn highlighting for that group on or off * @since 1.0.0 */ function set_comments_highlighting($key, $flag = true) { $this->lexic_permissions['COMMENTS'][$key] = ($flag) ? true : false; } /** * Sets the styles for escaped characters. If $preserve_defaults is * true, then styles are merged with the default styles, with the * user defined styles having priority * * @param string The style to make the escape characters * @param boolean Whether to merge the new styles with the old or just * to overwrite them * @since 1.0.0 */ function set_escape_characters_style($style, $preserve_defaults = false, $group = 0) { if (!$preserve_defaults) { $this->language_data['STYLES']['ESCAPE_CHAR'][$group] = $style; } else { $this->language_data['STYLES']['ESCAPE_CHAR'][$group] .= $style; } } /** * Turns highlighting on/off for escaped characters * * @param boolean Whether to turn highlighting for escape characters on or off * @since 1.0.0 */ function set_escape_characters_highlighting($flag = true) { $this->lexic_permissions['ESCAPE_CHAR'] = ($flag) ? true : false; } /** * Sets the styles for brackets. If $preserve_defaults is * true, then styles are merged with the default styles, with the * user defined styles having priority * * This method is DEPRECATED: use set_symbols_style instead. * This method will be removed in 1.2.X * * @param string The style to make the brackets * @param boolean Whether to merge the new styles with the old or just * to overwrite them * @since 1.0.0 * @deprecated In favour of set_symbols_style */ function set_brackets_style($style, $preserve_defaults = false) { if (!$preserve_defaults) { $this->language_data['STYLES']['BRACKETS'][0] = $style; } else { $this->language_data['STYLES']['BRACKETS'][0] .= $style; } } /** * Turns highlighting on/off for brackets * * This method is DEPRECATED: use set_symbols_highlighting instead. * This method will be remove in 1.2.X * * @param boolean Whether to turn highlighting for brackets on or off * @since 1.0.0 * @deprecated In favour of set_symbols_highlighting */ function set_brackets_highlighting($flag) { $this->lexic_permissions['BRACKETS'] = ($flag) ? true : false; } /** * Sets the styles for symbols. If $preserve_defaults is * true, then styles are merged with the default styles, with the * user defined styles having priority * * @param string The style to make the symbols * @param boolean Whether to merge the new styles with the old or just * to overwrite them * @param int Tells the group of symbols for which style should be set. * @since 1.0.1 */ function set_symbols_style($style, $preserve_defaults = false, $group = 0) { // Update the style of symbols if (!$preserve_defaults) { $this->language_data['STYLES']['SYMBOLS'][$group] = $style; } else { $this->language_data['STYLES']['SYMBOLS'][$group] .= $style; } // For backward compatibility if (0 == $group) { $this->set_brackets_style ($style, $preserve_defaults); } } /** * Turns highlighting on/off for symbols * * @param boolean Whether to turn highlighting for symbols on or off * @since 1.0.0 */ function set_symbols_highlighting($flag) { // Update lexic permissions for this symbol group $this->lexic_permissions['SYMBOLS'] = ($flag) ? true : false; // For backward compatibility $this->set_brackets_highlighting ($flag); } /** * Sets the styles for strings. If $preserve_defaults is * true, then styles are merged with the default styles, with the * user defined styles having priority * * @param string The style to make the escape characters * @param boolean Whether to merge the new styles with the old or just * to overwrite them * @param int Tells the group of strings for which style should be set. * @since 1.0.0 */ function set_strings_style($style, $preserve_defaults = false, $group = 0) { if (!$preserve_defaults) { $this->language_data['STYLES']['STRINGS'][$group] = $style; } else { $this->language_data['STYLES']['STRINGS'][$group] .= $style; } } /** * Turns highlighting on/off for strings * * @param boolean Whether to turn highlighting for strings on or off * @since 1.0.0 */ function set_strings_highlighting($flag) { $this->lexic_permissions['STRINGS'] = ($flag) ? true : false; } /** * Sets the styles for strict code blocks. If $preserve_defaults is * true, then styles are merged with the default styles, with the * user defined styles having priority * * @param string The style to make the script blocks * @param boolean Whether to merge the new styles with the old or just * to overwrite them * @param int Tells the group of script blocks for which style should be set. * @since 1.0.8.4 */ function set_script_style($style, $preserve_defaults = false, $group = 0) { // Update the style of symbols if (!$preserve_defaults) { $this->language_data['STYLES']['SCRIPT'][$group] = $style; } else { $this->language_data['STYLES']['SCRIPT'][$group] .= $style; } } /** * Sets the styles for numbers. If $preserve_defaults is * true, then styles are merged with the default styles, with the * user defined styles having priority * * @param string The style to make the numbers * @param boolean Whether to merge the new styles with the old or just * to overwrite them * @param int Tells the group of numbers for which style should be set. * @since 1.0.0 */ function set_numbers_style($style, $preserve_defaults = false, $group = 0) { if (!$preserve_defaults) { $this->language_data['STYLES']['NUMBERS'][$group] = $style; } else { $this->language_data['STYLES']['NUMBERS'][$group] .= $style; } } /** * Turns highlighting on/off for numbers * * @param boolean Whether to turn highlighting for numbers on or off * @since 1.0.0 */ function set_numbers_highlighting($flag) { $this->lexic_permissions['NUMBERS'] = ($flag) ? true : false; } /** * Sets the styles for methods. $key is a number that references the * appropriate "object splitter" - see the language file for the language * you are highlighting to get this number. If $preserve_defaults is * true, then styles are merged with the default styles, with the * user defined styles having priority * * @param int The key of the object splitter to change the styles of * @param string The style to make the methods * @param boolean Whether to merge the new styles with the old or just * to overwrite them * @since 1.0.0 */ function set_methods_style($key, $style, $preserve_defaults = false) { if (!$preserve_defaults) { $this->language_data['STYLES']['METHODS'][$key] = $style; } else { $this->language_data['STYLES']['METHODS'][$key] .= $style; } } /** * Turns highlighting on/off for methods * * @param boolean Whether to turn highlighting for methods on or off * @since 1.0.0 */ function set_methods_highlighting($flag) { $this->lexic_permissions['METHODS'] = ($flag) ? true : false; } /** * Sets the styles for regexps. If $preserve_defaults is * true, then styles are merged with the default styles, with the * user defined styles having priority * * @param string The style to make the regular expression matches * @param boolean Whether to merge the new styles with the old or just * to overwrite them * @since 1.0.0 */ function set_regexps_style($key, $style, $preserve_defaults = false) { if (!$preserve_defaults) { $this->language_data['STYLES']['REGEXPS'][$key] = $style; } else { $this->language_data['STYLES']['REGEXPS'][$key] .= $style; } } /** * Turns highlighting on/off for regexps * * @param int The key of the regular expression group to turn on or off * @param boolean Whether to turn highlighting for the regular expression group on or off * @since 1.0.0 */ function set_regexps_highlighting($key, $flag) { $this->lexic_permissions['REGEXPS'][$key] = ($flag) ? true : false; } /** * Sets whether a set of keywords are checked for in a case sensitive manner * * @param int The key of the keyword group to change the case sensitivity of * @param boolean Whether to check in a case sensitive manner or not * @since 1.0.0 */ function set_case_sensitivity($key, $case) { $this->language_data['CASE_SENSITIVE'][$key] = ($case) ? true : false; } /** * Sets the case that keywords should use when found. Use the constants: * * - GESHI_CAPS_NO_CHANGE: leave keywords as-is * - GESHI_CAPS_UPPER: convert all keywords to uppercase where found * - GESHI_CAPS_LOWER: convert all keywords to lowercase where found * * @param int A constant specifying what to do with matched keywords * @since 1.0.1 */ function set_case_keywords($case) { if (in_array($case, array( GESHI_CAPS_NO_CHANGE, GESHI_CAPS_UPPER, GESHI_CAPS_LOWER))) { $this->language_data['CASE_KEYWORDS'] = $case; } } /** * Sets how many spaces a tab is substituted for * * Widths below zero are ignored * * @param int The tab width * @since 1.0.0 */ function set_tab_width($width) { $this->tab_width = (int) $width; //Check if it fit's the constraints: if ($this->tab_width < 1) { //Return it to the default $this->tab_width = 8; } } /** * Sets whether or not to use tab-stop width specifed by language * * @param boolean Whether to use language-specific tab-stop widths * @since 1.0.7.20 */ function set_use_language_tab_width($use) { $this->use_language_tab_width = (bool) $use; } /** * Returns the tab width to use, based on the current language and user * preference * * @return int Tab width * @since 1.0.7.20 */ function get_real_tab_width() { if (!$this->use_language_tab_width || !isset($this->language_data['TAB_WIDTH'])) { return $this->tab_width; } else { return $this->language_data['TAB_WIDTH']; } } /** * Enables/disables strict highlighting. Default is off, calling this * method without parameters will turn it on. See documentation * for more details on strict mode and where to use it. * * @param boolean Whether to enable strict mode or not * @since 1.0.0 */ function enable_strict_mode($mode = true) { if (GESHI_MAYBE == $this->language_data['STRICT_MODE_APPLIES']) { $this->strict_mode = ($mode) ? GESHI_ALWAYS : GESHI_NEVER; } } /** * Disables all highlighting * * @since 1.0.0 * @todo Rewrite with array traversal * @deprecated In favour of enable_highlighting */ function disable_highlighting() { $this->enable_highlighting(false); } /** * Enables all highlighting * * The optional flag parameter was added in version 1.0.7.21 and can be used * to enable (true) or disable (false) all highlighting. * * @since 1.0.0 * @param boolean A flag specifying whether to enable or disable all highlighting * @todo Rewrite with array traversal */ function enable_highlighting($flag = true) { $flag = $flag ? true : false; foreach ($this->lexic_permissions as $key => $value) { if (is_array($value)) { foreach ($value as $k => $v) { $this->lexic_permissions[$key][$k] = $flag; } } else { $this->lexic_permissions[$key] = $flag; } } // Context blocks $this->enable_important_blocks = $flag; } /** * Given a file extension, this method returns either a valid geshi language * name, or the empty string if it couldn't be found * * @param string The extension to get a language name for * @param array A lookup array to use instead of the default one * @since 1.0.5 * @todo Re-think about how this method works (maybe make it private and/or make it * a extension->lang lookup?) * @todo static? */ function get_language_name_from_extension( $extension, $lookup = array() ) { if ( !is_array($lookup) || empty($lookup)) { $lookup = array( '6502acme' => array( 'a', 's', 'asm', 'inc' ), '6502tasm' => array( 'a', 's', 'asm', 'inc' ), '6502kickass' => array( 'a', 's', 'asm', 'inc' ), '68000devpac' => array( 'a', 's', 'asm', 'inc' ), 'abap' => array('abap'), 'actionscript' => array('as'), 'ada' => array('a', 'ada', 'adb', 'ads'), 'apache' => array('conf'), 'asm' => array('ash', 'asm', 'inc'), 'asp' => array('asp'), 'bash' => array('sh'), 'bf' => array('bf'), 'c' => array('c', 'h'), 'c_mac' => array('c', 'h'), 'caddcl' => array(), 'cadlisp' => array(), 'cdfg' => array('cdfg'), 'cobol' => array('cbl'), 'cpp' => array('cpp', 'hpp', 'C', 'H', 'CPP', 'HPP'), 'csharp' => array('cs'), 'css' => array('css'), 'd' => array('d'), 'delphi' => array('dpk', 'dpr', 'pp', 'pas'), 'diff' => array('diff', 'patch'), 'dos' => array('bat', 'cmd'), 'gdb' => array('kcrash', 'crash', 'bt'), 'gettext' => array('po', 'pot'), 'gml' => array('gml'), 'gnuplot' => array('plt'), 'groovy' => array('groovy'), 'haskell' => array('hs'), 'html4strict' => array('html', 'htm'), 'ini' => array('ini', 'desktop'), 'java' => array('java'), 'javascript' => array('js'), 'klonec' => array('kl1'), 'klonecpp' => array('klx'), 'latex' => array('tex'), 'lisp' => array('lisp'), 'lua' => array('lua'), 'matlab' => array('m'), 'mpasm' => array(), 'mysql' => array('sql'), 'nsis' => array(), 'objc' => array(), 'oobas' => array(), 'oracle8' => array(), 'oracle10' => array(), 'pascal' => array('pas'), 'perl' => array('pl', 'pm'), 'php' => array('php', 'php5', 'phtml', 'phps'), 'povray' => array('pov'), 'providex' => array('pvc', 'pvx'), 'prolog' => array('pl'), 'python' => array('py'), 'qbasic' => array('bi'), 'reg' => array('reg'), 'ruby' => array('rb'), 'sas' => array('sas'), 'scala' => array('scala'), 'scheme' => array('scm'), 'scilab' => array('sci'), 'smalltalk' => array('st'), 'smarty' => array(), 'tcl' => array('tcl'), 'vb' => array('bas'), 'vbnet' => array(), 'visualfoxpro' => array(), 'whitespace' => array('ws'), 'xml' => array('xml', 'svg', 'xrc'), 'z80' => array('z80', 'asm', 'inc') ); } foreach ($lookup as $lang => $extensions) { if (in_array($extension, $extensions)) { return $lang; } } return ''; } /** * Given a file name, this method loads its contents in, and attempts * to set the language automatically. An optional lookup table can be * passed for looking up the language name. If not specified a default * table is used * * The language table is in the form *
array(
     *   'lang_name' => array('extension', 'extension', ...),
     *   'lang_name' ...
     * );
* * @param string The filename to load the source from * @param array A lookup array to use instead of the default one * @todo Complete rethink of this and above method * @since 1.0.5 */ function load_from_file($file_name, $lookup = array()) { if (is_readable($file_name)) { $this->set_source(file_get_contents($file_name)); $this->set_language($this->get_language_name_from_extension(substr(strrchr($file_name, '.'), 1), $lookup)); } else { $this->error = GESHI_ERROR_FILE_NOT_READABLE; } } /** * Adds a keyword to a keyword group for highlighting * * @param int The key of the keyword group to add the keyword to * @param string The word to add to the keyword group * @since 1.0.0 */ function add_keyword($key, $word) { if (!in_array($word, $this->language_data['KEYWORDS'][$key])) { $this->language_data['KEYWORDS'][$key][] = $word; //NEW in 1.0.8 don't recompile the whole optimized regexp, simply append it if ($this->parse_cache_built) { $subkey = count($this->language_data['CACHED_KEYWORD_LISTS'][$key]) - 1; $this->language_data['CACHED_KEYWORD_LISTS'][$key][$subkey] .= '|' . preg_quote($word, '/'); } } } /** * Removes a keyword from a keyword group * * @param int The key of the keyword group to remove the keyword from * @param string The word to remove from the keyword group * @param bool Wether to automatically recompile the optimized regexp list or not. * Note: if you set this to false and @see GeSHi->parse_code() was already called once, * for the current language, you have to manually call @see GeSHi->optimize_keyword_group() * or the removed keyword will stay in cache and still be highlighted! On the other hand * it might be too expensive to recompile the regexp list for every removal if you want to * remove a lot of keywords. * @since 1.0.0 */ function remove_keyword($key, $word, $recompile = true) { $key_to_remove = array_search($word, $this->language_data['KEYWORDS'][$key]); if ($key_to_remove !== false) { unset($this->language_data['KEYWORDS'][$key][$key_to_remove]); //NEW in 1.0.8, optionally recompile keyword group if ($recompile && $this->parse_cache_built) { $this->optimize_keyword_group($key); } } } /** * Creates a new keyword group * * @param int The key of the keyword group to create * @param string The styles for the keyword group * @param boolean Whether the keyword group is case sensitive ornot * @param array The words to use for the keyword group * @since 1.0.0 */ function add_keyword_group($key, $styles, $case_sensitive = true, $words = array()) { $words = (array) $words; if (empty($words)) { // empty word lists mess up highlighting return false; } //Add the new keyword group internally $this->language_data['KEYWORDS'][$key] = $words; $this->lexic_permissions['KEYWORDS'][$key] = true; $this->language_data['CASE_SENSITIVE'][$key] = $case_sensitive; $this->language_data['STYLES']['KEYWORDS'][$key] = $styles; //NEW in 1.0.8, cache keyword regexp if ($this->parse_cache_built) { $this->optimize_keyword_group($key); } } /** * Removes a keyword group * * @param int The key of the keyword group to remove * @since 1.0.0 */ function remove_keyword_group ($key) { //Remove the keyword group internally unset($this->language_data['KEYWORDS'][$key]); unset($this->lexic_permissions['KEYWORDS'][$key]); unset($this->language_data['CASE_SENSITIVE'][$key]); unset($this->language_data['STYLES']['KEYWORDS'][$key]); //NEW in 1.0.8 unset($this->language_data['CACHED_KEYWORD_LISTS'][$key]); } /** * compile optimized regexp list for keyword group * * @param int The key of the keyword group to compile & optimize * @since 1.0.8 */ function optimize_keyword_group($key) { $this->language_data['CACHED_KEYWORD_LISTS'][$key] = $this->optimize_regexp_list($this->language_data['KEYWORDS'][$key]); $space_as_whitespace = false; if(isset($this->language_data['PARSER_CONTROL'])) { if(isset($this->language_data['PARSER_CONTROL']['KEYWORDS'])) { if(isset($this->language_data['PARSER_CONTROL']['KEYWORDS']['SPACE_AS_WHITESPACE'])) { $space_as_whitespace = $this->language_data['PARSER_CONTROL']['KEYWORDS']['SPACE_AS_WHITESPACE']; } if(isset($this->language_data['PARSER_CONTROL']['KEYWORDS'][$key]['SPACE_AS_WHITESPACE'])) { if(isset($this->language_data['PARSER_CONTROL']['KEYWORDS'][$key]['SPACE_AS_WHITESPACE'])) { $space_as_whitespace = $this->language_data['PARSER_CONTROL']['KEYWORDS'][$key]['SPACE_AS_WHITESPACE']; } } } } if($space_as_whitespace) { foreach ($this->language_data['CACHED_KEYWORD_LISTS'][$key] as $rxk => $rxv) { $this->language_data['CACHED_KEYWORD_LISTS'][$key][$rxk] = str_replace(" ", "\\s+", $rxv); } } } /** * Sets the content of the header block * * @param string The content of the header block * @since 1.0.2 */ function set_header_content($content) { $this->header_content = $content; } /** * Sets the content of the footer block * * @param string The content of the footer block * @since 1.0.2 */ function set_footer_content($content) { $this->footer_content = $content; } /** * Sets the style for the header content * * @param string The style for the header content * @since 1.0.2 */ function set_header_content_style($style) { $this->header_content_style = $style; } /** * Sets the style for the footer content * * @param string The style for the footer content * @since 1.0.2 */ function set_footer_content_style($style) { $this->footer_content_style = $style; } /** * Sets whether to force a surrounding block around * the highlighted code or not * * @param boolean Tells whether to enable or disable this feature * @since 1.0.7.20 */ function enable_inner_code_block($flag) { $this->force_code_block = (bool)$flag; } /** * Sets the base URL to be used for keywords * * @param int The key of the keyword group to set the URL for * @param string The URL to set for the group. If {FNAME} is in * the url somewhere, it is replaced by the keyword * that the URL is being made for * @since 1.0.2 */ function set_url_for_keyword_group($group, $url) { $this->language_data['URLS'][$group] = $url; } /** * Sets styles for links in code * * @param int A constant that specifies what state the style is being * set for - e.g. :hover or :visited * @param string The styles to use for that state * @since 1.0.2 */ function set_link_styles($type, $styles) { $this->link_styles[$type] = $styles; } /** * Sets the target for links in code * * @param string The target for links in the code, e.g. _blank * @since 1.0.3 */ function set_link_target($target) { if (!$target) { $this->link_target = ''; } else { $this->link_target = ' target="' . $target . '"'; } } /** * Sets styles for important parts of the code * * @param string The styles to use on important parts of the code * @since 1.0.2 */ function set_important_styles($styles) { $this->important_styles = $styles; } /** * Sets whether context-important blocks are highlighted * * @param boolean Tells whether to enable or disable highlighting of important blocks * @todo REMOVE THIS SHIZ FROM GESHI! * @deprecated * @since 1.0.2 */ function enable_important_blocks($flag) { $this->enable_important_blocks = ( $flag ) ? true : false; } /** * Whether CSS IDs should be added to each line * * @param boolean If true, IDs will be added to each line. * @since 1.0.2 */ function enable_ids($flag = true) { $this->add_ids = ($flag) ? true : false; } /** * Specifies which lines to highlight extra * * The extra style parameter was added in 1.0.7.21. * * @param mixed An array of line numbers to highlight, or just a line * number on its own. * @param string A string specifying the style to use for this line. * If null is specified, the default style is used. * If false is specified, the line will be removed from * special highlighting * @since 1.0.2 * @todo Some data replication here that could be cut down on */ function highlight_lines_extra($lines, $style = null) { if (is_array($lines)) { //Split up the job using single lines at a time foreach ($lines as $line) { $this->highlight_lines_extra($line, $style); } } else { //Mark the line as being highlighted specially $lines = (int) $lines; $this->highlight_extra_lines[$lines] = $lines; //Decide on which style to use if ($style === null) { //Check if we should use default style unset($this->highlight_extra_lines_styles[$lines]); } elseif ($style === false) { //Check if to remove this line unset($this->highlight_extra_lines[$lines]); unset($this->highlight_extra_lines_styles[$lines]); } else { $this->highlight_extra_lines_styles[$lines] = $style; } } } /** * Sets the style for extra-highlighted lines * * @param string The style for extra-highlighted lines * @since 1.0.2 */ function set_highlight_lines_extra_style($styles) { $this->highlight_extra_lines_style = $styles; } /** * Sets the line-ending * * @param string The new line-ending * @since 1.0.2 */ function set_line_ending($line_ending) { $this->line_ending = (string)$line_ending; } /** * Sets what number line numbers should start at. Should * be a positive integer, and will be converted to one. * * Warning: Using this method will add the "start" * attribute to the <ol> that is used for line numbering. * This is not valid XHTML strict, so if that's what you * care about then don't use this method. Firefox is getting * support for the CSS method of doing this in 1.1 and Opera * has support for the CSS method, but (of course) IE doesn't * so it's not worth doing it the CSS way yet. * * @param int The number to start line numbers at * @since 1.0.2 */ function start_line_numbers_at($number) { $this->line_numbers_start = abs((int) $number); } /** * Sets the encoding used for htmlspecialchars(), for international * support. * * NOTE: This is not needed for now because htmlspecialchars() is not * being used (it has a security hole in PHP4 that has not been patched). * Maybe in a future version it may make a return for speed reasons, but * I doubt it. * * @param string The encoding to use for the source * @since 1.0.3 */ function set_encoding($encoding) { if ($encoding) { $this->encoding = strtolower($encoding); } } /** * Turns linking of keywords on or off. * * @param boolean If true, links will be added to keywords * @since 1.0.2 */ function enable_keyword_links($enable = true) { $this->keyword_links = (bool) $enable; } /** * Setup caches needed for styling. This is automatically called in * parse_code() and get_stylesheet() when appropriate. This function helps * stylesheet generators as they rely on some style information being * preprocessed * * @since 1.0.8 * @access private */ function build_style_cache() { //Build the style cache needed to highlight numbers appropriate if($this->lexic_permissions['NUMBERS']) { //First check what way highlighting information for numbers are given if(!isset($this->language_data['NUMBERS'])) { $this->language_data['NUMBERS'] = 0; } if(is_array($this->language_data['NUMBERS'])) { $this->language_data['NUMBERS_CACHE'] = $this->language_data['NUMBERS']; } else { $this->language_data['NUMBERS_CACHE'] = array(); if(!$this->language_data['NUMBERS']) { $this->language_data['NUMBERS'] = GESHI_NUMBER_INT_BASIC | GESHI_NUMBER_FLT_NONSCI; } for($i = 0, $j = $this->language_data['NUMBERS']; $j > 0; ++$i, $j>>=1) { //Rearrange style indices if required ... if(isset($this->language_data['STYLES']['NUMBERS'][1<<$i])) { $this->language_data['STYLES']['NUMBERS'][$i] = $this->language_data['STYLES']['NUMBERS'][1<<$i]; unset($this->language_data['STYLES']['NUMBERS'][1<<$i]); } //Check if this bit is set for highlighting if($j&1) { //So this bit is set ... //Check if it belongs to group 0 or the actual stylegroup if(isset($this->language_data['STYLES']['NUMBERS'][$i])) { $this->language_data['NUMBERS_CACHE'][$i] = 1 << $i; } else { if(!isset($this->language_data['NUMBERS_CACHE'][0])) { $this->language_data['NUMBERS_CACHE'][0] = 0; } $this->language_data['NUMBERS_CACHE'][0] |= 1 << $i; } } } } } } /** * Setup caches needed for parsing. This is automatically called in parse_code() when appropriate. * This function makes stylesheet generators much faster as they do not need these caches. * * @since 1.0.8 * @access private */ function build_parse_cache() { // cache symbol regexp //As this is a costy operation, we avoid doing it for multiple groups ... //Instead we perform it for all symbols at once. // //For this to work, we need to reorganize the data arrays. if ($this->lexic_permissions['SYMBOLS'] && !empty($this->language_data['SYMBOLS'])) { $this->language_data['MULTIPLE_SYMBOL_GROUPS'] = count($this->language_data['STYLES']['SYMBOLS']) > 1; $this->language_data['SYMBOL_DATA'] = array(); $symbol_preg_multi = array(); // multi char symbols $symbol_preg_single = array(); // single char symbols foreach ($this->language_data['SYMBOLS'] as $key => $symbols) { if (is_array($symbols)) { foreach ($symbols as $sym) { $sym = $this->hsc($sym); if (!isset($this->language_data['SYMBOL_DATA'][$sym])) { $this->language_data['SYMBOL_DATA'][$sym] = $key; if (isset($sym[1])) { // multiple chars $symbol_preg_multi[] = preg_quote($sym, '/'); } else { // single char if ($sym == '-') { // don't trigger range out of order error $symbol_preg_single[] = '\-'; } else { $symbol_preg_single[] = preg_quote($sym, '/'); } } } } } else { $symbols = $this->hsc($symbols); if (!isset($this->language_data['SYMBOL_DATA'][$symbols])) { $this->language_data['SYMBOL_DATA'][$symbols] = 0; if (isset($symbols[1])) { // multiple chars $symbol_preg_multi[] = preg_quote($symbols, '/'); } elseif ($symbols == '-') { // don't trigger range out of order error $symbol_preg_single[] = '\-'; } else { // single char $symbol_preg_single[] = preg_quote($symbols, '/'); } } } } //Now we have an array with each possible symbol as the key and the style as the actual data. //This way we can set the correct style just the moment we highlight ... // //Now we need to rewrite our array to get a search string that $symbol_preg = array(); if (!empty($symbol_preg_multi)) { rsort($symbol_preg_multi); $symbol_preg[] = implode('|', $symbol_preg_multi); } if (!empty($symbol_preg_single)) { rsort($symbol_preg_single); $symbol_preg[] = '[' . implode('', $symbol_preg_single) . ']'; } $this->language_data['SYMBOL_SEARCH'] = implode("|", $symbol_preg); } // cache optimized regexp for keyword matching // remove old cache $this->language_data['CACHED_KEYWORD_LISTS'] = array(); foreach (array_keys($this->language_data['KEYWORDS']) as $key) { if (!isset($this->lexic_permissions['KEYWORDS'][$key]) || $this->lexic_permissions['KEYWORDS'][$key]) { $this->optimize_keyword_group($key); } } // brackets if ($this->lexic_permissions['BRACKETS']) { $this->language_data['CACHE_BRACKET_MATCH'] = array('[', ']', '(', ')', '{', '}'); if (!$this->use_classes && isset($this->language_data['STYLES']['BRACKETS'][0])) { $this->language_data['CACHE_BRACKET_REPLACE'] = array( '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">[|>', '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">]|>', '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">(|>', '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">)|>', '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">{|>', '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">}|>', ); } else { $this->language_data['CACHE_BRACKET_REPLACE'] = array( '<| class="br0">[|>', '<| class="br0">]|>', '<| class="br0">(|>', '<| class="br0">)|>', '<| class="br0">{|>', '<| class="br0">}|>', ); } } //Build the parse cache needed to highlight numbers appropriate if($this->lexic_permissions['NUMBERS']) { //Check if the style rearrangements have been processed ... //This also does some preprocessing to check which style groups are useable ... if(!isset($this->language_data['NUMBERS_CACHE'])) { $this->build_style_cache(); } //Number format specification //All this formats are matched case-insensitively! static $numbers_format = array( GESHI_NUMBER_INT_BASIC => '(?:(? '(? '(? '(? '(? '(? '(? '(? '(? '(? '(? '(? '(? '(? '(? '(?language_data['NUMBERS_RXCACHE'] = array(); foreach ($this->language_data['NUMBERS_CACHE'] as $key => $rxdata) { if(is_string($rxdata)) { $regexp = $rxdata; } else { //This is a bitfield of number flags to highlight: //Build an array, implode them together and make this the actual RX $rxuse = array(); for($i = 1; $i <= $rxdata; $i<<=1) { if($rxdata & $i) { $rxuse[] = $numbers_format[$i]; } } $regexp = implode("|", $rxuse); } $this->language_data['NUMBERS_RXCACHE'][$key] = "/(?)($regexp)(?!(?:|(?>[^\<]))+>)(?![^<]*>)(?!\|>)(?!\/>)/i"; // } if(!isset($this->language_data['PARSER_CONTROL']['NUMBERS']['PRECHECK_RX'])) { $this->language_data['PARSER_CONTROL']['NUMBERS']['PRECHECK_RX'] = '#\d#'; } } $this->parse_cache_built = true; } /** * Returns the code in $this->source, highlighted and surrounded by the * nessecary HTML. * * This should only be called ONCE, cos it's SLOW! If you want to highlight * the same source multiple times, you're better off doing a whole lot of * str_replaces to replace the <span>s * * @since 1.0.0 */ function parse_code () { // Start the timer $start_time = microtime(); // Replace all newlines to a common form. $code = str_replace("\r\n", "\n", $this->source); $code = str_replace("\r", "\n", $code); // Firstly, if there is an error, we won't highlight if ($this->error) { //Escape the source for output $result = $this->hsc($this->source); //This fix is related to SF#1923020, but has to be applied regardless of //actually highlighting symbols. $result = str_replace(array('', ''), array(';', '|'), $result); // Timing is irrelevant $this->set_time($start_time, $start_time); $this->finalise($result); return $result; } // make sure the parse cache is up2date if (!$this->parse_cache_built) { $this->build_parse_cache(); } // Initialise various stuff $length = strlen($code); $COMMENT_MATCHED = false; $stuff_to_parse = ''; $endresult = ''; // "Important" selections are handled like multiline comments // @todo GET RID OF THIS SHIZ if ($this->enable_important_blocks) { $this->language_data['COMMENT_MULTI'][GESHI_START_IMPORTANT] = GESHI_END_IMPORTANT; } if ($this->strict_mode) { // Break the source into bits. Each bit will be a portion of the code // within script delimiters - for example, HTML between < and > $k = 0; $parts = array(); $matches = array(); $next_match_pointer = null; // we use a copy to unset delimiters on demand (when they are not found) $delim_copy = $this->language_data['SCRIPT_DELIMITERS']; $i = 0; while ($i < $length) { $next_match_pos = $length + 1; // never true foreach ($delim_copy as $dk => $delimiters) { if(is_array($delimiters)) { foreach ($delimiters as $open => $close) { // make sure the cache is setup properly if (!isset($matches[$dk][$open])) { $matches[$dk][$open] = array( 'next_match' => -1, 'dk' => $dk, 'open' => $open, // needed for grouping of adjacent code blocks (see below) 'open_strlen' => strlen($open), 'close' => $close, 'close_strlen' => strlen($close), ); } // Get the next little bit for this opening string if ($matches[$dk][$open]['next_match'] < $i) { // only find the next pos if it was not already cached $open_pos = strpos($code, $open, $i); if ($open_pos === false) { // no match for this delimiter ever unset($delim_copy[$dk][$open]); continue; } $matches[$dk][$open]['next_match'] = $open_pos; } if ($matches[$dk][$open]['next_match'] < $next_match_pos) { //So we got a new match, update the close_pos $matches[$dk][$open]['close_pos'] = strpos($code, $close, $matches[$dk][$open]['next_match']+1); $next_match_pointer =& $matches[$dk][$open]; $next_match_pos = $matches[$dk][$open]['next_match']; } } } else { //So we should match an RegExp as Strict Block ... /** * The value in $delimiters is expected to be an RegExp * containing exactly 2 matching groups: * - Group 1 is the opener * - Group 2 is the closer */ if(!GESHI_PHP_PRE_433 && //Needs proper rewrite to work with PHP >=4.3.0; 4.3.3 is guaranteed to work. preg_match($delimiters, $code, $matches_rx, PREG_OFFSET_CAPTURE, $i)) { //We got a match ... if(isset($matches_rx['start']) && isset($matches_rx['end'])) { $matches[$dk] = array( 'next_match' => $matches_rx['start'][1], 'dk' => $dk, 'close_strlen' => strlen($matches_rx['end'][0]), 'close_pos' => $matches_rx['end'][1], ); } else { $matches[$dk] = array( 'next_match' => $matches_rx[1][1], 'dk' => $dk, 'close_strlen' => strlen($matches_rx[2][0]), 'close_pos' => $matches_rx[2][1], ); } } else { // no match for this delimiter ever unset($delim_copy[$dk]); continue; } if ($matches[$dk]['next_match'] <= $next_match_pos) { $next_match_pointer =& $matches[$dk]; $next_match_pos = $matches[$dk]['next_match']; } } } // non-highlightable text $parts[$k] = array( 1 => substr($code, $i, $next_match_pos - $i) ); ++$k; if ($next_match_pos > $length) { // out of bounds means no next match was found break; } // highlightable code $parts[$k][0] = $next_match_pointer['dk']; //Only combine for non-rx script blocks if(is_array($delim_copy[$next_match_pointer['dk']])) { // group adjacent script blocks, e.g. should be one block, not three! $i = $next_match_pos + $next_match_pointer['open_strlen']; while (true) { $close_pos = strpos($code, $next_match_pointer['close'], $i); if ($close_pos == false) { break; } $i = $close_pos + $next_match_pointer['close_strlen']; if ($i == $length) { break; } if ($code[$i] == $next_match_pointer['open'][0] && ($next_match_pointer['open_strlen'] == 1 || substr($code, $i, $next_match_pointer['open_strlen']) == $next_match_pointer['open'])) { // merge adjacent but make sure we don't merge things like foreach ($matches as $submatches) { foreach ($submatches as $match) { if ($match['next_match'] == $i) { // a different block already matches here! break 3; } } } } else { break; } } } else { $close_pos = $next_match_pointer['close_pos'] + $next_match_pointer['close_strlen']; $i = $close_pos; } if ($close_pos === false) { // no closing delimiter found! $parts[$k][1] = substr($code, $next_match_pos); ++$k; break; } else { $parts[$k][1] = substr($code, $next_match_pos, $i - $next_match_pos); ++$k; } } unset($delim_copy, $next_match_pointer, $next_match_pos, $matches); $num_parts = $k; if ($num_parts == 1 && $this->strict_mode == GESHI_MAYBE) { // when we have only one part, we don't have anything to highlight at all. // if we have a "maybe" strict language, this should be handled as highlightable code $parts = array( 0 => array( 0 => '', 1 => '' ), 1 => array( 0 => null, 1 => $parts[0][1] ) ); $num_parts = 2; } } else { // Not strict mode - simply dump the source into // the array at index 1 (the first highlightable block) $parts = array( 0 => array( 0 => '', 1 => '' ), 1 => array( 0 => null, 1 => $code ) ); $num_parts = 2; } //Unset variables we won't need any longer unset($code); //Preload some repeatedly used values regarding hardquotes ... $hq = isset($this->language_data['HARDQUOTE']) ? $this->language_data['HARDQUOTE'][0] : false; $hq_strlen = strlen($hq); //Preload if line numbers are to be generated afterwards //Added a check if line breaks should be forced even without line numbers, fixes SF#1727398 $check_linenumbers = $this->line_numbers != GESHI_NO_LINE_NUMBERS || !empty($this->highlight_extra_lines) || !$this->allow_multiline_span; //preload the escape char for faster checking ... $escaped_escape_char = $this->hsc($this->language_data['ESCAPE_CHAR']); // this is used for single-line comments $sc_disallowed_before = ""; $sc_disallowed_after = ""; if (isset($this->language_data['PARSER_CONTROL'])) { if (isset($this->language_data['PARSER_CONTROL']['COMMENTS'])) { if (isset($this->language_data['PARSER_CONTROL']['COMMENTS']['DISALLOWED_BEFORE'])) { $sc_disallowed_before = $this->language_data['PARSER_CONTROL']['COMMENTS']['DISALLOWED_BEFORE']; } if (isset($this->language_data['PARSER_CONTROL']['COMMENTS']['DISALLOWED_AFTER'])) { $sc_disallowed_after = $this->language_data['PARSER_CONTROL']['COMMENTS']['DISALLOWED_AFTER']; } } } //Fix for SF#1932083: Multichar Quotemarks unsupported $is_string_starter = array(); if ($this->lexic_permissions['STRINGS']) { foreach ($this->language_data['QUOTEMARKS'] as $quotemark) { if (!isset($is_string_starter[$quotemark[0]])) { $is_string_starter[$quotemark[0]] = (string)$quotemark; } elseif (is_string($is_string_starter[$quotemark[0]])) { $is_string_starter[$quotemark[0]] = array( $is_string_starter[$quotemark[0]], $quotemark); } else { $is_string_starter[$quotemark[0]][] = $quotemark; } } } // Now we go through each part. We know that even-indexed parts are // code that shouldn't be highlighted, and odd-indexed parts should // be highlighted for ($key = 0; $key < $num_parts; ++$key) { $STRICTATTRS = ''; // If this block should be highlighted... if (!($key & 1)) { // Else not a block to highlight $endresult .= $this->hsc($parts[$key][1]); unset($parts[$key]); continue; } $result = ''; $part = $parts[$key][1]; $highlight_part = true; if ($this->strict_mode && !is_null($parts[$key][0])) { // get the class key for this block of code $script_key = $parts[$key][0]; $highlight_part = $this->language_data['HIGHLIGHT_STRICT_BLOCK'][$script_key]; if ($this->language_data['STYLES']['SCRIPT'][$script_key] != '' && $this->lexic_permissions['SCRIPT']) { // Add a span element around the source to // highlight the overall source block if (!$this->use_classes && $this->language_data['STYLES']['SCRIPT'][$script_key] != '') { $attributes = ' style="' . $this->language_data['STYLES']['SCRIPT'][$script_key] . '"'; } else { $attributes = ' class="sc' . $script_key . '"'; } $result .= ""; $STRICTATTRS = $attributes; } } if ($highlight_part) { // Now, highlight the code in this block. This code // is really the engine of GeSHi (along with the method // parse_non_string_part). // cache comment regexps incrementally $next_comment_regexp_key = ''; $next_comment_regexp_pos = -1; $next_comment_multi_pos = -1; $next_comment_single_pos = -1; $comment_regexp_cache_per_key = array(); $comment_multi_cache_per_key = array(); $comment_single_cache_per_key = array(); $next_open_comment_multi = ''; $next_comment_single_key = ''; $escape_regexp_cache_per_key = array(); $next_escape_regexp_key = ''; $next_escape_regexp_pos = -1; $length = strlen($part); for ($i = 0; $i < $length; ++$i) { // Get the next char $char = $part[$i]; $char_len = 1; // update regexp comment cache if needed if (isset($this->language_data['COMMENT_REGEXP']) && $next_comment_regexp_pos < $i) { $next_comment_regexp_pos = $length; foreach ($this->language_data['COMMENT_REGEXP'] as $comment_key => $regexp) { $match_i = false; if (isset($comment_regexp_cache_per_key[$comment_key]) && ($comment_regexp_cache_per_key[$comment_key]['pos'] >= $i || $comment_regexp_cache_per_key[$comment_key]['pos'] === false)) { // we have already matched something if ($comment_regexp_cache_per_key[$comment_key]['pos'] === false) { // this comment is never matched continue; } $match_i = $comment_regexp_cache_per_key[$comment_key]['pos']; } elseif ( //This is to allow use of the offset parameter in preg_match and stay as compatible with older PHP versions as possible (GESHI_PHP_PRE_433 && preg_match($regexp, substr($part, $i), $match, PREG_OFFSET_CAPTURE)) || (!GESHI_PHP_PRE_433 && preg_match($regexp, $part, $match, PREG_OFFSET_CAPTURE, $i)) ) { $match_i = $match[0][1]; if (GESHI_PHP_PRE_433) { $match_i += $i; } $comment_regexp_cache_per_key[$comment_key] = array( 'key' => $comment_key, 'length' => strlen($match[0][0]), 'pos' => $match_i ); } else { $comment_regexp_cache_per_key[$comment_key]['pos'] = false; continue; } if ($match_i !== false && $match_i < $next_comment_regexp_pos) { $next_comment_regexp_pos = $match_i; $next_comment_regexp_key = $comment_key; if ($match_i === $i) { break; } } } } $string_started = false; if (isset($is_string_starter[$char])) { // Possibly the start of a new string ... //Check which starter it was ... //Fix for SF#1932083: Multichar Quotemarks unsupported if (is_array($is_string_starter[$char])) { $char_new = ''; foreach ($is_string_starter[$char] as $testchar) { if ($testchar === substr($part, $i, strlen($testchar)) && strlen($testchar) > strlen($char_new)) { $char_new = $testchar; $string_started = true; } } if ($string_started) { $char = $char_new; } } else { $testchar = $is_string_starter[$char]; if ($testchar === substr($part, $i, strlen($testchar))) { $char = $testchar; $string_started = true; } } $char_len = strlen($char); } if ($string_started && ($i != $next_comment_regexp_pos)) { // Hand out the correct style information for this string $string_key = array_search($char, $this->language_data['QUOTEMARKS']); if (!isset($this->language_data['STYLES']['STRINGS'][$string_key]) || !isset($this->language_data['STYLES']['ESCAPE_CHAR'][$string_key])) { $string_key = 0; } // parse the stuff before this $result .= $this->parse_non_string_part($stuff_to_parse); $stuff_to_parse = ''; if (!$this->use_classes) { $string_attributes = ' style="' . $this->language_data['STYLES']['STRINGS'][$string_key] . '"'; } else { $string_attributes = ' class="st'.$string_key.'"'; } // now handle the string $string = "" . GeSHi::hsc($char); $start = $i + $char_len; $string_open = true; if(empty($this->language_data['ESCAPE_REGEXP'])) { $next_escape_regexp_pos = $length; } do { //Get the regular ending pos ... $close_pos = strpos($part, $char, $start); if(false === $close_pos) { $close_pos = $length; } if($this->lexic_permissions['ESCAPE_CHAR']) { // update escape regexp cache if needed if (isset($this->language_data['ESCAPE_REGEXP']) && $next_escape_regexp_pos < $start) { $next_escape_regexp_pos = $length; foreach ($this->language_data['ESCAPE_REGEXP'] as $escape_key => $regexp) { $match_i = false; if (isset($escape_regexp_cache_per_key[$escape_key]) && ($escape_regexp_cache_per_key[$escape_key]['pos'] >= $start || $escape_regexp_cache_per_key[$escape_key]['pos'] === false)) { // we have already matched something if ($escape_regexp_cache_per_key[$escape_key]['pos'] === false) { // this comment is never matched continue; } $match_i = $escape_regexp_cache_per_key[$escape_key]['pos']; } elseif ( //This is to allow use of the offset parameter in preg_match and stay as compatible with older PHP versions as possible (GESHI_PHP_PRE_433 && preg_match($regexp, substr($part, $start), $match, PREG_OFFSET_CAPTURE)) || (!GESHI_PHP_PRE_433 && preg_match($regexp, $part, $match, PREG_OFFSET_CAPTURE, $start)) ) { $match_i = $match[0][1]; if (GESHI_PHP_PRE_433) { $match_i += $start; } $escape_regexp_cache_per_key[$escape_key] = array( 'key' => $escape_key, 'length' => strlen($match[0][0]), 'pos' => $match_i ); } else { $escape_regexp_cache_per_key[$escape_key]['pos'] = false; continue; } if ($match_i !== false && $match_i < $next_escape_regexp_pos) { $next_escape_regexp_pos = $match_i; $next_escape_regexp_key = $escape_key; if ($match_i === $start) { break; } } } } //Find the next simple escape position if('' != $this->language_data['ESCAPE_CHAR']) { $simple_escape = strpos($part, $this->language_data['ESCAPE_CHAR'], $start); if(false === $simple_escape) { $simple_escape = $length; } } else { $simple_escape = $length; } } else { $next_escape_regexp_pos = $length; $simple_escape = $length; } if($simple_escape < $next_escape_regexp_pos && $simple_escape < $length && $simple_escape < $close_pos) { //The nexxt escape sequence is a simple one ... $es_pos = $simple_escape; //Add the stuff not in the string yet ... $string .= $this->hsc(substr($part, $start, $es_pos - $start)); //Get the style for this escaped char ... if (!$this->use_classes) { $escape_char_attributes = ' style="' . $this->language_data['STYLES']['ESCAPE_CHAR'][0] . '"'; } else { $escape_char_attributes = ' class="es0"'; } //Add the style for the escape char ... $string .= "" . GeSHi::hsc($this->language_data['ESCAPE_CHAR']); //Get the byte AFTER the ESCAPE_CHAR we just found $es_char = $part[$es_pos + 1]; if ($es_char == "\n") { // don't put a newline around newlines $string .= "
\n"; $start = $es_pos + 2; } elseif (ord($es_char) >= 128) { //This is an non-ASCII char (UTF8 or single byte) //This code tries to work around SF#2037598 ... if(function_exists('mb_substr')) { $es_char_m = mb_substr(substr($part, $es_pos+1, 16), 0, 1, $this->encoding); $string .= $es_char_m . ''; } elseif (!GESHI_PHP_PRE_433 && 'utf-8' == $this->encoding) { if(preg_match("/[\xC2-\xDF][\x80-\xBF]". "|\xE0[\xA0-\xBF][\x80-\xBF]". "|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}". "|\xED[\x80-\x9F][\x80-\xBF]". "|\xF0[\x90-\xBF][\x80-\xBF]{2}". "|[\xF1-\xF3][\x80-\xBF]{3}". "|\xF4[\x80-\x8F][\x80-\xBF]{2}/s", $part, $es_char_m, null, $es_pos + 1)) { $es_char_m = $es_char_m[0]; } else { $es_char_m = $es_char; } $string .= $this->hsc($es_char_m) . ''; } else { $es_char_m = $this->hsc($es_char); } $start = $es_pos + strlen($es_char_m) + 1; } else { $string .= $this->hsc($es_char) . ''; $start = $es_pos + 2; } } elseif ($next_escape_regexp_pos < $length && $next_escape_regexp_pos < $close_pos) { $es_pos = $next_escape_regexp_pos; //Add the stuff not in the string yet ... $string .= $this->hsc(substr($part, $start, $es_pos - $start)); //Get the key and length of this match ... $escape = $escape_regexp_cache_per_key[$next_escape_regexp_key]; $escape_str = substr($part, $es_pos, $escape['length']); $escape_key = $escape['key']; //Get the style for this escaped char ... if (!$this->use_classes) { $escape_char_attributes = ' style="' . $this->language_data['STYLES']['ESCAPE_CHAR'][$escape_key] . '"'; } else { $escape_char_attributes = ' class="es' . $escape_key . '"'; } //Add the style for the escape char ... $string .= "" . $this->hsc($escape_str) . ''; $start = $es_pos + $escape['length']; } else { //Copy the remainder of the string ... $string .= $this->hsc(substr($part, $start, $close_pos - $start + $char_len)) . ''; $start = $close_pos + $char_len; $string_open = false; } } while($string_open); if ($check_linenumbers) { // Are line numbers used? If, we should end the string before // the newline and begin it again (so when
  • s are put in the source // remains XHTML compliant) // note to self: This opens up possibility of config files specifying // that languages can/cannot have multiline strings??? $string = str_replace("\n", "\n", $string); } $result .= $string; $string = ''; $i = $start - 1; continue; } elseif ($this->lexic_permissions['STRINGS'] && $hq && $hq[0] == $char && substr($part, $i, $hq_strlen) == $hq && ($i != $next_comment_regexp_pos)) { // The start of a hard quoted string if (!$this->use_classes) { $string_attributes = ' style="' . $this->language_data['STYLES']['STRINGS']['HARD'] . '"'; $escape_char_attributes = ' style="' . $this->language_data['STYLES']['ESCAPE_CHAR']['HARD'] . '"'; } else { $string_attributes = ' class="st_h"'; $escape_char_attributes = ' class="es_h"'; } // parse the stuff before this $result .= $this->parse_non_string_part($stuff_to_parse); $stuff_to_parse = ''; // now handle the string $string = ''; // look for closing quote $start = $i + $hq_strlen; while ($close_pos = strpos($part, $this->language_data['HARDQUOTE'][1], $start)) { $start = $close_pos + 1; if ($this->lexic_permissions['ESCAPE_CHAR'] && $part[$close_pos - 1] == $this->language_data['HARDCHAR'] && (($i + $hq_strlen) != ($close_pos))) { //Support empty string for HQ escapes if Starter = Escape // make sure this quote is not escaped foreach ($this->language_data['HARDESCAPE'] as $hardescape) { if (substr($part, $close_pos - 1, strlen($hardescape)) == $hardescape) { // check wether this quote is escaped or if it is something like '\\' $escape_char_pos = $close_pos - 1; while ($escape_char_pos > 0 && $part[$escape_char_pos - 1] == $this->language_data['HARDCHAR']) { --$escape_char_pos; } if (($close_pos - $escape_char_pos) & 1) { // uneven number of escape chars => this quote is escaped continue 2; } } } } // found closing quote break; } //Found the closing delimiter? if (!$close_pos) { // span till the end of this $part when no closing delimiter is found $close_pos = $length; } //Get the actual string $string = substr($part, $i, $close_pos - $i + 1); $i = $close_pos; // handle escape chars and encode html chars // (special because when we have escape chars within our string they may not be escaped) if ($this->lexic_permissions['ESCAPE_CHAR'] && $this->language_data['ESCAPE_CHAR']) { $start = 0; $new_string = ''; while ($es_pos = strpos($string, $this->language_data['ESCAPE_CHAR'], $start)) { // hmtl escape stuff before $new_string .= $this->hsc(substr($string, $start, $es_pos - $start)); // check if this is a hard escape foreach ($this->language_data['HARDESCAPE'] as $hardescape) { if (substr($string, $es_pos, strlen($hardescape)) == $hardescape) { // indeed, this is a hardescape $new_string .= "" . $this->hsc($hardescape) . ''; $start = $es_pos + strlen($hardescape); continue 2; } } // not a hard escape, but a normal escape // they come in pairs of two $c = 0; while (isset($string[$es_pos + $c]) && isset($string[$es_pos + $c + 1]) && $string[$es_pos + $c] == $this->language_data['ESCAPE_CHAR'] && $string[$es_pos + $c + 1] == $this->language_data['ESCAPE_CHAR']) { $c += 2; } if ($c) { $new_string .= "" . str_repeat($escaped_escape_char, $c) . ''; $start = $es_pos + $c; } else { // this is just a single lonely escape char... $new_string .= $escaped_escape_char; $start = $es_pos + 1; } } $string = $new_string . $this->hsc(substr($string, $start)); } else { $string = $this->hsc($string); } if ($check_linenumbers) { // Are line numbers used? If, we should end the string before // the newline and begin it again (so when
  • s are put in the source // remains XHTML compliant) // note to self: This opens up possibility of config files specifying // that languages can/cannot have multiline strings??? $string = str_replace("\n", "\n", $string); } $result .= "" . $string . ''; $string = ''; continue; } else { //Have a look for regexp comments if ($i == $next_comment_regexp_pos) { $COMMENT_MATCHED = true; $comment = $comment_regexp_cache_per_key[$next_comment_regexp_key]; $test_str = $this->hsc(substr($part, $i, $comment['length'])); //@todo If remove important do remove here if ($this->lexic_permissions['COMMENTS']['MULTI']) { if (!$this->use_classes) { $attributes = ' style="' . $this->language_data['STYLES']['COMMENTS'][$comment['key']] . '"'; } else { $attributes = ' class="co' . $comment['key'] . '"'; } $test_str = "" . $test_str . ""; // Short-cut through all the multiline code if ($check_linenumbers) { // strreplace to put close span and open span around multiline newlines $test_str = str_replace( "\n", "\n", str_replace("\n ", "\n ", $test_str) ); } } $i += $comment['length'] - 1; // parse the rest $result .= $this->parse_non_string_part($stuff_to_parse); $stuff_to_parse = ''; } // If we haven't matched a regexp comment, try multi-line comments if (!$COMMENT_MATCHED) { // Is this a multiline comment? if (!empty($this->language_data['COMMENT_MULTI']) && $next_comment_multi_pos < $i) { $next_comment_multi_pos = $length; foreach ($this->language_data['COMMENT_MULTI'] as $open => $close) { $match_i = false; if (isset($comment_multi_cache_per_key[$open]) && ($comment_multi_cache_per_key[$open] >= $i || $comment_multi_cache_per_key[$open] === false)) { // we have already matched something if ($comment_multi_cache_per_key[$open] === false) { // this comment is never matched continue; } $match_i = $comment_multi_cache_per_key[$open]; } elseif (($match_i = stripos($part, $open, $i)) !== false) { $comment_multi_cache_per_key[$open] = $match_i; } else { $comment_multi_cache_per_key[$open] = false; continue; } if ($match_i !== false && $match_i < $next_comment_multi_pos) { $next_comment_multi_pos = $match_i; $next_open_comment_multi = $open; if ($match_i === $i) { break; } } } } if ($i == $next_comment_multi_pos) { $open = $next_open_comment_multi; $close = $this->language_data['COMMENT_MULTI'][$open]; $open_strlen = strlen($open); $close_strlen = strlen($close); $COMMENT_MATCHED = true; $test_str_match = $open; //@todo If remove important do remove here if ($this->lexic_permissions['COMMENTS']['MULTI'] || $open == GESHI_START_IMPORTANT) { if ($open != GESHI_START_IMPORTANT) { if (!$this->use_classes) { $attributes = ' style="' . $this->language_data['STYLES']['COMMENTS']['MULTI'] . '"'; } else { $attributes = ' class="coMULTI"'; } $test_str = "" . $this->hsc($open); } else { if (!$this->use_classes) { $attributes = ' style="' . $this->important_styles . '"'; } else { $attributes = ' class="imp"'; } // We don't include the start of the comment if it's an // "important" part $test_str = ""; } } else { $test_str = $this->hsc($open); } $close_pos = strpos( $part, $close, $i + $open_strlen ); if ($close_pos === false) { $close_pos = $length; } // Short-cut through all the multiline code $rest_of_comment = $this->hsc(substr($part, $i + $open_strlen, $close_pos - $i - $open_strlen + $close_strlen)); if (($this->lexic_permissions['COMMENTS']['MULTI'] || $test_str_match == GESHI_START_IMPORTANT) && $check_linenumbers) { // strreplace to put close span and open span around multiline newlines $test_str .= str_replace( "\n", "\n", str_replace("\n ", "\n ", $rest_of_comment) ); } else { $test_str .= $rest_of_comment; } if ($this->lexic_permissions['COMMENTS']['MULTI'] || $test_str_match == GESHI_START_IMPORTANT) { $test_str .= ''; } $i = $close_pos + $close_strlen - 1; // parse the rest $result .= $this->parse_non_string_part($stuff_to_parse); $stuff_to_parse = ''; } } // If we haven't matched a multiline comment, try single-line comments if (!$COMMENT_MATCHED) { // cache potential single line comment occurances if (!empty($this->language_data['COMMENT_SINGLE']) && $next_comment_single_pos < $i) { $next_comment_single_pos = $length; foreach ($this->language_data['COMMENT_SINGLE'] as $comment_key => $comment_mark) { $match_i = false; if (isset($comment_single_cache_per_key[$comment_key]) && ($comment_single_cache_per_key[$comment_key] >= $i || $comment_single_cache_per_key[$comment_key] === false)) { // we have already matched something if ($comment_single_cache_per_key[$comment_key] === false) { // this comment is never matched continue; } $match_i = $comment_single_cache_per_key[$comment_key]; } elseif ( // case sensitive comments ($this->language_data['CASE_SENSITIVE'][GESHI_COMMENTS] && ($match_i = stripos($part, $comment_mark, $i)) !== false) || // non case sensitive (!$this->language_data['CASE_SENSITIVE'][GESHI_COMMENTS] && (($match_i = strpos($part, $comment_mark, $i)) !== false))) { $comment_single_cache_per_key[$comment_key] = $match_i; } else { $comment_single_cache_per_key[$comment_key] = false; continue; } if ($match_i !== false && $match_i < $next_comment_single_pos) { $next_comment_single_pos = $match_i; $next_comment_single_key = $comment_key; if ($match_i === $i) { break; } } } } if ($next_comment_single_pos == $i) { $comment_key = $next_comment_single_key; $comment_mark = $this->language_data['COMMENT_SINGLE'][$comment_key]; $com_len = strlen($comment_mark); // This check will find special variables like $# in bash // or compiler directives of Delphi beginning {$ if ((empty($sc_disallowed_before) || ($i == 0) || (false === strpos($sc_disallowed_before, $part[$i-1]))) && (empty($sc_disallowed_after) || ($length <= $i + $com_len) || (false === strpos($sc_disallowed_after, $part[$i + $com_len])))) { // this is a valid comment $COMMENT_MATCHED = true; if ($this->lexic_permissions['COMMENTS'][$comment_key]) { if (!$this->use_classes) { $attributes = ' style="' . $this->language_data['STYLES']['COMMENTS'][$comment_key] . '"'; } else { $attributes = ' class="co' . $comment_key . '"'; } $test_str = "" . $this->hsc($this->change_case($comment_mark)); } else { $test_str = $this->hsc($comment_mark); } //Check if this comment is the last in the source $close_pos = strpos($part, "\n", $i); $oops = false; if ($close_pos === false) { $close_pos = $length; $oops = true; } $test_str .= $this->hsc(substr($part, $i + $com_len, $close_pos - $i - $com_len)); if ($this->lexic_permissions['COMMENTS'][$comment_key]) { $test_str .= ""; } // Take into account that the comment might be the last in the source if (!$oops) { $test_str .= "\n"; } $i = $close_pos; // parse the rest $result .= $this->parse_non_string_part($stuff_to_parse); $stuff_to_parse = ''; } } } } // Where are we adding this char? if (!$COMMENT_MATCHED) { $stuff_to_parse .= $char; } else { $result .= $test_str; unset($test_str); $COMMENT_MATCHED = false; } } // Parse the last bit $result .= $this->parse_non_string_part($stuff_to_parse); $stuff_to_parse = ''; } else { $result .= $this->hsc($part); } // Close the that surrounds the block if ($STRICTATTRS != '') { $result = str_replace("\n", "\n", $result); $result .= ''; } $endresult .= $result; unset($part, $parts[$key], $result); } //This fix is related to SF#1923020, but has to be applied regardless of //actually highlighting symbols. /** NOTE: memorypeak #3 */ $endresult = str_replace(array('', ''), array(';', '|'), $endresult); // // Parse the last stuff (redundant?) // $result .= $this->parse_non_string_part($stuff_to_parse); // Lop off the very first and last spaces // $result = substr($result, 1, -1); // We're finished: stop timing $this->set_time($start_time, microtime()); $this->finalise($endresult); return $endresult; } /** * Swaps out spaces and tabs for HTML indentation. Not needed if * the code is in a pre block... * * @param string The source to indent (reference!) * @since 1.0.0 * @access private */ function indent(&$result) { /// Replace tabs with the correct number of spaces if (false !== strpos($result, "\t")) { $lines = explode("\n", $result); $result = null;//Save memory while we process the lines individually $tab_width = $this->get_real_tab_width(); $tab_string = ' ' . str_repeat(' ', $tab_width); for ($key = 0, $n = count($lines); $key < $n; $key++) { $line = $lines[$key]; if (false === strpos($line, "\t")) { continue; } $pos = 0; $length = strlen($line); $lines[$key] = ''; // reduce memory $IN_TAG = false; for ($i = 0; $i < $length; ++$i) { $char = $line[$i]; // Simple engine to work out whether we're in a tag. // If we are we modify $pos. This is so we ignore HTML // in the line and only workout the tab replacement // via the actual content of the string // This test could be improved to include strings in the // html so that < or > would be allowed in user's styles // (e.g. quotes: '<' '>'; or similar) if ($IN_TAG) { if ('>' == $char) { $IN_TAG = false; } $lines[$key] .= $char; } elseif ('<' == $char) { $IN_TAG = true; $lines[$key] .= '<'; } elseif ('&' == $char) { $substr = substr($line, $i + 3, 5); $posi = strpos($substr, ';'); if (false === $posi) { ++$pos; } else { $pos -= $posi+2; } $lines[$key] .= $char; } elseif ("\t" == $char) { $str = ''; // OPTIMISE - move $strs out. Make an array: // $tabs = array( // 1 => ' ', // 2 => '  ', // 3 => '   ' etc etc // to use instead of building a string every time $tab_end_width = $tab_width - ($pos % $tab_width); //Moved out of the look as it doesn't change within the loop if (($pos & 1) || 1 == $tab_end_width) { $str .= substr($tab_string, 6, $tab_end_width); } else { $str .= substr($tab_string, 0, $tab_end_width+5); } $lines[$key] .= $str; $pos += $tab_end_width; if (false === strpos($line, "\t", $i + 1)) { $lines[$key] .= substr($line, $i + 1); break; } } elseif (0 == $pos && ' ' == $char) { $lines[$key] .= ' '; ++$pos; } else { $lines[$key] .= $char; ++$pos; } } } $result = implode("\n", $lines); unset($lines);//We don't need the lines separated beyond this --- free them! } // Other whitespace // BenBE: Fix to reduce the number of replacements to be done $result = preg_replace('/^ /m', ' ', $result); $result = str_replace(' ', '  ', $result); if ($this->line_numbers == GESHI_NO_LINE_NUMBERS && $this->header_type != GESHI_HEADER_PRE_TABLE) { if ($this->line_ending === null) { $result = nl2br($result); } else { $result = str_replace("\n", $this->line_ending, $result); } } } /** * Changes the case of a keyword for those languages where a change is asked for * * @param string The keyword to change the case of * @return string The keyword with its case changed * @since 1.0.0 * @access private */ function change_case($instr) { switch ($this->language_data['CASE_KEYWORDS']) { case GESHI_CAPS_UPPER: return strtoupper($instr); case GESHI_CAPS_LOWER: return strtolower($instr); default: return $instr; } } /** * Handles replacements of keywords to include markup and links if requested * * @param string The keyword to add the Markup to * @return The HTML for the match found * @since 1.0.8 * @access private * * @todo Get rid of ender in keyword links */ function handle_keyword_replace($match) { $k = $this->_kw_replace_group; $keyword = $match[0]; $before = ''; $after = ''; if ($this->keyword_links) { // Keyword links have been ebabled if (isset($this->language_data['URLS'][$k]) && $this->language_data['URLS'][$k] != '') { // There is a base group for this keyword // Old system: strtolower //$keyword = ( $this->language_data['CASE_SENSITIVE'][$group] ) ? $keyword : strtolower($keyword); // New system: get keyword from language file to get correct case if (!$this->language_data['CASE_SENSITIVE'][$k] && strpos($this->language_data['URLS'][$k], '{FNAME}') !== false) { foreach ($this->language_data['KEYWORDS'][$k] as $word) { if (strcasecmp($word, $keyword) == 0) { break; } } } else { $word = $keyword; } $before = '<|UR1|"' . str_replace( array( '{FNAME}', '{FNAMEL}', '{FNAMEU}', '.'), array( str_replace('+', '%20', urlencode($this->hsc($word))), str_replace('+', '%20', urlencode($this->hsc(strtolower($word)))), str_replace('+', '%20', urlencode($this->hsc(strtoupper($word)))), ''), $this->language_data['URLS'][$k] ) . '">'; $after = ''; } } return $before . '<|/'. $k .'/>' . $this->change_case($keyword) . '|>' . $after; } /** * handles regular expressions highlighting-definitions with callback functions * * @note this is a callback, don't use it directly * * @param array the matches array * @return The highlighted string * @since 1.0.8 * @access private */ function handle_regexps_callback($matches) { // before: "' style=\"' . call_user_func(\"$func\", '\\1') . '\"\\1|>'", return ' style="' . call_user_func($this->language_data['STYLES']['REGEXPS'][$this->_rx_key], $matches[1]) . '"'. $matches[1] . '|>'; } /** * handles newlines in REGEXPS matches. Set the _hmr_* vars before calling this * * @note this is a callback, don't use it directly * * @param array the matches array * @return string * @since 1.0.8 * @access private */ function handle_multiline_regexps($matches) { $before = $this->_hmr_before; $after = $this->_hmr_after; if ($this->_hmr_replace) { $replace = $this->_hmr_replace; $search = array(); foreach (array_keys($matches) as $k) { $search[] = '\\' . $k; } $before = str_replace($search, $matches, $before); $after = str_replace($search, $matches, $after); $replace = str_replace($search, $matches, $replace); } else { $replace = $matches[0]; } return $before . '<|!REG3XP' . $this->_hmr_key .'!>' . str_replace("\n", "|>\n<|!REG3XP" . $this->_hmr_key . '!>', $replace) . '|>' . $after; } /** * Takes a string that has no strings or comments in it, and highlights * stuff like keywords, numbers and methods. * * @param string The string to parse for keyword, numbers etc. * @since 1.0.0 * @access private * @todo BUGGY! Why? Why not build string and return? */ function parse_non_string_part($stuff_to_parse) { $stuff_to_parse = ' ' . $this->hsc($stuff_to_parse); // Highlight keywords $disallowed_before = "(?lexic_permissions['STRINGS']) { $quotemarks = preg_quote(implode($this->language_data['QUOTEMARKS']), '/'); $disallowed_before .= $quotemarks; $disallowed_after .= $quotemarks; } $disallowed_before .= "])"; $disallowed_after .= "])"; $parser_control_pergroup = false; if (isset($this->language_data['PARSER_CONTROL'])) { if (isset($this->language_data['PARSER_CONTROL']['KEYWORDS'])) { $x = 0; // check wether per-keyword-group parser_control is enabled if (isset($this->language_data['PARSER_CONTROL']['KEYWORDS']['DISALLOWED_BEFORE'])) { $disallowed_before = $this->language_data['PARSER_CONTROL']['KEYWORDS']['DISALLOWED_BEFORE']; ++$x; } if (isset($this->language_data['PARSER_CONTROL']['KEYWORDS']['DISALLOWED_AFTER'])) { $disallowed_after = $this->language_data['PARSER_CONTROL']['KEYWORDS']['DISALLOWED_AFTER']; ++$x; } $parser_control_pergroup = (count($this->language_data['PARSER_CONTROL']['KEYWORDS']) - $x) > 0; } } foreach (array_keys($this->language_data['KEYWORDS']) as $k) { if (!isset($this->lexic_permissions['KEYWORDS'][$k]) || $this->lexic_permissions['KEYWORDS'][$k]) { $case_sensitive = $this->language_data['CASE_SENSITIVE'][$k]; $modifiers = $case_sensitive ? '' : 'i'; // NEW in 1.0.8 - per-keyword-group parser control $disallowed_before_local = $disallowed_before; $disallowed_after_local = $disallowed_after; if ($parser_control_pergroup && isset($this->language_data['PARSER_CONTROL']['KEYWORDS'][$k])) { if (isset($this->language_data['PARSER_CONTROL']['KEYWORDS'][$k]['DISALLOWED_BEFORE'])) { $disallowed_before_local = $this->language_data['PARSER_CONTROL']['KEYWORDS'][$k]['DISALLOWED_BEFORE']; } if (isset($this->language_data['PARSER_CONTROL']['KEYWORDS'][$k]['DISALLOWED_AFTER'])) { $disallowed_after_local = $this->language_data['PARSER_CONTROL']['KEYWORDS'][$k]['DISALLOWED_AFTER']; } } $this->_kw_replace_group = $k; //NEW in 1.0.8, the cached regexp list // since we don't want PHP / PCRE to crash due to too large patterns we split them into smaller chunks for ($set = 0, $set_length = count($this->language_data['CACHED_KEYWORD_LISTS'][$k]); $set < $set_length; ++$set) { $keywordset =& $this->language_data['CACHED_KEYWORD_LISTS'][$k][$set]; // Might make a more unique string for putting the number in soon // Basically, we don't put the styles in yet because then the styles themselves will // get highlighted if the language has a CSS keyword in it (like CSS, for example ;)) $stuff_to_parse = preg_replace_callback( "/$disallowed_before_local({$keywordset})(?!\(?:htm|php|aspx?))$disallowed_after_local/$modifiers", array($this, 'handle_keyword_replace'), $stuff_to_parse ); } } } // Regular expressions foreach ($this->language_data['REGEXPS'] as $key => $regexp) { if ($this->lexic_permissions['REGEXPS'][$key]) { if (is_array($regexp)) { if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) { // produce valid HTML when we match multiple lines $this->_hmr_replace = $regexp[GESHI_REPLACE]; $this->_hmr_before = $regexp[GESHI_BEFORE]; $this->_hmr_key = $key; $this->_hmr_after = $regexp[GESHI_AFTER]; $stuff_to_parse = preg_replace_callback( "/" . $regexp[GESHI_SEARCH] . "/{$regexp[GESHI_MODIFIERS]}", array($this, 'handle_multiline_regexps'), $stuff_to_parse); $this->_hmr_replace = false; $this->_hmr_before = ''; $this->_hmr_after = ''; } else { $stuff_to_parse = preg_replace( '/' . $regexp[GESHI_SEARCH] . '/' . $regexp[GESHI_MODIFIERS], $regexp[GESHI_BEFORE] . '<|!REG3XP'. $key .'!>' . $regexp[GESHI_REPLACE] . '|>' . $regexp[GESHI_AFTER], $stuff_to_parse); } } else { if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) { // produce valid HTML when we match multiple lines $this->_hmr_key = $key; $stuff_to_parse = preg_replace_callback( "/(" . $regexp . ")/", array($this, 'handle_multiline_regexps'), $stuff_to_parse); $this->_hmr_key = ''; } else { $stuff_to_parse = preg_replace( "/(" . $regexp . ")/", "<|!REG3XP$key!>\\1|>", $stuff_to_parse); } } } } // Highlight numbers. As of 1.0.8 we support different types of numbers $numbers_found = false; if ($this->lexic_permissions['NUMBERS'] && preg_match($this->language_data['PARSER_CONTROL']['NUMBERS']['PRECHECK_RX'], $stuff_to_parse )) { $numbers_found = true; //For each of the formats ... foreach ($this->language_data['NUMBERS_RXCACHE'] as $id => $regexp) { //Check if it should be highlighted ... $stuff_to_parse = preg_replace($regexp, "<|/NUM!$id/>\\1|>", $stuff_to_parse); } } // // Now that's all done, replace /[number]/ with the correct styles // foreach (array_keys($this->language_data['KEYWORDS']) as $k) { if (!$this->use_classes) { $attributes = ' style="' . (isset($this->language_data['STYLES']['KEYWORDS'][$k]) ? $this->language_data['STYLES']['KEYWORDS'][$k] : "") . '"'; } else { $attributes = ' class="kw' . $k . '"'; } $stuff_to_parse = str_replace("<|/$k/>", "<|$attributes>", $stuff_to_parse); } if ($numbers_found) { // Put number styles in foreach ($this->language_data['NUMBERS_RXCACHE'] as $id => $regexp) { //Commented out for now, as this needs some review ... // if ($numbers_permissions & $id) { //Get the appropriate style ... //Checking for unset styles is done by the style cache builder ... if (!$this->use_classes) { $attributes = ' style="' . $this->language_data['STYLES']['NUMBERS'][$id] . '"'; } else { $attributes = ' class="nu'.$id.'"'; } //Set in the correct styles ... $stuff_to_parse = str_replace("/NUM!$id/", $attributes, $stuff_to_parse); // } } } // Highlight methods and fields in objects if ($this->lexic_permissions['METHODS'] && $this->language_data['OOLANG']) { $oolang_spaces = "[\s]*"; $oolang_before = ""; $oolang_after = "[a-zA-Z][a-zA-Z0-9_]*"; if (isset($this->language_data['PARSER_CONTROL'])) { if (isset($this->language_data['PARSER_CONTROL']['OOLANG'])) { if (isset($this->language_data['PARSER_CONTROL']['OOLANG']['MATCH_BEFORE'])) { $oolang_before = $this->language_data['PARSER_CONTROL']['OOLANG']['MATCH_BEFORE']; } if (isset($this->language_data['PARSER_CONTROL']['OOLANG']['MATCH_AFTER'])) { $oolang_after = $this->language_data['PARSER_CONTROL']['OOLANG']['MATCH_AFTER']; } if (isset($this->language_data['PARSER_CONTROL']['OOLANG']['MATCH_SPACES'])) { $oolang_spaces = $this->language_data['PARSER_CONTROL']['OOLANG']['MATCH_SPACES']; } } } foreach ($this->language_data['OBJECT_SPLITTERS'] as $key => $splitter) { if (false !== strpos($stuff_to_parse, $splitter)) { if (!$this->use_classes) { $attributes = ' style="' . $this->language_data['STYLES']['METHODS'][$key] . '"'; } else { $attributes = ' class="me' . $key . '"'; } $stuff_to_parse = preg_replace("/($oolang_before)(" . preg_quote($this->language_data['OBJECT_SPLITTERS'][$key], '/') . ")($oolang_spaces)($oolang_after)/", "\\1\\2\\3<|$attributes>\\4|>", $stuff_to_parse); } } } // // Highlight brackets. Yes, I've tried adding a semi-colon to this list. // You try it, and see what happens ;) // TODO: Fix lexic permissions not converting entities if shouldn't // be highlighting regardless // if ($this->lexic_permissions['BRACKETS']) { $stuff_to_parse = str_replace( $this->language_data['CACHE_BRACKET_MATCH'], $this->language_data['CACHE_BRACKET_REPLACE'], $stuff_to_parse ); } //FIX for symbol highlighting ... if ($this->lexic_permissions['SYMBOLS'] && !empty($this->language_data['SYMBOLS'])) { //Get all matches and throw away those witin a block that is already highlighted... (i.e. matched by a regexp) $n_symbols = preg_match_all("/<\|(?:|[^>])+>(?:(?!\|>).*?)\|>|<\/a>|(?:" . $this->language_data['SYMBOL_SEARCH'] . ")+(?![^<]+?>)/", $stuff_to_parse, $pot_symbols, PREG_OFFSET_CAPTURE | PREG_SET_ORDER); $global_offset = 0; for ($s_id = 0; $s_id < $n_symbols; ++$s_id) { $symbol_match = $pot_symbols[$s_id][0][0]; if (strpos($symbol_match, '<') !== false || strpos($symbol_match, '>') !== false) { // already highlighted blocks _must_ include either < or > // so if this conditional applies, we have to skip this match // BenBE: UNLESS the block contains or if(strpos($symbol_match, '') === false && strpos($symbol_match, '') === false) { continue; } } // if we reach this point, we have a valid match which needs to be highlighted $symbol_length = strlen($symbol_match); $symbol_offset = $pot_symbols[$s_id][0][1]; unset($pot_symbols[$s_id]); $symbol_end = $symbol_length + $symbol_offset; $symbol_hl = ""; // if we have multiple styles, we have to handle them properly if ($this->language_data['MULTIPLE_SYMBOL_GROUPS']) { $old_sym = -1; // Split the current stuff to replace into its atomic symbols ... preg_match_all("/" . $this->language_data['SYMBOL_SEARCH'] . "/", $symbol_match, $sym_match_syms, PREG_PATTERN_ORDER); foreach ($sym_match_syms[0] as $sym_ms) { //Check if consequtive symbols belong to the same group to save output ... if (isset($this->language_data['SYMBOL_DATA'][$sym_ms]) && ($this->language_data['SYMBOL_DATA'][$sym_ms] != $old_sym)) { if (-1 != $old_sym) { $symbol_hl .= "|>"; } $old_sym = $this->language_data['SYMBOL_DATA'][$sym_ms]; if (!$this->use_classes) { $symbol_hl .= '<| style="' . $this->language_data['STYLES']['SYMBOLS'][$old_sym] . '">'; } else { $symbol_hl .= '<| class="sy' . $old_sym . '">'; } } $symbol_hl .= $sym_ms; } unset($sym_match_syms); //Close remaining tags and insert the replacement at the right position ... //Take caution if symbol_hl is empty to avoid doubled closing spans. if (-1 != $old_sym) { $symbol_hl .= "|>"; } } else { if (!$this->use_classes) { $symbol_hl = '<| style="' . $this->language_data['STYLES']['SYMBOLS'][0] . '">'; } else { $symbol_hl = '<| class="sy0">'; } $symbol_hl .= $symbol_match . '|>'; } $stuff_to_parse = substr_replace($stuff_to_parse, $symbol_hl, $symbol_offset + $global_offset, $symbol_length); // since we replace old text with something of different size, // we'll have to keep track of the differences $global_offset += strlen($symbol_hl) - $symbol_length; } } //FIX for symbol highlighting ... // Add class/style for regexps foreach (array_keys($this->language_data['REGEXPS']) as $key) { if ($this->lexic_permissions['REGEXPS'][$key]) { if (is_callable($this->language_data['STYLES']['REGEXPS'][$key])) { $this->_rx_key = $key; $stuff_to_parse = preg_replace_callback("/!REG3XP$key!(.*)\|>/U", array($this, 'handle_regexps_callback'), $stuff_to_parse); } else { if (!$this->use_classes) { $attributes = ' style="' . $this->language_data['STYLES']['REGEXPS'][$key] . '"'; } else { if (is_array($this->language_data['REGEXPS'][$key]) && array_key_exists(GESHI_CLASS, $this->language_data['REGEXPS'][$key])) { $attributes = ' class="' . $this->language_data['REGEXPS'][$key][GESHI_CLASS] . '"'; } else { $attributes = ' class="re' . $key . '"'; } } $stuff_to_parse = str_replace("!REG3XP$key!", "$attributes", $stuff_to_parse); } } } // Replace with . for urls $stuff_to_parse = str_replace('', '.', $stuff_to_parse); // Replace <|UR1| with link_styles[GESHI_LINK])) { if ($this->use_classes) { $stuff_to_parse = str_replace('<|UR1|', 'link_target . ' href=', $stuff_to_parse); } else { $stuff_to_parse = str_replace('<|UR1|', 'link_target . ' style="' . $this->link_styles[GESHI_LINK] . '" href=', $stuff_to_parse); } } else { $stuff_to_parse = str_replace('<|UR1|', 'link_target . ' href=', $stuff_to_parse); } // // NOW we add the span thingy ;) // $stuff_to_parse = str_replace('<|', '', '', $stuff_to_parse ); return substr($stuff_to_parse, 1); } /** * Sets the time taken to parse the code * * @param microtime The time when parsing started * @param microtime The time when parsing ended * @since 1.0.2 * @access private */ function set_time($start_time, $end_time) { $start = explode(' ', $start_time); $end = explode(' ', $end_time); $this->time = $end[0] + $end[1] - $start[0] - $start[1]; } /** * Gets the time taken to parse the code * * @return double The time taken to parse the code * @since 1.0.2 */ function get_time() { return $this->time; } /** * Merges arrays recursively, overwriting values of the first array with values of later arrays * * @since 1.0.8 * @access private */ function merge_arrays() { $arrays = func_get_args(); $narrays = count($arrays); // check arguments // comment out if more performance is necessary (in this case the foreach loop will trigger a warning if the argument is not an array) for ($i = 0; $i < $narrays; $i ++) { if (!is_array($arrays[$i])) { // also array_merge_recursive returns nothing in this case trigger_error('Argument #' . ($i+1) . ' is not an array - trying to merge array with scalar! Returning false!', E_USER_WARNING); return false; } } // the first array is in the output set in every case $ret = $arrays[0]; // merege $ret with the remaining arrays for ($i = 1; $i < $narrays; $i ++) { foreach ($arrays[$i] as $key => $value) { if (is_array($value) && isset($ret[$key])) { // if $ret[$key] is not an array you try to merge an scalar value with an array - the result is not defined (incompatible arrays) // in this case the call will trigger an E_USER_WARNING and the $ret[$key] will be false. $ret[$key] = $this->merge_arrays($ret[$key], $value); } else { $ret[$key] = $value; } } } return $ret; } /** * Gets language information and stores it for later use * * @param string The filename of the language file you want to load * @since 1.0.0 * @access private * @todo Needs to load keys for lexic permissions for keywords, regexps etc */ function load_language($file_name) { if ($file_name == $this->loaded_language) { // this file is already loaded! return; } //Prepare some stuff before actually loading the language file $this->loaded_language = $file_name; $this->parse_cache_built = false; $this->enable_highlighting(); $language_data = array(); //Load the language file require $file_name; // Perhaps some checking might be added here later to check that // $language data is a valid thing but maybe not $this->language_data = $language_data; // Set strict mode if should be set $this->strict_mode = $this->language_data['STRICT_MODE_APPLIES']; // Set permissions for all lexics to true // so they'll be highlighted by default foreach (array_keys($this->language_data['KEYWORDS']) as $key) { if (!empty($this->language_data['KEYWORDS'][$key])) { $this->lexic_permissions['KEYWORDS'][$key] = true; } else { $this->lexic_permissions['KEYWORDS'][$key] = false; } } foreach (array_keys($this->language_data['COMMENT_SINGLE']) as $key) { $this->lexic_permissions['COMMENTS'][$key] = true; } foreach (array_keys($this->language_data['REGEXPS']) as $key) { $this->lexic_permissions['REGEXPS'][$key] = true; } // for BenBE and future code reviews: // we can use empty here since we only check for existance and emptiness of an array // if it is not an array at all but rather false or null this will work as intended as well // even if $this->language_data['PARSER_CONTROL'] is undefined this won't trigger a notice if (!empty($this->language_data['PARSER_CONTROL']['ENABLE_FLAGS'])) { foreach ($this->language_data['PARSER_CONTROL']['ENABLE_FLAGS'] as $flag => $value) { // it's either true or false and maybe is true as well $perm = $value !== GESHI_NEVER; if ($flag == 'ALL') { $this->enable_highlighting($perm); continue; } if (!isset($this->lexic_permissions[$flag])) { // unknown lexic permission continue; } if (is_array($this->lexic_permissions[$flag])) { foreach ($this->lexic_permissions[$flag] as $key => $val) { $this->lexic_permissions[$flag][$key] = $perm; } } else { $this->lexic_permissions[$flag] = $perm; } } unset($this->language_data['PARSER_CONTROL']['ENABLE_FLAGS']); } //Fix: Problem where hardescapes weren't handled if no ESCAPE_CHAR was given //You need to set one for HARDESCAPES only in this case. if(!isset($this->language_data['HARDCHAR'])) { $this->language_data['HARDCHAR'] = $this->language_data['ESCAPE_CHAR']; } //NEW in 1.0.8: Allow styles to be loaded from a separate file to override defaults $style_filename = substr($file_name, 0, -4) . '.style.php'; if (is_readable($style_filename)) { //Clear any style_data that could have been set before ... if (isset($style_data)) { unset($style_data); } //Read the Style Information from the style file include $style_filename; //Apply the new styles to our current language styles if (isset($style_data) && is_array($style_data)) { $this->language_data['STYLES'] = $this->merge_arrays($this->language_data['STYLES'], $style_data); } } } /** * Takes the parsed code and various options, and creates the HTML * surrounding it to make it look nice. * * @param string The code already parsed (reference!) * @since 1.0.0 * @access private */ function finalise(&$parsed_code) { // Remove end parts of important declarations // This is BUGGY!! My fault for bad code: fix coming in 1.2 // @todo Remove this crap if ($this->enable_important_blocks && (strpos($parsed_code, $this->hsc(GESHI_START_IMPORTANT)) === false)) { $parsed_code = str_replace($this->hsc(GESHI_END_IMPORTANT), '', $parsed_code); } // Add HTML whitespace stuff if we're using the
    header if ($this->header_type != GESHI_HEADER_PRE && $this->header_type != GESHI_HEADER_PRE_VALID) { $this->indent($parsed_code); } // purge some unnecessary stuff /** NOTE: memorypeak #1 */ $parsed_code = preg_replace('#]+>(\s*)#', '\\1', $parsed_code); // If we are using IDs for line numbers, there needs to be an overall // ID set to prevent collisions. if ($this->add_ids && !$this->overall_id) { $this->overall_id = 'geshi-' . substr(md5(microtime()), 0, 4); } // Get code into lines /** NOTE: memorypeak #2 */ $code = explode("\n", $parsed_code); $parsed_code = $this->header(); // If we're using line numbers, we insert
  • s and appropriate // markup to style them (otherwise we don't need to do anything) if ($this->line_numbers != GESHI_NO_LINE_NUMBERS && $this->header_type != GESHI_HEADER_PRE_TABLE) { // If we're using the
     header, we shouldn't add newlines because
                // the 
     will line-break them (and the 
  • s already do this for us) $ls = ($this->header_type != GESHI_HEADER_PRE && $this->header_type != GESHI_HEADER_PRE_VALID) ? "\n" : ''; // Set vars to defaults for following loop $i = 0; // Foreach line... for ($i = 0, $n = count($code); $i < $n;) { //Reset the attributes for a new line ... $attrs = array(); // Make lines have at least one space in them if they're empty // BenBE: Checking emptiness using trim instead of relying on blanks if ('' == trim($code[$i])) { $code[$i] = ' '; } // If this is a "special line"... if ($this->line_numbers == GESHI_FANCY_LINE_NUMBERS && $i % $this->line_nth_row == ($this->line_nth_row - 1)) { // Set the attributes to style the line if ($this->use_classes) { //$attr = ' class="li2"'; $attrs['class'][] = 'li2'; $def_attr = ' class="de2"'; } else { //$attr = ' style="' . $this->line_style2 . '"'; $attrs['style'][] = $this->line_style2; // This style "covers up" the special styles set for special lines // so that styles applied to special lines don't apply to the actual // code on that line $def_attr = ' style="' . $this->code_style . '"'; } } else { if ($this->use_classes) { //$attr = ' class="li1"'; $attrs['class'][] = 'li1'; $def_attr = ' class="de1"'; } else { //$attr = ' style="' . $this->line_style1 . '"'; $attrs['style'][] = $this->line_style1; $def_attr = ' style="' . $this->code_style . '"'; } } //Check which type of tag to insert for this line if ($this->header_type == GESHI_HEADER_PRE_VALID) { $start = ""; $end = '
  • '; } else { // Span or div? $start = ""; $end = '
  • '; } ++$i; // Are we supposed to use ids? If so, add them if ($this->add_ids) { $attrs['id'][] = "$this->overall_id-$i"; } //Is this some line with extra styles??? if (in_array($i, $this->highlight_extra_lines)) { if ($this->use_classes) { if (isset($this->highlight_extra_lines_styles[$i])) { $attrs['class'][] = "lx$i"; } else { $attrs['class'][] = "ln-xtra"; } } else { array_push($attrs['style'], $this->get_line_style($i)); } } // Add in the line surrounded by appropriate list HTML $attr_string = ''; foreach ($attrs as $key => $attr) { $attr_string .= ' ' . $key . '="' . implode(' ', $attr) . '"'; } $parsed_code .= "$start{$code[$i-1]}$end$ls"; unset($code[$i - 1]); } } else { $n = count($code); if ($this->use_classes) { $attributes = ' class="de1"'; } else { $attributes = ' style="'. $this->code_style .'"'; } if ($this->header_type == GESHI_HEADER_PRE_VALID) { $parsed_code .= ''; } elseif ($this->header_type == GESHI_HEADER_PRE_TABLE) { if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) { if ($this->use_classes) { $attrs = ' class="ln"'; } else { $attrs = ' style="'. $this->table_linenumber_style .'"'; } $parsed_code .= ''; // get linenumbers // we don't merge it with the for below, since it should be better for // memory consumption this way // @todo: but... actually it would still be somewhat nice to merge the two loops // the mem peaks are at different positions for ($i = 0; $i < $n; ++$i) { $close = 0; // fancy lines if ($this->line_numbers == GESHI_FANCY_LINE_NUMBERS && $i % $this->line_nth_row == ($this->line_nth_row - 1)) { // Set the attributes to style the line if ($this->use_classes) { $parsed_code .= ''; } else { // This style "covers up" the special styles set for special lines // so that styles applied to special lines don't apply to the actual // code on that line $parsed_code .= '' .''; } $close += 2; } //Is this some line with extra styles??? if (in_array($i + 1, $this->highlight_extra_lines)) { if ($this->use_classes) { if (isset($this->highlight_extra_lines_styles[$i])) { $parsed_code .= ""; } else { $parsed_code .= ""; } } else { $parsed_code .= "get_line_style($i) . "\">"; } ++$close; } $parsed_code .= $this->line_numbers_start + $i; if ($close) { $parsed_code .= str_repeat('', $close); } elseif ($i != $n) { $parsed_code .= "\n"; } } $parsed_code .= ''; } $parsed_code .= ''; } // No line numbers, but still need to handle highlighting lines extra. // Have to use divs so the full width of the code is highlighted $close = 0; for ($i = 0; $i < $n; ++$i) { // Make lines have at least one space in them if they're empty // BenBE: Checking emptiness using trim instead of relying on blanks if ('' == trim($code[$i])) { $code[$i] = ' '; } // fancy lines if ($this->line_numbers == GESHI_FANCY_LINE_NUMBERS && $i % $this->line_nth_row == ($this->line_nth_row - 1)) { // Set the attributes to style the line if ($this->use_classes) { $parsed_code .= ''; } else { // This style "covers up" the special styles set for special lines // so that styles applied to special lines don't apply to the actual // code on that line $parsed_code .= '' .''; } $close += 2; } //Is this some line with extra styles??? if (in_array($i + 1, $this->highlight_extra_lines)) { if ($this->use_classes) { if (isset($this->highlight_extra_lines_styles[$i])) { $parsed_code .= ""; } else { $parsed_code .= ""; } } else { $parsed_code .= "get_line_style($i) . "\">"; } ++$close; } $parsed_code .= $code[$i]; if ($close) { $parsed_code .= str_repeat('', $close); $close = 0; } elseif ($i + 1 < $n) { $parsed_code .= "\n"; } unset($code[$i]); } if ($this->header_type == GESHI_HEADER_PRE_VALID || $this->header_type == GESHI_HEADER_PRE_TABLE) { $parsed_code .= ''; } if ($this->header_type == GESHI_HEADER_PRE_TABLE && $this->line_numbers != GESHI_NO_LINE_NUMBERS) { $parsed_code .= ''; } } $parsed_code .= $this->footer(); } /** * Creates the header for the code block (with correct attributes) * * @return string The header for the code block * @since 1.0.0 * @access private */ function header() { // Get attributes needed /** * @todo Document behaviour change - class is outputted regardless of whether * we're using classes or not. Same with style */ $attributes = ' class="' . $this->_genCSSName($this->language); if ($this->overall_class != '') { $attributes .= " ".$this->_genCSSName($this->overall_class); } $attributes .= '"'; if ($this->overall_id != '') { $attributes .= " id=\"{$this->overall_id}\""; } if ($this->overall_style != '' && !$this->use_classes) { $attributes .= ' style="' . $this->overall_style . '"'; } $ol_attributes = ''; if ($this->line_numbers_start != 1) { $ol_attributes .= ' start="' . $this->line_numbers_start . '"'; } // Get the header HTML $header = $this->header_content; if ($header) { if ($this->header_type == GESHI_HEADER_PRE || $this->header_type == GESHI_HEADER_PRE_VALID) { $header = str_replace("\n", '', $header); } $header = $this->replace_keywords($header); if ($this->use_classes) { $attr = ' class="head"'; } else { $attr = " style=\"{$this->header_content_style}\""; } if ($this->header_type == GESHI_HEADER_PRE_TABLE && $this->line_numbers != GESHI_NO_LINE_NUMBERS) { $header = "$header"; } else { $header = "$header
    "; } } if (GESHI_HEADER_NONE == $this->header_type) { if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) { return "$header"; } return $header . ($this->force_code_block ? '
    ' : ''); } // Work out what to return and do it if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) { if ($this->header_type == GESHI_HEADER_PRE) { return "$header"; } elseif ($this->header_type == GESHI_HEADER_DIV || $this->header_type == GESHI_HEADER_PRE_VALID) { return "$header"; } elseif ($this->header_type == GESHI_HEADER_PRE_TABLE) { return "$header"; } } else { if ($this->header_type == GESHI_HEADER_PRE) { return "$header" . ($this->force_code_block ? '
    ' : ''); } else { return "$header" . ($this->force_code_block ? '
    ' : ''); } } } /** * Returns the footer for the code block. * * @return string The footer for the code block * @since 1.0.0 * @access private */ function footer() { $footer = $this->footer_content; if ($footer) { if ($this->header_type == GESHI_HEADER_PRE) { $footer = str_replace("\n", '', $footer); } $footer = $this->replace_keywords($footer); if ($this->use_classes) { $attr = ' class="foot"'; } else { $attr = " style=\"{$this->footer_content_style}\""; } if ($this->header_type == GESHI_HEADER_PRE_TABLE && $this->line_numbers != GESHI_NO_LINE_NUMBERS) { $footer = "$footer"; } else { $footer = "$footer
    "; } } if (GESHI_HEADER_NONE == $this->header_type) { return ($this->line_numbers != GESHI_NO_LINE_NUMBERS) ? '' . $footer : $footer; } if ($this->header_type == GESHI_HEADER_DIV || $this->header_type == GESHI_HEADER_PRE_VALID) { if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) { return "$footer
    "; } return ($this->force_code_block ? '
    ' : '') . "$footer
    "; } elseif ($this->header_type == GESHI_HEADER_PRE_TABLE) { if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) { return "$footer"; } return ($this->force_code_block ? '
    ' : '') . "$footer
    "; } else { if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) { return "$footer"; } return ($this->force_code_block ? '
    ' : '') . "$footer"; } } /** * Replaces certain keywords in the header and footer with * certain configuration values * * @param string The header or footer content to do replacement on * @return string The header or footer with replaced keywords * @since 1.0.2 * @access private */ function replace_keywords($instr) { $keywords = $replacements = array(); $keywords[] = '
      to have no effect at all if there are line numbers // (
        s have margins that should be destroyed so all layout is // controlled by the set_overall_style method, which works on the //
         or 
        container). Additionally, set default styles for lines if (!$economy_mode || $this->line_numbers != GESHI_NO_LINE_NUMBERS) { //$stylesheet .= "$selector, {$selector}ol, {$selector}ol li {margin: 0;}\n"; $stylesheet .= "$selector.de1, $selector.de2 {{$this->code_style}}\n"; } // Add overall styles // note: neglect economy_mode, empty styles are meaningless if ($this->overall_style != '') { $stylesheet .= "$selector {{$this->overall_style}}\n"; } // Add styles for links // note: economy mode does not make _any_ sense here // either the style is empty and thus no selector is needed // or the appropriate key is given. foreach ($this->link_styles as $key => $style) { if ($style != '') { switch ($key) { case GESHI_LINK: $stylesheet .= "{$selector}a:link {{$style}}\n"; break; case GESHI_HOVER: $stylesheet .= "{$selector}a:hover {{$style}}\n"; break; case GESHI_ACTIVE: $stylesheet .= "{$selector}a:active {{$style}}\n"; break; case GESHI_VISITED: $stylesheet .= "{$selector}a:visited {{$style}}\n"; break; } } } // Header and footer // note: neglect economy_mode, empty styles are meaningless if ($this->header_content_style != '') { $stylesheet .= "$selector.head {{$this->header_content_style}}\n"; } if ($this->footer_content_style != '') { $stylesheet .= "$selector.foot {{$this->footer_content_style}}\n"; } // Styles for important stuff // note: neglect economy_mode, empty styles are meaningless if ($this->important_styles != '') { $stylesheet .= "$selector.imp {{$this->important_styles}}\n"; } // Simple line number styles if ((!$economy_mode || $this->line_numbers != GESHI_NO_LINE_NUMBERS) && $this->line_style1 != '') { $stylesheet .= "{$selector}li, {$selector}.li1 {{$this->line_style1}}\n"; } if ((!$economy_mode || $this->line_numbers != GESHI_NO_LINE_NUMBERS) && $this->table_linenumber_style != '') { $stylesheet .= "{$selector}.ln {{$this->table_linenumber_style}}\n"; } // If there is a style set for fancy line numbers, echo it out if ((!$economy_mode || $this->line_numbers == GESHI_FANCY_LINE_NUMBERS) && $this->line_style2 != '') { $stylesheet .= "{$selector}.li2 {{$this->line_style2}}\n"; } // note: empty styles are meaningless foreach ($this->language_data['STYLES']['KEYWORDS'] as $group => $styles) { if ($styles != '' && (!$economy_mode || (isset($this->lexic_permissions['KEYWORDS'][$group]) && $this->lexic_permissions['KEYWORDS'][$group]))) { $stylesheet .= "$selector.kw$group {{$styles}}\n"; } } foreach ($this->language_data['STYLES']['COMMENTS'] as $group => $styles) { if ($styles != '' && (!$economy_mode || (isset($this->lexic_permissions['COMMENTS'][$group]) && $this->lexic_permissions['COMMENTS'][$group]) || (!empty($this->language_data['COMMENT_REGEXP']) && !empty($this->language_data['COMMENT_REGEXP'][$group])))) { $stylesheet .= "$selector.co$group {{$styles}}\n"; } } foreach ($this->language_data['STYLES']['ESCAPE_CHAR'] as $group => $styles) { if ($styles != '' && (!$economy_mode || $this->lexic_permissions['ESCAPE_CHAR'])) { // NEW: since 1.0.8 we have to handle hardescapes if ($group === 'HARD') { $group = '_h'; } $stylesheet .= "$selector.es$group {{$styles}}\n"; } } foreach ($this->language_data['STYLES']['BRACKETS'] as $group => $styles) { if ($styles != '' && (!$economy_mode || $this->lexic_permissions['BRACKETS'])) { $stylesheet .= "$selector.br$group {{$styles}}\n"; } } foreach ($this->language_data['STYLES']['SYMBOLS'] as $group => $styles) { if ($styles != '' && (!$economy_mode || $this->lexic_permissions['SYMBOLS'])) { $stylesheet .= "$selector.sy$group {{$styles}}\n"; } } foreach ($this->language_data['STYLES']['STRINGS'] as $group => $styles) { if ($styles != '' && (!$economy_mode || $this->lexic_permissions['STRINGS'])) { // NEW: since 1.0.8 we have to handle hardquotes if ($group === 'HARD') { $group = '_h'; } $stylesheet .= "$selector.st$group {{$styles}}\n"; } } foreach ($this->language_data['STYLES']['NUMBERS'] as $group => $styles) { if ($styles != '' && (!$economy_mode || $this->lexic_permissions['NUMBERS'])) { $stylesheet .= "$selector.nu$group {{$styles}}\n"; } } foreach ($this->language_data['STYLES']['METHODS'] as $group => $styles) { if ($styles != '' && (!$economy_mode || $this->lexic_permissions['METHODS'])) { $stylesheet .= "$selector.me$group {{$styles}}\n"; } } // note: neglect economy_mode, empty styles are meaningless foreach ($this->language_data['STYLES']['SCRIPT'] as $group => $styles) { if ($styles != '') { $stylesheet .= "$selector.sc$group {{$styles}}\n"; } } foreach ($this->language_data['STYLES']['REGEXPS'] as $group => $styles) { if ($styles != '' && (!$economy_mode || (isset($this->lexic_permissions['REGEXPS'][$group]) && $this->lexic_permissions['REGEXPS'][$group]))) { if (is_array($this->language_data['REGEXPS'][$group]) && array_key_exists(GESHI_CLASS, $this->language_data['REGEXPS'][$group])) { $stylesheet .= "$selector."; $stylesheet .= $this->language_data['REGEXPS'][$group][GESHI_CLASS]; $stylesheet .= " {{$styles}}\n"; } else { $stylesheet .= "$selector.re$group {{$styles}}\n"; } } } // Styles for lines being highlighted extra if (!$economy_mode || (count($this->highlight_extra_lines)!=count($this->highlight_extra_lines_styles))) { $stylesheet .= "{$selector}.ln-xtra, {$selector}li.ln-xtra, {$selector}div.ln-xtra {{$this->highlight_extra_lines_style}}\n"; } $stylesheet .= "{$selector}span.xtra { display:block; }\n"; foreach ($this->highlight_extra_lines_styles as $lineid => $linestyle) { $stylesheet .= "{$selector}.lx$lineid, {$selector}li.lx$lineid, {$selector}div.lx$lineid {{$linestyle}}\n"; } return $stylesheet; } /** * Get's the style that is used for the specified line * * @param int The line number information is requested for * @access private * @since 1.0.7.21 */ function get_line_style($line) { //$style = null; $style = null; if (isset($this->highlight_extra_lines_styles[$line])) { $style = $this->highlight_extra_lines_styles[$line]; } else { // if no "extra" style assigned $style = $this->highlight_extra_lines_style; } return $style; } /** * this functions creates an optimized regular expression list * of an array of strings. * * Example: * $list = array('faa', 'foo', 'foobar'); * => string 'f(aa|oo(bar)?)' * * @param $list array of (unquoted) strings * @param $regexp_delimiter your regular expression delimiter, @see preg_quote() * @return string for regular expression * @author Milian Wolff * @since 1.0.8 * @access private */ function optimize_regexp_list($list, $regexp_delimiter = '/') { $regex_chars = array('.', '\\', '+', '-', '*', '?', '[', '^', ']', '$', '(', ')', '{', '}', '=', '!', '<', '>', '|', ':', $regexp_delimiter); sort($list); $regexp_list = array(''); $num_subpatterns = 0; $list_key = 0; // the tokens which we will use to generate the regexp list $tokens = array(); $prev_keys = array(); // go through all entries of the list and generate the token list $cur_len = 0; for ($i = 0, $i_max = count($list); $i < $i_max; ++$i) { if ($cur_len > GESHI_MAX_PCRE_LENGTH) { // seems like the length of this pcre is growing exorbitantly $regexp_list[++$list_key] = $this->_optimize_regexp_list_tokens_to_string($tokens); $num_subpatterns = substr_count($regexp_list[$list_key], '(?:'); $tokens = array(); $cur_len = 0; } $level = 0; $entry = preg_quote((string) $list[$i], $regexp_delimiter); $pointer = &$tokens; // properly assign the new entry to the correct position in the token array // possibly generate smaller common denominator keys while (true) { // get the common denominator if (isset($prev_keys[$level])) { if ($prev_keys[$level] == $entry) { // this is a duplicate entry, skip it continue 2; } $char = 0; while (isset($entry[$char]) && isset($prev_keys[$level][$char]) && $entry[$char] == $prev_keys[$level][$char]) { ++$char; } if ($char > 0) { // this entry has at least some chars in common with the current key if ($char == strlen($prev_keys[$level])) { // current key is totally matched, i.e. this entry has just some bits appended $pointer = &$pointer[$prev_keys[$level]]; } else { // only part of the keys match $new_key_part1 = substr($prev_keys[$level], 0, $char); $new_key_part2 = substr($prev_keys[$level], $char); if (in_array($new_key_part1[0], $regex_chars) || in_array($new_key_part2[0], $regex_chars)) { // this is bad, a regex char as first character $pointer[$entry] = array('' => true); array_splice($prev_keys, $level, count($prev_keys), $entry); $cur_len += strlen($entry); continue; } else { // relocate previous tokens $pointer[$new_key_part1] = array($new_key_part2 => $pointer[$prev_keys[$level]]); unset($pointer[$prev_keys[$level]]); $pointer = &$pointer[$new_key_part1]; // recreate key index array_splice($prev_keys, $level, count($prev_keys), array($new_key_part1, $new_key_part2)); $cur_len += strlen($new_key_part2); } } ++$level; $entry = substr($entry, $char); continue; } // else: fall trough, i.e. no common denominator was found } if ($level == 0 && !empty($tokens)) { // we can dump current tokens into the string and throw them away afterwards $new_entry = $this->_optimize_regexp_list_tokens_to_string($tokens); $new_subpatterns = substr_count($new_entry, '(?:'); if (GESHI_MAX_PCRE_SUBPATTERNS && $num_subpatterns + $new_subpatterns > GESHI_MAX_PCRE_SUBPATTERNS) { $regexp_list[++$list_key] = $new_entry; $num_subpatterns = $new_subpatterns; } else { if (!empty($regexp_list[$list_key])) { $new_entry = '|' . $new_entry; } $regexp_list[$list_key] .= $new_entry; $num_subpatterns += $new_subpatterns; } $tokens = array(); $cur_len = 0; } // no further common denominator found $pointer[$entry] = array('' => true); array_splice($prev_keys, $level, count($prev_keys), $entry); $cur_len += strlen($entry); break; } unset($list[$i]); } // make sure the last tokens get converted as well $new_entry = $this->_optimize_regexp_list_tokens_to_string($tokens); if (GESHI_MAX_PCRE_SUBPATTERNS && $num_subpatterns + substr_count($new_entry, '(?:') > GESHI_MAX_PCRE_SUBPATTERNS) { if ( !empty($regexp_list[$list_key]) ) { ++$list_key; } $regexp_list[$list_key] = $new_entry; } else { if (!empty($regexp_list[$list_key])) { $new_entry = '|' . $new_entry; } $regexp_list[$list_key] .= $new_entry; } return $regexp_list; } /** * this function creates the appropriate regexp string of an token array * you should not call this function directly, @see $this->optimize_regexp_list(). * * @param &$tokens array of tokens * @param $recursed bool to know wether we recursed or not * @return string * @author Milian Wolff * @since 1.0.8 * @access private */ function _optimize_regexp_list_tokens_to_string(&$tokens, $recursed = false) { $list = ''; foreach ($tokens as $token => $sub_tokens) { $list .= $token; $close_entry = isset($sub_tokens['']); unset($sub_tokens['']); if (!empty($sub_tokens)) { $list .= '(?:' . $this->_optimize_regexp_list_tokens_to_string($sub_tokens, true) . ')'; if ($close_entry) { // make sub_tokens optional $list .= '?'; } } $list .= '|'; } if (!$recursed) { // do some optimizations // common trailing strings // BUGGY! //$list = preg_replace_callback('#(?<=^|\:|\|)\w+?(\w+)(?:\|.+\1)+(?=\|)#', create_function( // '$matches', 'return "(?:" . preg_replace("#" . preg_quote($matches[1], "#") . "(?=\||$)#", "", $matches[0]) . ")" . $matches[1];'), $list); // (?:p)? => p? $list = preg_replace('#\(\?\:(.)\)\?#', '\1?', $list); // (?:a|b|c|d|...)? => [abcd...]? // TODO: a|bb|c => [ac]|bb static $callback_2; if (!isset($callback_2)) { $callback_2 = create_function('$matches', 'return "[" . str_replace("|", "", $matches[1]) . "]";'); } $list = preg_replace_callback('#\(\?\:((?:.\|)+.)\)#', $callback_2, $list); } // return $list without trailing pipe return substr($list, 0, -1); } } // End Class GeSHi if (!function_exists('geshi_highlight')) { /** * Easy way to highlight stuff. Behaves just like highlight_string * * @param string The code to highlight * @param string The language to highlight the code in * @param string The path to the language files. You can leave this blank if you need * as from version 1.0.7 the path should be automatically detected * @param boolean Whether to return the result or to echo * @return string The code highlighted (if $return is true) * @since 1.0.2 */ function geshi_highlight($string, $language, $path = null, $return = false) { $geshi = new GeSHi($string, $language, $path); $geshi->set_header_type(GESHI_HEADER_NONE); if ($return) { return '' . $geshi->parse_code() . ''; } echo '' . $geshi->parse_code() . ''; if ($geshi->error()) { return false; } return true; } } ?> content/geshi/index.html000066600000000037150771657550011340 0ustar00 content/geshi/geshi.xml000066600000001543150771657550011167 0ustar00 plg_content_geshi Joomla! Project November 2005 Copyright (C) 2005 - 2013 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt qbnz.com/highlighter 3.0.0 PLG_CONTENT_GESHI_XML_DESCRIPTION geshi.php index.html geshi en-GB.plg_content_geshi.ini en-GB.plg_content_geshi.sys.ini content/geshi/geshi.php000066600000004125150771657550011155 0ustar00text is also available * @param object The article params * @param integer The 'page' number */ public function onContentPrepare($context, &$article, &$params, $page = 0) { // Simple performance check to determine whether bot should process further. if (JString::strpos($article->text, 'pre>') === false) { return true; } // Define the regular expression for the bot. $regex = "#
        (.*?)
        #s"; // Perform the replacement. $article->text = preg_replace_callback($regex, array(&$this, '_replace'), $article->text); return true; } /** * Replaces the matched tags. * * @param array An array of matches (see preg_match_all) * @return string */ protected function _replace(&$matches) { jimport('joomla.utilities.utility'); require_once __DIR__ . '/geshi/geshi.php'; $args = JUtility::parseAttributes($matches[1]); $text = $matches[2]; $lang = JArrayHelper::getValue($args, 'lang', 'php'); $lines = JArrayHelper::getValue($args, 'lines', 'false'); $html_entities_match = array("|\
        |", "#<#", "#>#", "|'|", '#"#', '# #'); $html_entities_replace = array("\n", '<', '>', "'", '"', ' '); $text = preg_replace($html_entities_match, $html_entities_replace, $text); $text = str_replace('<', '<', $text); $text = str_replace('>', '>', $text); $text = str_replace("\t", ' ', $text); $geshi = new GeSHi($text, $lang); if ($lines == 'true') { $geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS); } $text = $geshi->parse_code(); return $text; } } content/finder/index.html000066600000000037150771657550011510 0ustar00 content/finder/finder.php000066600000010032150771657550011467 0ustar00trigger('onFinderAfterSave', array($context, $article, $isNew)); } /** * Smart Search before save content method. * Content is passed by reference. Method is called before the content is saved. * * @param string $context The context of the content passed to the plugin (added in 1.6). * @param object $article A JTableContent object. * @param bool $isNew If the content is just about to be created. * * @return void * * @since 2.5 */ public function onContentBeforeSave($context, $article, $isNew) { $dispatcher = JEventDispatcher::getInstance(); JPluginHelper::importPlugin('finder'); // Trigger the onFinderBeforeSave event. $dispatcher->trigger('onFinderBeforeSave', array($context, $article, $isNew)); } /** * Smart Search after delete content method. * Content is passed by reference, but after the deletion. * * @param string $context The context of the content passed to the plugin (added in 1.6). * @param object $article A JTableContent object. * * @return void * * @since 2.5 */ public function onContentAfterDelete($context, $article) { $dispatcher = JEventDispatcher::getInstance(); JPluginHelper::importPlugin('finder'); // Trigger the onFinderAfterDelete event. $dispatcher->trigger('onFinderAfterDelete', array($context, $article)); } /** * Smart Search content state change method. * Method to update the link information for items that have been changed * from outside the edit screen. This is fired when the item is published, * unpublished, archived, or unarchived from the list view. * * @param string $context The context for the content passed to the plugin. * @param array $pks A list of primary key ids of the content that has changed state. * @param integer $value The value of the state that the content has been changed to. * * @return void * * @since 2.5 */ public function onContentChangeState($context, $pks, $value) { $dispatcher = JEventDispatcher::getInstance(); JPluginHelper::importPlugin('finder'); // Trigger the onFinderChangeState event. $dispatcher->trigger('onFinderChangeState', array($context, $pks, $value)); } /** * Smart Search change category state content method. * Method is called when the state of the category to which the * content item belongs is changed. * * @param string $extension The extension whose category has been updated. * @param array $pks A list of primary key ids of the content that has changed state. * @param integer $value The value of the state that the content has been changed to. * * @return void * * @since 2.5 */ public function onCategoryChangeState($extension, $pks, $value) { $dispatcher = JEventDispatcher::getInstance(); JPluginHelper::importPlugin('finder'); // Trigger the onFinderCategoryChangeState event. $dispatcher->trigger('onFinderCategoryChangeState', array($extension, $pks, $value)); } } content/finder/finder.xml000066600000001570150771657550011507 0ustar00 plg_content_finder Joomla! Project December 2011 Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.0.0 PLG_CONTENT_FINDER_XML_DESCRIPTION finder.php index.html en-GB.plg_content_finder.ini en-GB.plg_content_finder.sys.ini content/contact/contact.xml000066600000001574150771657550012063 0ustar00 plg_content_contact Joomla! Project January 2014 Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.2.2 PLG_CONTENT_CONTACT_XML_DESCRIPTION contact.php index.html en-GB.plg_content_contact.ini en-GB.plg_content_contact.sys.ini content/contact/index.html000066600000000037150771657550011674 0ustar00 content/contact/contact.php000066600000005243150771657550012047 0ustar00get('link_author')) { return true; } // Return if we don't have a valid article id if (!isset($row->id) || !(int) $row->id) { return true; } $row->contactid = $this->getContactID($row->created_by); if ($row->contactid) { $needle = 'index.php?option=com_contact&view=contact&id=' . $row->contactid; $menu = JFactory::getApplication()->getMenu(); $item = $menu->getItems('link', $needle, true); $link = $item ? $needle . '&Itemid=' . $item->id : $needle; $row->contact_link = JRoute::_($link); } else { $row->contact_link = ''; } return true; } /** * Retrieve Contact * * @param int $created_by Id of the user who created the contact * * @return mixed|null|integer */ protected function getContactID($created_by) { static $contacts = array(); if (isset($contacts[$created_by])) { return $contacts[$created_by]; } $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('MAX(contact.id) AS contactid'); $query->from('#__contact_details AS contact'); $query->where('contact.published = 1'); $query->where('contact.user_id = ' . (int) $created_by); if (JLanguageMultilang::isEnabled() == 1) { $query->where('(contact.language in ' . '(' . $db->quote(JFactory::getLanguage()->getTag()) . ',' . $db->quote('*') . ') ' . ' OR contact.language IS NULL)'); } $db->setQuery($query); $contacts[$created_by] = $db->loadResult(); return $contacts[$created_by]; } } content/joomla/joomla.php000066600000017655150771657550011535 0ustar00params->def('email_new_fe', 1)) { return true; } // Check this is a new article. if (!$isNew) { return true; } $user = JFactory::getUser(); // Messaging for new items JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_messages/models', 'MessagesModel'); JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_messages/tables'); $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select($db->quoteName('id')) ->from($db->quoteName('#__users')) ->where($db->quoteName('sendEmail') . ' = 1'); $db->setQuery($query); $users = (array) $db->loadColumn(); $default_language = JComponentHelper::getParams('com_languages')->get('administrator'); $debug = JFactory::getConfig()->get('debug_lang'); foreach ($users as $user_id) { if ($user_id != $user->id) { // Load language for messaging $receiver = JUser::getInstance($user_id); $lang = JLanguage::getInstance($receiver->getParam('admin_language', $default_language), $debug); $lang->load('com_content'); $message = array( 'user_id_to' => $user_id, 'subject' => $lang->_('COM_CONTENT_NEW_ARTICLE'), 'message' => sprintf($lang->_('COM_CONTENT_ON_NEW_CONTENT'), $user->get('name'), $article->title) ); $model_message = JModelLegacy::getInstance('Message', 'MessagesModel'); $result = $model_message->save($message); } } return $result; } /** * Don't allow categories to be deleted if they contain items or subcategories with items * * @param string $context The context for the content passed to the plugin. * @param object $data The data relating to the content that was deleted. * * @return boolean * * @since 1.6 */ public function onContentBeforeDelete($context, $data) { // Skip plugin if we are deleting something other than categories if ($context != 'com_categories.category') { return true; } // Check if this function is enabled. if (!$this->params->def('check_categories', 1)) { return true; } $extension = JFactory::getApplication()->input->getString('extension'); // Default to true if not a core extension $result = true; $tableInfo = array( 'com_banners' => array('table_name' => '#__banners'), 'com_contact' => array('table_name' => '#__contact_details'), 'com_content' => array('table_name' => '#__content'), 'com_newsfeeds' => array('table_name' => '#__newsfeeds'), 'com_weblinks' => array('table_name' => '#__weblinks') ); // Now check to see if this is a known core extension if (isset($tableInfo[$extension])) { // Get table name for known core extensions $table = $tableInfo[$extension]['table_name']; // See if this category has any content items $count = $this->_countItemsInCategory($table, $data->get('id')); // Return false if db error if ($count === false) { $result = false; } else { // Show error if items are found in the category if ($count > 0) { $msg = JText::sprintf('COM_CATEGORIES_DELETE_NOT_ALLOWED', $data->get('title')) . JText::plural('COM_CATEGORIES_N_ITEMS_ASSIGNED', $count); JError::raiseWarning(403, $msg); $result = false; } // Check for items in any child categories (if it is a leaf, there are no child categories) if (!$data->isLeaf()) { $count = $this->_countItemsInChildren($table, $data->get('id'), $data); if ($count === false) { $result = false; } elseif ($count > 0) { $msg = JText::sprintf('COM_CATEGORIES_DELETE_NOT_ALLOWED', $data->get('title')) . JText::plural('COM_CATEGORIES_HAS_SUBCATEGORY_ITEMS', $count); JError::raiseWarning(403, $msg); $result = false; } } } return $result; } } /** * Get count of items in a category * * @param string $table table name of component table (column is catid) * @param integer $catid id of the category to check * * @return mixed count of items found or false if db error * * @since 1.6 */ private function _countItemsInCategory($table, $catid) { $db = JFactory::getDbo(); $query = $db->getQuery(true); // Count the items in this category $query->select('COUNT(id)') ->from($table) ->where('catid = ' . $catid); $db->setQuery($query); try { $count = $db->loadResult(); } catch (RuntimeException $e) { JError::raiseWarning(500, $e->getMessage()); return false; } return $count; } /** * Get count of items in a category's child categories * * @param string $table table name of component table (column is catid) * @param integer $catid id of the category to check * @param object $data The data relating to the content that was deleted. * * @return mixed count of items found or false if db error * * @since 1.6 */ private function _countItemsInChildren($table, $catid, $data) { $db = JFactory::getDbo(); // Create subquery for list of child categories $childCategoryTree = $data->getTree(); // First element in tree is the current category, so we can skip that one unset($childCategoryTree[0]); $childCategoryIds = array(); foreach ($childCategoryTree as $node) { $childCategoryIds[] = $node->id; } // Make sure we only do the query if we have some categories to look in if (count($childCategoryIds)) { // Count the items in this category $query = $db->getQuery(true) ->select('COUNT(id)') ->from($table) ->where('catid IN (' . implode(',', $childCategoryIds) . ')'); $db->setQuery($query); try { $count = $db->loadResult(); } catch (RuntimeException $e) { JError::raiseWarning(500, $e->getMessage()); return false; } return $count; } else // If we didn't have any categories to check, return 0 { return 0; } } /** * Change the state in core_content if the state in a table is changed * * @param string $context The context for the content passed to the plugin. * @param array $pks A list of primary key ids of the content that has changed state. * @param integer $value The value of the state that the content has been changed to. * * @return boolean * * @since 3.1 */ public function onContentChangeState($context, $pks, $value) { $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select($db->quoteName('core_content_id')) ->from($db->quoteName('#__ucm_content')) ->where($db->quoteName('core_type_alias') . ' = ' . $db->quote($context)) ->where($db->quoteName('core_content_item_id') . ' IN (' . $pksImploded = implode(',', $pks) . ')'); $db->setQuery($query); $ccIds = $db->loadColumn(); $cctable = new JTableCorecontent($db); $cctable->publish($ccIds, $value); return true; } } content/joomla/index.html000066600000000037150771657550011522 0ustar00 content/joomla/joomla.xml000066600000003036150771657550011532 0ustar00 plg_content_joomla Joomla! Project November 2010 Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.0.0 PLG_CONTENT_JOOMLA_XML_DESCRIPTION joomla.php index.html en-GB.plg_content_joomla.ini en-GB.plg_content_joomla.sys.ini
        content/emailcloak/emailcloak.xml000066600000002350150771657550013170 0ustar00 plg_content_emailcloak Joomla! Project November 2005 Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.0.0 PLG_CONTENT_EMAILCLOAK_XML_DESCRIPTION emailcloak.php index.html en-GB.plg_content_emailcloak.ini en-GB.plg_content_emailcloak.sys.ini
        content/emailcloak/index.html000066600000000037150771657550012342 0ustar00 content/emailcloak/emailcloak.php000066600000022557150771657550013172 0ustar00_cloak($row->text, $params); } return $this->_cloak($row, $params); } /** * Generate a search pattern based on link and text. * * @param string $link The target of an email link. * @param string $text The text enclosed by the link. * * @return string A regular expression that matches a link containing the parameters. */ protected function _getPattern ($link, $text) { $pattern = '~(?:
        ' . $text . '~i'; return $pattern; } /** * Adds an attributes to the js cloaked email. * * @param string $jsEmail Js cloaked email. * @param string $before Attributes before email. * @param string $after Attributes after email. * * @return string Js cloaked email with attributes. */ protected function _addAttributesToEmail($jsEmail, $before, $after) { if ($before !== "") { $before = str_replace("'", "\'", $before); $jsEmail = str_replace("document.write('');", "'\'{$after}>');", $jsEmail); } return $jsEmail; } /** * Cloak all emails in text from spambots via Javascript. * * @param string &$text The string to be cloaked. * @param mixed &$params Additional parameters. Parameter "mode" (integer, default 1) * replaces addresses with "mailto:" links if nonzero. * * @return boolean True on success. */ protected function _cloak(&$text, &$params) { /* * Check for presence of {emailcloak=off} which is explicits disables this * bot for the item. */ if (JString::strpos($text, '{emailcloak=off}') !== false) { $text = JString::str_ireplace('{emailcloak=off}', '', $text); return true; } // Simple performance check to determine whether bot should process further. if (JString::strpos($text, '@') === false) { return true; } $mode = $this->params->def('mode', 1); // Example: any@email.address.com $searchEmail = '([\w\.\-]+\@(?:[a-z0-9\.\-]+\.)+(?:[a-zA-Z0-9\-]{2,10}))'; // Example: any@email.address.com?subject=anyText $searchEmailLink = $searchEmail . '([?&][\x20-\x7f][^"<>]+)'; // Any Text $searchText = '([\x20-\x7f][^<>]+)'; // Any Image link $searchImage = "(]+>)"; /* * Search and fix derivatives of link code email@email.com. This happens when inserting an email in TinyMCE, cancelling its suggestion to add * the mailto: prefix... */ $pattern = $this->_getPattern($searchEmail, $searchEmail); $pattern = str_replace('"mailto:', '"http://mce_host([\x20-\x7f][^<>]+/)', $pattern); while (preg_match($pattern, $text, $regs, PREG_OFFSET_CAPTURE)) { $mail = $regs[3][0]; $mailText = $regs[5][0]; // Check to see if mail text is different from mail addy $replacement = JHtml::_('email.cloak', $mail, $mode, $mailText); // Ensure that attributes is not stripped out by email cloaking $replacement = $this->_addAttributesToEmail($replacement, $regs[1][0], $regs[4][0]); // Replace the found address with the js cloaked email $text = substr_replace($text, $replacement, $regs[0][1], strlen($regs[0][0])); } /* * Search and fix derivatives of link code anytext. This happens when inserting an email in TinyMCE, cancelling its suggestion to add * the mailto: prefix... */ $pattern = $this->_getPattern($searchEmail, $searchText); $pattern = str_replace('"mailto:', '"http://mce_host([\x20-\x7f][^<>]+/)', $pattern); while (preg_match($pattern, $text, $regs, PREG_OFFSET_CAPTURE)) { $mail = $regs[3][0]; $mailText = $regs[5][0]; // Check to see if mail text is different from mail addy $replacement = JHtml::_('email.cloak', $mail, $mode, $mailText, 0); // Ensure that attributes is not stripped out by email cloaking $replacement = $this->_addAttributesToEmail($replacement, $regs[1][0], $regs[4][0]); // Replace the found address with the js cloaked email $text = substr_replace($text, $replacement, $regs[0][1], strlen($regs[0][0])); } /* * Search for derivatives of link code email@amail.com */ $pattern = $this->_getPattern($searchEmail, $searchEmail); while (preg_match($pattern, $text, $regs, PREG_OFFSET_CAPTURE)) { $mail = $regs[2][0]; $mailText = $regs[4][0]; // Check to see if mail text is different from mail addy $replacement = JHtml::_('email.cloak', $mail, $mode, $mailText); // Ensure that attributes is not stripped out by email cloaking $replacement = $this->_addAttributesToEmail($replacement, $regs[1][0], $regs[3][0]); // Replace the found address with the js cloaked email $text = substr_replace($text, $replacement, $regs[0][1], strlen($regs[0][0])); } /* * Search for derivatives of link code * anytext */ $pattern = $this->_getPattern($searchEmail, $searchText); while (preg_match($pattern, $text, $regs, PREG_OFFSET_CAPTURE)) { $mail = $regs[2][0]; $mailText = $regs[4][0]; $replacement = JHtml::_('email.cloak', $mail, $mode, $mailText, 0); // Ensure that attributes is not stripped out by email cloaking $replacement = $this->_addAttributesToEmail($replacement, $regs[1][0], $regs[3][0]); // Replace the found address with the js cloaked email $text = substr_replace($text, $replacement, $regs[0][1], strlen($regs[0][0])); } /* * Search for derivatives of link code * */ $pattern = $this->_getPattern($searchEmail, $searchImage); while (preg_match($pattern, $text, $regs, PREG_OFFSET_CAPTURE)) { $mail = $regs[2][0]; $mailText = $regs[4][0]; $replacement = JHtml::_('email.cloak', $mail, $mode, $mailText, 0); // Ensure that attributes is not stripped out by email cloaking $replacement = $this->_addAttributesToEmail($replacement, $regs[1][0], $regs[3][0]); // Replace the found address with the js cloaked email $text = substr_replace($text, $replacement, $regs[0][1], strlen($regs[0][0])); } /* * Search for derivatives of link code email@amail.com */ $pattern = $this->_getPattern($searchEmailLink, $searchEmail); while (preg_match($pattern, $text, $regs, PREG_OFFSET_CAPTURE)) { $mail = $regs[2][0] . $regs[3][0]; $mailText = $regs[5][0]; // Needed for handling of Body parameter $mail = str_replace('&', '&', $mail); // Check to see if mail text is different from mail addy $replacement = JHtml::_('email.cloak', $mail, $mode, $mailText); // Ensure that attributes is not stripped out by email cloaking $replacement = $this->_addAttributesToEmail($replacement, $regs[1][0], $regs[4][0]); // Replace the found address with the js cloaked email $text = substr_replace($text, $replacement, $regs[0][1], strlen($regs[0][0])); } /* * Search for derivatives of link code anytext */ $pattern = $this->_getPattern($searchEmailLink, $searchText); while (preg_match($pattern, $text, $regs, PREG_OFFSET_CAPTURE)) { $mail = $regs[2][0] . $regs[3][0]; $mailText = $regs[5][0]; // Needed for handling of Body parameter $mail = str_replace('&', '&', $mail); $replacement = JHtml::_('email.cloak', $mail, $mode, $mailText, 0); // Ensure that attributes is not stripped out by email cloaking $replacement = $this->_addAttributesToEmail($replacement, $regs[1][0], $regs[4][0]); // Replace the found address with the js cloaked email $text = substr_replace($text, $replacement, $regs[0][1], strlen($regs[0][0])); } // Search for plain text email@amail.com $pattern = '~' . $searchEmail . '([^a-z0-9]|$)~i'; while (preg_match($pattern, $text, $regs, PREG_OFFSET_CAPTURE)) { $mail = $regs[1][0]; $replacement = JHtml::_('email.cloak', $mail, $mode); // Replace the found address with the js cloaked email $text = substr_replace($text, $replacement, $regs[1][1], strlen($mail)); } return true; } } content/index.html000066600000000037150771657550010241 0ustar00 content/pagenavigation/pagenavigation.php000066600000013751150771657550014754 0ustar00input->get('view'); $print = $app->input->getBool('print'); if ($print) { return false; } if (($context == 'com_content.article') && ($view == 'article') && $params->get('show_item_navigation')) { $db = JFactory::getDbo(); $user = JFactory::getUser(); $lang = JFactory::getLanguage(); $nullDate = $db->getNullDate(); $date = JFactory::getDate(); $now = $date->toSql(); $uid = $row->id; $option = 'com_content'; $canPublish = $user->authorise('core.edit.state', $option . '.article.' . $row->id); /** * The following is needed as different menu items types utilise a different param to control ordering. * For Blogs the `orderby_sec` param is the order controlling param. * For Table and List views it is the `orderby` param. **/ $params_list = $params->toArray(); if (array_key_exists('orderby_sec', $params_list)) { $order_method = $params->get('orderby_sec', ''); } else { $order_method = $params->get('orderby', ''); } // Additional check for invalid sort ordering. if ($order_method == 'front') { $order_method = ''; } // Determine sort order. switch ($order_method) { case 'date' : $orderby = 'a.created'; break; case 'rdate' : $orderby = 'a.created DESC'; break; case 'alpha' : $orderby = 'a.title'; break; case 'ralpha' : $orderby = 'a.title DESC'; break; case 'hits' : $orderby = 'a.hits'; break; case 'rhits' : $orderby = 'a.hits DESC'; break; case 'order' : $orderby = 'a.ordering'; break; case 'author' : $orderby = 'a.created_by_alias, u.name'; break; case 'rauthor' : $orderby = 'a.created_by_alias DESC, u.name DESC'; break; case 'front' : $orderby = 'f.ordering'; break; default : $orderby = 'a.ordering'; break; } $xwhere = ' AND (a.state = 1 OR a.state = -1)' . ' AND (publish_up = ' . $db->quote($nullDate) . ' OR publish_up <= ' . $db->quote($now) . ')' . ' AND (publish_down = ' . $db->quote($nullDate) . ' OR publish_down >= ' . $db->quote($now) . ')'; // Array of articles in same category correctly ordered. $query = $db->getQuery(true); // Sqlsrv changes $case_when = ' CASE WHEN '; $case_when .= $query->charLength('a.alias', '!=', '0'); $case_when .= ' THEN '; $a_id = $query->castAsChar('a.id'); $case_when .= $query->concatenate(array($a_id, 'a.alias'), ':'); $case_when .= ' ELSE '; $case_when .= $a_id . ' END as slug'; $case_when1 = ' CASE WHEN '; $case_when1 .= $query->charLength('cc.alias', '!=', '0'); $case_when1 .= ' THEN '; $c_id = $query->castAsChar('cc.id'); $case_when1 .= $query->concatenate(array($c_id, 'cc.alias'), ':'); $case_when1 .= ' ELSE '; $case_when1 .= $c_id . ' END as catslug'; $query->select('a.id,' . $case_when . ',' . $case_when1) ->from('#__content AS a') ->join('LEFT', '#__categories AS cc ON cc.id = a.catid') ->where( 'a.catid = ' . (int) $row->catid . ' AND a.state = ' . (int) $row->state . ($canPublish ? '' : ' AND a.access = ' . (int) $row->access) . $xwhere ); $query->order($orderby); if ($app->isSite() && $app->getLanguageFilter()) { $query->where('a.language in (' . $db->quote($lang->getTag()) . ',' . $db->quote('*') . ')'); } $db->setQuery($query); $list = $db->loadObjectList('id'); // This check needed if incorrect Itemid is given resulting in an incorrect result. if (!is_array($list)) { $list = array(); } reset($list); // Location of current content item in array list. $location = array_search($uid, array_keys($list)); $rows = array_values($list); $row->prev = null; $row->next = null; if ($location - 1 >= 0) { // The previous content item cannot be in the array position -1. $row->prev = $rows[$location - 1]; } if (($location + 1) < count($rows)) { // The next content item cannot be in an array position greater than the number of array postions. $row->next = $rows[$location + 1]; } // $pnSpace is/can be used in the include file $pnSpace = ""; if (JText::_('JGLOBAL_LT') || JText::_('JGLOBAL_GT')) { $pnSpace = " "; } if ($row->prev) { $row->prev = JRoute::_(ContentHelperRoute::getArticleRoute($row->prev->slug, $row->prev->catslug)); } else { $row->prev = ''; } if ($row->next) { $row->next = JRoute::_(ContentHelperRoute::getArticleRoute($row->next->slug, $row->next->catslug)); } else { $row->next = ''; } // Output. if ($row->prev || $row->next) { // Get the path for the layout file $path = JPluginHelper::getLayoutPath('content', 'pagenavigation'); // Render the pagenav ob_start(); include $path; $row->pagination = ob_get_clean(); $row->paginationposition = $this->params->get('position', 1); // This will default to the 1.5 and 1.6-1.7 behavior. $row->paginationrelative = $this->params->get('relative', 0); } } return; } } content/pagenavigation/tmpl/default.php000066600000001277150771657550014360 0ustar00 content/pagenavigation/tmpl/index.html000066600000000037150771657550014211 0ustar00 content/pagenavigation/pagenavigation.xml000066600000003120150771657550014752 0ustar00 plg_content_pagenavigation Joomla! Project January 2006 Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.0.0 PLG_PAGENAVIGATION_XML_DESCRIPTION pagenavigation.php index.html en-GB.plg_content_pagenavigation.ini en-GB.plg_content_pagenavigation.sys.ini
        content/pagenavigation/index.html000066600000000037150771657550013235 0ustar00 content/vote/vote.xml000066600000001543150771657550010723 0ustar00 plg_content_vote Joomla! Project November 2005 Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.0.0 PLG_VOTE_XML_DESCRIPTION vote.php index.html en-GB.plg_content_vote.ini en-GB.plg_content_vote.sys.ini content/vote/index.html000066600000000037150771657550011216 0ustar00 content/vote/vote.php000066600000006731150771657550010716 0ustar00get('show_vote', null)) { $rating = (int) @$row->rating; $view = JFactory::getApplication()->input->getString('view', ''); $img = ''; // Look for images in template if available $starImageOn = JHtml::_('image', 'system/rating_star.png', JText::_('PLG_VOTE_STAR_ACTIVE'), null, true); $starImageOff = JHtml::_('image', 'system/rating_star_blank.png', JText::_('PLG_VOTE_STAR_INACTIVE'), null, true); for ($i = 0; $i < $rating; $i++) { $img .= $starImageOn; } for ($i = $rating; $i < 5; $i++) { $img .= $starImageOff; } $html .= '
        '; $html .= '

        ' . JText::sprintf('PLG_VOTE_USER_RATING', '' . $rating . '', '5') . '' . '' . '

        '; $html .= $img; $html .= '
        '; if ($view == 'article' && $row->state == 1) { $uri = JUri::getInstance(); $uri->setQuery($uri->getQuery() . '&hitcount=0'); // Create option list for voting select box $options = array(); for ($i = 1; $i < 6; $i++) { $options[] = JHtml::_('select.option', $i, JText::sprintf('PLG_VOTE_VOTE', $i)); } // Generate voting form $html .= '
        '; $html .= ''; $html .= ''; $html .= JHtml::_('select.genericlist', $options, 'user_rating', null, 'value', 'text', '5', 'content_vote_' . $row->id); $html .= ' '; $html .= ''; $html .= ''; $html .= ''; $html .= JHtml::_('form.token'); $html .= ''; $html .= '
        '; } } return $html; } } content/loadmodule/loadmodule.php000066600000012525150771657550013234 0ustar00text is also available * @param mixed &$params The article params * @param integer $page The 'page' number * * @return mixed true if there is an error. Void otherwise. * * @since 1.6 */ public function onContentPrepare($context, &$article, &$params, $page = 0) { // Don't run this plugin when the content is being indexed if ($context == 'com_finder.indexer') { return true; } // Simple performance check to determine whether bot should process further if (strpos($article->text, 'loadposition') === false && strpos($article->text, 'loadmodule') === false) { return true; } // Expression to search for (positions) $regex = '/{loadposition\s(.*?)}/i'; $style = $this->params->def('style', 'none'); // Expression to search for(modules) $regexmod = '/{loadmodule\s(.*?)}/i'; $stylemod = $this->params->def('style', 'none'); // Find all instances of plugin and put in $matches for loadposition // $matches[0] is full pattern match, $matches[1] is the position preg_match_all($regex, $article->text, $matches, PREG_SET_ORDER); // No matches, skip this if ($matches) { foreach ($matches as $match) { $matcheslist = explode(',', $match[1]); // We may not have a module style so fall back to the plugin default. if (!array_key_exists(1, $matcheslist)) { $matcheslist[1] = $style; } $position = trim($matcheslist[0]); $style = trim($matcheslist[1]); $output = $this->_load($position, $style); // We should replace only first occurrence in order to allow positions with the same name to regenerate their content: $article->text = preg_replace("|$match[0]|", addcslashes($output, '\\$'), $article->text, 1); $style = $this->params->def('style', 'none'); } } // Find all instances of plugin and put in $matchesmod for loadmodule preg_match_all($regexmod, $article->text, $matchesmod, PREG_SET_ORDER); // If no matches, skip this if ($matchesmod) { foreach ($matchesmod as $matchmod) { $matchesmodlist = explode(',', $matchmod[1]); // We may not have a specific module so set to null if (!array_key_exists(1, $matchesmodlist)) { $matchesmodlist[1] = null; } // We may not have a module style so fall back to the plugin default. if (!array_key_exists(2, $matchesmodlist)) { $matchesmodlist[2] = $stylemod; } $module = trim($matchesmodlist[0]); $name = htmlspecialchars_decode(trim($matchesmodlist[1])); $stylemod = trim($matchesmodlist[2]); // $match[0] is full pattern match, $match[1] is the module,$match[2] is the title $output = $this->_loadmod($module, $name, $stylemod); // We should replace only first occurrence in order to allow positions with the same name to regenerate their content: $article->text = preg_replace("|$matchmod[0]|", addcslashes($output, '\\$'), $article->text, 1); $stylemod = $this->params->def('style', 'none'); } } } /** * Loads and renders the module * * @param string $position The position assigned to the module * @param string $style The style assigned to the module * * @return mixed * * @since 1.6 */ protected function _load($position, $style = 'none') { self::$modules[$position] = ''; $document = JFactory::getDocument(); $renderer = $document->loadRenderer('module'); $modules = JModuleHelper::getModules($position); $params = array('style' => $style); ob_start(); foreach ($modules as $module) { echo $renderer->render($module, $params); } self::$modules[$position] = ob_get_clean(); return self::$modules[$position]; } /** * This is always going to get the first instance of the module type unless * there is a title. * * @param string $module The module title * @param string $title The title of the module * @param string $style The style of the module * * @return mixed * * @since 1.6 */ protected function _loadmod($module, $title, $style = 'none') { self::$mods[$module] = ''; $document = JFactory::getDocument(); $renderer = $document->loadRenderer('module'); $mod = JModuleHelper::getModule($module, $title); // If the module without the mod_ isn't found, try it with mod_. // This allows people to enter it either way in the content if (!isset($mod)) { $name = 'mod_' . $module; $mod = JModuleHelper::getModule($name, $title); } $params = array('style' => $style); ob_start(); echo $renderer->render($mod, $params); self::$mods[$module] = ob_get_clean(); return self::$mods[$module]; } } content/loadmodule/index.html000066600000000037150771657550012366 0ustar00 content/loadmodule/loadmodule.xml000066600000002675150771657550013252 0ustar00 plg_content_loadmodule Joomla! Project November 2005 Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.0.0 PLG_LOADMODULE_XML_DESCRIPTION loadmodule.php index.html en-GB.plg_content_loadmodule.ini en-GB.plg_content_loadmodule.sys.ini
        content/joomsef/joomsef.php000066600000002066150771657550012065 0ustar00_checkURLs($option,$item); } } function onContentAfterDelete($context,$item) { $context=explode(".",$context); $option=$context[0]; JoomSEF::_removeURL($option,$item); } } ?>content/joomsef/joomsef.xml000066600000001150150771657550012067 0ustar00 Content - ARTIO JoomSEF ARTIO s.r.o. 12. June 2010 ARTIO s.r.o. GNU/GPLv3 http://www.artio.net/license/gnu-general-public-license info@artio.net www.artio.net 4.0.0 PLG_CONTENT_JOOMSEF_XML_DESCRIPTION joomsef.php content/zooshortcode/zooshortcode.php000066600000004633150771657550014227 0ustar00_prepareContent($row, $params, $page); } public function onContentPrepare($context, &$article, &$params, $page = 0) { return $this->_prepareContent($article, $params, $page); } protected function _prepareContent(&$article, &$params, $page = 0) { // simple performance check to determine whether text should be processed further if (strpos($article->text, 'zooitem') === false && strpos($article->text, 'zoocategory') === false) { return true; } // load ZOO config jimport('joomla.filesystem.file'); if (!JFile::exists(JPATH_ADMINISTRATOR.'/components/com_zoo/config.php') || !JComponentHelper::getComponent('com_zoo', true)->enabled) { return; } require_once(JPATH_ADMINISTRATOR.'/components/com_zoo/config.php'); // Get the ZOO App instance $this->app = App::getInstance('zoo'); $this->_doReplacement($article, 'item'); $this->_doReplacement($article, 'category'); return true; } protected function _doReplacement(&$article, $name) { // expression to search for $regex = '/{zoo'.$name.':\s*(\S*)(?:\s*text:\s*(.*?))?}/i'; $matches = array(); // find all instances of plugin and put in $matches preg_match_all($regex, $article->text, $matches, PREG_SET_ORDER); foreach ($matches as $match) { // $match[0] is full pattern match, $match[1] is the item id or alias $id = $match[1]; if (!is_numeric($match[1])) { $id = $this->app->alias->$name->translateAliasToID($match[1]); } if ($id && ($object = $this->app->table->$name->get($id))) { if (isset($match[2]) && !empty($match[2])) { $text = $match[2]; } else { $text = $object->name; } $output = ''.$text.''; } else { $output = ''; } // We should replace only first occurrence in order to allow positions with the same name to regenerate their content: $article->text = preg_replace("|$match[0]|", $output, $article->text, 1); } return true; } }content/zooshortcode/zooshortcode.xml000066600000001516150771657550014235 0ustar00 Content - ZOO Shortcode YOOtheme October 2012 Copyright (C) YOOtheme GmbH http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only YOOtheme Proprietary Use License (http://www.yootheme.com/license) info@yootheme.com http://www.yootheme.com 3.0.0 Shortcode plugin for ZOO developed by YOOtheme (http://www.yootheme.com) Usage: {zooitem OR zoocategory: ID OR alias} Optionally: {zooitem: ID text: MYTEXT} zooshortcode.php captcha/index.html000066600000000037150771657550010172 0ustar00 captcha/recaptcha/index.html000066600000000037150771657550012124 0ustar00 captcha/recaptcha/recaptcha.php000066600000015505150771657550012600 0ustar00_getLanguage(); $pubkey = $this->params->get('public_key', ''); $theme = $this->params->get('theme', 'clean'); if ($pubkey == null || $pubkey == '') { throw new Exception(JText::_('PLG_RECAPTCHA_ERROR_NO_PUBLIC_KEY')); } $server = self::RECAPTCHA_API_SERVER; if ($app->isSSLConnection()) { $server = self::RECAPTCHA_API_SECURE_SERVER; } JHtml::_('script', $server . '/js/recaptcha_ajax.js'); $document->addScriptDeclaration('jQuery( document ).ready(function() { Recaptcha.create("' . $pubkey . '", "dynamic_recaptcha_1", {theme: "' . $theme . '",' . $lang . 'tabindex: 0});});' ); return true; } /** * Gets the challenge HTML * * @param string $name The name of the field. * @param string $id The id of the field. * @param string $class The class of the field. * * @return string The HTML to be embedded in the form. * * @since 2.5 */ public function onDisplay($name, $id, $class) { return '
        '; } /** * Calls an HTTP POST function to verify if the user's guess was correct * * @param string $code Answer provided by user. * * @return True if the answer is correct, false otherwise * * @since 2.5 */ public function onCheckAnswer($code) { $input = JFactory::getApplication()->input; $privatekey = $this->params->get('private_key'); $remoteip = $input->server->get('REMOTE_ADDR', '', 'string'); $challenge = $input->get('recaptcha_challenge_field', '', 'string'); $response = $input->get('recaptcha_response_field', '', 'string'); // Check for Private Key if (empty($privatekey)) { $this->_subject->setError(JText::_('PLG_RECAPTCHA_ERROR_NO_PRIVATE_KEY')); return false; } // Check for IP if (empty($remoteip)) { $this->_subject->setError(JText::_('PLG_RECAPTCHA_ERROR_NO_IP')); return false; } // Discard spam submissions if ($challenge == null || strlen($challenge) == 0 || $response == null || strlen($response) == 0) { $this->_subject->setError(JText::_('PLG_RECAPTCHA_ERROR_EMPTY_SOLUTION')); return false; } $response = $this->_recaptcha_http_post( self::RECAPTCHA_VERIFY_SERVER, "/recaptcha/api/verify", array( 'privatekey' => $privatekey, 'remoteip' => $remoteip, 'challenge' => $challenge, 'response' => $response ) ); $answers = explode("\n", $response[1]); if (trim($answers[0]) == 'true') { return true; } else { // @todo use exceptions here $this->_subject->setError(JText::_('PLG_RECAPTCHA_ERROR_' . strtoupper(str_replace('-', '_', $answers[1])))); return false; } } /** * Encodes the given data into a query string format. * * @param array $data Array of string elements to be encoded * * @return string Encoded request * * @since 2.5 */ private function _recaptcha_qsencode($data) { $req = ""; foreach ($data as $key => $value) { $req .= $key . '=' . urlencode(stripslashes($value)) . '&'; } // Cut the last '&' $req = rtrim($req, '&'); return $req; } /** * Submits an HTTP POST to a reCAPTCHA server. * * @param string $host Host name to POST to. * @param string $path Path on host to POST to. * @param array $data Data to be POSTed. * @param int $port Optional port number on host. * * @return array Response * * @since 2.5 */ private function _recaptcha_http_post($host, $path, $data, $port = 80) { $req = $this->_recaptcha_qsencode($data); $http_request = "POST $path HTTP/1.0\r\n"; $http_request .= "Host: $host\r\n"; $http_request .= "Content-Type: application/x-www-form-urlencoded;\r\n"; $http_request .= "Content-Length: " . strlen($req) . "\r\n"; $http_request .= "User-Agent: reCAPTCHA/PHP\r\n"; $http_request .= "\r\n"; $http_request .= $req; $response = ''; if (($fs = @fsockopen($host, $port, $errno, $errstr, 10)) == false ) { die('Could not open socket'); } fwrite($fs, $http_request); while (!feof($fs)) { // One TCP-IP packet $response .= fgets($fs, 1160); } fclose($fs); $response = explode("\r\n\r\n", $response, 2); return $response; } /** * Get the language tag or a custom translation * * @return string * * @since 2.5 */ private function _getLanguage() { $language = JFactory::getLanguage(); $tag = explode('-', $language->getTag()); $tag = $tag[0]; $available = array('en', 'pt', 'fr', 'de', 'nl', 'ru', 'es', 'tr'); if (in_array($tag, $available)) { return "lang : '" . $tag . "',"; } // If the default language is not available, let's search for a custom translation if ($language->hasKey('PLG_RECAPTCHA_CUSTOM_LANG')) { $custom[] = 'custom_translations : {'; $custom[] = "\t" . 'instructions_visual : "' . JText::_('PLG_RECAPTCHA_INSTRUCTIONS_VISUAL') . '",'; $custom[] = "\t" . 'instructions_audio : "' . JText::_('PLG_RECAPTCHA_INSTRUCTIONS_AUDIO') . '",'; $custom[] = "\t" . 'play_again : "' . JText::_('PLG_RECAPTCHA_PLAY_AGAIN') . '",'; $custom[] = "\t" . 'cant_hear_this : "' . JText::_('PLG_RECAPTCHA_CANT_HEAR_THIS') . '",'; $custom[] = "\t" . 'visual_challenge : "' . JText::_('PLG_RECAPTCHA_VISUAL_CHALLENGE') . '",'; $custom[] = "\t" . 'audio_challenge : "' . JText::_('PLG_RECAPTCHA_AUDIO_CHALLENGE') . '",'; $custom[] = "\t" . 'refresh_btn : "' . JText::_('PLG_RECAPTCHA_REFRESH_BTN') . '",'; $custom[] = "\t" . 'help_btn : "' . JText::_('PLG_RECAPTCHA_HELP_BTN') . '",'; $custom[] = "\t" . 'incorrect_try_again : "' . JText::_('PLG_RECAPTCHA_INCORRECT_TRY_AGAIN') . '",'; $custom[] = '},'; $custom[] = "lang : '" . $tag . "',"; return implode("\n", $custom); } // If nothing helps fall back to english return ''; } } captcha/recaptcha/recaptcha.xml000066600000003101150771657550012576 0ustar00 plg_captcha_recaptcha 3.0.0 December 2011 Joomla! Project admin@joomla.org www.joomla.org Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt PLG_CAPTCHA_RECAPTCHA_XML_DESCRIPTION recaptcha.php