Knowledgebase



 Categories





 Dimofinf Mobile


Subscribe now to Dimofinf Mobile and enjoy a wide range of premium services. You will receive our SMS text messages wherever you are for a very low cost! More


 Currency Converter


  • Currency
  • US$ Amount

Settings system



Dimofinf presents you with a professional easy-to-use system for the settings and their dealings, there are some basic points you need to understand about Dimofinf settings system:

  • Settings are saved in an xml file within the xml folder in the plugin folder.

The settings file is saved in the path 'pluginfolder-settings.xml' replacing the 'pluginfolder' with the plugin folder name.

Example for the settings xml file:

CODE :
<?xml version="1.0" encoding="UTF-8"?>
<settinggroups product="pluginfolder">
							
	// Settings group
	<settinggroup name="pluginfolder_general_group" displayorder="10" 	product="pluginfolder">	
		<setting varname="album_max_limit_block" displayorder="350">
			<datatype>TN</datatype>
			<validationcode><![CDATA[return ($data > 0);]]></validationcode>
			<defaultvalue>10</defaultvalue>
		</setting>
	</settinggroup>
</settinggroups>

Notes:

  • Settings are classified into groups and each group has its own set of settings.
  • The feature 'product' in the 'settinggroups' tag is the name of the plugin folder where the 'pluginfolder' is replaced by the folder name.
  • The feature 'name' in the 'settinggroups' tag is the group name and it must have a phrase that carries the same name in the language.
  • The feature 'displayorder' in the 'settinggroups' tag is the group display order among the settings groups.
  • The feature 'varname' in the 'setting' tag is the setting name and it must have a phrase that carries the same name in the language.
  • The feature 'displayorder' in the 'setting' tag is the setting display order among the settings in the group.
  • The 'datatype' tag is responsible for the the input type in the HTML.
  • The ' validationcode' tag is the PHP code responsible for verifying the setting value where the PHP code is added directly in the tag CODE :
]> replacing 'code' with the PHP verifying code.</li>
<li>The tag 'defaultvalue' and it is optional is used to assign the default value for the setting.</li>
<li>To use the ready colors input from Dimofinf, end the name of the tag 'varname' with '_color' and the system will automatically transfer it to the colors input. </li>
</ul>
<strong>Example</strong><strong>:</strong>>
[code]
<setting varname="editor_color" displayorder="40">
	<datatype>TN</datatype>
	<defaultvalue>transparent</defaultvalue>
	</setting>

Inputs types:

  • TN :

This type is for a Text input type.

Example:

CODE :
<setting varname="temppath" displayorder="30">
		<datatype>TN</datatype>
		<validationcode><![CDATA[return ($data !="");]]></validationcode>
		<defaultvalue><![CDATA[/temp]]></defaultvalue>
</setting>
  • Y :

This type is for Yes/No menus noting that the value is zero for No and 1 for yes.

Example:

CODE :
<setting varname="searchactive" displayorder="150">
		<datatype>Y</datatype>
		<defaultvalue>1</defaultvalue>
</setting>
  • S :

This type is for input from Select menu type with one choice noting that its choices are assigned using the tag 'optioncode' which includes the value and its title in the 'key:title' form and separating between choices using a comma.

Example:

CODE :
<setting varname="mailmethod" displayorder="10">
		<datatype>S</datatype>	
	<optioncode><![CDATA[mail:MAIL,sendmail:SENDMAIL,smtp:SMTP]]></optioncode>
		<defaultvalue>mail</defaultvalue>
</setting>
  • SM :

This type is for input from Select menu type with multiple choices noting that its choices are assigned using the tag 'optioncode' which includes the value and its title in the 'key:title' form and separating between choices using a comma.

Please note: the default values are assigned in the tag 'defaultvalue' but within the tag replacing the 'values' with the default values names.

Example:

CODE :
<setting varname="activestyles" displayorder="30">
		<datatype>SM</datatype>
		<validationcode><![CDATA[return is_array($data);]]></validationcode>
		<optioncode><![CDATA[1:default]]></optioncode>
		<defaultvalue><![CDATA[1]]></defaultvalue>
</setting>
  • P :

This type is for input of Password type.

Example:

CODE :
<setting varname="mailpass" displayorder="50">
		<datatype>P</datatype>
</setting>

Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article


Online