Пример #1
0
 function action_export_profile($input)
 {
     if (!Perms::get()->admin_trackers) {
         throw new Services_Exception_Denied(tr('Reserved to tracker administrators'));
     }
     $trackerId = $input->trackerId->int();
     $profile = Tiki_Profile::fromString('dummy', '');
     $data = array();
     $profileObject = new Tiki_Profile_Object($data, $profile);
     $profileTrackerInstallHandler = new Tiki_Profile_InstallHandler_Tracker($profileObject, array());
     $export_yaml = $profileTrackerInstallHandler->_export($trackerId, $profileObject);
     include_once 'lib/wiki-plugins/wikiplugin_code.php';
     $export_yaml = wikiplugin_code($export_yaml, array('caption' => 'YAML', 'colors' => 'yaml'));
     $export_yaml = preg_replace('/~[\\/]?np~/', '', $export_yaml);
     return array('trackerId' => $trackerId, 'yaml' => $export_yaml);
 }