Version 5.0.0 beta 2

This commit is contained in:
Neo committed 2025-12-19 16:39:01 -08:00
1 parent 15c7beabc5
commit f61b0da85d
181 files changed
+3182 -1533

No files matched your search

+35 -1
View File
@@ -24,6 +24,7 @@ use IPS\Helpers\Form\Text;
use IPS\Helpers\Form\Translatable;
use IPS\Http\Url;
use IPS\Lang;
use IPS\Member;
use IPS\Node\Model;
use IPS\Request;
use IPS\Settings;
@@ -98,6 +99,39 @@ class Category extends Model
*/
public static ?string $subnodeClass = Setting::class;
/**
* [Node] Get Title
*
* @return string
*/
protected function get__title(): string
{
return Member::loggedIn()->language()->addToStack( static::$titleLangPrefix . $this->key, NULL, array( 'escape' => TRUE ) );
}
/**
* Get the title for a node using the specified language object
* This is commonly used where we cannot use the logged in member's language, such as sending emails
*
* @param Lang $language Language object to fetch the title with
* @param array $options What options to use for language parsing
* @return string
*/
public function getTitleForLanguage( Lang $language, array $options=array() ): string
{
return $language->addToStack( static::$titleLangPrefix . $this->key, NULL, $options );
}
/**
* [Node] Get Title language key, not added to a language stack
*
* @return string|null
*/
protected function get__titleLanguageKey(): ?string
{
return static::$titleLangPrefix . $this->key;
}
/**
* [Node] Get Icon for tree
*
@@ -365,7 +399,7 @@ class Category extends Model
$return['cat_app'] = $values['themeeditor_cat_app']->directory;
}
Lang::saveCustom( 'core', static::$titleLangPrefix . $this->id, $values['themeeditor_cat_name'] );
Lang::saveCustom( 'core', static::$titleLangPrefix . $this->key, $values['themeeditor_cat_name'] );
return $return;
}