PM 2.0 Skin feature. The green now becomes classic and it is possible to have Skins under PATH_DATA /skins each skin folder has a configuration file, layout htmls, css and images
This commit is contained in:
44
workflow/engine/methods/setup/skin_Ajax.php
Normal file
44
workflow/engine/methods/setup/skin_Ajax.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
if (! isset ( $_REQUEST ['action'] )) {
|
||||
$res ['success'] = 'failure';
|
||||
$res ['message'] = 'You may request an action';
|
||||
print G::json_encode ( $res);
|
||||
die ();
|
||||
}
|
||||
if (! function_exists ( $_REQUEST ['action'] )) {
|
||||
$res ['success'] = 'failure';
|
||||
$res ['message'] = 'The requested action doesn\'t exists';
|
||||
print G::json_encode ( $res );
|
||||
die ();
|
||||
}
|
||||
|
||||
$functionName = $_REQUEST ['action'];
|
||||
$functionParams = isset ( $_REQUEST ['params'] ) ? $_REQUEST ['params'] : array ();
|
||||
|
||||
$functionName ( $functionParams );
|
||||
|
||||
function updatePageSize(){
|
||||
G::LoadClass('configuration');
|
||||
$c = new Configurations();
|
||||
$arr['pageSize'] = $_REQUEST['size'];
|
||||
$arr['dateSave'] = date('Y-m-d H:i:s');
|
||||
$config = Array();
|
||||
$config[] = $arr;
|
||||
$c->aConfig = $config;
|
||||
$c->saveConfig('calendarList', 'pageSize','',$_SESSION['USER_LOGGED']);
|
||||
echo '{success: true}';
|
||||
}
|
||||
function skinList(){
|
||||
$skinListArray=array();
|
||||
$customSkins=glob(PATH_CUSTOM_SKINS."*");
|
||||
foreach($customSkins as $skin){
|
||||
if(is_dir($skin)){
|
||||
$res['CALENDAR_UID']=$skin;
|
||||
$res['CALENDAR_NAME']=basename($skin);
|
||||
|
||||
$skinListArray['cals'][]=$res;
|
||||
}
|
||||
}
|
||||
print_r(G::json_encode($skinListArray));
|
||||
}
|
||||
@@ -22,6 +22,33 @@
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
if($RBAC->userCanAccess('PM_SETUP') != 1 && $RBAC->userCanAccess('PM_SETUP_ADVANCE') != 1){
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
//G::header('location: ../login/login');
|
||||
die;
|
||||
}
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'setup';
|
||||
$G_ID_MENU_SELECTED = 'SETUP';
|
||||
$G_ID_SUB_MENU_SELECTED = 'CALENDAR';
|
||||
|
||||
$G_PUBLISH = new Publisher;
|
||||
|
||||
G::LoadClass('configuration');
|
||||
$c = new Configurations();
|
||||
$configPage = $c->getConfiguration('skinList', 'pageSize','',$_SESSION['USER_LOGGED']);
|
||||
$Config['pageSize'] = isset($configPage['pageSize']) ? $configPage['pageSize'] : 20;
|
||||
|
||||
$oHeadPublisher =& headPublisher::getSingleton();
|
||||
$oHeadPublisher->addExtJsScript('setup/skinList', false); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent('setup/skinList'); //adding a html file .html.
|
||||
$oHeadPublisher->assign('CONFIG', $Config);
|
||||
|
||||
G::RenderPage('publish', 'extJs');
|
||||
die;
|
||||
|
||||
global $RBAC;
|
||||
$access = $RBAC->userCanAccess('PM_SETUP');
|
||||
if( $access != 1 ){
|
||||
@@ -41,9 +68,9 @@ if( $access != 1 ){
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die;
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// lets display the items
|
||||
$items[] = array ( 'id' => 'char', 'title' => 'char', 'type' => 'char', 'creator' => 'char' ,
|
||||
'modifiedBy' => 'char', 'filename' => 'char', 'size' => 'char', 'mime' => 'char');
|
||||
@@ -52,6 +79,7 @@ if( $access != 1 ){
|
||||
$aFiles = array ();
|
||||
if ($handle = opendir( PATH_SKINS )) {
|
||||
while ( false !== ($file = readdir($handle))) {
|
||||
G::pr($file);
|
||||
$filename = substr ( $file,0, strrpos($file, '.'));
|
||||
|
||||
// list of no complete skins
|
||||
@@ -88,14 +116,14 @@ if( $access != 1 ){
|
||||
|
||||
$linkPackValue = G::LoadTranslation('ID_EXPORT') ;
|
||||
$link = 'skinsExport?id=' . $key ;
|
||||
$items[] = array (
|
||||
'id' => count($items),
|
||||
'name' => $key,
|
||||
$items[] = array (
|
||||
'id' => count($items),
|
||||
'name' => $key,
|
||||
'filename' => $key,
|
||||
'description' => $description,
|
||||
'version' => $version,
|
||||
'url' => $link,
|
||||
'linkPackValue' => $linkPackValue
|
||||
'linkPackValue' => $linkPackValue
|
||||
);
|
||||
}
|
||||
$folders['items'] = $items;
|
||||
|
||||
Reference in New Issue
Block a user