function editLanguageSource($p_lname, $option) { global $adminLanguage; $file = stripslashes("../language/{$p_lname}.php"); if ($fp = fopen($file, "r")) { $content = fread($fp, filesize($file)); $content = htmlspecialchars($content); HTML_languages::editLanguageSource($p_lname, $content, $option); } else { mosRedirect("index2.php?option={$option}&mosmsg=" . $adminLanguage->A_COMP_LANG_FAILED_OPEN . " " . $file); } }
/** * Compiles a list of installed languages */ function viewLanguages() { global $mainframe, $option; // Initialize some variables $db =& JFactory::getDBO(); $client =& JApplicationHelper::getClientInfo(JRequest::getVar('client', '0', '', 'int')); $rows = array(); $limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int'); $limitstart = $mainframe->getUserStateFromRequest($option . '.limitstart', 'limitstart', 0, 'int'); $rowid = 0; // Set FTP credentials, if given jimport('joomla.client.helper'); $ftp =& JClientHelper::setCredentialsFromRequest('ftp'); //load folder filesystem class jimport('joomla.filesystem.folder'); $path = JLanguage::getLanguagePath($client->path); $dirs = JFolder::folders($path); foreach ($dirs as $dir) { $files = JFolder::files($path . DS . $dir, '^([-_A-Za-z]*)\\.xml$'); foreach ($files as $file) { $data = JApplicationHelper::parseXMLLangMetaFile($path . DS . $dir . DS . $file); $row = new StdClass(); $row->id = $rowid; $row->language = substr($file, 0, -4); if (!is_array($data)) { continue; } foreach ($data as $key => $value) { $row->{$key} = $value; } // if current than set published $params = JComponentHelper::getParams('com_languages'); if ($params->get($client->name, 'en-GB') == $row->language) { $row->published = 1; } else { $row->published = 0; } $row->checked_out = 0; $row->mosname = JString::strtolower(str_replace(" ", "_", $row->name)); $rows[] = $row; $rowid++; } } jimport('joomla.html.pagination'); $pageNav = new JPagination($rowid, $limitstart, $limit); $rows = array_slice($rows, $pageNav->limitstart, $pageNav->limit); HTML_languages::showLanguages($rows, $pageNav, $option, $client, $ftp); }
function editLanguageSource($p_lname, $option) { $file = stripslashes("../language/{$p_lname}.php"); if ($fp = fopen($file, "r")) { $content = fread($fp, filesize($file)); $content = htmlspecialchars($content); HTML_languages::editLanguageSource($p_lname, $content, $option); } else { mosRedirect("index2.php?option={$option}&mosmsg=Operation Failed: Could not open {$file}"); } }
function editLanguageSource($p_lname, $option) { $file = stripslashes("../language/{$p_lname}.php"); if ($fp = fopen($file, "r")) { $content = fread($fp, filesize($file)); $content = htmlspecialchars($content); HTML_languages::editLanguageSource($p_lname, $content, $option); } else { mosRedirect("index2.php?option={$option}&mosmsg=Operação Falhou: Não foi possível abrir o arquivo {$file}"); } }