Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Huge language file structure change (foreign languages will follow) #627

Merged
merged 12 commits into from
Apr 27, 2012
Merged
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ The *Kunena* projects thrives on contributions from the community. Our dedicated

1. [Create an account on kunena.org](http://www.kunena.org/component/community/register)
2. [Create a topic (unless there already is one)](http://www.kunena.org/forum/newtopic)
3. [Checkout our GIT repository on github](https://github.com/Kunena)
3. [Checkout our Git repository on github](https://github.com/Kunena)
4. [Read our documentation](http://docs.kunena.org)
5. [Read our developer wiki](https://github.com/Kunena/Kunena-2.0/wiki)
6. Send us a pull request
Expand Down
5 changes: 5 additions & 0 deletions administrator/components/com_kunena/admin.kunena.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@
KunenaFactory::loadLanguage('com_kunena', 'admin');
KunenaFactory::loadLanguage('com_kunena', 'site');
KunenaFactory::loadLanguage('com_kunena.install', 'admin');
KunenaFactory::loadLanguage('com_kunena.controllers', 'admin');
KunenaFactory::loadLanguage('com_kunena.models', 'admin');
KunenaFactory::loadLanguage('com_kunena.views', 'admin');

KunenaForum::setup();

// Initialize error handlers
KunenaError::initialize ();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ public static function isCompatible($version) {
if (version_compare($version, '2.0.0-DEV', '<')) {
return false;
}
// Check if future version is needed (remove SVN from the check)
if (version_compare($version, preg_replace('/-SVN/i', '', self::version()), '>')) {
// Check if future version is needed (remove GIT from the check)
if (version_compare($version, preg_replace('/-GIT/i', '', self::version()), '>')) {
return false;
}
return true;
Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_kunena/install/j25upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ protected function migrateExtensionCustom() {
$manifest15 = JPATH_ADMINISTRATOR.'/components/com_kunena/kunena.xml';
if (file_exists($manifest25)) {
$content = file_get_contents($manifest25);
// Take care of SVN install
$content = preg_replace('/@kunenaversion@/', preg_replace('/-SVN/i', '', KunenaForum::version()), $content);
// Take care of Git install
$content = preg_replace('/@kunenaversion@/', preg_replace('/-GIT/i', '', KunenaForum::version()), $content);
$content = preg_replace('/@kunenaversiondate@/', KunenaForum::versionDate(), $content);
$content = preg_replace('/@kunenaversionname@/', KunenaForum::versionName(), $content);
JFile::write($manifest15, $content);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,8 @@
<version version="2.0.0-DEV15" versiondate="2012-04-13" versionname="Internal">
<phpfile name="upgrade-2.0.0_menu"></phpfile>
</version>
<version version="2.0.0-BETA1" versiondate="2012-04-24" versionname="Newspeak">
</version>
<version version="@kunenaversion@" versiondate="@kunenaversiondate@" versionname="@kunenaversionname@">
</version>
</upgrade>
Expand Down
51 changes: 34 additions & 17 deletions administrator/components/com_kunena/install/model.php
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ function uninstallPlugin($folder, $name) {
}

public function deleteFiles($path, $ignore=array()) {
$ignore = array_merge($ignore, array('.svn', 'CVS','.DS_Store','__MACOSX'));
$ignore = array_merge($ignore, array('.git', '.svn', 'CVS','.DS_Store','__MACOSX'));
foreach (JFolder::files($path, '.', false, true, $ignore) as $file) {
if ( JFile::exists($file) ) {
JFile::delete($file);
Expand All @@ -509,7 +509,7 @@ public function deleteFiles($path, $ignore=array()) {
}

public function deleteFolders($path, $ignore=array()) {
$ignore = array_merge($ignore, array('.svn', 'CVS','.DS_Store','__MACOSX'));
$ignore = array_merge($ignore, array('.git', '.svn', 'CVS','.DS_Store','__MACOSX'));
foreach (JFolder::folders($path, '.', false, true, $ignore) as $folder) {
if ( JFolder::exists($folder) ) {
JFolder::delete($folder);
Expand Down Expand Up @@ -571,7 +571,7 @@ public function stepLanguage() {
public function stepExtract() {
$path = JPATH_ADMINISTRATOR . '/components/com_kunena/archive';
if (KunenaForum::isDev() || !is_file("{$path}/fileformat")) {
// SVN install
// Git install
$dir = JPATH_ADMINISTRATOR.'/components/com_kunena/media/kunena';
if (is_dir($dir)) {
JFolder::copy($dir, KPATH_MEDIA, false, true);
Expand Down Expand Up @@ -868,10 +868,10 @@ public function upgradeDatabase() {
$state[$vernum] = 1;

if ($version['version'] == '@'.'kunenaversion'.'@') {
$svn = 1;
$git = 1;
$vernum = KunenaForum::version();
}
if(isset($svn) || version_compare(strtolower($version['version']), strtolower($curversion->version), '>')) {
if(isset($git) || version_compare(strtolower($version['version']), strtolower($curversion->version), '>')) {
foreach ($version as $action) {
$result = $this->processUpgradeXMLNode($action);
if ($result) $this->addStatus ( $result ['action'] . ' ' . $result ['name'], $result ['success'] );
Expand Down Expand Up @@ -1450,6 +1450,22 @@ protected function updateVersionState($state) {
}

function getActionText($version, $type='', $action=null) {
/* Translations generated:

Installation types: COM_KUNENA_INSTALL_UPGRADE, COM_KUNENA_INSTALL_DOWNGRADE, COM_KUNENA_INSTALL_REINSTALL,
COM_KUNENA_INSTALL_MIGRATE, COM_KUNENA_INSTALL_INSTALL, COM_KUNENA_INSTALL_UNINSTALL, COM_KUNENA_INSTALL_RESTORE

Installation descriptions: COM_KUNENA_INSTALL_UPGRADE_DESC, COM_KUNENA_INSTALL_DOWNGRADE_DESC, COM_KUNENA_INSTALL_REINSTALL_DESC,
COM_KUNENA_INSTALL_MIGRATE_DESC, COM_KUNENA_INSTALL_INSTALL_DESC, COM_KUNENA_INSTALL_UNINSTALL_DESC, COM_KUNENA_INSTALL_RESTORE_DESC

Installation hints: COM_KUNENA_INSTALL_UPGRADE_HINT, COM_KUNENA_INSTALL_DOWNGRADE_HINT, COM_KUNENA_INSTALL_REINSTALL_HINT,
COM_KUNENA_INSTALL_MIGRATE_HINT, COM_KUNENA_INSTALL_INSTALL_HINT, COM_KUNENA_INSTALL_UNINSTALL_HINT, COM_KUNENA_INSTALL_RESTORE_HINT

Installation warnings: COM_KUNENA_INSTALL_UPGRADE_WARN, COM_KUNENA_INSTALL_DOWNGRADE_WARN, COM_KUNENA_INSTALL_REINSTALL_WARN,
COM_KUNENA_INSTALL_MIGRATE_WARN, COM_KUNENA_INSTALL_INSTALL_WARN, COM_KUNENA_INSTALL_UNINSTALL_WARN, COM_KUNENA_INSTALL_RESTORE_WARN

*/

static $search = array ('#COMPONENT_OLD#','#VERSION_OLD#','#VERSION#');
$replace = array ($version->component, $version->version, KunenaForum::version());
if (!$action) $action = $version->action;
Expand Down Expand Up @@ -1639,26 +1655,26 @@ function deleteTables($prefix) {
* and if not, adds a forum link in the mainmenu.
*/
function createMenu() {
$menu = array('name'=>JText::_ ( 'COM_KUNENA_MENU_FORUM' ), 'alias'=>JString::strtolower(JText::_ ( 'COM_KUNENA_MENU_FORUM_ALIAS' )),
$menu = array('name'=>JText::_ ( 'COM_KUNENA_MENU_ITEM_FORUM' ), 'alias'=>JString::strtolower(JText::_ ( 'COM_KUNENA_MENU_FORUM_ALIAS' )),
'link'=>'index.php?option=com_kunena&view=home', 'access'=>0, 'params'=>array('catids'=>0));
$submenu = array(
'index'=>array('name'=>JText::_ ( 'COM_KUNENA_MENU_INDEX' ), 'alias'=>JString::strtolower(JText::_ ( 'COM_KUNENA_MENU_INDEX_ALIAS' )),
'index'=>array('name'=>JText::_ ( 'COM_KUNENA_MENU_ITEM_INDEX' ), 'alias'=>JString::strtolower(JText::_ ( 'COM_KUNENA_MENU_INDEX_ALIAS' )),
'link'=>'index.php?option=com_kunena&view=category&layout=list', 'access'=>0, 'default'=>'categories', 'params'=>array()),
'recent'=>array('name'=>JText::_ ( 'COM_KUNENA_MENU_RECENT' ), 'alias'=>JString::strtolower(JText::_ ( 'COM_KUNENA_MENU_RECENT_ALIAS' )),
'recent'=>array('name'=>JText::_ ( 'COM_KUNENA_MENU_ITEM_RECENT' ), 'alias'=>JString::strtolower(JText::_ ( 'COM_KUNENA_MENU_RECENT_ALIAS' )),
'link'=>'index.php?option=com_kunena&view=topics&mode=replies', 'access'=>0, 'default'=>'recent', 'params'=>array('topics_catselection'=>1, 'topics_categories'=>0, 'topics_time'=>720)),
'newtopic'=>array('name'=>JText::_ ( 'COM_KUNENA_MENU_NEWTOPIC' ), 'alias'=>JString::strtolower(JText::_ ( 'COM_KUNENA_MENU_NEWTOPIC_ALIAS' )),
'newtopic'=>array('name'=>JText::_ ( 'COM_KUNENA_MENU_ITEM_NEWTOPIC' ), 'alias'=>JString::strtolower(JText::_ ( 'COM_KUNENA_MENU_NEWTOPIC_ALIAS' )),
'link'=>'index.php?option=com_kunena&view=topic&layout=create', 'access'=>1, 'params'=>array()),
'noreplies'=>array('name'=>JText::_ ( 'COM_KUNENA_MENU_NOREPLIES' ), 'alias'=>JString::strtolower(JText::_ ( 'COM_KUNENA_MENU_NOREPLIES_ALIAS' )),
'noreplies'=>array('name'=>JText::_ ( 'COM_KUNENA_MENU_ITEM_NOREPLIES' ), 'alias'=>JString::strtolower(JText::_ ( 'COM_KUNENA_MENU_NOREPLIES_ALIAS' )),
'link'=>'index.php?option=com_kunena&view=topics&mode=noreplies', 'access'=>1, 'params'=>array('topics_catselection'=>1, 'topics_categories'=>0, 'topics_time'=>-1)),
'mylatest'=>array('name'=>JText::_ ( 'COM_KUNENA_MENU_MYLATEST' ), 'alias'=>JString::strtolower(JText::_ ( 'COM_KUNENA_MENU_MYLATEST_ALIAS' )),
'mylatest'=>array('name'=>JText::_ ( 'COM_KUNENA_MENU_ITEM_MYLATEST' ), 'alias'=>JString::strtolower(JText::_ ( 'COM_KUNENA_MENU_MYLATEST_ALIAS' )),
'link'=>'index.php?option=com_kunena&view=topics&layout=user&mode=default', 'access'=>1, 'default'=>'my' , 'params'=>array('topics_catselection'=>1, 'topics_categories'=>0, 'topics_time'=>-1)),
'profile'=>array('name'=>JText::_ ( 'COM_KUNENA_MENU_PROFILE' ), 'alias'=>JString::strtolower(JText::_ ( 'COM_KUNENA_MENU_PROFILE_ALIAS' )),
'profile'=>array('name'=>JText::_ ( 'COM_KUNENA_MENU_ITEM_PROFILE' ), 'alias'=>JString::strtolower(JText::_ ( 'COM_KUNENA_MENU_PROFILE_ALIAS' )),
'link'=>'index.php?option=com_kunena&view=user', 'access'=>1, 'params'=>array('integration'=>1)),
'rules'=>array('name'=>JText::_ ( 'COM_KUNENA_MENU_RULES' ), 'alias'=>JString::strtolower(JText::_ ( 'COM_KUNENA_MENU_RULES_ALIAS' )),
'rules'=>array('name'=>JText::_ ( 'COM_KUNENA_MENU_ITEM_RULES' ), 'alias'=>JString::strtolower(JText::_ ( 'COM_KUNENA_MENU_RULES_ALIAS' )),
'link'=>'index.php?option=com_kunena&view=misc', 'access'=>0, 'params'=>array('body'=>JText::_ ( 'COM_KUNENA_MENU_MISC_DEFAULT_BODY' ), 'body_format'=>'text')),
'help'=>array('name'=>JText::_ ( 'COM_KUNENA_MENU_HELP' ), 'alias'=>JString::strtolower(JText::_ ( 'COM_KUNENA_MENU_HELP_ALIAS' )),
'help'=>array('name'=>JText::_ ( 'COM_KUNENA_MENU_ITEM_HELP' ), 'alias'=>JString::strtolower(JText::_ ( 'COM_KUNENA_MENU_HELP_ALIAS' )),
'link'=>'index.php?option=com_kunena&view=misc', 'access'=>0, 'params'=>array('body'=>JText::_ ( 'COM_KUNENA_MENU_MISC_DEFAULT_BODY' ), 'body_format'=>'text')),
'search'=>array('name'=>JText::_ ( 'COM_KUNENA_MENU_SEARCH' ), 'alias'=>JString::strtolower(JText::_ ( 'COM_KUNENA_MENU_SEARCH_ALIAS' )),
'search'=>array('name'=>JText::_ ( 'COM_KUNENA_MENU_ITEM_SEARCH' ), 'alias'=>JString::strtolower(JText::_ ( 'COM_KUNENA_MENU_SEARCH_ALIAS' )),
'link'=>'index.php?option=com_kunena&view=search', 'access'=>0, 'params'=>array()),
);

Expand Down Expand Up @@ -1943,6 +1959,7 @@ function createMenuJ25($menu, $submenu) {
$moduleid = $module->id;

// Now publish the module
// TODO: no need for the menu module
$query = "REPLACE INTO `#__modules_menu` (`moduleid`, `menuid`) VALUES ($moduleid, 0);";
$this->db->setQuery ( $query );
$this->db->query ();
Expand All @@ -1954,11 +1971,11 @@ function createMenuJ25($menu, $submenu) {
$defaultmenu = JMenu::getInstance('site')->getDefault('workaround');
if (!$defaultmenu) return true;
$table = JTable::getInstance ( 'menu' );
$table->load(array('menutype'=>$defaultmenu->menutype, 'type'=>'alias', 'title'=>JText::_ ( 'COM_KUNENA_MENU_FORUM' )));
$table->load(array('menutype'=>$defaultmenu->menutype, 'type'=>'alias', 'title'=>JText::_ ( 'COM_KUNENA_MENU_ITEM_FORUM' )));
if (!$table->id) {
$data = array (
'menutype' => $defaultmenu->menutype,
'title' => JText::_ ( 'COM_KUNENA_MENU_FORUM' ),
'title' => JText::_ ( 'COM_KUNENA_MENU_ITEM_FORUM' ),
'link' => 'index.php?Itemid='.$parent->id,
'type' => 'alias',
'published' => 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function onAfterPost($message) {
$act->cmd = 'wall.write';
$act->actor = $message->userid;
$act->target = 0; // no target
$act->title = JText::_ ( '{actor} ' . JText::_ ( 'COM_KUNENA_JS_ACTIVITYSTREAM_CREATE_MSG1' ) . ' <a href="' . $message->getTopic()->getUrl() . '">' . $message->subject . '</a> ' . JText::_ ( 'COM_KUNENA_JS_ACTIVITYSTREAM_CREATE_MSG2' ) );
$act->title = JText::_ ( '{actor} ' . JText::sprintf ( 'PLG_KUNENA_COMMUNITY_ACTIVITY_POST_TITLE', ' <a href="' . $message->getTopic()->getUrl() . '">' . $message->subject . '</a>') );
$act->content = $content;
$act->app = 'kunena.post';
$act->cid = $message->thread;
Expand All @@ -61,7 +61,7 @@ public function onAfterReply($message) {
$act->cmd = 'wall.write';
$act->actor = $message->userid;
$act->target = 0; // no target
$act->title = JText::_ ( '{single}{actor}{/single}{multiple}{actors}{/multiple} ' . JText::_ ( 'COM_KUNENA_JS_ACTIVITYSTREAM_REPLY_MSG1' ) . ' <a href="' . $message->getTopic()->getUrl() . '">' . $message->subject . '</a> ' . JText::_ ( 'COM_KUNENA_JS_ACTIVITYSTREAM_REPLY_MSG2' ) );
$act->title = JText::_ ( '{single}{actor}{/single}{multiple}{actors}{/multiple} ' . JText::sprintf ( 'PLG_KUNENA_COMMUNITY_ACTIVITY_REPLY_TITLE', '<a href="' . $message->getTopic()->getUrl() . '">' . $message->subject . '</a>' ) );
$act->content = $content;
$act->app = 'kunena.post';
$act->cid = $message->thread;
Expand All @@ -81,7 +81,7 @@ public function onAfterThankyou($thankyoutargetid, $username , $message) {
$act->cmd = 'wall.write';
$act->actor = JFactory::getUser()->id;
$act->target = $thankyoutargetid;
$act->title = JText::_ ( '{single}{actor}{/single}{multiple}{actors}{/multiple} ' . JText::_( 'COM_KUNENA_JS_ACTIVITYSTREAM_THANKYOU' ).' <a href="' . $message->getTopic()->getUrl() . '">' . $message->subject . '</a> ' . JText::_ ( 'COM_KUNENA_JS_ACTIVITYSTREAM_REPLY_MSG2' ) );
$act->title = JText::_ ( '{single}{actor}{/single}{multiple}{actors}{/multiple} ' . JText::sprintf( 'PLG_KUNENA_COMMUNITY_ACTIVITY_THANKYOU_TITLE', $username ) );
$act->content = NULL;
$act->app = 'kunena.thankyou';
$act->cid = $thankyoutargetid;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ public function getAccessOptions($accesstype, $category) {
}
if (!$accesstype || $accesstype == 'none') {
$yesno = array ();
$yesno [] = JHTML::_ ( 'select.option', 0, JText::_ ( 'COM_KUNENA_ANN_NO' ) );
$yesno [] = JHTML::_ ( 'select.option', 1, JText::_ ( 'COM_KUNENA_ANN_YES' ) );
$yesno [] = JHTML::_ ( 'select.option', 0, JText::_ ( 'COM_KUNENA_NO' ) );
$yesno [] = JHTML::_ ( 'select.option', 1, JText::_ ( 'COM_KUNENA_YES' ) );

$pub_groups = array ();
$pub_groups [] = JHTML::_ ( 'select.option', 1, JText::_('COM_KUNENA_NOBODY') );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ public function getAccessOptions($accesstype, $category) {
}
if (!$accesstype || $accesstype == 'none') {
$yesno = array ();
$yesno [] = JHTML::_ ( 'select.option', 0, JText::_ ( 'COM_KUNENA_ANN_NO' ) );
$yesno [] = JHTML::_ ( 'select.option', 1, JText::_ ( 'COM_KUNENA_ANN_YES' ) );
$yesno [] = JHTML::_ ( 'select.option', 0, JText::_ ( 'COM_KUNENA_NO' ) );
$yesno [] = JHTML::_ ( 'select.option', 1, JText::_ ( 'COM_KUNENA_YES' ) );

$html ['none']['pub_access'] = array(
'title' => JText::_('PLG_KUNENA_JOOMLA_ACCESS_GROUP_PRIMARY_TITLE'),
Expand Down
8 changes: 4 additions & 4 deletions administrator/components/com_kunena/install/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ public function __construct()
/**
* Get warning for unstable releases
*
* @param string Message to be shown containing two %s parameters for version (2.0.0RC) and version type (SVN, RC, BETA etc)
* @param string Message to be shown containing two %s parameters for version (2.0.0RC) and version type (GIT, RC, BETA etc)
* @return string Warning message
* @since 1.6
*/
public function getVersionWarning($msg='COM_KUNENA_VERSION_WARNING')
{
if (strpos(KunenaForum::version(), 'SVN') !== false) {
$kn_version_type = JText::_('COM_KUNENA_VERSION_SVN');
$kn_version_warning = JText::_('COM_KUNENA_VERSION_SVN_WARNING');
if (strpos(KunenaForum::version(), 'GIT') !== false) {
$kn_version_type = JText::_('COM_KUNENA_VERSION_GIT');
$kn_version_warning = JText::_('COM_KUNENA_VERSION_GIT_WARNING');
} else if (strpos(KunenaForum::version(), 'RC') !== false) {
$kn_version_type = JText::_('COM_KUNENA_VERSION_RC');
$kn_version_warning = JText::_('COM_KUNENA_VERSION_RC_WARNING');
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_kunena/kunena.j25.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<authorUrl>http://www.kunena.org</authorUrl>
<copyright>(C) 2008 - 2012 Kunena Team. All rights reserved.</copyright>
<license>GNU/GPL</license>
<description>Kunena Forum</description>
<description>COM_KUNENA_XML_DESCRIPTION</description>
<scriptfile>install/install.script.php</scriptfile>
<files>
<filename>kunena.php</filename>
Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_kunena/kunena.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<!DOCTYPE install>
<install type="component" version="1.5.0" method="upgrade">
<name>Kunena</name>
<version>2.0.0-BETA1</version>
<versionname>Newspeak</versionname>
<version>2.0.0-BETA2-DEV</version>
<versionname>Internal</versionname>
<creationDate>@kunenaversiondate@</creationDate>
<author>Kunena Team</author>
<authorEmail>kunena@kunena.org</authorEmail>
Expand Down
Loading