Message-ID: <623616841.10621.1711647992411.JavaMail.confluence@docs1> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_10620_2112974412.1711647992410" ------=_Part_10620_2112974412.1711647992410 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
All configurations for your apps are set up in=20 Install.php file. Below is an example ( ToDoList app): =20Requires: phpFox 4.5+
=20
<?php namespace Apps\TodoList; use Core\App; class Install extends App\App { private $_app_phrases =3D []; protected function setId() { //Set ID for your app. This action is required. $this->id =3D 'TodoList'; } protected function setSupportVersion() { //Start support version $this->start_support_version =3D '4.5.0'; } protected function setAlias() { //Set alias for your app $this->alias =3D 'todo'; } protected function setName() { //Set Name for your app, this name will display in manage apps (adm= incp) $this->name =3D 'TodoList'; } protected function setVersion() { //Set version for your app $this->version =3D '4.1.2'; } protected function setSettings() { //Define settings for your app $this->settings =3D [ 'td_can_user_privacy' =3D> [ 'var_name' =3D> 'td_can_user_privacy', 'info' =3D> 'Allow user add privacy', 'description' =3D> 'Enable this setting in case you want= your user can use privacy during adding new todo list', 'type' =3D> 'boolean', 'value' =3D> '1', ], 'td_feature_price' =3D> [ 'var_name' =3D> 'td_feature_price', 'info' =3D> 'How much does it cost to feature a todo lis= t?', 'type' =3D> 'currency', 'value' =3D> serialize(['USD' =3D> 1, 'EUR' =3D> 1= , 'GBP' =3D> 1]) ] ]; } protected function setUserGroupSettings() { //Define user group settings for your app $this->user_group_settings =3D [ 'td_can_add_new_todo_list' =3D> [ 'var_name' =3D> 'td_can_add_new_todo_list', 'info' =3D> 'Can add new todo list?', 'type' =3D> 'boolean', 'value' =3D> [ "1" =3D> "1", "2" =3D> "1", "3" =3D> "1", "4" =3D> "1", "5" =3D> "0" ], 'ordering' =3D> 1, ], 'can_sponsor_todo' =3D> [ 'info' =3D> 'Can members of this user group mark a todo = list as Sponsor without paying fee?', 'type' =3D> 'boolean', 'value' =3D> [ '1' =3D> '1', '2' =3D> '0', '3' =3D> '0', '4' =3D> '0', '5' =3D> '0' ], 'ordering' =3D> 1, ], 'todo_sponsor_price' =3D> [ 'var_name' =3D> 'td_user_sponsor_price', 'info' =3D> 'How much does it cost to sponsor a todo lis= t', 'type' =3D> 'currency', 'value' =3D> [ '1' =3D> ['USD' =3D> 1], '2' =3D> ['USD' =3D> 2], '3' =3D> ['USD' =3D> 3], '4' =3D> ['USD' =3D> 4], '5' =3D> ['USD' =3D> 5], ], ], 'auto_publish_sponsored_todo' =3D> [ 'info' =3D> 'Auto publish sponsored todo list?', 'description' =3D> 'After the user has purchased a spons= ored space, should the todo list be published right away? If set to No, the= admin will have to approve each new purchased sponsored todo list space be= fore it is shown in the site.', 'type' =3D> 'boolean', 'value' =3D> [ '1' =3D> '1', '2' =3D> '0', '3' =3D> '0', '4' =3D> '0', '5' =3D> '0' ], ], ]; } protected function setComponent() { //Define component for your app $this->component =3D [ "block" =3D> [ "recent_items" =3D> "", ], "controller" =3D> [ "index" =3D> "todo.index", ] ]; } protected function setComponentBlock() { //Define component block for your app $this->component_block =3D [ "Recent Items" =3D> [ "type_id" =3D> "0", "m_connection" =3D> "todo.index", "component" =3D> "recent_items", "location" =3D> "3", "is_active" =3D> "1", "ordering" =3D> "1" ], ]; } protected function setPhrase() { //Add more phrase for your app. However, for mow please define in p= hrase.json $this->phrase =3D $this->_app_phrases; } protected function setOthers() { //Default page of your app in AdminCP $this->admincp_route =3D {your_admincp_route}; //Set action menu to your app in AdminCP $this->admincp_action_menu =3D [ '{your_action_menu_link}' =3D> {your_action_menu_name} ]; //Set default menu when view app detail in AdminCP $this->admincp_menu =3D [ 'Manage To Do' =3D> 'todo', // 'todo' is your app's alias ]; //Add your app menu into main menu in frontend $this->menu =3D [ "name" =3D> "To Do List", // Menu label "url" =3D> "/to-do-list", // Menu Url "icon" =3D> "tasks" // Menu icons, see http://fontaweso= me.io/icons/ ]; //Your company name $this->_publisher =3D 'phpFox'; //Your company website $this->_publisher_url =3D 'http://store.phpfox.com/'; //Include your external paths $this->external_paths =3D [ [ 'path' =3D> 'PF.Base/example_folder' 'removeable =3D> true ], [ 'path' =3D> 'PF.Base/example_file' 'removeable =3D> false ] ]; //Include database class name $this->database =3D [ 'TodoTaskTable' ]; } }=20
These are all properties you can define for your app:
=20ID | =20
Define | =20
Type | =20
Note | =20
Version | =20
In Function | =20
Required? | =20
|
---|---|---|---|---|---|---|---|
1 | =20
id | =20
String | =20
This is your app ID, it must be the same fold= er name stored your app. Space is not allowed. This ID can't change. =20 | 4.5+ | =20
setId | =20
Yes | =20
|
2 | =20
name | =20
String | =20
The name of your app, it will display in mana= ge app in admincp | =20
4.5+ | =20
setName | =20
Yes | =20
|
3 | =20
version | =20
String | =20
Version of your app. It has to follow version= naming convention. | =20
4.5+ | =20
setVersion | =20
Yes | =20
|
4 | =20
alias | =20
String | =20
This value is used for: admincp url, block na= me, component name, ajax name,... This value must be lower case and no spac= e. If your app is simple, this value can be empty. | =20
4.5+ | =20
setAlias | =20
No | =20
|
5 | =20
icon | =20
String | =20
Define Icon of your app. We support 3 ways to= define your app icon: Image link: Put image link of your icon here. Font a= wesome class: Put font awesome class here: it will display icon from font a= wsome. Icon image: Don't set or set empty this value, we will get file "ico= n.png" | =20
4.5+ | =20
setOthers | =20
No | =20
|
6 | =20
admincp_route | =20
String | =20
Default page of your app in admincp | =
=20
4.5+ | =20
setOthers | =20
No | =20
|
7 | =20
admincp_menu | =20
String | =20
Your app menu in admincp | =20
4.5+ | =20
setOthers | =20
No | =20
|
8 | =20
admincp_help | =20
String | =20
You can help admin by providing your instruct= ions external and add your url here. | =20
4.5+ | =20
setOthers | =20
No | =20
|
9 | =20
admincp_action_menu | =20
String | =20
Action button of your app in admincp (The top= right button) | =20
4.5+ | =20
setOthers | =20
No | =20
|
10 | =20
map | =20
String | =20
Support search in feed | =20
4.5+ | =20
setOthers | =20
No | =20
|
11 | =20
map_search | =20
String | =20
Support search in feed | =20
4.5+ | =20
setOthers | =20
No | =20
|
12 | =20
menu | =20
Array | =20
Add a menu for your app on main menu bar <= /td>=20 | 4.5+ | =20
setOthers | =20
No | =20
|
13 | =20
settings | =20
Array | =20
Your app's settings | =20
4.5+ | =20
setSettings | =20
No | =20
|
14 | =20
user_group_settings | =20
Array | =20
Your app's user groups settings | =20
4.5+ | =20
setUserGroupSettings | =20
No | =20
|
15 | =20
database | =20
Array | =20
Define database structure for your app =20 | 4.5+ | =20
setOthers | =20
No | =20
|
16 | =20
component | =20
Array | =20
App's components | =20
4.5+ | =20
setComponent | =20
No | =20
|
17 | =20
component_block | =20
Array | =20
Default blocks | =20
4.5+ | =20
setComponentBlock | =20
No | =20
|
18 | =20
component_block_remove | =20
Array | =20
Old blocks that you want to remove on upgrade= your app | =20
4.5.2+ | =20
component_block_remove | =20
setComponentBlock | =20
No | =20
19 | =20
start_support_version | =20
String | =20
Oldest phpFox version your app can support | =20
4.5+ | =20
setSupportVersion | =20
No | =20
|
20 | =20
end_support_version | =20
String | =20
Newest phpFox version your app can support | =20
4.5+ | =20
setSupportVersion | =20
No | =20
|
21 | =20
phrase | =20
Array | =20
Advanced phrases | =20
4.5+ | =20
setPhrase | =20
No | =20
|
22 | =20
_publisher | =20
String | =20
Your company name | =20
4.5+ | =20
setOthers | =20
No | =20
|
23 | =20
_publisher_url | =20
String | =20
Your company home page | =20
4.5+ | =20
setOthers | =20
No | =20
|
24 | =20
_apps_dir | =20
String | =20
Your app directory name | =20
4.5+ | =20
setOthers | =20
No | =20
|
25 | =20
_admin_cp_menu_ajax | =20
Boolean | =20
Set true: menu in admincp will load by ajax; = false: menu will load by refresh page. Default is true | =20
4.5+ | =20
setOthers | =20
No | =20
|
26 | =20
_writable_dirs | =20
Array | =20
List all directories that your app need writa= ble permission | =20
4.5.3+ | =20
setOthers | =20
No | =20
|
27 | =20
external_paths | =20
Array | =20
List all your external directories/files that= outside your app folder. You also can define which files/directories will = be removed when uninstall your app. | =20
4.5.3+ | =20
setOthers | =20
No | =20
|
28 | =20
store_id | =20
Integer | =20
Support to alert site admin when new version = has been available in the store. | =20
4.5+ | =20
setOthers | =20
No | =20