diff options
Diffstat (limited to 'site/app/views/developers/edit.thtml')
-rw-r--r-- | site/app/views/developers/edit.thtml | 164 |
1 files changed, 164 insertions, 0 deletions
diff --git a/site/app/views/developers/edit.thtml b/site/app/views/developers/edit.thtml new file mode 100644 index 0000000..4f71333 --- /dev/null +++ b/site/app/views/developers/edit.thtml @@ -0,0 +1,164 @@ +<?php +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/e + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is addons.mozilla.org site. + * + * The Initial Developer of the Original Code is + * Justin Scott <fligtar@gmail.com>. + * Portions created by the Initial Developer are Copyright (C) 2006 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Frederic Wenzel <fwenzel@mozilla.com> + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ +?> +<div id="content"> + <?=$this->renderElement('developers/myaddons', array('addons' => $all_addons));?> + + <div id="content-main"> + +<?php +echo $html->formTag('/developers/edit/'.$addon['Addon']['id'], 'post', array('enctype'=>'multipart/form-data')); +?> +<h3>Edit <?=$addon['Translation']['name']['string']?></h3> +<?=!empty($errors['main']) ? '<div class="error">'.$errors['main'].'</div>' : ''?> +<div id="developersForm"> + <div> + <label for="addLink"><?=_('devcp_edit_header_authors')?></label> + <div id="authors" class="spaced"> + <?php + if (!empty($addon['authors'])) { + foreach ($addon['authors'] as $id => $author) { + echo '<div>'.$author.' ('.$html->link(_('devcp_edit_author_remove'), 'javascript:void(0);', array('onClick' => 'removeAuthor(this);')).')'; + echo $html->hidden('User/User][', array('value' => $id)).'</div>'; + } + } + echo $html->tagErrorMsg('User/User', $errors['User/User']); + ?> + </div> + </div> + <div id="addAuthorRow" class="spaced"> + <?=$html->link(_('devcp_edit_author_add'), 'javascript:void(0);', array('id' => 'addLink', 'onClick' => 'showAuthorForm();'))?> + </div> + <div id="newAuthorRow" style="display: none; clear: both;"> + <form> + <label for="AddonAuthor"><?=_('devcp_edit_author_email')?></label> + <?=$html->input('Addon/Author', array('size' => 40, 'id' => 'newAuthor'))?> + <button type="submit" id="addButton" onClick="addAuthor('<?=$html->url('/developers/authorLookup/')?>');return false;"><?=_('devcp_edit_author_add')?></button> + </form> + </div> + <div> + <label for="TagTag"><?=_('devcp_edit_label_categories')?></label> + <?=(!empty($tags) ? $html->selectTag('Tag/Tag', $tags['names'], $selectedTags, array('multiple' => 'multiple', 'size' => 10, 'style' => 'float: left;', 'onChange' => 'updateTagDescription(this);'), null, false). + $html->tagErrorMsg('Tag/Tag', $errors['Tag/Tag']) : $html->hidden('Tag/noTags', array('value' => 'true'))._('devcp_edit_error_categories_unavailable'))?> + <div id="tagDescription"></div> + </div> + <div id="afterDescription"> + <label for="AddonDefaultlocale"><?=_('devcp_edit_label_defaultlocale')?></label> + <select id="AddonDefaultlocale" name="data[Addon][defaultlocale]"> + <?php + foreach ($localebox['languages'] as $key => $language) { + echo '<option value="'.$key.'" '.($key == $localebox['defaultLocale'] ? 'selected' : '').'>' + .html_entity_decode($language).'</option>'; + } + ?> + </select> + </div> + <div id="iconDiv"> + <label><?=_('devcp_edit_label_info')?></label> + <?php + if (!empty($addon['Addon']['icontype'])) { + echo '<img src="'.$this->controller->Image->getAddonIconURL($addon['Addon']['id']).'">'; + echo $html->link(_('devcp_edit_icon_change_link'), 'javascript:void(0);', array('onClick' => 'addIcon(\'edit\');', 'id' => 'iconLink')); + } + else { + echo $html->link(_('devcp_edit_icon_add_link'), 'javascript:void(0);', array('onClick' => 'addIcon(\'new\');', 'id' => 'iconLink')); + } + ?> + </div> + <div id="newIcon" style="display: none;"> + <label><?=_('devcp_edit_label_icon_new')?></label> + <?=$html->file('Addon/icon').$html->tagErrorMsg('Addon/icon', $errors['Addon/icon'])?> + </div> + <div id="deleteIcon" class="spaced" style="display: none;"> + <?=$html->checkbox('Addon/DeleteIcon', array('class' => 'vmiddle'))?> + <label for="AddonDeleteIcon" class="nofloat"> + <?=_('devcp_edit_label_icon_delete')?></label> + </div> + <?php + if (!empty($errors['Addon/icon'])) { + echo '<div class="error_message">'.$errors['Addon/icon'].'</div>'; + } + ?> + <?php if (in_array($addon['Addon']['addontype_id'], array(ADDON_DICT, ADDON_LPAPP))): ?> + <div> + <label for="AddonTargetLocale"><?=_('devcp_edit_label_target_locale')?></label> + <?=$html->input('Addon/target_locale', array('value'=>$html->unsanitize($addon['Addon']['target_locale'])))?> + <?=_('devcp_edit_target_locale_explanation')?> + </div> + <div> + <label for="AddonLocaleDisambiguation"><?=_('devcp_edit_label_locale_disambiguation')?></label> + <?=$html->input('Addon/locale_disambiguation', array('value'=>$html->unsanitize($addon['Addon']['locale_disambiguation'])))?> + <?=_('devcp_edit_locale_disambiguation_explanation')?> + </div> + <?php endif; ?> + <div> + <?=$html->checkbox('Addon/viewsource', null, $addon['Addon']['viewsource'])?> + <label for="AddonViewsource" class="nofloat"><?=_('devcp_edit_label_allow_viewsource')?></label> + </div> + <div> + <?=$html->checkbox('Addon/prerelease', null, $addon['Addon']['prerelease'])?> + <label for="AddonPrerelease" class="nofloat"><?=_('devcp_edit_label_prerelease')?></label> + </div> + <div> + <?=$html->checkbox('Addon/sitespecific', null, $addon['Addon']['sitespecific'])?> + <label for="AddonSitespecific" class="nofloat"><?=_('devcp_edit_label_sitespecific')?></label> + </div> + <div> + <?=$html->checkbox('Addon/externalsoftware', null, $addon['Addon']['externalsoftware'])?> + <label for="AddonExternalsoftware" class="nofloat"><?=_('devcp_edit_label_externalsoftware')?></label> + </div> + <?php if ($this->controller->SimpleAcl->actionAllowed('*', '*', $this->controller->Session->read('User'))): ?> + <div> + <?=$html->checkbox('Addon/trusted', null, $addon['Addon']['trusted'])?> + <label for="AddonTrusted" class="nofloat">This add-on is trusted [ADMIN]</label> + </div> + <?php endif; ?> + <?=$this->renderElement('developers/localebox')?> + <div class="buttonBox"> + <?=$html->submit(_('devcp_edit_submit_update'), array('name' => 'update'));?> + </div> +</div> <!-- developersForm --> +</form> +</div> <!-- corner-box --> +<script language="JavaScript" type="text/javascript"> +<?php + if (!empty($tags['descriptions'])) { + echo 'var tagDescriptions = {'.html_entity_decode(implode(',', $tags['descriptions'])).'};'; + } +?> +</script> |