Jumi для использования J! 1,0
Предположим, у вас есть Jumi компонент, плагин и модуль установлено и запущено в вашей рабочей Joomla! окружающей среды.
Вы можете начать играть с Jumi сейчас.
Я не играл с советом Jumi на общей живой сайт - вы должны публиковать там только такие приложения Jumi которые были успешно протестированы на личные (то есть не для посторонних глаз) Joomla! установки, предпочтительно на вашем локальном компьютере.
Общая стратегия использования Jumi
Просто, чтобы напомнить:
Jumi ничего не делает, но включает в себя (вводит) пользовательский код в Joomla. Либо в виде отдельной странице (через компонент Jumi) или в статьях (через Jumi плагин) или в положение модулей (через модуль Jumi). Содержание включения вашего - простой или магия - делает то, что вы видите.
Код может быть сохранен в файлах, которые находятся на вашем сервере или в записи Jumi компонент таблицы базы данных или непосредственно записаны в расширениях Jumi.
Если вы решили хранить коды в файлы PHP читают Вопросы безопасности тоже.
Использование общих Jumi может быть посвящен один из следующих схем
В этой статье вы узнаете, как использовать Jumi компонентов, плагинов и модулей соответственно
Компонент
Компонент Jumi создает пользовательские Joomla! страниц и включает в него пользовательский код. Пользовательский код можно сразу же записать в пункт компонента и / или "выведены" из ранее сохраненного файла.
Компонент доступен через администратора бэкэнда верхнем меню: Компоненты -> Jumi. Это открывает Jumi Application Manager.
Вы увидите список компонентов приложений в Application Manager. Значения колонн в списке и в сопровождении меню Application Manager очевидна - он уважает общие Joomla! стандартов.
Есть два предустановленных примеров там: "Привет Jumi!" и «Blogspot». Из этих примеров вы узнаете, как использовать Jumi компонента.
The Pathname field should contain references to the files that resides on your server only.
Scripts order processing
If you have filled both component filelds "Custom script" and "Pathname" then the "Custom script" is processed first.
Calling Jumi application
You can call an Application by two ways:
- relate an Application item with Joomla! menu item or. After the installation of the component there is, as an example for the study, main menu item "Hello Jumi!" connected to the "Hello Jumi!" Application item.
- write anywhere into the Joomla! content link to the Application item URL adress. The rule for link creation is simple:
index.php?option=com_jumi&fileid=xxx
where xxx is ID of Jumi application, that can be seen in the right column of Jumi Application Manager list.
Plugin/mambot
The Jumi plugin/mambot includes into Joomla! articles custom script: from a file or from Jumi component database record.
Before using the plugin do not forget to enable it in the admin backend.
There is a switch "Stop/Clear Jumi Codes" in the plugin Advance parameters. If switched to Yes it clears all Jumi plugin syntax text in Joomla! articles and stops code inclusions!
Plugin syntax
The general Jumi plugin syntax can be learnt from the Jumi Usage Cheatsheet. We will bring just several examples here:
{jumi [images/codes/test.php]} //includes test.php file located in images/codes
{jumi [*1]} //includes code stored in the 1st record of Jumi component database table
{jumi area calc [test.php] width[4] height[6]} //includes test.php file and fills $jumi array
From given examples you can easily guess that
- There must not be any character between the left bracket { and the keyword jumi in the Jumi syntax.
- Everything else outside [ ] brackets is stripped out and not processed.
- Jumi interprets the conent of the first bracket as the code source and tries to include it. The code source can be either a file or record ID of Jumi component database table.
- Beginning from the second bracket [ ] Jumi stores the contents of brackets into $jumi array. The $jumi array (and it values) is accessible from your included php code.
Argument values can be numbers, plain text, html encoded text, etc. etc. It can be everything with an exception of brackets symbols: [ ,], {,}.
If something goes wrong, e.g. nothing is shown in the article, switch "Debug mode" to Yes. It will show you Jumi error message if present.
Parameter: Jumi Default Absolute Path
The Default absolute jumi path is prepanded to the file pathname to be included. If not set it is eqaul to Joomla! root directory. For example:
If we write
{jumi [test.php]}
and the Default Absolute Jumi Path is not set then Jumi plugin looks up test.php in the Joomla! root (where Joomla! configuration.php is). But if we set it to be "images/mycodes" it looks it up in this directory.
We can place our files outside Joomla! installation directory too. For example (on local host) we can have our Joomla! here: "D:/xamp/htdocs/joomla". No problem to store our codes here: "D:/xampp/htdocs/codes" - out of the Joomla! installation directory. The same applies for hosted sites.
The Default Absolute Jumi Paths has got two reasons:
- user comfort: no need to over and over again write the full relative path to files to be included
- web security: if for certain reasons Jumi is not working the the Jumi syntax code is visible for visitors. Including file path. The Default Absolute Jumi Path is hidden and it is more difficult to gueast from visible code where the code actually is. And if the files for inclusion lies out of your site (www) it is practically impossible to reach them from web browsers. See Вопросы безопасности for more details.
The Default Absolute Jumi Path set here is the global parameter for all Jumi plugin syntax instancies throughout the whole Joomla!.
Parameter: Nested replace
Nesting feature interprets Jumi syntax in included codes. For example:
Lets have two files: main.php and nested.php.
The file main.php contains
PHP
echo "This is the main file<br />";
echo "{jumi [nested.php]}";
?>
and nested.php contains
PHP
echo "This is the nested script";
?>
Having both files main.php and nested.php uploaded into the server we can write into the article
{jumi [main.php]}
The result we see can be either
This is the main file
{jumi [nested.pgp]}
if the switch Nested replace is set to No или
This is the main file
This is the nested script
in case the switch is set to Yes.
It is clear that Nested replace feature brings for the developers quite interesting possibilities.
The nesting feature works in Jumi plugin only.
The nesting feature works for files and codes stored in the Jumi component database table.
Other plugin parameters
If Режим отладки is set to Yes it will show you Jumi error message if present.
If Stop/Clear Jumi Codes is switched to Yes it clears all Jumi plugin syntax text in Joomla! articles and stops code inclusions! There is no Jumi code and no code output from Jumi plugin in Joomla! articles.
Модуль
The Jumi module includes into a module position custom script: manually or from a file or from Jumi component database record.
Basic parameters
There are just few Basic parametrs in the module administration there: "Notepad", "Code written" and "Source of code".
Notepad serves as an area for your notes.
Code written is an area for your code.
Into the field Source of code you can put either a filepathname of the file to be included into a module or *id of the Jumi component Application item.
Advanced parameters
Jumi Default Absolute Path has exactly the same meaning as it has in the plugin. With one slight difference: this parameter is not global for all Jumi modules but it can be unique to each Jumi module instance.
Режим отладки has the same meaning as it has in the plugin: when set to No then Jumi module will not show any Jumi error message. So if you are in troubles, e.g. nothing is shown, switch "Debug mode" to Yes.
Other advanced parameters - Module Class Suffix, Enable Cache - are general Joomla! parameters that can be found in standard Joomla! modules. I suppose their meaning is clear.
Scripts order processing
If you have filled both component filelds "Code written" and "Source of code" then the "Code written" is processed first.

