Sfoglia il codice sorgente

When there is still no dictionary available, the menus / classes / attributes have a default label based on their raw names (replacing _ by a blank)

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@1948 a333f486-631f-4898-b8df-5754b55c2be0
romainq 13 anni fa
parent
commit
c16e91369d

+ 2 - 2
application/menunode.class.inc.php

@@ -372,12 +372,12 @@ abstract class MenuNode
 	
 	public function GetTitle()
 	{
-		return Dict::S("Menu:$this->sMenuId");
+		return Dict::S("Menu:$this->sMenuId", str_replace('_', ' ', $this->sMenuId));
 	}
 	
 	public function GetLabel()
 	{
-		return Dict::S("Menu:$this->sMenuId+");
+		return Dict::S("Menu:$this->sMenuId+", "");
 	}
 	
 	public function GetIndex()

+ 2 - 2
core/attributedef.class.inc.php

@@ -181,7 +181,7 @@ abstract class AttributeDefinition
 		// If no default value is specified, let's define the most relevant one for developping purposes
 		if (is_null($sDefault))
 		{
-			$sDefault = $this->m_sCode;
+			$sDefault = str_replace('_', ' ', $this->m_sCode);
 		}
 
 		$sLabel = Dict::S('Class:'.$this->m_sHostClass.'/Attribute:'.$this->m_sCode, '');
@@ -2048,7 +2048,7 @@ class AttributeEnum extends AttributeString
 			$sLabel = Dict::S('Class:'.$this->GetHostClass().'/Attribute:'.$this->GetCode().'/Value:'.$sValue, '');
 			if (strlen($sLabel) == 0)
 			{
-				$sLabel = $sValue;
+				$sLabel = str_replace('_', ' ', $sValue);
 				$sParentClass = MetaModel::GetParentClass($this->m_sHostClass);
 				if ($sParentClass)
 				{

+ 1 - 1
core/metamodel.class.php

@@ -296,7 +296,7 @@ abstract class MetaModel
 	{
 		self::_check_subclass($sClass);
 		$sStringCode = 'Class:'.$sClass;
-		return Dict::S($sStringCode, $sClass);
+		return Dict::S($sStringCode, str_replace('_', ' ', $sClass));
 	}
 	final static public function GetName_Obsolete($sClass)
 	{