function jirafeau_admin_bug_report($cfg)
{
$out = "<fieldset><legend>" . t('REPORTING_AN_ISSUE') . "</legend>";
- $out .= "If you have a problem related to Jirafeau, please <a href='https://gitlab.com/pcanterino/Jirafeau/-/issues'>open an issue</a>, explain your problem in english and copy-paste the following content:<br/><br/><code>";
+ $out .= "If you have a problem related to Jirafeau, please <a href='" . JIRAFEAU_WEBSITE . "/-/issues'>open an issue</a>, explain your problem in english and copy-paste the following content:<br/><br/><code>";
$out .= "# Jirafeau<br/>";
$out .= "- version: " . JIRAFEAU_VERSION . "<br/>";
fwrite($handle, $count . NL . time() . NL . $ip);
fclose($handle);
}
+
+function jirafeau_create_upload_finished_box($preview = true) {
+ ?>
+
+ <div id="upload_finished">
+ <p><?php echo t('FILE_UP') ?></p>
+
+ <div id="upload_finished_download_page">
+ <p>
+ <a id="upload_link" href=""><?php echo t('DL_PAGE') ?></a>
+ <a id="upload_link_email" href=""><img id="upload_image_email"/></a>
+ </p><p>
+ <code id=upload_link_text></code>
+ <button id="upload_link_button">📋</button>
+ </p>
+ </div>
+
+ <?php if ($preview == true) {
+ ?>
+ <div id="upload_finished_preview">
+ <p>
+ <a id="preview_link" href=""><?php echo t('VIEW_LINK') ?></a>
+ </p><p>
+ <code id=preview_link_text></code>
+ <button id="preview_link_button">📋</button>
+ </p>
+ </div>
+ <?php
+} ?>
+
+ <div id="upload_direct_download">
+ <p>
+ <a id="direct_link" href=""><?php echo t('DIRECT_DL') ?></a>
+ </p><p>
+ <code id=direct_link_text></code>
+ <button id="direct_link_button">📋</button>
+ </p>
+ </div>
+
+ <div id="upload_delete">
+ <p>
+ <a id="delete_link" href=""><?php echo t('DELETE_LINK') ?></a>
+ </p><p>
+ <code id=delete_link_text></code>
+ <button id="delete_link_button">📋</button>
+ </p>
+ </div>
+
+ <div id="upload_validity">
+ <p><?php echo t('VALID_UNTIL'); ?>:</p>
+ <p id="date"></p>
+ </div>
+</div>
+<?php
+}
+
+function jirafeau_get_expiration_time_options() {
+ return
+ array(
+ array(
+ 'value' => 'minute',
+ 'label' => '1_MIN'
+ ),
+ array(
+ 'value' => 'hour',
+ 'label' => '1_H'
+ ),
+ array(
+ 'value' => 'day',
+ 'label' => '1_D'
+ ),
+ array(
+ 'value' => 'week',
+ 'label' => '1_W'
+ ),
+ array(
+ 'value' => 'fortnight',
+ 'label' => '2_W'
+ ),
+ array(
+ 'value' => 'month',
+ 'label' => '1_M'
+ ),
+ array(
+ 'value' => 'quarter',
+ 'label' => '1_Q'
+ ),
+ array(
+ 'value' => 'year',
+ 'label' => '1_Y'
+ ),
+ array(
+ 'value' => 'none',
+ 'label' => 'NONE'
+ )
+ );
+}
+
+
+
+ /**
+ *
+ * creates the time selection field
+ * @param mixed $cfg
+ * @return void
+ */
+ function jirafeau_create_selection_array($cfg) {
+ echo
+ '<select name="time" id="select_time">';
+
+
+ $expirationTimeOptions = jirafeau_get_expiration_time_options();
+
+ foreach ($expirationTimeOptions as $expirationTimeOption) {
+ $selected = ($expirationTimeOption['value'] === $cfg['availability_default'])? 'selected="selected"' : '';
+ if (true === $cfg['availabilities'][$expirationTimeOption['value']]) {
+ echo '<option value="' . $expirationTimeOption['value'] . '" ' .
+ $selected . '>' . t($expirationTimeOption['label']) . '</option>';
+ }
+ }
+ echo '</select>';
+ }
+
+ function jirafeau_datestr_to_int ($time_str) {
+ $time = time();
+ switch ($time_str) {
+ case 'minute':
+ $time += JIRAFEAU_MINUTE;
+ break;
+ case 'hour':
+ $time += JIRAFEAU_HOUR;
+ break;
+ case 'day':
+ $time += JIRAFEAU_DAY;
+ break;
+ case 'week':
+ $time += JIRAFEAU_WEEK;
+ break;
+ case 'fortnight':
+ $time += JIRAFEAU_FORTNIGHT;
+ break;
+ case 'month':
+ $time += JIRAFEAU_MONTH;
+ break;
+ case 'quarter':
+ $time += JIRAFEAU_QUARTER;
+ break;
+ case 'year':
+ $time += JIRAFEAU_YEAR;
+ break;
+ default:
+ $time = JIRAFEAU_INFINITY;
+ break;
+ }
+ return $time;
+}