public static function lesscall() { T3::import('core/less'); $result = array(); try { T3Less::compileAll(); $result['successful'] = JText::_('T3_MSG_COMPILE_SUCCESS'); } catch (Exception $e) { $result['error'] = JText::sprintf('T3_MSG_COMPILE_FAILURE', $e->getMessage()); } echo json_encode($result); }
public static function lesscall() { T3::import('core/less'); $input = JFactory::getApplication()->input; $result = array(); try { T3Less::compileAll($input->get('theme', '')); $result['successful'] = JText::_('T3_MSG_COMPILE_SUCCESS'); } catch (Exception $e) { $result['error'] = JText::sprintf('T3_MSG_COMPILE_FAILURE', $e->__toString()); } echo json_encode($result); }
/** * * Clone Profile */ public static function duplicate($path) { $theme = JFactory::getApplication()->input->getCmd('theme'); $from = JFactory::getApplication()->input->getCmd('from'); $result = array(); if (empty($theme) || empty($from)) { return self::error(JText::_('T3_TM_INVALID_DATA_TO_SAVE')); } $source = $path . '/less/themes/' . $from; if (!JFolder::exists($source)) { return self::error(JText::sprintf('T3_TM_NOT_FOUND', $from)); } $dest = $path . '/less/themes/' . $theme; if (JFolder::exists($dest)) { return self::error(JText::sprintf('T3_TM_EXISTED', $theme)); } $result = array(); if (@JFolder::copy($source, $dest) == true) { $result['success'] = JText::_('T3_TM_CLONE_SUCCESSFULLY'); $result['theme'] = $theme; $result['reset'] = true; $result['type'] = 'duplicate'; } else { return self::error(JText::_('T3_TM_OPERATION_FAILED')); } //LessHelper::compileForTemplate(T3_TEMPLATE_PATH , $theme); T3::import('core/less'); T3Less::compileAll($theme); return self::response($result); }