Beispiel #1
0
<?php

/**
 * Master Submission Edit Form
 */
use Entity\Upload;
use FA\Legacy\Utilities as FAUtils;
$di = \Phalcon\Di::getDefault();
$config = $di['config'];
return array('id' => 'browse_filters', 'method' => 'post', 'elements' => array('category' => array('select', array('label' => 'Category', 'options' => FAUtils::reverseArray($config->fa->categories->toArray()))), 'theme' => array('select', array('label' => 'Theme', 'options' => FAUtils::reverseArray($config->fa->art_types->toArray()))), 'species' => array('select', array('label' => 'Species', 'options' => FAUtils::reverseArray($config->fa->species->toArray()))), 'gender' => array('select', array('label' => 'Gender', 'options' => FAUtils::reverseArray($config->fa->genders->toArray()))), 'rating' => array('multiCheckbox', array('label' => 'Rating', 'default' => Upload::RATING_GENERAL, 'options' => array(Upload::RATING_GENERAL => 'General', Upload::RATING_MATURE => 'Mature', Upload::RATING_ADULT => 'Adult'))), 'page' => array('hidden', array('default' => 1)), 'submit' => array('submit', array('type' => 'submit', 'label' => 'Apply Filters', 'helper' => 'formButton', 'class' => 'btn btn-default'))));
Beispiel #2
0
 public function getSpeciesName()
 {
     $di = \Phalcon\Di::getDefault();
     $config = $di['config'];
     $species_raw = $config->fa->species->toArray();
     $species = \FA\Legacy\Utilities::reverseArray($species_raw);
     if (isset($species[$this->species])) {
         return $species[$this->species];
     } else {
         return NULL;
     }
 }
<?php

/**
 * Master Submission Edit Form
 */
use Entity\Upload;
use FA\Legacy\Utilities as FAUtils;
$di = \Phalcon\Di::getDefault();
$config = $di['config'];
return array('method' => 'post', 'enctype' => 'multipart/form-data', 'groups' => array('files' => array('legend' => 'Select Files to Submit', 'elements' => array('submission' => array('file', array('label' => 'File to Submit', 'maxSize' => '10M', 'description' => 'If you do not want to replace the existing uploaded file, leave this field empty.')), 'rebuild_thumbnail' => array('radio', array('label' => 'Rebuild the thumbnail from this file', 'description' => 'If you select "Yes" to this option (and don\'t upload a custom thumbnail below), a new one will be generated for this submission based on the new file you upload above, replacing any existing thumbnail.', 'options' => array(0 => 'No', 1 => 'Yes'), 'default' => 0, 'required' => true)), 'thumbnail' => array('file', array('label' => 'Custom Thumbnail', 'allowedTypes' => array('image/jpeg', 'image/gif', 'image/png'), 'description' => 'If you would like to use a custom thumbnail image for this submission, upload it here. It will automatically be scaled down to the correct size.')))), 'metadata' => array('legend' => 'Submission Details', 'elements' => array('title' => array('text', array('label' => 'Title', 'maxlength' => 60, 'class' => 'full-width', 'required' => true)), 'description' => array('textarea', array('label' => 'Description', 'maxlength' => 65535, 'class' => 'full-width full-height', 'required' => true)), 'rating' => array('radio', array('label' => 'Rating', 'default' => 0, 'options' => array(Upload::RATING_GENERAL => '<b>General:</b> Suitable for all-ages.', Upload::RATING_MATURE => '<b>Mature:</b> Gore, violence or tasteful/artistic nudity or mature themes.', Upload::RATING_ADULT => '<b>Adult:</b> Explicit or imagery otherwise geared towards adult audiences.'), 'required' => true)), 'category' => array('select', array('label' => 'Category', 'options' => FAUtils::reverseArray($config->fa->categories->toArray()), 'layout' => 'col50')), 'theme' => array('select', array('label' => 'Theme', 'options' => FAUtils::reverseArray($config->fa->art_types->toArray()), 'layout' => 'col50')), 'species' => array('select', array('label' => 'Species', 'options' => FAUtils::reverseArray($config->fa->species->toArray()), 'layout' => 'col50')), 'gender' => array('select', array('label' => 'Gender', 'options' => FAUtils::reverseArray($config->fa->genders->toArray()), 'layout' => 'col50')), 'keywords' => array('textarea', array('label' => 'Keywords', 'description' => 'Separate keywords using spaces (e.g. "fox lion male men friends fishing"). Keywords helps user find your submission in the search engine. Per site policy, keywords must be related directly to the content of your submission. Misleading or abusive keywords are not permitted.', 'class' => 'full-width', 'maxlength' => 65535)))), 'settings' => array('legend' => 'Site Settings', 'elements' => array('lock_comments' => array('radio', array('label' => 'Disable Comments', 'default' => 0, 'options' => array(0 => 'No', 1 => 'Yes'))), 'is_scrap' => array('radio', array('label' => 'Put in "Scraps" Section', 'default' => 0, 'options' => array(0 => 'No', 1 => 'Yes'))))), 'submit_grp' => array('elements' => array('csrf' => array('csrf'), 'submit' => array('submit', array('type' => 'submit', 'label' => 'Submit', 'helper' => 'formButton', 'class' => 'btn btn-default'))))));