Пример #1
0
    print '  </option>';
    print '<option value="false" ';
    if ($value === false || $value == 'false' || $value == 0) {
        print 'selected="selected"';
    }
    print '>';
    print $GLOBALS['I18N']->get('No');
    print '  </option>';
    print '</select>';
} elseif ($configItem['type'] == 'image') {
    print '<br/><p>' . s('Please upload an image file, PNG or JPG.') . '</p>';
    include 'class.image.inc';
    $image = new imageUpload();
    printf('<input type="hidden" name="values[%s]" value="%s" />', $id, $value);
    ## to trigger the saving of the value
    print $image->showInput($id, $value, 0);
} else {
    print s('Don\'t know how to handle type ' . $configItem['type']);
}
if (isset($_GET['ret']) && $_GET['ret'] == 'catlists') {
    print '<input type="hidden" name="ret" value="catlists" />';
}
print '<input type="hidden" name="save" value="item_' . $id . '" />
<button class="submit" type="submit" name="savebutton">' . s('save changes') . '</button>';
## for cancellation, we use a reset button, but that will reset all values in the entire page
## https://mantis.phplist.org/view.php?id=16924
## UX wise, it would be good to close the editing DIV again.
print '<button class="dontsavebutton" id="dontsaveitem_' . $id . '" type="reset">' . s('undo') . '</button>';
## another option is to use a link back to configure, but that will go back to top, which isn't great UX either.
#print '<a href="./?page=configure" class="button">'.s('cancel changes').'</a>';
print '</div>';
Пример #2
0
     include dirname(__FILE__) . "/class.image.inc";
     $image = new imageUpload();
     print "<h3>" . $GLOBALS['I18N']->get('Images') . '</h3><p class="information">' . $GLOBALS['I18N']->get('Below is the list of images used in your template. If an image is currently unavailable, please upload it to the database.') . "</p>";
     print '<p class="information">' . $GLOBALS['I18N']->get('This includes all images, also fully referenced ones, so you may choose not to upload some. If you upload images, they will be included in the campaigns that use this template.') . "</p>";
     print formStart('enctype="multipart/form-data" class="template1" ');
     print '<input type="hidden" name="id" value="' . $id . '" />';
     ksort($images);
     reset($images);
     while (list($key, $val) = each($images)) {
         $key = trim($key);
         if (preg_match('~^https?://~i', $key)) {
             $missingImage = true;
             $imageFound = testUrl($key);
             if ($imageFound != 200) {
                 printf($GLOBALS['I18N']->get('Image name:') . ' <b>%s</b> (' . $GLOBALS['I18N']->get('%d times used') . ')<br/>', $key, $val);
                 print $image->showInput($key, $val, $id);
             }
         } else {
             printf($GLOBALS['I18N']->get('Image name:') . ' <b>%s</b> (' . $GLOBALS['I18N']->get('%d times used') . ')<br/>', $key, $val);
             print $image->showInput($key, $val, $id);
         }
     }
     print '<input type="hidden" name="id" value="' . $id . '" /><input type="hidden" name="action" value="addimages" />
 <input class="submit" type="submit" name="addimages" value="' . $GLOBALS['I18N']->get('Save Images') . '" /></form>';
     if (empty($_POST['sendtest'])) {
         return;
     }
     #    return;
 } else {
     $_SESSION['action_result'] = s('Template was successfully saved');
     #      print '<p class="information">'.$GLOBALS['I18N']->get('Template does not contain local images')."</p>";