/** * Loader * @param $chart_id The chart iD * @return String */ public static function loadChart($chart_id, $l) { self::$l = $l; switch ($chart_id) { case 'cpie_rfsus': return self::loadPieFreeUsedSpaceRatioChart(); break; case 'clines_usse': return self::loadLinesLastSevenDaysUsedSpaceChart(); break; case 'chisto_us': return self::loadHistoMonthlyUsedSpaceChart(); break; } }
" /> <?php print $l->t($sc_sort_title) . ' ' . $l->t('for'); ?> "<?php print OC_Group::inGroup(OCP\User::getUser(), 'admin') ? $l->t('all users') : OCP\User::getDisplayName(); ?> " </h3> <div id="<?php print substr($sc_sort, 1); ?> " style="max-width: 100%; height: 400px; margin: 0 auto"></div> <script type="text/javascript">$(document).ready(function(){<?php print OC_DLStChartsLoader::loadChart($sc_sort, $l); ?> });</script> </div> <?php } } ?> </div> <?php if ($_['c_disp']['clines_usse']) { print '<script type="text/javascript">$(document).ready(function(){getLinesUsseUnitsSelect(' . $_['hu_size'] . ');});</script>'; } if ($_['c_disp']['chisto_us']) { print '<script type="text/javascript">$(document).ready(function(){getHistoUsUnitsSelect(' . $_['hu_size_hus'] . ');});</script>'; }
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE * License as published by the Free Software Foundation; either * version 3 of the License, or any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU AFFERO GENERAL PUBLIC LICENSE for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see <http://www.gnu.org/licenses/>. * */ OCP\JSON::checkLoggedIn(); OCP\JSON::checkAppEnabled('storagecharts2'); $l = new OC_L10N('storagecharts2'); // Update and save the new configuration if (is_numeric($_POST['s']) && in_array($_POST['k'], array('hu_size', 'hu_size_hus', 'hu_ratio'))) { OC_DLStCharts::setUConfValue($_POST['k'], $_POST['s']); switch ($_POST['k']) { case 'hu_size': OCP\JSON::encodedPrint(array('r' => OC_DLStChartsLoader::loadChart('chisto_us', $l))); break; case 'hu_size_hus': OCP\JSON::encodedPrint(array('r' => OC_DLStChartsLoader::loadChart('clines_usse', $l))); break; } } else { // default OCP\JSON::encodedPrint(array('r' => OC_DLStChartsLoader::loadChart('cpie_rfsus', $l))); }
* * @author Xavier Beurois * @copyright 2012 Xavier Beurois www.djazz-lab.net * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE * License as published by the Free Software Foundation; either * version 3 of the License, or any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU AFFERO GENERAL PUBLIC LICENSE for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see <http://www.gnu.org/licenses/>. * */ require_once '../../../lib/base.php'; OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('storage_charts'); $l = new OC_L10N('storage_charts', OC_L10N::findLanguage(array('en', 'fr'))); // Update and save the new configuration if (is_numeric($_POST['s']) && in_array($_POST['k'], array('hu_size', 'hu_size_hus'))) { OC_DLStCharts::setUConfValue($_POST['k'], $_POST['s']); if (strcmp($_POST['k'], 'hu_size') == 0) { OC_JSON::encodedPrint(array('r' => OC_DLStChartsLoader::loadChart('clines_usse', $l))); } else { OC_JSON::encodedPrint(array('r' => OC_DLStChartsLoader::loadChart('chisto_us', $l))); } }
* but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU AFFERO GENERAL PUBLIC LICENSE for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see <http://www.gnu.org/licenses/>. * */ OCP\JSON::checkLoggedIn(); $l = new OC_L10N('storagecharts2'); // build user list $uids = OCP\User::getUsers(); $users = array(); foreach ($uids as $user) { array_push($users, '{"name":"' . $user . '","displayName":"' . OCP\User::getDisplayName($user) . '"}'); } if (array_key_exists('s', $_POST) && array_key_exists('k', $_POST) && is_numeric($_POST['s']) && in_array($_POST['k'], array('hu_size', 'hu_size_hus', 'hu_ratio'))) { // Update and save the new configuration OC_DLStCharts::setUConfValue($_POST['k'], $_POST['s']); switch ($_POST['k']) { case 'hu_size': OCP\JSON::encodedPrint(array('data' => array('chart' => OC_DLStChartsLoader::loadChart('chisto_us', $l), 'users' => $users))); break; case 'hu_size_hus': OCP\JSON::encodedPrint(array('data' => array('chart' => OC_DLStChartsLoader::loadChart('clines_usse', $l), 'users' => $users))); break; } } else { // default OCP\JSON::encodedPrint(array('data' => array('chart' => OC_DLStChartsLoader::loadChart('cpie_rfsus', $l), 'users' => $users))); }