),
// Description
- 'descr' => array(
- 'field' => 'descr',
- 'type' => 'text',
- 'use' => 'a'
- ),
+ //'descr' => array(
+ // 'field' => 'descr',
+ // 'type' => 'text',
+ // 'use' => 'a'
+ //),
// Caption
'caption' => array(
// Sanitize input
$caption = sanitize_text_field( $_REQUEST['file_caption'][$k] );
- $descr = sanitize_text_field( $_REQUEST['file_descr'][$k] );
+ $descr = (isset($_REQUEST['file_descr'])) ? sanitize_text_field( $_REQUEST['file_descr'][$k] ):'';
// Update data for this image
$sql = "UPDATE ".GLM_MEMBERS_PLUGIN_DB_PREFIX ."files SET caption = '$caption', descr = '$descr' WHERE id = $id;";
var uploadStatusTemplate;
var imageDataTemplate;
var galleryImages;
+ var galleryFiles;
var newImageAdded = false;
var enableDraggable = true;
// Check for success
if (fileData.status) {
- // Add image(s) to gallery display
- for (var i = 0 ; i < fileData.files.length ; i++) {
-
- // Using a copy of the supplied template, add image information
- imageData = imageDataTemplate;
- imageData = imageData.replace(/bust-stupid-ngg-image-selection/g, 'img');
- imageData = imageData.replace(/{ id }/g, fileData.files[i].id);
- imageData = imageData.replace(/\{ filename \}/g, fileData.files[i].newFileName);
- galleryImages.prepend(imageData);
-
- // Enable the fields that were just added
- $("#" + fileData.files[i].id + " input, #" + fileData.files[i].id + " textarea").removeAttr('disabled');
-
- // Prepend image ID to position order input field
- $("#galleryPositionOrder").val(fileData.files[i].id + ',' + $("#galleryPositionOrder").val());
-
+ // Check if these are not images (noimage will be true)
+ if ( fileData.noimage ) {
+ // Add files(s) to files display
+ for ( var i = 0; i < fileData.files.length; i++ ) {
+ // Using a copy of the supplied template, add file information
+ fData = fileDataTemplate;
+ fData = fData.replace(/{ id }/g, fileData.files[i].id);
+ fData = fData.replace(/\{ filename \}/g, fileData.files[i].newFileName);
+ fData = fData.replace(/\{ file_name \}/g, fileData.files[i].name);
+ galleryFiles.prepend(fData);
+
+ // Enable the fields that were just added
+ $("#" + fileData.files[i].id + " input, #" + fileData.files[i].id + " textarea").removeAttr('disabled');
+
+ // Prepend file ID to position order input field
+ $("#filePositionOrder").val(fileData.files[i].id + ',' + $("#filePositionOrder").val());
+ }
+ } else {
+ // Add image(s) to gallery display
+ for (var i = 0 ; i < fileData.files.length ; i++) {
+
+ // Using a copy of the supplied template, add image information
+ imageData = imageDataTemplate;
+ imageData = imageData.replace(/bust-stupid-ngg-image-selection/g, 'img');
+ imageData = imageData.replace(/{ id }/g, fileData.files[i].id);
+ imageData = imageData.replace(/\{ filename \}/g, fileData.files[i].newFileName);
+ galleryImages.prepend(imageData);
+
+ // Enable the fields that were just added
+ $("#" + fileData.files[i].id + " input, #" + fileData.files[i].id + " textarea").removeAttr('disabled');
+
+ // Prepend image ID to position order input field
+ $("#galleryPositionOrder").val(fileData.files[i].id + ',' + $("#galleryPositionOrder").val());
+
+ }
}
} else {
if (isset($file['name']) && is_file($file['tmp_name'])) {
// Store the image
- $file = $this->storeImage($file, $refType, $refTable, $refDest);
+ $file = $this->storeFile($file, $refType, $refTable, $refDest);
$return['files'][] = $file;
// Indicate if we actually stored an image
$return['status'] = ($file != false);
+ $return['noimage'] = true;
} else {
$newFilename = strtolower($fInfo['filename'].'_'.time().'.'.$fInfo['extension']);
}
- $fileUploaded = move_uploaded_file( $_FILES['file']['tm_name'], GLM_MEMBERS_PLUGIN_IMAGES_PATH . '/'. $newFilename );
+ $fileUploaded = move_uploaded_file( $_FILES['file']['tmp_name'], GLM_MEMBERS_PLUGIN_FILES_PATH . '/'. $newFilename );
// If we have a good image
if ( $fileUploaded ) {
(
name,
file_name,
- descr,
caption,
status,
position,
(
'".$file['name']."',
'".$file['newFileName']."',
- '',
'".addslashes($caption)."',
".$this->config['status_numb']['Active'].",
99,
'exportCity' => $this->checkFlag('exportCity'),
'exportState' => $this->checkFlag('exportState'),
'exportZip' => $this->checkFlag('exportZip'),
+ 'exportCounty' => $this->checkFlag('exportCounty'),
+ 'exportRegion' => $this->checkFlag('exportRegion'),
'exportMailingAddr1' => $this->checkFlag('exportMailingAddr1'),
'exportMailingAddr2' => $this->checkFlag('exportMailingAddr2'),
'exportMailingCity' => $this->checkFlag('exportMailingCity'),
{if $select.exportCity}<th align="left">City</th>{/if}
{if $select.exportState}<th align="left">State</th>{/if}
{if $select.exportZip}<th align="left">ZIP</th>{/if}
+ {if $select.exportCounty}<th align="left">County</th>{/if}
+ {if $select.exportRegion}<th align="left">Region</th>{/if}
{if $select.exportMailingAddr1}<th align="left">Mailing Address</th>{/if}
{if $select.exportMailingAddr2}<th align="left">Mailing Addr Line #2</th>{/if}
{if $select.exportMailingCity}<th align="left">Mailing City</th>{/if}
{if $select.exportCity}<td>{$m.city}</td>{/if}
{if $select.exportState}<td>{$m.state.value}</td>{/if}
{if $select.exportZip}<td>{$m.zip}</td>{/if}
+ {if $select.exportCounty}<td>{$m.county.value}</td>{/if}
+ {if $select.exportRegion}<td>{$m.region.value}</td>{/if}
{if $select.exportMailingAddr1}<td>{$m.mailing_addr1}</td>{/if}
{if $select.exportMailingAddr2}<td>{$m.mailing_addr2}</td>{/if}
{if $select.exportMailingCity}<td>{$m.mailing_city}</td>{/if}
{if $select.exportCity}"City",{/if}
{if $select.exportState}"State",{/if}
{if $select.exportZip}"ZIP/Postal",{/if}
+{if $select.exportCounty}"County",{/if}
+{if $select.exportRegion}"Region",{/if}
{if $select.exportMailingAddr1}"Mailing Address",{/if}
{if $select.exportMailingAddr2}"Mailing Addr Line #2",{/if}
{if $select.exportMailingCity}"Mailing City",{/if}
{if $select.exportCity}"{$m.city}",{/if}
{if $select.exportState}"{$m.state.value}",{/if}
{if $select.exportZip}"{$m.zip}",{/if}
+{if $select.exportCounty}"{$m.county.value}",{/if}
+{if $select.exportRegion}"{$m.region.value}",{/if}
{if $select.exportMailingAddr1}"{$m.mailing_addr1}",{/if}
{if $select.exportMailingAddr2}"{$m.mailing_addr2}",{/if}
{if $select.exportMailingCity}"{$m.mailing_city}",{/if}
<div class="glm-fileData">
<table class="glm-statusTable">
<tr>
- <th>Caption:</th>
- <td><input id="file_caption_{ id }" type="text" name="file_caption[{ id }]" value="" class="glm-form-text-input-medium" disabled></td>
+ <th>File Name:</th>
+ <td><input id="file_caption_{ id }" type="text" name="file_caption[{ id }]" value="" class="glm-form-text-input-small" disabled></td>
<td rowspan="2">
<table>
<tr><th>Delete:</th><td><input type="checkbox" name="file_delete[{ id }]" disabled></td></tr>
- <tr><th>featured File:</th><td><input type="radio" name="file_featured" value="{ id }"></td></tr>
<tr><th colspan="2" class="glm-notice" style="font-size: 1.2em;">New Upload</th></tr>
</table>
</td>
</tr>
- <tr>
- <th>Description:</th>
- <td><textarea name="file_descr[{ id }]" disabled></textarea></td>
- </tr>
</table>
</div>
+ <div class="glm-file">
+ <a target="_blank" href="{$glmPluginMediaUrl}/files/{ filename }">{ file_name }</a>
+ </div>
</li>
<!-- End of template -->
<div class="glm-fileData">
<table class="glm-statusTable">
<tr>
- <th>Caption:</th>
- <td><input id="file_caption_{$i.id}" type="text" name="file_caption[{$i.id}]" value="{$i.caption}" class="glm-form-text-input-medium"></td>
+ <th>File Name:</th>
+ <td><input id="file_caption_{$i.id}" type="text" name="file_caption[{$i.id}]" value="{$i.caption}" class="glm-form-text-input-small"></td>
<td rowspan="2">
<table>
<tr><th>Delete:</th><td><input type="checkbox" name="file_delete[{$i.id}]"></td></tr>
<input type="hidden" name="file_position[{$i.id}]" value="{$i.position}">
</td>
</tr>
- <tr>
- <th>Description:</th>
- <td><textarea name="file_descr[{$i.id}]">{$i.descr}</textarea></td>
- <th colspan="2">
- </th>
- </tr>
</table>
</div>
<div class="glm-file" data-id="{$i.id}">
--- /dev/null
+
+ <table id="glm-table-address" class="glm-admin-table glm-hidden glm-member-info-table">
+ <tr>
+ <th {if $memberInfo.fieldRequired.addr1}class="glm-required"{/if}>Address Line 1:</th>
+ <td {if $memberInfo.fieldFail.addr1}class="glm-form-bad-input" data-tabid="glm-member-info-address"{/if}>
+ <input type="text" id="addr1" name="addr1" value="{$memberInfo.fieldData.addr1}" class="glm-form-text-input">
+ {if $memberInfo.fieldFail.addr1}<p>{$memberInfo.fieldFail.addr1}</p>{/if}
+ </td>
+ </tr>
+ <tr>
+ <th {if $memberInfo.fieldRequired.addr2}class="glm-required"{/if}>Address Line 2:</th>
+ <td {if $memberInfo.fieldFail.addr2}class="glm-form-bad-input" data-tabid="glm-member-info-address"{/if}>
+ <input id="addr2" type="text" name="addr2" value="{$memberInfo.fieldData.addr2}" class="glm-form-text-input">
+ {if $memberInfo.fieldFail.addr2}<p>{$memberInfo.fieldFail.addr2}</p>{/if}
+ </td>
+ </tr>
+ <tr>
+ <th>City</th>
+ <td class="glm-item-container">
+ <!-- Add new city dialog -->
+ <div id="newCityButton" class="button button-secondary glm-right">Add a new City</div>
+ <div id="newCityDialog" class="glm-dialog-box" title="Enter a New City">
+ <table class="glm-admin-table">
+ <tr>
+ <th class="glm-required">City Name:</th>
+ <td id="newCityNameTD">
+ <input id="newCityName" type="text" name="newCityName" class="glm-form-text-input">
+ <div id="newCityNameRequired"></div>
+ </td>
+ </tr>
+ </table>
+ <p><span class="glm-required">*</span> Required</p>
+ <a id="newCityCancel" class="button button-primary glm-right">Cancel</a>
+ <input id="newCitySubmit" type="submit" value="Add new City">
+ </div>
+ <!-- City Selection -->
+ <input id="cityName" type="hidden" name="newCityName" value=""><!-- this field is only used if adding a new city to pass the new name -->
+ <select name="city" id="city">
+ <option value="0"></option>
+ {foreach from=$memberInfo.fieldData.city.list item=v}
+ <option value="{$v.value}"{if $v.default} selected="selected"{/if}>
+ {$v.name}
+ </option>
+ {/foreach}
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <th {if $memberInfo.fieldRequired.state}class="glm-required"{/if}>State:</th>
+ <td {if $memberInfo.fieldFail.state}class="glm-form-bad-input" data-tabid="glm-member-info-address"{/if}>
+ <select id="state" name="state">
+ {foreach from=$memberInfo.fieldData.state.list item=v}
+ <option value="{$v.value}"{if $memberInfo.fieldData.state.value == $v.value} selected="selected"{/if}>
+ {$v.name}
+ </option>
+ {/foreach}
+ </select>
+ {if $memberInfo.fieldFail.state}<p>{$memberInfo.fieldFail.state}</p>{/if}
+ </td>
+ </tr>
+ <tr>
+ <th {if $memberInfo.fieldRequired.zip}class="glm-required"{/if}>ZIP / Postal Code:</th>
+ <td {if $memberInfo.fieldFail.zip}class="glm-form-bad-input" data-tabid="glm-member-info-address"{/if}>
+ <input id="zip" type="text" name="zip" value="{$memberInfo.fieldData.zip}" class="glm-form-text-input-short">
+ {if $memberInfo.fieldFail.zip}<p>{$memberInfo.fieldFail.zip}</p>{/if}
+ </td>
+ </tr>
+ <tr>
+ <th {if $memberInfo.fieldRequired.county}class="glm-required"{/if}>County:</th>
+ <td {if $memberInfo.fieldFail.county}class="glm-form-bad-input" data-tabid="glm-member-info-address"{/if}>
+ <select name="county">
+ {foreach from=$memberInfo.fieldData.county.list item=v}
+ <option value="{$v.value}"{if $v.default} selected="selected"{/if}>{$v.name}</option>
+ {/foreach}
+ </select>
+ {if $memberInfo.fieldFail.county}<p>{$memberInfo.fieldFail.county}</p>{/if}
+ </td>
+ </tr>
+ <tr>
+ <th {if $memberInfo.fieldRequired.country}class="glm-required"{/if}>Country:</th>
+ <td {if $memberInfo.fieldFail.country}class="glm-form-bad-input" data-tabid="glm-member-info-address"{/if}>
+ <select id="country" name="country">
+ {foreach from=$memberInfo.fieldData.country.list item=v}
+ <option value="{$v.value}"{if $v.default} selected="selected"{/if}>
+ {$v.name} {$v.value}
+ </option>
+ {/foreach}
+ </select>
+ {if $memberInfo.fieldFail.country}<p>{$memberInfo.fieldFail.country}</p>{/if}
+ </td>
+ </tr>
+ <tr>
+ <th {if $memberInfo.fieldRequired.region}class="glm-required"{/if}>Region:</th>
+ <td {if $memberInfo.fieldFail.region}class="glm-form-bad-input" data-tabid="glm-member-info-address"{/if}>
+ <select name="region">
+ {foreach from=$memberInfo.fieldData.region.list item=v}
+ <option value="{$v.value}"{if $v.default} selected="selected"{/if}>{$v.name}</option>
+ {/foreach}
+ </select>
+ {if $memberInfo.fieldFail.region}<p>{$memberInfo.fieldFail.region}</p>{/if}
+ </td>
+ </tr>
+ <tr>
+ {if $memberInfo.fieldRequired.lat}<th class="emRequiredInputField">{else}<th>{/if}Location:</th>
+ <td>
+ <div id="glm-estimate-location" class="button button-secondary">Map Location Using Above Address</div>
+ <p>
+ MAP USE: Drag the pointer to the desired location for this {$terms.term_member}.
+ Use + and - buttons or the mouse wheel to zoom in or out.
+ Click and drag anywhere else on the map to move to another area.
+ </p>
+ <div id="locationMap" class="glm-map-edit">(map loads here)</div>
+ <p>
+ <b>Selected Position:</b>
+ Latitude <input id="glmLat" name="lat" type="text" value="{$memberInfo.fieldData.lat}" class="glm-form-text-input-veryshort">
+ Longitude <input id="glmLng" name="lon" type="text" value="{$memberInfo.fieldData.lon}" class="glm-form-text-input-veryshort">
+ <span id="latLonRecenter" class="button button-secondary">Update pointer with new lat/lon postion.</span>
+ </p>
+ </td>
+ </tr>
+ </table>
<input type="checkbox" name="exportCity" checked> City<br>
<input type="checkbox" name="exportState" checked> State<br>
<input type="checkbox" name="exportZip" checked> ZIP/Postal Code<br>
+ <input type="checkbox" name="exportCounty" checked> County <br>
+ <input type="checkbox" name="exportRegion" checked> Region <br>
</td>
<td>
<input type="checkbox" name="exportPhone" checked> Phone #<br>