Namespaces | Functions | Variables

cms/iconmanagement.lib.php File Reference

Go to the source code of this file.

Namespaces

namespace  pragyan
 

Widget Framework for Pragyan CMS (c) 2010 Pragyan Team http://www.gnu.org/licenses/ GNU Public License For more details, see README Add support for File Upload/Download via the widget's configurations Reload Widgets ,Get Widget Instances. see bottom.


Functions

 handleIconManagement ()
 getTreeView ($pageId, $depth, $rootUri, $userId, $curdepth)
 getIconList ()
 getListOfFiles ($dir, $isTopLevel=false)

Variables

 $fakeid = $userId
 This contains file upload functions of CMS. Look into upload.lib.php documentation for more.
 $imageUploadField = getMultipleFileUploadField('iconUpload','iconman',512*1024)
 get the html for upload - input tag
 $uploadForm
 $iconForm = "<table class=\"myIconForm\"><tr><td id=\"iconTreeMenu\">"
 Display Icons.
 $selectionList = getIconList()
 Fetch Icon file list and get as html.
</style > STYLES
 $iconList = "<div class='myIconList'>"
 $id = 0

Function Documentation

getIconList (  ) 

Function getIconList Get the complete list of icons using getListOfFiles - integrate it with HTML and assign drag handlers, and click handlers

Returns:
html of the icon list categorized

Definition at line 251 of file iconmanagement.lib.php.

getListOfFiles ( dir,
isTopLevel = false 
)

Function getListOfFiles "To generate File list given a folder"

Parameters:
dir Name of the directory : Relative path
isTopLevel This is to ensure that the $iconList doesnt get emptied when recursion occurs. Always call the function as getListOfFiles(<Directory>, true)

Definition at line 326 of file iconmanagement.lib.php.

getTreeView ( pageId,
depth,
rootUri,
userId,
curdepth 
)

Function getTreeView

Similar to menu generation code. It recursively fetches pages according to the sitemap, and generates a ul list with drop handlers defined.

Parameters:
pageId The current Page the function is operation on
depth depth of the child list to be fetched at each level. Here it is always -1 to fetch till the last element is reached
rootUri here it is /. Look into Menu documentation for implementation of the same elsewhere.
userId This is just to check the permission.
curdepth Current Depth of the recursion
Returns:
HTML - UL list of the tree structure of pages

Definition at line 217 of file iconmanagement.lib.php.

handleIconManagement (  ) 

Function handleIconManagement Returns the Icon Admin page html and handles AJAX requests for page /+admin$subaction=i

Returns:
HTML of the FORM

If user is setting an icon to a page, then generate an ajax response

Security checks

Save the Icon in Database - The following entries are saved icon URL - path relative to the website installation folder on the server

Handler for icon subaction. TODO: implement icon size variations, icon resize Options,

Security Check

Icon Management Form Generation Code Starts here

Ajax handler functions, drag and drop handlers defined in icon.event.handler.js

Definition at line 24 of file iconmanagement.lib.php.


Variable Documentation

$fakeid = $userId

This contains file upload functions of CMS. Look into upload.lib.php documentation for more.

Just a duplicate copy for sending it to the upload functions.

Definition at line 149 of file iconmanagement.lib.php.

return $iconForm = "<table class=\"myIconForm\"><tr><td id=\"iconTreeMenu\">"

Display Icons.

Gather the html and append the iconform html.

Fetch the site's complete tree structure of pages. The elements here are the ones on which icons are dropped.

Definition at line 164 of file iconmanagement.lib.php.

return $iconList = "<div class='myIconList'>"

Definition at line 284 of file iconmanagement.lib.php.

$id = 0

Definition at line 286 of file iconmanagement.lib.php.

$imageUploadField = getMultipleFileUploadField('iconUpload','iconman',512*1024)

get the html for upload - input tag

Definition at line 152 of file iconmanagement.lib.php.

$selectionList = getIconList()

Fetch Icon file list and get as html.

Definition at line 173 of file iconmanagement.lib.php.

$uploadForm
Initial value:
"submit" />
        </form>
        
FORM

Definition at line 155 of file iconmanagement.lib.php.

</style> STYLES

Definition at line 283 of file iconmanagement.lib.php.