The theming system has been greatly simplified to allow easy customization. It is now using bootstrap 3.1. All themes are located in the folder themes. If you open the default theme file you will see many files in that folder. Those are all the theme files you can modify. The folder named components includes some important files that you should not modify unless you know what you are doing.
Using the editor
The script has a powerful theme editor built-in. The theme editor includes a code editor that you can use to easily change things. The code editor (ACE) is set to format only HTML and CSS. It will NOT format PHP. All php codes will be treated as text. You should not touch any PHP code unless you have the knowledge. There are some codes you can edit and these are explained below. You also have the ability to clone a theme by clicking on the clone button. You canot however delete a theme from the script. You will need to do this by deleting the folder manually. This feature was not implemented because the deletion process is very sensitive and differs from server to server.
Theme API
The new theming system offers an easy to use API that you can use to custom some stuff like widgets and features.
Shortener Form
You can invoke the shortener form anywhere by using the following code: $this->shortener($options = array());
. This function will output the shortener form in any of the theme files. You can also customize by adding some options:
$options = array('autohide' => Boolean (TRUE or FALSE), 'advanced' => Boolean (TRUE or FALSE), 'multiple' => Boolean (TRUE or FALSE));
In the code above, autohide will autohide the advanced features, advanced will either show or remove advanced features and multiple will show or remove the multiple URLs option.
Example
$this->shortener(array('autohide' =>TRUE, 'advanced' => TRUE, 'multiple' => TRUE))
Widgets
The theming system include some widgets you can use via the theme editor. To call a widget, use $this->widgets('Widget Name',$options = array())
. The list of widgets available is described below along with the options you can configure.
- Name: activities - Options: Limit (the number items to list), Refresh time in milliseconds
- Name: countries - Options: None
- Name: top_urls - Options: Limit
- Name: tools - Options: None
- Name: social_count - Options: None
- Name: news - Options: None
Example
$this->widgets('activities', array('limit'=>10, 'refresh' => 10000))
Menus
Menus are now built-in to the core however you can still customize them. Two menus are available: menu($options = array()) which controls the header menu and user_menu($options = array()) which controls the sidebar menu of the dashboard. Both menus are added in the file header.php in the theme folder.
Both menu accepts custom links send as an array(). See the example below:
$links = array(array('href' => 'http://google.com', 'text' => 'Google'), array('href' => 'http://apple.com', 'text' => 'Apple'));
$this->user_menu($links);