WikyBlog
Download

Plugins > API > Link Definitions

A link definition is used to register special pages or admin pages with the application. By defining a link, you can add special pages and admin pages to your plugin. These links will be added to the Control Panel of an installed system if the hide option is not set.

$specialLinks[$linkName] = Definition

Definition Variables

Variable Value Description
$specialLinks[$linkName]['script'] PRI The location of the script to be called when /Admin/Main/<plugin>/<link> is requested.. in relation to the plugin's directory (required)


$specialLinks[$linkName]['header'] Text The header this link will be put under. (optional) Ex: 'User Plugins';


$specialLinks[$linkName]['label'] Text Clickable text of the link, $langA will be checked. (optional) Ex: 'User List'


$specialLinks[$linkName]['img'] File Path The 16x16 img to be shown next to the link. This path is relative to the installation directory of WikyBlog and not relative to the plugin directory. (optional)


$specialLinks[$linkName]['p_img'] PRI If your 16x16 img is in your plugin directory, you may use the p_img variable instead of the img variable. Note: Available as of V1.5.4. (optional)


$specialLinks[$linkName]['userlevel'] Integer Determines which users will see the link in the Control Panel.
-1 = A Banned User (default)
0 = Anonymous User
1 = Logged in User
2 = User that is part of the current workgroup
3 = Full Account Privileges (eg: Owner)
4 = Owner (Strict)
5 = Site Admin
Note
This variable will be available as of V1.5.4
$specialLinks[$linkName]['visible'] Integer Determines if the link should appear in the Control Panel. (optional)
0 = Hidden
1 = Visible (default)
2 = Visible and Unable to Hide by Administrator

The third option should be used sparingly. Available as of V1.6.

$specialLinks[$linkName]['hide'] Boolean (Deprecated) Determines if the link should appear in the Control Panel. (optional)



Example links.php

<?php
$linkName = 'Hello';
$specialLinks[$linkName]['script'] = 'hello.php';
$specialLinks[$linkName]['header'] = 'Hello Special';

This example is explained in the Special Pages portion of Plugin Basics.

Last modified 01:46 Tue, 10 Jun 2008 by Main. Accessed 1,297 times Children What Links Here share Share