Beispiel #1
0
 /**
  * set a config value
  * @param string $name  like in get method
  * @param mixed  $value anything
  */
 public static function set($name, $value)
 {
     set_array_value(static::$list, $name, $value);
 }
Beispiel #2
0
         if ($working_id == -1) {
             echo 'Couldn\'t find the item to save to...';
         }
     }
     $ignore_if_blank = !isset($_GET['title']);
     $arr_to_save = !isset($_GET['title']) ? array() : $items[$working_id];
     set_array_value($arr_to_save, $ignore_if_blank, 'title', $_POST['title']);
     set_array_value($arr_to_save, $ignore_if_blank, 'pubDate', $_POST['pubDate']);
     set_array_value($arr_to_save, $ignore_if_blank, 'description', $_POST['description']);
     set_array_value($arr_to_save, $ignore_if_blank, 'sparkle:releaseNotesLink', $_POST['sparkle:releaseNotesLink']);
     set_array_value($arr_to_save['enclosure']['_params'], $ignore_if_blank, 'url', $_POST['url']);
     set_array_value($arr_to_save['enclosure']['_params'], $ignore_if_blank, 'sparkle:version', $_POST['version']);
     set_array_value($arr_to_save['enclosure']['_params'], $ignore_if_blank, 'sparkle:shortVersionString', $_POST['sparkle:shortVersionString']);
     set_array_value($arr_to_save['enclosure']['_params'], $ignore_if_blank, 'sparkle:dsaSignature', $_POST['sparkle:dsaSignature']);
     set_array_value($arr_to_save['enclosure']['_params'], $ignore_if_blank, 'sparkleDotNET:primaryInstallationFile', $_POST['sparkleDotNET:primaryInstallationFile']);
     set_array_value($arr_to_save['enclosure']['_params'], $ignore_if_blank, 'sparkleDotNET:executableType', $_POST['sparkleDotNET:executableType']);
     if (!isset($_GET['title'])) {
         $items = array_insert($items, 0, $arr_to_save);
     } else {
         $items[$working_id] = $arr_to_save;
     }
     save_items($items, $_GET['id']);
     break;
 }
 $title = urldecode($_GET['title']);
 echo '<h2>Appcasts - ' . ($title ? 'Edit item' : 'Add item') . '</h2>';
 $item = array();
 foreach ($items as $it) {
     if ($it['title'] == urldecode($_GET['title'])) {
         $item = $it;
         break;
Beispiel #3
0
 public static function put($name, $value)
 {
     set_array_value(static::$container, $name, $value);
     static::save();
 }