Changeset 8297


Ignore:
Timestamp:
12/24/10 19:03:30 (9 years ago)
Author:
plg
Message:

feature 2085 added: new method pwg.themes.performAction

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/ws_functions.inc.php

    r8274 r8297  
    25402540} 
    25412541 
     2542function ws_themes_performAction($params, &$service) 
     2543{ 
     2544  global $template; 
     2545   
     2546  if (!is_admin() || is_adviser() ) 
     2547  { 
     2548    return new PwgError(401, 'Access denied'); 
     2549  } 
     2550 
     2551  if (empty($params['pwg_token']) or get_pwg_token() != $params['pwg_token']) 
     2552  { 
     2553    return new PwgError(403, 'Invalid security token'); 
     2554  } 
     2555 
     2556  define('IN_ADMIN', true); 
     2557  include_once(PHPWG_ROOT_PATH.'admin/include/themes.class.php'); 
     2558  $themes = new themes(); 
     2559  $errors = $themes->perform_action($params['action'], $params['theme']); 
     2560   
     2561  if (!empty($errors)) 
     2562  { 
     2563    return new PwgError(500, $errors); 
     2564  } 
     2565  else 
     2566  { 
     2567    if (in_array($params['action'], array('activate', 'deactivate'))) 
     2568    { 
     2569      $template->delete_compiled_templates(); 
     2570    } 
     2571    return true; 
     2572  } 
     2573} 
    25422574?> 
Note: See TracChangeset for help on using the changeset viewer.