AdminSettings.php 157 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483
  1. <?php
  2. /**
  3. *
  4. * PHP Pro Bid $Id$ d90lcIU5wVn0pAMag2dlSA81RrCAAvGLWVBalJTM790=
  5. *
  6. * @link http://www.phpprobid.com
  7. * @copyright Copyright (c) 2017 Online Ventures Software & CodeCube SRL
  8. * @license http://www.phpprobid.com/license Commercial License
  9. *
  10. * @version 7.10 [rev.7.10.03]
  11. */
  12. /**
  13. * admin form elements collection
  14. */
  15. namespace Ppb\Model\Elements;
  16. use Cube\Controller\Front,
  17. Cube\Db\Select,
  18. Cube\Db\Expr,
  19. Cube\Cache\Adapter as CacheAdapter,
  20. Ppb\Service\Table\Currencies as CurrenciesService,
  21. Ppb\Service\Timezones as TimezonesService,
  22. Ppb\Service\Listings as ListingsService,
  23. Ppb\Service\Fees;
  24. class AdminSettings extends AbstractElements
  25. {
  26. /**
  27. *
  28. * form id
  29. *
  30. * @var string
  31. */
  32. protected $_formId;
  33. /**
  34. *
  35. * timezones table service
  36. *
  37. * @var \Ppb\Service\Timezones
  38. */
  39. protected $_timezones;
  40. /**
  41. *
  42. * currencies table service
  43. *
  44. * @var \Ppb\Service\Table\Currencies
  45. */
  46. protected $_currencies;
  47. /**
  48. *
  49. * class constructor
  50. *
  51. * @param string $formId
  52. */
  53. public function __construct($formId = null)
  54. {
  55. parent::__construct();
  56. $this->_formId = $formId;
  57. }
  58. /**
  59. *
  60. * get timezones table service
  61. *
  62. * @return \Ppb\Service\Timezones
  63. */
  64. public function getTimezones()
  65. {
  66. if (!$this->_timezones instanceof TimezonesService) {
  67. $this->setTimezones(
  68. new TimezonesService());
  69. }
  70. return $this->_timezones;
  71. }
  72. /**
  73. *
  74. * set timezones table service
  75. *
  76. * @param \Ppb\Service\Timezones $timezones
  77. *
  78. * @return \Ppb\Model\Elements\AdminSettings
  79. */
  80. public function setTimezones(TimezonesService $timezones)
  81. {
  82. $this->_timezones = $timezones;
  83. return $this;
  84. }
  85. /**
  86. *
  87. * get currencies table service
  88. *
  89. * @return \Ppb\Service\Table\Currencies
  90. */
  91. public function getCurrencies()
  92. {
  93. if (!$this->_currencies instanceof CurrenciesService) {
  94. $this->setCurrencies(
  95. new CurrenciesService());
  96. }
  97. return $this->_currencies;
  98. }
  99. /**
  100. *
  101. * set currencies service
  102. *
  103. * @param \Ppb\Service\Table\Currencies $currencies
  104. *
  105. * @return \Ppb\Model\Elements\AdminSettings
  106. */
  107. public function setCurrencies(CurrenciesService $currencies)
  108. {
  109. $this->_currencies = $currencies;
  110. return $this;
  111. }
  112. /**
  113. *
  114. * get model elements
  115. *
  116. * @return array
  117. */
  118. public function getElements()
  119. {
  120. $settings = $this->getSettings();
  121. $translate = $this->getTranslate();
  122. $basePath = Front::getInstance()->getRequest()->getBasePath();
  123. $totalListings = 0;
  124. if ($this->_formId == 'listings_counters') {
  125. $listingsService = new ListingsService();
  126. $select = $listingsService->select(ListingsService::SELECT_LISTINGS);
  127. $select->reset(Select::COLUMNS);
  128. $select->columns(array('nb_rows' => new Expr('count(*)')));
  129. $stmt = $select->query();
  130. $totalListings = (integer)$stmt->fetchColumn('nb_rows');
  131. }
  132. $maximumFileUploadSize = \Ppb\Utility::getMaximumFileUploadSize('M')
  133. . ' ' . $translate->_('MB');
  134. return array(
  135. /**
  136. * --------------
  137. * SITE SETUP
  138. * --------------
  139. */
  140. array(
  141. 'form_id' => 'site_setup',
  142. 'id' => 'sitename',
  143. 'element' => 'text',
  144. 'label' => $this->_('Site Name'),
  145. 'description' => $this->_('Enter your site\'s name. The name will be used for generating dynamic meta titles, and it will appear in all the emails sent by and through the site.'),
  146. 'attributes' => array(
  147. 'class' => 'form-control input-medium',
  148. ),
  149. 'required' => true,
  150. 'validators' => array(
  151. 'NoHtml'
  152. ),
  153. ),
  154. array(
  155. 'form_id' => 'site_setup',
  156. 'id' => 'site_path',
  157. 'element' => 'text',
  158. 'label' => $this->_('Site URL'),
  159. 'description' => $this->_('Enter your site\'s URL. <br>'
  160. . 'The URL must have the following format: http://www.yoursite.com<br>'
  161. . 'If you have SSL available you can set your URL using https:// rather than http:// (Optional)'),
  162. 'attributes' => array(
  163. 'class' => 'form-control input-medium',
  164. ),
  165. 'required' => true,
  166. 'validators' => array(
  167. 'Url',
  168. ),
  169. ),
  170. array(
  171. 'form_id' => 'site_setup',
  172. 'id' => 'site_logo_path',
  173. 'element' => '\\Ppb\\Form\\Element\\MultiUpload',
  174. 'label' => $this->_('Site Logo'),
  175. 'description' => $this->_('Upload a logo for your website.'),
  176. 'required' => true,
  177. 'customData' => array(
  178. 'buttonText' => 'Select Logo',
  179. 'acceptFileTypes' => '/(\.|\/)(gif|jpe?g|png)$/i',
  180. 'formData' => array(
  181. 'fileSizeLimit' => 10000000, // approx 10MB
  182. 'uploadLimit' => 1,
  183. ),
  184. ),
  185. ),
  186. array(
  187. 'form_id' => 'site_setup',
  188. 'id' => 'default_theme',
  189. 'element' => 'select',
  190. 'label' => $this->_('Site Theme'),
  191. 'multiOptions' => \Ppb\Utility::getThemes(),
  192. 'description' => $this->_('Select a theme for your website.'),
  193. 'attributes' => array(
  194. 'class' => 'form-control input-medium',
  195. ),
  196. 'required' => true,
  197. ),
  198. array(
  199. 'form_id' => 'site_setup',
  200. 'id' => 'site_lang',
  201. 'element' => 'select',
  202. 'label' => $this->_('Site Language'),
  203. 'multiOptions' => \Ppb\Utility::getLanguages(),
  204. 'description' => $this->_('Select a default language for your website.'),
  205. 'attributes' => array(
  206. 'class' => 'form-control input-medium',
  207. ),
  208. 'required' => true,
  209. ),
  210. array(
  211. 'form_id' => 'site_setup',
  212. 'id' => 'admin_security_key',
  213. 'element' => 'text',
  214. 'label' => $this->_('Admin Area Security Key'),
  215. 'description' => $this->_('(Optional) You can add a security key that will be required to be added to the admin path in order to be able to access it. <br>'
  216. . 'Current Admin Path:')
  217. . '<div class="text-info"><strong>'
  218. . $this->getView()->url(array('skey' => $this->getData('admin_security_key')), 'admin-index-index') . '</strong></div>',
  219. 'attributes' => array(
  220. 'class' => 'form-control input-medium alert-box',
  221. 'data-message' => $translate->_('Warning! If adding a security key, please save the admin path in a safe place because you will '
  222. . 'not be able to access the admin area without adding the security key to the url.'),
  223. ),
  224. ),
  225. array(
  226. 'form_id' => 'site_setup',
  227. 'id' => 'admin_email',
  228. 'element' => 'text',
  229. 'label' => $this->_('Admin Email Address'),
  230. 'description' => $this->_('Enter your admin email address. This address will be used in the "From" field by all system emails.'),
  231. 'attributes' => array(
  232. 'class' => 'form-control input-medium',
  233. ),
  234. 'required' => true,
  235. 'validators' => array(
  236. 'Email'
  237. ),
  238. ),
  239. array(
  240. 'form_id' => 'site_setup',
  241. 'id' => 'email_admin_title',
  242. 'element' => 'text',
  243. 'label' => $this->_('Admin Email From Name'),
  244. 'description' => $this->_('Enter the from name which will appear on all emails sent by the site on behalf of the administrator.'),
  245. 'attributes' => array(
  246. 'class' => 'form-control input-medium',
  247. ),
  248. 'required' => true,
  249. 'validators' => array(
  250. 'NoHtml'
  251. ),
  252. ),
  253. array(
  254. 'form_id' => 'site_setup',
  255. 'id' => 'mailer',
  256. 'element' => 'select',
  257. 'label' => $this->_('Choose Mailer'),
  258. 'multiOptions' => array(
  259. 'mail' => 'PHP mail()',
  260. 'sendmail' => 'Sendmail',
  261. 'smtp' => 'SMTP',
  262. ),
  263. 'description' => $this->_('Available methods: php mail() function, unix sendmail app, SMTP protocol.<br>'
  264. . 'SMTP recommended (if available on your server)'),
  265. 'required' => true,
  266. 'attributes' => array(
  267. 'id' => 'mailer',
  268. 'class' => 'form-control input-medium',
  269. 'onchange' => 'javascript:checkMailFields()',
  270. ),
  271. 'bodyCode' => "
  272. <script type=\"text/javascript\">
  273. function checkMailFields() {
  274. var mailerSendmail = $('.mailer-sendmail');
  275. var mailerSmtp = $('.mailer-smtp');
  276. switch ($('#mailer').val()) {
  277. case 'sendmail':
  278. mailerSendmail.closest('.form-group').show();
  279. mailerSmtp.closest('.form-group').hide();
  280. break;
  281. case 'smtp':
  282. mailerSendmail.closest('.form-group').hide();
  283. mailerSmtp.closest('.form-group').show();
  284. break;
  285. default:
  286. mailerSendmail.closest('.form-group').hide();
  287. mailerSmtp.closest('.form-group').hide();
  288. break;
  289. }
  290. }
  291. $(document).ready(function() {
  292. checkMailFields();
  293. });
  294. </script>",
  295. ),
  296. /* site setup => sendmail path */
  297. array(
  298. 'form_id' => 'site_setup',
  299. 'id' => 'sendmail_path',
  300. 'element' => 'text',
  301. 'label' => $this->_('Sendmail Path'),
  302. 'description' => $this->_('Enter the unix path for the sendmail app (available in phpinfo())'),
  303. 'required' => array('mailer', 'sendmail', true),
  304. 'attributes' => array(
  305. 'class' => 'mailer-sendmail form-control input-medium',
  306. ),
  307. ),
  308. /* site setup => smtp related fields */
  309. array(
  310. 'form_id' => 'site_setup',
  311. 'id' => 'smtp_host',
  312. 'element' => 'text',
  313. 'label' => $this->_('SMTP Host'),
  314. 'attributes' => array(
  315. 'class' => 'mailer-smtp form-control input-medium',
  316. ),
  317. ),
  318. array(
  319. 'form_id' => 'site_setup',
  320. 'id' => 'smtp_port',
  321. 'element' => 'text',
  322. 'label' => $this->_('SMTP Port'),
  323. 'attributes' => array(
  324. 'class' => 'mailer-smtp form-control input-medium',
  325. ),
  326. ),
  327. array(
  328. 'form_id' => 'site_setup',
  329. 'id' => 'smtp_username',
  330. 'element' => 'text',
  331. 'label' => $this->_('SMTP Username'),
  332. 'attributes' => array(
  333. 'class' => 'mailer-smtp form-control input-medium',
  334. ),
  335. ),
  336. array(
  337. 'form_id' => 'site_setup',
  338. 'id' => 'smtp_password',
  339. 'element' => 'text',
  340. 'label' => $this->_('SMTP Password'),
  341. 'description' => $this->_('Enter your SMTP login details in case you choose to use SMTP as the system emails handler.<br>'
  342. . '<b>Important</b>: you only need enter a username and a password if you SMTP server requires authentication.'
  343. . 'If the server doesn\'t require authentication, please leave these fields empty because otherwise the SMTP server can return an error and no emails will be sent.<br>'
  344. . 'If you are unsure of your SMTP server\'s host name and port, please leave the Host and Port fields empty and the software will try to retrieve them for you.'),
  345. 'attributes' => array(
  346. 'class' => 'mailer-smtp form-control input-medium',
  347. ),
  348. ),
  349. array(
  350. 'form_id' => 'site_setup',
  351. 'id' => 'maintenance_mode',
  352. 'element' => 'checkbox',
  353. 'label' => $this->_('Maintenance Mode'),
  354. 'multiOptions' => array(
  355. 1 => null,
  356. ),
  357. 'description' => $this->_('Check the above checkbox to enable maintenance mode. With maintenance mode enabled, '
  358. . 'only logged in administrators will be able to access the front end of the site.'),
  359. ),
  360. array(
  361. 'form_id' => 'site_setup',
  362. 'id' => 'disable_installer',
  363. 'element' => 'checkbox',
  364. 'label' => $this->_('Disable Installer'),
  365. 'multiOptions' => array(
  366. 1 => null,
  367. ),
  368. 'description' => $this->_('Check the above checkbox to disable the install module. The installer module should only be enabled when '
  369. . 'you need to upgrade the software.'),
  370. ),
  371. /**
  372. * --------------
  373. * USER SETTINGS
  374. * --------------
  375. */
  376. /**
  377. * ++++++++++++++
  378. * REGISTRATION & VERIFICATION
  379. * ++++++++++++++
  380. */
  381. array(
  382. 'form_id' => 'registration_verification',
  383. 'subtitle' => $this->_('User Registration'),
  384. 'id' => 'registration_type',
  385. 'element' => 'radio',
  386. 'label' => $this->_('Select Registration Type'),
  387. 'multiOptions' => array(
  388. 'quick' => array(
  389. $translate->_('Quick'),
  390. $translate->_('Only the username, email address and password fields will appear on the registration page.'),
  391. ),
  392. 'full' => array(
  393. $translate->_('Full'),
  394. $translate->_('This form will include all registration fields, address, date of birth, phone number and any available custom fields.'),
  395. ),
  396. ),
  397. 'attributes' => array(
  398. 'class' => 'field-changeable',
  399. ),
  400. 'bodyCode' => "
  401. <script type=\"text/javascript\">
  402. function checkFormFields()
  403. {
  404. if ($('input:radio[name=\"registration_type\"]:checked').val() === 'full') {
  405. $('.full-registration-field').closest('.form-group').show();
  406. }
  407. else {
  408. $('input[name=\"min_reg_age\"]').val('');
  409. $('.full-registration-field').closest('.form-group').hide();
  410. }
  411. }
  412. $(document).ready(function() {
  413. checkFormFields();
  414. });
  415. $(document).on('change', '.field-changeable', function() {
  416. checkFormFields();
  417. });
  418. </script>"
  419. ),
  420. array(
  421. 'form_id' => 'registration_verification',
  422. 'id' => 'min_reg_age',
  423. 'element' => 'text',
  424. 'label' => $this->_('Minimum Registration Age'),
  425. 'suffix' => $this->_('years'),
  426. 'description' => $this->_('Enter the minimum age required for users to be able to register to your site, or leave empty to disable this functionality.'),
  427. 'attributes' => array(
  428. 'class' => 'form-control input-mini full-registration-field',
  429. ),
  430. 'validators' => array(
  431. 'Digits',
  432. ),
  433. ),
  434. array(
  435. 'form_id' => 'registration_verification',
  436. 'id' => 'payment_methods_registration',
  437. 'element' => 'checkbox',
  438. 'label' => $this->_('Direct Payment Gateways Fields'),
  439. 'multiOptions' => array(
  440. 1 => null,
  441. ),
  442. 'description' => $this->_('Check the above checkbox if you wish to display the setup fields for your enabled direct payment gateways on the registration page.'),
  443. ),
  444. /**
  445. * ++++++++++++++
  446. * USER VERIFICATION - UNIFIED SELLER/BUYER VERIFICATION
  447. * ++++++++++++++
  448. */
  449. array(
  450. 'form_id' => 'registration_verification',
  451. 'subtitle' => $this->_('User Verification'),
  452. 'id' => 'user_verification',
  453. 'element' => 'checkbox',
  454. 'label' => $this->_('Enable User Verification'),
  455. 'multiOptions' => array(
  456. 1 => null,
  457. ),
  458. 'description' => $this->_('Check the above checkbox to enable the user verification feature.<br>'
  459. . '<b>Note</b>: Even if you disable user verification, you will still be able to set the status of your '
  460. . 'users to verified from the Users Management page. Users will however not be able to verify their '
  461. . 'accounts themselves.'),
  462. 'attributes' => array(
  463. 'class' => 'field-changeable',
  464. ),
  465. 'bodyCode' => "
  466. <script type=\"text/javascript\">
  467. function checkVerificationFields()
  468. {
  469. if ($('input:checkbox[name=\"user_verification\"]').is(':checked')) {
  470. $('[name=\"seller_verification_mandatory\"]').closest('.form-group').show();
  471. $('[name=\"buyer_verification_mandatory\"]').closest('.form-group').show();
  472. $('[name=\"user_verification_refund\"]').closest('.form-group').show();
  473. $('input:text[name=\"user_verification_fee\"]').closest('.form-group').show();
  474. $('input:text[name=\"user_verification_recurring\"]').closest('.form-group').show();
  475. }
  476. else {
  477. $('[name=\"seller_verification_mandatory\"]').prop('checked', false).closest('.form-group').hide();
  478. $('[name=\"buyer_verification_mandatory\"]').prop('checked', false).closest('.form-group').hide();
  479. $('[name=\"user_verification_refund\"]').prop('checked', false).closest('.form-group').hide();
  480. $('input:text[name=\"user_verification_fee\"]').val('').closest('.form-group').hide();
  481. $('input:text[name=\"user_verification_recurring\"]').val('').closest('.form-group').hide();
  482. }
  483. }
  484. $(document).ready(function() {
  485. checkVerificationFields();
  486. });
  487. $(document).on('change', '.field-changeable', function() {
  488. checkVerificationFields();
  489. });
  490. </script>"
  491. ),
  492. array(
  493. 'form_id' => 'registration_verification',
  494. 'id' => 'seller_verification_mandatory',
  495. 'element' => 'checkbox',
  496. 'label' => $this->_('Mandatory For Selling'),
  497. 'multiOptions' => array(
  498. 1 => null,
  499. ),
  500. 'description' => $this->_('If mandatory seller verification is enabled, users will need to get verified in order to be able to list items on your website.'),
  501. ),
  502. array(
  503. 'form_id' => 'registration_verification',
  504. 'id' => 'buyer_verification_mandatory',
  505. 'element' => 'checkbox',
  506. 'label' => $this->_('Mandatory for Buying'),
  507. 'multiOptions' => array(
  508. 1 => null,
  509. ),
  510. 'description' => $this->_('If mandatory buyer verification is enabled, users will need to get verified in order to be able to bid on/purchase items on your website.'),
  511. ),
  512. array(
  513. 'form_id' => 'registration_verification',
  514. 'table' => 'fees',
  515. 'id' => 'user_verification_fee',
  516. 'element' => '\\Ppb\\Form\\Element\\LocalizedNumeric',
  517. 'label' => $this->_('Verification Fee'),
  518. 'prefix' => $settings['currency'],
  519. 'attributes' => array(
  520. 'class' => 'form-control input-mini',
  521. ),
  522. 'required' => ($this->getData('user_verification')) ? true : false,
  523. 'validators' => array(
  524. 'Numeric',
  525. array('GreaterThan', array(0, true)),
  526. ),
  527. 'filters' => array(
  528. '\\Ppb\\Filter\\LocalizedNumeric',
  529. ),
  530. ),
  531. array(
  532. 'form_id' => 'registration_verification',
  533. 'id' => 'user_verification_recurring',
  534. 'element' => 'text',
  535. 'prefix' => $this->_('recurring every'),
  536. 'suffix' => $this->_('days'),
  537. 'description' => $this->_('You can set up a one time or recurring verification fee. If you wish the verification fee to be a one time fee enter 0 in the recurring field.'),
  538. 'attributes' => array(
  539. 'class' => 'form-control input-mini',
  540. ),
  541. 'validators' => array(
  542. 'Digits',
  543. ),
  544. ),
  545. array(
  546. 'form_id' => 'registration_verification',
  547. 'id' => 'user_verification_refund',
  548. 'element' => 'checkbox',
  549. 'label' => $this->_('Refund Verification Fee'),
  550. 'multiOptions' => array(
  551. 1 => null,
  552. ),
  553. 'description' => $this->_('If the checkbox above is checked, the verification fee will be credited to the user\'s account after payment.<br>'
  554. . 'The user\'s account will need to run in account mode for this feature to apply.'),
  555. ),
  556. /**
  557. * ++++++++++++++
  558. * REGISTRATION TERMS & CONDITIONS LINK
  559. * ++++++++++++++
  560. */
  561. array(
  562. 'form_id' => 'registration_verification',
  563. 'subtitle' => $this->_('Terms and Conditions / Privacy Policy Link'),
  564. 'id' => 'enable_registration_terms',
  565. 'element' => 'checkbox',
  566. 'label' => $this->_('Show Registration Terms & Conditions Link'),
  567. 'multiOptions' => array(
  568. 1 => null,
  569. ),
  570. 'description' => $this->_('Check the above checkbox to require users to agree to the site\'s terms and/or privacy when registering.'),
  571. ),
  572. array(
  573. 'form_id' => 'registration_verification',
  574. 'id' => 'registration_terms_link',
  575. 'element' => 'text',
  576. 'label' => $this->_('Terms and Conditions Link'),
  577. 'description' => $this->_('Enter the url of the terms and conditions page (relative url).'),
  578. 'attributes' => array(
  579. 'class' => 'form-control input-large',
  580. ),
  581. 'required' => $this->getData('enable_registration_terms') ? true : false,
  582. 'validators' => array(
  583. 'NoHtml',
  584. ),
  585. ),
  586. array(
  587. 'form_id' => 'registration_verification',
  588. 'id' => 'registration_privacy_link',
  589. 'element' => 'text',
  590. 'label' => $this->_('Privacy Policy Link'),
  591. 'description' => $this->_('Enter the url of the privacy policy page (relative url).'),
  592. 'attributes' => array(
  593. 'class' => 'form-control input-large',
  594. ),
  595. 'required' => $this->getData('enable_registration_terms') ? true : false,
  596. 'validators' => array(
  597. 'NoHtml',
  598. ),
  599. ),
  600. /**
  601. * ++++++++++++++
  602. * USER ACCOUNT SETTINGS
  603. * ++++++++++++++
  604. */
  605. array(
  606. 'form_id' => 'account_settings',
  607. 'id' => 'payment_mode',
  608. 'element' => 'radio',
  609. 'label' => $this->_('Choose Payment Option'),
  610. 'multiOptions' => array(
  611. 'live' => array(
  612. $translate->_('Live (Pay as You Go)'),
  613. $translate->_('Choose this option if you want your users to pay for site fees immediately.'),
  614. ),
  615. 'account' => array(
  616. $translate->_('Account Mode'),
  617. $translate->_('Choose this option in order for your site\'s users to pay for site fees periodically. '
  618. . 'All fees they owe will be added in their account balance.'),
  619. ),
  620. ),
  621. 'attributes' => array(
  622. 'class' => 'field-changeable',
  623. ),
  624. 'bodyCode' => "
  625. <script type=\"text/javascript\">
  626. function checkAccountSettingsFormFields()
  627. {
  628. if ($('input:radio[name=\"payment_mode\"]:checked').val() === 'live' &&
  629. $('input:radio[name=\"user_account_type\"]:checked').val() === 'global') {
  630. $('.account-mode-field').closest('.form-group').hide();
  631. }
  632. else {
  633. $('input[name=\"min_reg_age\"]').val('');
  634. $('.account-mode-field').closest('.form-group').show();
  635. }
  636. }
  637. $(document).ready(function() {
  638. checkAccountSettingsFormFields();
  639. });
  640. $(document).on('change', '.field-changeable', function() {
  641. checkAccountSettingsFormFields();
  642. });
  643. </script>"
  644. ),
  645. array(
  646. 'form_id' => 'account_settings',
  647. 'id' => 'user_account_type',
  648. 'element' => 'radio',
  649. 'label' => $this->_('User Account Type'),
  650. 'multiOptions' => array(
  651. 'global' => array(
  652. $translate->_('Global'),
  653. $translate->_('Choose this option if you want all accounts to run using the default payment option.'),
  654. ),
  655. 'personal' => array(
  656. $translate->_('Personal'),
  657. $translate->_('Choose this option if you want to be able to choose the payment option for each user account, from the users management page.'),
  658. ),
  659. ),
  660. 'attributes' => array(
  661. 'class' => 'field-changeable',
  662. ),
  663. ),
  664. array(
  665. 'form_id' => 'account_settings',
  666. 'subtitle' => $this->_('Account Mode Settings'),
  667. 'id' => 'signup_credit',
  668. 'element' => '\\Ppb\\Form\\Element\\LocalizedNumeric',
  669. 'label' => $this->_('Signup Credit'),
  670. 'prefix' => $settings['currency'],
  671. 'attributes' => array(
  672. 'class' => 'form-control input-mini account-mode-field',
  673. ),
  674. 'validators' => array(
  675. 'Numeric',
  676. ),
  677. 'filters' => array(
  678. '\\Ppb\\Filter\\LocalizedNumeric',
  679. ),
  680. ),
  681. array(
  682. 'form_id' => 'account_settings',
  683. 'id' => 'maximum_debit',
  684. 'element' => '\\Ppb\\Form\\Element\\LocalizedNumeric',
  685. 'label' => $this->_('Maximum Debit'),
  686. 'prefix' => $settings['currency'],
  687. 'description' => $this->_('Enter the maximum debit an account is allowed to have before being suspended.'),
  688. 'attributes' => array(
  689. 'class' => 'form-control input-mini account-mode-field',
  690. ),
  691. 'validators' => array(
  692. 'Numeric',
  693. ),
  694. 'filters' => array(
  695. '\\Ppb\\Filter\\LocalizedNumeric',
  696. ),
  697. ),
  698. array(
  699. 'form_id' => 'account_settings',
  700. 'id' => 'min_invoice_value',
  701. 'element' => '\\Ppb\\Form\\Element\\LocalizedNumeric',
  702. 'label' => $this->_('Minimum Credit Amount'),
  703. 'prefix' => $settings['currency'],
  704. 'attributes' => array(
  705. 'class' => 'form-control input-mini account-mode-field',
  706. ),
  707. 'description' => $this->_('Enter the minimum payment amount that a user can credit his account balance with.'),
  708. 'validators' => array(
  709. 'Numeric',
  710. ),
  711. 'filters' => array(
  712. '\\Ppb\\Filter\\LocalizedNumeric',
  713. ),
  714. ),
  715. array(
  716. 'form_id' => 'account_settings',
  717. 'id' => 'payment_reminder_email',
  718. 'element' => 'checkbox',
  719. 'label' => $this->_('Payment Notification Emails'),
  720. 'multiOptions' => array(
  721. 1 => null,
  722. ),
  723. 'attributes' => array(
  724. 'class' => 'account-mode-field',
  725. ),
  726. 'description' => $this->_('Check the above checkbox if you wish to send automatic notification emails to accounts that have exceeded their debit limit.'),
  727. ),
  728. array(
  729. 'form_id' => 'account_settings',
  730. 'id' => 'suspend_over_limit_accounts',
  731. 'element' => 'checkbox',
  732. 'label' => $this->_('Suspend Accounts over Limit'),
  733. 'multiOptions' => array(
  734. 1 => null,
  735. ),
  736. 'attributes' => array(
  737. 'class' => 'account-mode-field',
  738. ),
  739. 'description' => $this->_('Check the above checkbox if you wish to suspend accounts that have the balance over the maximum debit limit.'),
  740. ),
  741. array(
  742. 'form_id' => 'account_settings',
  743. 'id' => 'suspension_days',
  744. 'element' => 'text',
  745. 'label' => $this->_('Cron Invoice Suspension'),
  746. 'suffix' => $this->_('days'),
  747. 'attributes' => array(
  748. 'class' => 'form-control input-mini account-mode-field',
  749. ),
  750. 'description' => $this->_('(Optional) enter the number of days after which an account that has been sent an automatic payment notification email will be suspended. '
  751. . 'This setting will only apply if you have selected not to suspend accounts that have exceeded their debit limit.'),
  752. 'validators' => array(
  753. 'Digits',
  754. ),
  755. ),
  756. array(
  757. 'form_id' => 'account_settings',
  758. 'id' => 'rebill_expired_subscriptions',
  759. 'element' => 'checkbox',
  760. 'label' => $this->_('Re-bill Expired Subscriptions'),
  761. 'multiOptions' => array(
  762. 1 => null,
  763. ),
  764. 'attributes' => array(
  765. 'class' => 'account-mode-field',
  766. ),
  767. 'description' => $this->_('Check the above checkbox if you wish to bill expired subscriptions automatically from the users\' balances (works only when in account mode).'),
  768. ),
  769. /**
  770. * ++++++++++++++
  771. * USER SIGNUP CONFIRMATION
  772. * ++++++++++++++
  773. */
  774. array(
  775. 'form_id' => 'signup_settings',
  776. 'id' => 'signup_settings',
  777. 'element' => 'radio',
  778. 'label' => $this->_('User Signup Confirmation'),
  779. 'multiOptions' => array(
  780. 0 => array(
  781. $translate->_('No Confirmation Required'),
  782. $translate->_('Check the above box if user accounts should be activated immediately, with no confirmation required.'),
  783. ),
  784. 1 => array(
  785. $translate->_('Email Address Verification'),
  786. $translate->_('Check the above box if you wish to enable email address confirmation. In this case, users will '
  787. . 'need to click the link from the registration confirmation email they receive when registering in order to activate their account.'),
  788. ),
  789. 2 => array(
  790. $translate->_('Admin Approval'),
  791. $translate->_('Check the above box if you wish for the admin to manually activate each user from the users management page.<br>'
  792. . 'Users will also need to confirm their email address like on the "email address confirmation" option.'),
  793. ),
  794. ),
  795. 'description' => $this->_('Select the signup confirmation settings which should apply on your website.'),
  796. ),
  797. // /**
  798. // * ++++++++++++++
  799. // * ABOUT ME/PROFILE PAGE
  800. // * ++++++++++++++
  801. // */
  802. // array(
  803. // 'form_id' => 'profile_page',
  804. // 'id' => 'profile_page',
  805. // 'element' => 'checkbox',
  806. // 'label' => $this->_('Enable About Me/Profile Page'),
  807. // 'multiOptions' => array(
  808. // 1 => null,
  809. // ),
  810. // 'description' => $this->_('Check the above checkbox to enable users to create an about me/profile page on the website.'),
  811. // ),
  812. /**
  813. * ++++++++++++++
  814. * ENABLE PRIVATE REPUTATION COMMENTS
  815. * ++++++++++++++
  816. */
  817. array(
  818. 'form_id' => 'private_reputation_comments',
  819. 'id' => 'private_reputation',
  820. 'element' => 'checkbox',
  821. 'label' => $this->_('Enable Private Reputation Comments'),
  822. 'multiOptions' => array(
  823. 1 => null,
  824. ),
  825. 'description' => $this->_('Check the above checkbox in order to make the reputation comments private/not available for other users to read.<br>'
  826. . 'In this case, only the reputation score will be viewable publicly.'),
  827. ),
  828. /**
  829. * DISABLE REPUTATION
  830. */
  831. array(
  832. 'form_id' => 'users_reputation',
  833. 'id' => 'enable_reputation',
  834. 'element' => 'checkbox',
  835. 'label' => $this->_('Enable Reputation'),
  836. 'multiOptions' => array(
  837. 1 => null,
  838. ),
  839. 'description' => $this->_('Check the above checkbox in order to enable the reputation module.'),
  840. ),
  841. /**
  842. * ++++++++++++++
  843. * TIME AND DATE SETTINGS
  844. * ++++++++++++++
  845. */
  846. array(
  847. 'form_id' => 'time_date',
  848. 'id' => 'timezone',
  849. 'element' => 'select',
  850. 'label' => $this->_('Time Zone'),
  851. 'multiOptions' => $this->getTimezones()->getMultiOptions(),
  852. 'description' => $this->_('Select your site\'s time zone.'),
  853. 'attributes' => array(
  854. 'class' => 'form-control input-medium',
  855. ),
  856. 'required' => true,
  857. ),
  858. array(
  859. 'form_id' => 'time_date',
  860. 'id' => 'date_format',
  861. 'element' => 'radio',
  862. 'label' => $this->_('Date Format'),
  863. 'multiOptions' => array(
  864. '%m/%d/%Y %H:%M:%S' => array(
  865. 'mm/dd/yyyy h:m:s',
  866. $translate->_('Example:') . ' ' . $this->getView()->date(time(), false, '%m/%d/%Y %H:%M:%S'),
  867. ),
  868. '%d.%m.%Y %H:%M:%S' => array(
  869. 'dd.mm.yyyy h:m:s',
  870. $translate->_('Example:') . ' ' . $this->getView()->date(time(), false, '%d.%m.%Y %H:%M:%S'),
  871. ),
  872. ),
  873. 'description' => $this->_('Select a format for displaying dates and date/time combinations on your website.'),
  874. 'required' => true,
  875. ),
  876. /**
  877. * ++++++++++++++
  878. * USER DEFINED LANGUAGES
  879. * ++++++++++++++
  880. */
  881. array(
  882. 'form_id' => 'user_languages',
  883. 'id' => 'user_languages',
  884. 'element' => 'checkbox',
  885. 'label' => $this->_('Multi Language Support'),
  886. 'multiOptions' => array(
  887. 1 => null,
  888. ),
  889. 'description' => $this->_('If this setting is enabled, visitors browsing your site will be able to select a language in which the site will be displayed.<br>'
  890. . 'This setting will only apply if your site is available in multiple languages (not available by default).'),
  891. ),
  892. /**
  893. * ++++++++++++++
  894. * SEO SETTINGS
  895. * ++++++++++++++
  896. */
  897. array(
  898. 'form_id' => 'seo_settings',
  899. 'id' => 'meta_title',
  900. 'element' => 'text',
  901. 'label' => $this->_('Meta Title'),
  902. 'description' => $this->_('(Highly Recommended) Add a meta title for your home page.'),
  903. 'attributes' => array(
  904. 'class' => 'form-control input-xlarge',
  905. ),
  906. 'validators' => array(
  907. 'NoHtml',
  908. ),
  909. ),
  910. array(
  911. 'form_id' => 'seo_settings',
  912. 'id' => 'meta_description',
  913. 'element' => 'textarea',
  914. 'label' => $this->_('Meta Description'),
  915. 'description' => $this->_('(Highly Recommended) This meta description tells the search engines what your site is about. '
  916. . 'Your description should have between 70 and 155 characters (including spaces).'),
  917. 'validators' => array(
  918. 'NoHtml',
  919. ),
  920. 'attributes' => array(
  921. 'rows' => '4',
  922. 'class' => 'form-control',
  923. ),
  924. ),
  925. array(
  926. 'form_id' => 'seo_settings',
  927. 'id' => 'meta_data',
  928. 'element' => '\\Ppb\\Form\\Element\\MultiKeyValue',
  929. 'label' => $this->_('Other Tags'),
  930. 'description' => $this->_('(Optional) Enter any additional meta tags that you might want to add to your site.<br>'
  931. . 'Format: name (keywords, robots, etc) - content (string)'),
  932. 'attributes' => array(
  933. 'class' => 'form-control input-medium',
  934. ),
  935. ),
  936. array(
  937. 'form_id' => 'seo_settings',
  938. 'id' => 'mod_rewrite_urls',
  939. 'element' => 'checkbox',
  940. 'label' => $this->_('Enable Search Engine Friendly URLs'),
  941. 'description' => sprintf(
  942. $this->_('The mod_rewrite apache extension should be loaded in order for search engine friendly URLs to work. '
  943. . 'There are alternatives to this extension if running '
  944. . '<a target="_blank" href="http://blog.martinfjordvald.com/2011/02/nginx-primer-2-from-apache-to-nginx/">ngnix</a> or '
  945. . '<a target="_blank" href="http://www.micronovae.com/ModRewrite/ModRewrite.html">Microsoft IIS</a>.<br>'
  946. . '<em>mod_rewrite extension status:</em> %s'),
  947. ((\Ppb\Utility::checkModRewrite()) ?
  948. '<span class="label label-success">' . $this->_('Enabled') . '</span>' :
  949. '<span class="label label-warning">' . $this->_('Disabled / Check Failed') . '</span>')),
  950. 'multiOptions' => array(
  951. 1 => null
  952. ),
  953. ),
  954. array(
  955. 'form_id' => 'seo_settings',
  956. 'id' => 'home_page_html',
  957. 'element' => 'textarea',
  958. 'label' => $this->_('Home Page Custom HTML'),
  959. 'description' => $this->_('(Recommended for SEO) Add custom html to your home page. '
  960. . 'You should add one <strong>h1</strong> tag that best describes your website and at least one <strong>h2</strong> tag with secondary descriptions.'),
  961. 'attributes' => array(
  962. 'class' => 'form-control textarea-code',
  963. 'rows' => 12,
  964. ),
  965. ),
  966. // array(
  967. // 'form_id' => 'seo_settings',
  968. // 'id' => 'enable_sitemap',
  969. // 'element' => 'checkbox',
  970. // 'label' => $this->_('Enable XML Sitemap'),
  971. // 'multiOptions' => array(
  972. // 1 => null,
  973. // ),
  974. // 'description' => $this->_('If this setting is enabled, visitors browsing your site will be able to select a language in which the site will be displayed.<br>'
  975. // . 'This setting will only apply if your site is available in multiple languages (not available by default).'),
  976. // ),
  977. /**
  978. * ++++++++++++++
  979. * CRON JOBS
  980. * ++++++++++++++
  981. */
  982. array(
  983. 'form_id' => 'cron_jobs',
  984. 'id' => 'cron_job_type',
  985. 'element' => 'radio',
  986. 'label' => $this->_('Cron Jobs Setup'),
  987. 'multiOptions' => array(
  988. 'server' => array(
  989. $translate->_('Run cron jobs from your server\'s control panel'),
  990. sprintf($translate->_('Please add ONE of the following lines and set it to run every minute:<br>'
  991. . '<code>curl -s %1$s/cron.php</code>' . ' or<br>'
  992. . '<code>wget -q %1$s/cron.php</code>' . '<br><br>'
  993. . 'Purge unused images - run once per hour:<br>'
  994. . '<code>curl -s %1$s/cron.php?command=purge-unused-uploaded-files 2>&1</code> or' . '<br>'
  995. . '<code>wget -q %1$s/cron.php?command=purge-unused-uploaded-files</code>' . '<br><br>'
  996. . 'Purge cache data - run daily:<br>'
  997. . '<code>curl -s %1$s/cron.php?command=purge-cache-data 2>&1</code> or' . '<br>'
  998. . '<code>wget -q %1$s/cron.php?command=purge-cache-data</code>' . '<br><br>'
  999. . 'Update currency exchange rates - run daily:<br>'
  1000. . '<code>curl -s %1$s/cron.php?command=update-currency-exchange-rates 2>&1</code> or' . '<br>'
  1001. . '<code>wget -q %1$s/cron.php?command=update-currency-exchange-rates</code>'
  1002. ), $settings['site_path']),
  1003. ),
  1004. 'application' => array(
  1005. $translate->_('Run cron jobs from within the application'),
  1006. $translate->_('Cron jobs will be run automatically each time the site is accessed. Use only if you dont '
  1007. . 'have access to the cron tab application on your server.'),
  1008. )
  1009. ),
  1010. ),
  1011. /**
  1012. * ++++++++++++++
  1013. * CACHING ENGINE
  1014. * ++++++++++++++
  1015. */
  1016. array(
  1017. 'form_id' => 'caching',
  1018. 'id' => 'caching_engine',
  1019. 'element' => 'radio',
  1020. 'label' => 'Caching Engine',
  1021. 'multiOptions' => $this->_cachingEngineMultiOptions(),
  1022. ),
  1023. /**
  1024. * ++++++++++++++
  1025. * PRIVATE SITE/SINGLE SELLER
  1026. * ++++++++++++++
  1027. */
  1028. array(
  1029. 'form_id' => 'private_site',
  1030. 'id' => 'private_site',
  1031. 'element' => 'checkbox',
  1032. 'label' => $this->_('Private Site/Single Seller'),
  1033. 'multiOptions' => array(
  1034. 1 => null
  1035. ),
  1036. 'description' => $this->_('Enable this feature if you want to be able to select which users are allowed to list on your site.<br>'
  1037. . 'You can select which users will have selling privileges from the Users Management page.'),
  1038. ),
  1039. /**
  1040. * ++++++++++++++
  1041. * PREFERRED SELLERS FEATURE
  1042. * ++++++++++++++
  1043. */
  1044. array(
  1045. 'form_id' => 'preferred_sellers',
  1046. 'id' => 'preferred_sellers',
  1047. 'element' => 'checkbox',
  1048. 'label' => $this->_('Preferred Sellers Feature'),
  1049. 'multiOptions' => array(
  1050. 1 => null
  1051. ),
  1052. 'description' => $this->_('Enable this feature if you want to give certain users listing/sale fee reductions.'),
  1053. ),
  1054. array(
  1055. 'form_id' => 'preferred_sellers',
  1056. 'id' => 'preferred_sellers_expiration',
  1057. 'element' => 'text',
  1058. 'label' => $this->_('Expires after'),
  1059. 'description' => $this->_('(Optional) Enter the number of days after which the preferred seller status will expire.'),
  1060. 'suffix' => $this->_('days'),
  1061. 'attributes' => array(
  1062. 'class' => 'form-control input-mini',
  1063. ),
  1064. 'validators' => array(
  1065. 'Digits',
  1066. ),
  1067. ),
  1068. array(
  1069. 'form_id' => 'preferred_sellers',
  1070. 'id' => 'preferred_sellers_reduction',
  1071. 'element' => '\\Ppb\\Form\\Element\\LocalizedNumeric',
  1072. 'label' => $this->_('Reduction'),
  1073. 'description' => $this->_('Enter the reduction percentage that will be applied.'),
  1074. 'suffix' => '%',
  1075. 'attributes' => array(
  1076. 'class' => 'form-control input-mini',
  1077. ),
  1078. 'validators' => array(
  1079. 'Numeric',
  1080. ),
  1081. 'filters' => array(
  1082. '\\Ppb\\Filter\\LocalizedNumeric',
  1083. ),
  1084. ),
  1085. array(
  1086. 'form_id' => 'preferred_sellers',
  1087. 'id' => 'preferred_sellers_apply_sale',
  1088. 'element' => 'checkbox',
  1089. 'label' => $this->_('Apply To Sale Fees'),
  1090. 'multiOptions' => array(
  1091. 1 => null
  1092. ),
  1093. 'description' => $this->_('Check the above checkbox if you wish to apply the preferred seller reduction to sale fees.'),
  1094. ),
  1095. /**
  1096. * SITE INVOICES SETTINGS [ Header - Footer ]
  1097. */
  1098. array(
  1099. 'form_id' => 'site_invoices',
  1100. 'id' => 'invoice_address',
  1101. 'element' => 'textarea',
  1102. 'label' => $this->_('Invoice Address'),
  1103. 'description' => $this->_('Enter the address that will appear on site invoices.'),
  1104. 'attributes' => array(
  1105. 'rows' => '8',
  1106. 'class' => 'form-control textarea-code',
  1107. ),
  1108. 'validators' => array(
  1109. 'NoHtml',
  1110. ),
  1111. ),
  1112. array(
  1113. 'form_id' => 'site_invoices',
  1114. 'id' => 'invoice_header',
  1115. 'element' => 'textarea',
  1116. 'label' => $this->_('Invoice Header'),
  1117. 'description' => $this->_('Add a custom html header for site invoices, or leave empty if you wish for the site logo will be displayed.'),
  1118. 'attributes' => array(
  1119. 'rows' => '12',
  1120. 'class' => 'form-control textarea-code',
  1121. ),
  1122. ),
  1123. array(
  1124. 'form_id' => 'site_invoices',
  1125. 'id' => 'invoice_footer',
  1126. 'element' => 'textarea',
  1127. 'label' => $this->_('Invoice Footer'),
  1128. 'description' => $this->_('Add a custom html footer for site invoices.'),
  1129. 'attributes' => array(
  1130. 'rows' => '12',
  1131. 'class' => 'form-control textarea-code',
  1132. ),
  1133. ),
  1134. /**
  1135. * ++++++++++++++
  1136. * ADDRESS DISPLAY FORMAT
  1137. * ++++++++++++++
  1138. */
  1139. array(
  1140. 'form_id' => 'address_display_format',
  1141. 'id' => 'address_display_format',
  1142. 'element' => 'radio',
  1143. 'label' => $this->_('Address Display Format'),
  1144. 'multiOptions' => array(
  1145. 'default' => array(
  1146. $translate->_('Default'),
  1147. $translate->_('Address, City, Post/Zip Code, County/State, Country'),
  1148. ),
  1149. 'alternate' => array(
  1150. $translate->_('Alternate'),
  1151. $translate->_('Address, City, County/State, Post/Zip Code, Country'),
  1152. ),
  1153. ),
  1154. 'description' => $this->_('Choose how addresses should be displayed on the website (on sales, invoices, etc.).'),
  1155. ),
  1156. /**
  1157. * ++++++++++++++
  1158. * GOOGLE ANALYTICS
  1159. * ++++++++++++++
  1160. */
  1161. array(
  1162. 'form_id' => 'google_analytics',
  1163. 'id' => 'google_analytics_code',
  1164. 'element' => 'textarea',
  1165. 'label' => $this->_('Google Analytics Code'),
  1166. 'description' => $this->_('If you have a Google Analytics account that you want to use for your site, you can add the tracking code that '
  1167. . 'Google provides in the field above.'),
  1168. 'attributes' => array(
  1169. 'rows' => '16',
  1170. 'class' => 'form-control textarea-code',
  1171. ),
  1172. ),
  1173. /**
  1174. * ++++++++++++++
  1175. * ALLOW BUYER TO COMBINE PURCHASES
  1176. * ++++++++++++++
  1177. */
  1178. array(
  1179. 'form_id' => 'combine_purchases',
  1180. 'id' => 'buyer_create_invoices',
  1181. 'element' => 'checkbox',
  1182. 'label' => $this->_('Buyer can Combine Purchases'),
  1183. 'multiOptions' => array(
  1184. 1 => null
  1185. ),
  1186. 'description' => $this->_('If this setting is enabled, buyers can combine purchased items from the same seller into a single invoice.<br>'
  1187. . '<b>Important</b>: Only non-invoiced items can be combined.'),
  1188. ),
  1189. /**
  1190. * ++++++++++++++
  1191. * FEATURED LISTINGS BOXES
  1192. * ++++++++++++++
  1193. */
  1194. array(
  1195. 'form_id' => 'home_page_appearance',
  1196. 'id' => 'hp_listings_imgsize',
  1197. 'element' => 'text',
  1198. 'label' => $this->_('Image Size'),
  1199. 'description' => $this->_('Enter the size of the listings images.'),
  1200. 'required' => true,
  1201. 'suffix' => $this->_('pixels'),
  1202. 'validators' => array(
  1203. 'Digits',
  1204. array('GreaterThan', array(30, true)),
  1205. ),
  1206. 'attributes' => array(
  1207. 'class' => 'form-control input-mini',
  1208. ),
  1209. ),
  1210. /**
  1211. * DISPLAY SECTIONS SETTINGS
  1212. */
  1213. /* HOME PAGE FEATURED */
  1214. array(
  1215. 'form_id' => 'home_page_appearance',
  1216. 'subtitle' => $this->_('Home Page Featured'),
  1217. 'id' => 'hpfeat_nb',
  1218. 'element' => 'text',
  1219. 'label' => $this->_('Listings'),
  1220. 'description' => $this->_('Enter the maximum number of home page featured listings that will be displayed or leave empty to disable.'),
  1221. 'required' => false,
  1222. 'validators' => array(
  1223. 'Digits',
  1224. array('LessThan', array(24, true)),
  1225. ),
  1226. 'attributes' => array(
  1227. 'class' => 'form-control input-mini',
  1228. ),
  1229. ),
  1230. array(
  1231. 'form_id' => 'home_page_appearance',
  1232. 'id' => 'hpfeat_tabbed',
  1233. 'element' => 'checkbox',
  1234. 'label' => $this->_('Tabbed Display'),
  1235. 'required' => false,
  1236. 'multiOptions' => array(
  1237. 1 => null,
  1238. ),
  1239. ),
  1240. array(
  1241. 'form_id' => 'home_page_appearance',
  1242. 'id' => 'hpfeat_carousel',
  1243. 'element' => 'checkbox',
  1244. 'label' => $this->_('Carousel'),
  1245. 'required' => false,
  1246. 'multiOptions' => array(
  1247. 1 => null,
  1248. ),
  1249. ),
  1250. array(
  1251. 'form_id' => 'home_page_appearance',
  1252. 'id' => 'hpfeat_box',
  1253. 'element' => 'radio',
  1254. 'label' => $this->_('Box Type'),
  1255. 'required' => false,
  1256. 'multiOptions' => array(
  1257. 'list' => 'List',
  1258. 'grid' => 'Grid',
  1259. ),
  1260. ),
  1261. /* RECENTLY LISTED */
  1262. array(
  1263. 'form_id' => 'home_page_appearance',
  1264. 'subtitle' => $this->_('Recently Listed'),
  1265. 'id' => 'recent_nb',
  1266. 'element' => 'text',
  1267. 'label' => $this->_('Listings'),
  1268. 'required' => false,
  1269. 'validators' => array(
  1270. 'Digits',
  1271. array('LessThan', array(32, true)),
  1272. ),
  1273. 'attributes' => array(
  1274. 'class' => 'form-control input-mini',
  1275. ),
  1276. ),
  1277. array(
  1278. 'form_id' => 'home_page_appearance',
  1279. 'id' => 'recent_tabbed',
  1280. 'element' => 'checkbox',
  1281. 'label' => $this->_('Tabbed Display'),
  1282. 'required' => false,
  1283. 'multiOptions' => array(
  1284. 1 => null,
  1285. ),
  1286. ),
  1287. array(
  1288. 'form_id' => 'home_page_appearance',
  1289. 'id' => 'recent_carousel',
  1290. 'element' => 'checkbox',
  1291. 'label' => $this->_('Carousel'),
  1292. 'required' => false,
  1293. 'multiOptions' => array(
  1294. 1 => null,
  1295. ),
  1296. ),
  1297. array(
  1298. 'form_id' => 'home_page_appearance',
  1299. 'id' => 'recent_box',
  1300. 'element' => 'radio',
  1301. 'label' => $this->_('Box Type'),
  1302. 'required' => false,
  1303. 'multiOptions' => array(
  1304. 'list' => 'List',
  1305. 'grid' => 'Grid',
  1306. ),
  1307. ),
  1308. /* ENDING SOON */
  1309. array(
  1310. 'form_id' => 'home_page_appearance',
  1311. 'subtitle' => $this->_('Ending Soon'),
  1312. 'id' => 'ending_nb',
  1313. 'element' => 'text',
  1314. 'label' => $this->_('Listings'),
  1315. 'required' => false,
  1316. 'validators' => array(
  1317. 'Digits',
  1318. array('LessThan', array(32, true)),
  1319. ),
  1320. 'attributes' => array(
  1321. 'class' => 'form-control input-mini',
  1322. ),
  1323. ),
  1324. array(
  1325. 'form_id' => 'home_page_appearance',
  1326. 'id' => 'ending_tabbed',
  1327. 'element' => 'checkbox',
  1328. 'label' => $this->_('Tabbed Display'),
  1329. 'required' => false,
  1330. 'multiOptions' => array(
  1331. 1 => null,
  1332. ),
  1333. ),
  1334. array(
  1335. 'form_id' => 'home_page_appearance',
  1336. 'id' => 'ending_carousel',
  1337. 'element' => 'checkbox',
  1338. 'label' => $this->_('Carousel'),
  1339. 'required' => false,
  1340. 'multiOptions' => array(
  1341. 1 => null,
  1342. ),
  1343. ),
  1344. array(
  1345. 'form_id' => 'home_page_appearance',
  1346. 'id' => 'ending_box',
  1347. 'element' => 'radio',
  1348. 'label' => $this->_('Box Type'),
  1349. 'required' => false,
  1350. 'multiOptions' => array(
  1351. 'list' => 'List',
  1352. 'grid' => 'Grid',
  1353. ),
  1354. ),
  1355. /* POPULAR */
  1356. array(
  1357. 'form_id' => 'home_page_appearance',
  1358. 'subtitle' => $this->_('Popular'),
  1359. 'id' => 'popular_nb',
  1360. 'element' => 'text',
  1361. 'label' => $this->_('Listings'),
  1362. 'required' => false,
  1363. 'validators' => array(
  1364. 'Digits',
  1365. array('LessThan', array(32, true)),
  1366. ),
  1367. 'attributes' => array(
  1368. 'class' => 'form-control input-mini',
  1369. ),
  1370. ),
  1371. array(
  1372. 'form_id' => 'home_page_appearance',
  1373. 'id' => 'popular_tabbed',
  1374. 'element' => 'checkbox',
  1375. 'label' => $this->_('Tabbed Display'),
  1376. 'required' => false,
  1377. 'multiOptions' => array(
  1378. 1 => null,
  1379. ),
  1380. ),
  1381. array(
  1382. 'form_id' => 'home_page_appearance',
  1383. 'id' => 'popular_carousel',
  1384. 'element' => 'checkbox',
  1385. 'label' => $this->_('Carousel'),
  1386. 'required' => false,
  1387. 'multiOptions' => array(
  1388. 1 => null,
  1389. ),
  1390. ),
  1391. array(
  1392. 'form_id' => 'home_page_appearance',
  1393. 'id' => 'popular_box',
  1394. 'element' => 'radio',
  1395. 'label' => $this->_('Box Type'),
  1396. 'required' => false,
  1397. 'multiOptions' => array(
  1398. 'list' => 'List',
  1399. 'grid' => 'Grid',
  1400. ),
  1401. ),
  1402. /**
  1403. * ++++++++++++++
  1404. * CATEGORY PAGES FEATURED LISTINGS
  1405. * ++++++++++++++
  1406. */
  1407. array(
  1408. 'form_id' => 'category_featured',
  1409. 'id' => 'catfeat_nb',
  1410. 'element' => 'text',
  1411. 'label' => $this->_('Number of Featured Items'),
  1412. 'description' => $this->_('Leave empty or enter 0 to disable (applies to all the fields below as well).'),
  1413. 'required' => false,
  1414. 'validators' => array(
  1415. 'Digits',
  1416. array('LessThan', array(24, true)),
  1417. ),
  1418. 'attributes' => array(
  1419. 'class' => 'form-control input-mini',
  1420. ),
  1421. ),
  1422. /**
  1423. * ++++++++++++++
  1424. * DISPLAY FREE FEES ON FRONT END
  1425. * ++++++++++++++
  1426. */
  1427. array(
  1428. 'form_id' => 'display_free_fees',
  1429. 'id' => 'display_free_fees',
  1430. 'element' => 'checkbox',
  1431. 'label' => $this->_('Display Free Fees on User End'),
  1432. 'multiOptions' => array(
  1433. 1 => null,
  1434. ),
  1435. 'description' => $this->_('Check the above checkbox if you wish for free fees to be displayed on the front end.'),
  1436. ),
  1437. /**
  1438. * ++++++++++++++
  1439. * CUSTOM START/END TIME OPTIONS
  1440. * ++++++++++++++
  1441. */
  1442. array(
  1443. 'form_id' => 'custom_start_end_times',
  1444. 'id' => 'enable_custom_start_time',
  1445. 'element' => 'checkbox',
  1446. 'label' => $this->_('Enable Custom Start Time'),
  1447. 'multiOptions' => array(
  1448. 1 => null,
  1449. ),
  1450. 'description' => $this->_('Check the above checkbox to enable the custom start time option for listings.'),
  1451. ),
  1452. array(
  1453. 'form_id' => 'custom_start_end_times',
  1454. 'id' => 'enable_custom_end_time',
  1455. 'element' => 'checkbox',
  1456. 'label' => $this->_('Enable Custom End Time'),
  1457. 'multiOptions' => array(
  1458. 1 => null,
  1459. ),
  1460. 'description' => $this->_('Check the above checkbox to enable the custom end time option for listings.'),
  1461. ),
  1462. /**
  1463. * ++++++++++++++
  1464. * LISTINGS SEARCH SETTINGS
  1465. * ++++++++++++++
  1466. */
  1467. array(
  1468. 'form_id' => 'listings_search_settings',
  1469. 'id' => 'search_title',
  1470. 'element' => 'checkbox',
  1471. 'label' => $this->_('By Title'),
  1472. 'multiOptions' => array(
  1473. 1 => null,
  1474. ),
  1475. 'description' => $this->_('This setting cannot be disabled, searching by listing titles is mandatory.'),
  1476. 'attributes' => array(
  1477. 'checked' => true,
  1478. 'disabled' => true,
  1479. ),
  1480. ),
  1481. array(
  1482. 'form_id' => 'listings_search_settings',
  1483. 'id' => 'search_subtitle',
  1484. 'element' => 'checkbox',
  1485. 'label' => $this->_('By Subtitle'),
  1486. 'multiOptions' => array(
  1487. 1 => null,
  1488. ),
  1489. 'description' => $this->_('Check the above checkbox to allow searching for keywords in listing subtitles.'),
  1490. ),
  1491. array(
  1492. 'form_id' => 'listings_search_settings',
  1493. 'id' => 'search_description',
  1494. 'element' => 'checkbox',
  1495. 'label' => $this->_('By Description'),
  1496. 'multiOptions' => array(
  1497. 1 => null,
  1498. ),
  1499. 'description' => $this->_('Check the above checkbox to allow searching for keywords in listing descriptions.'),
  1500. ),
  1501. array(
  1502. 'form_id' => 'listings_search_settings',
  1503. 'id' => 'search_category_name',
  1504. 'element' => 'checkbox',
  1505. 'label' => $this->_('By Category Names'),
  1506. 'multiOptions' => array(
  1507. 1 => null,
  1508. ),
  1509. 'description' => $this->_('Check the above checkbox to allow searching for keywords in category names.'),
  1510. ),
  1511. /**
  1512. * ++++++++++++++
  1513. * LISTING SETUP PROCESS
  1514. * ++++++++++++++
  1515. */
  1516. array(
  1517. 'form_id' => 'listing_setup',
  1518. 'id' => 'listing_setup_process',
  1519. 'element' => 'radio',
  1520. 'label' => $this->_('Listing Setup Process'),
  1521. 'multiOptions' => array(
  1522. 'full' => array(
  1523. $translate->_('Full'),
  1524. $translate->_('Use the standard 4 steps form - details, settings, shipping and preview.'),
  1525. ),
  1526. 'quick' => array(
  1527. $translate->_('Quick'),
  1528. $translate->_('Use the quick 2 steps form - setup and preview.'),
  1529. ),
  1530. ),
  1531. 'description' => $this->_('Choose the type of listing creation form to use in the front end.'),
  1532. ),
  1533. /**
  1534. * ++++++++++++++
  1535. * CURRENCY SETTINGS
  1536. * ++++++++++++++
  1537. */
  1538. array(
  1539. 'subtitle' => $translate->_('Current Display Format:') . ' <b>' . $this->getView()->amount(3999) . '</b>',
  1540. 'form_id' => 'currency_settings',
  1541. 'id' => 'currency',
  1542. 'element' => 'select',
  1543. 'label' => $this->_('Default Currency'),
  1544. 'multiOptions' => $this->getCurrencies()->getMultiOptions(),
  1545. 'description' => sprintf(
  1546. $translate->_('Select the site\'s default currency.<br>'
  1547. . '<b>Important</b>: Please <a href="%s">click here</a> to define which currencies will be available on the site.'),
  1548. $this->_view->url(array('module' => 'admin', 'controller' => 'tables', 'action' => 'index', 'table' => 'currencies'))),
  1549. 'required' => true,
  1550. 'attributes' => array(
  1551. 'class' => 'form-control input-large',
  1552. ),
  1553. ),
  1554. array(
  1555. 'form_id' => 'currency_settings',
  1556. 'id' => 'currency_format',
  1557. 'element' => 'radio',
  1558. 'label' => $this->_('Amount Display Format'),
  1559. 'multiOptions' => array(
  1560. 1 => array(
  1561. $translate->_('US Format: 9,999.95'),
  1562. ),
  1563. 2 => array(
  1564. $translate->_('EU Format: 9.999,95'),
  1565. ),
  1566. ),
  1567. 'description' => $this->_('Select the amount display format that will be applied for when displaying currency amounts on your website.'),
  1568. 'required' => true,
  1569. ),
  1570. array(
  1571. 'form_id' => 'currency_settings',
  1572. 'id' => 'currency_decimals',
  1573. 'element' => 'text',
  1574. 'label' => $this->_('Decimal Digits'),
  1575. 'description' => $this->_('Enter the number of decimal digits that will be shown when displaying a currency amount.'),
  1576. 'required' => true,
  1577. 'validators' => array(
  1578. 'Digits',
  1579. ),
  1580. 'attributes' => array(
  1581. 'class' => 'form-control input-mini',
  1582. ),
  1583. ),
  1584. array(
  1585. 'form_id' => 'currency_settings',
  1586. 'id' => 'currency_position',
  1587. 'element' => 'radio',
  1588. 'label' => $this->_('Symbol Position'),
  1589. 'multiOptions' => array(
  1590. 1 => array(
  1591. $translate->_('Symbol before amount:') . ' ' . $this->getCurrencies()->getSymbol($settings['currency']) . ' 199',
  1592. ),
  1593. 2 => array(
  1594. $translate->_('Amount before symbol:') . ' 199 ' . $this->getCurrencies()->getSymbol($settings['currency']),
  1595. ),
  1596. ),
  1597. 'description' => $this->_('Select the amount display format that will be applied for when displaying currency amounts on your website.'),
  1598. 'required' => true,
  1599. ),
  1600. /**
  1601. * ++++++++++++++
  1602. * TITLE CHARACTER LENGTH
  1603. * ++++++++++++++
  1604. */
  1605. array(
  1606. 'form_id' => 'character_length',
  1607. 'id' => 'character_length',
  1608. 'element' => 'text',
  1609. 'label' => $this->_('Title Character Length'),
  1610. 'description' => $this->_('Enter the maximum character length allowed for the listing title field.'),
  1611. 'validators' => array(
  1612. 'Digits',
  1613. ),
  1614. 'attributes' => array(
  1615. 'class' => 'form-control input-mini',
  1616. ),
  1617. ),
  1618. /**
  1619. * ++++++++++++++
  1620. * LISTINGS APPROVAL
  1621. * ++++++++++++++
  1622. */
  1623. array(
  1624. 'form_id' => 'listings_approval',
  1625. 'id' => 'enable_listings_approval',
  1626. 'element' => 'checkbox',
  1627. 'label' => $this->_('Enable Listings Approval'),
  1628. 'multiOptions' => array(
  1629. 1 => null,
  1630. ),
  1631. 'description' => $this->_('Check the above checkbox if you wish for listings to require admin approval before they are displayed '
  1632. . 'on your website. Listings will require approval after being edited as well.'),
  1633. ),
  1634. /**
  1635. * ++++++++++++++
  1636. * SUBTITLE
  1637. * ++++++++++++++
  1638. */
  1639. array(
  1640. 'form_id' => 'listing_subtitle',
  1641. 'id' => 'enable_subtitle',
  1642. 'element' => 'checkbox',
  1643. 'label' => $this->_('Enable Listing Subtitle'),
  1644. 'multiOptions' => array(
  1645. 1 => null,
  1646. ),
  1647. 'description' => $this->_('Check the above checkbox if you wish to allow sellers to add subtitles to their listings.'),
  1648. ),
  1649. /**
  1650. * ++++++++++++++
  1651. * IMAGES SETTINGS
  1652. * ++++++++++++++
  1653. */
  1654. array(
  1655. 'form_id' => 'images_settings',
  1656. 'id' => 'images_max',
  1657. 'element' => 'text',
  1658. 'label' => $this->_('Number of Images'),
  1659. 'description' => $this->_('Enter the maximum number of images that can be added to a listing.'),
  1660. 'required' => true,
  1661. 'validators' => array(
  1662. 'Digits',
  1663. ),
  1664. 'attributes' => array(
  1665. 'class' => 'form-control input-mini',
  1666. ),
  1667. ),
  1668. array(
  1669. 'form_id' => 'images_settings',
  1670. 'id' => 'mandatory_images',
  1671. 'element' => 'checkbox',
  1672. 'label' => $this->_('Mandatory Images'),
  1673. 'multiOptions' => array(
  1674. 1 => null,
  1675. ),
  1676. 'description' => $this->_('Check the above checkbox to require for at least one image to be added when a listing is created.'),
  1677. ),
  1678. array(
  1679. 'form_id' => 'images_settings',
  1680. 'id' => 'images_size',
  1681. 'element' => 'text',
  1682. 'label' => $this->_('Maximum Size Allowed'),
  1683. 'suffix' => $this->_('KB'),
  1684. 'description' => sprintf($this->_('Enter the maximum size an uploaded image can have.<br>'
  1685. . '<strong>Note</strong>: The maximum allowed size of a file that can be uploaded on your server is <strong>%s</strong>. <br>'
  1686. . 'If needing to have the limit increased, please contact your hosting provider.'), $maximumFileUploadSize),
  1687. 'validators' => array(
  1688. 'Digits',
  1689. ),
  1690. 'attributes' => array(
  1691. 'class' => 'form-control input-mini',
  1692. ),
  1693. ),
  1694. array(
  1695. 'form_id' => 'images_settings',
  1696. 'id' => 'crop_images',
  1697. 'element' => 'checkbox',
  1698. 'label' => $this->_('Crop to Aspect Ratio'),
  1699. 'multiOptions' => array(
  1700. 1 => null,
  1701. ),
  1702. 'description' => $this->_('Check the above checkbox if you wish for uploaded images to be cropped when thumbnails are generated.'),
  1703. ),
  1704. array(
  1705. 'form_id' => 'images_settings',
  1706. 'id' => 'lazy_load_images',
  1707. 'element' => 'checkbox',
  1708. 'label' => $this->_('Lazy Load'),
  1709. 'multiOptions' => array(
  1710. 1 => null,
  1711. ),
  1712. 'description' => $this->_('Check the above checkbox to enable the lazy load javascript for listing images (improves website loading speed).'),
  1713. ),
  1714. array(
  1715. 'form_id' => 'images_settings',
  1716. 'id' => 'remote_uploads',
  1717. 'element' => 'checkbox',
  1718. 'label' => $this->_('Allow Remote Images'),
  1719. 'multiOptions' => array(
  1720. 1 => null,
  1721. ),
  1722. 'description' => $this->_('Check the above checkbox to allow adding images from remote locations by entering the direct link.'),
  1723. ),
  1724. array(
  1725. 'form_id' => 'images_settings',
  1726. 'id' => 'images_watermark',
  1727. 'element' => 'text',
  1728. 'label' => $this->_('Watermark Text'),
  1729. 'description' => $this->_('Enter a watermark text that will be applied to uploaded images, or leave empty for no watermark.'),
  1730. 'attributes' => array(
  1731. 'class' => 'form-control input-medium',
  1732. ),
  1733. 'required' => false,
  1734. ),
  1735. /**
  1736. * ++++++++++++++
  1737. * MEDIA UPLOAD SETTINGS
  1738. * ++++++++++++++
  1739. */
  1740. array(
  1741. 'form_id' => 'media_upload',
  1742. 'id' => 'videos_max',
  1743. 'element' => 'text',
  1744. 'label' => $this->_('Number of Videos'),
  1745. 'description' => $this->_('Enter the maximum number of videos that can be added to a listing. <br>'
  1746. . '<b>Important</b>: To disable this feature, enter 0 in the above field.'),
  1747. 'required' => true,
  1748. 'validators' => array(
  1749. 'Digits',
  1750. ),
  1751. 'attributes' => array(
  1752. 'class' => 'form-control input-mini',
  1753. ),
  1754. ),
  1755. array(
  1756. 'form_id' => 'media_upload',
  1757. 'id' => 'videos_size',
  1758. 'element' => 'text',
  1759. 'label' => $this->_('Maximum Size Allowed'),
  1760. 'suffix' => $this->_('KB'),
  1761. 'description' => sprintf($this->_('Enter the maximum size an uploaded video can have.<br>'
  1762. . '<strong>Note</strong>: The maximum allowed size of a file that can be uploaded on your server is <strong>%s</strong>. <br>'
  1763. . 'If needing to have the limit increased, please contact your hosting provider.'), $maximumFileUploadSize),
  1764. 'validators' => array(
  1765. 'Digits',
  1766. ),
  1767. 'attributes' => array(
  1768. 'class' => 'form-control input-mini',
  1769. ),
  1770. ),
  1771. array(
  1772. 'form_id' => 'media_upload',
  1773. 'id' => 'embedded_code',
  1774. 'element' => 'checkbox',
  1775. 'label' => $this->_('Allow Embedded Code'),
  1776. 'multiOptions' => array(
  1777. 1 => null,
  1778. ),
  1779. 'description' => $this->_('Check the above checkbox to allow adding remote videos using embedded code. <br>'
  1780. . '<b>Eg</b>: For YouTube use the code provided by accessing "share" -> "embed" on any youtube video.'),
  1781. ),
  1782. /**
  1783. * ++++++++++++++
  1784. * DIGITAL DOWNLOADS SETTINGS
  1785. * ++++++++++++++
  1786. */
  1787. array(
  1788. 'form_id' => 'digital_downloads',
  1789. 'id' => 'digital_downloads_max',
  1790. 'element' => 'text',
  1791. 'label' => $this->_('Digital Downloads'),
  1792. 'description' => $this->_('Enter the maximum number of downloadable files that can be added to a listing. <br>'
  1793. . '<b>Important</b>: To disable this feature, enter 0 in the above field.'),
  1794. 'required' => true,
  1795. 'validators' => array(
  1796. 'Digits',
  1797. ),
  1798. 'attributes' => array(
  1799. 'class' => 'form-control input-mini',
  1800. ),
  1801. ),
  1802. array(
  1803. 'form_id' => 'digital_downloads',
  1804. 'id' => 'digital_downloads_folder',
  1805. 'element' => 'text',
  1806. 'label' => $this->_('Digital Downloads Folder'),
  1807. 'description' => $translate->_('Please enter a folder relative to your document root, where the files will be stored.<br>'
  1808. . 'Your document root path is:') . ' ' . $basePath,
  1809. 'attributes' => array(
  1810. 'class' => 'form-control input-medium',
  1811. ),
  1812. ),
  1813. array(
  1814. 'form_id' => 'digital_downloads',
  1815. 'id' => 'digital_downloads_size',
  1816. 'element' => 'text',
  1817. 'label' => $this->_('Maximum Size Allowed'),
  1818. 'suffix' => $this->_('KB'),
  1819. 'description' => sprintf($this->_('Enter the maximum size an uploaded file can have.<br>'
  1820. . '<strong>Note</strong>: The maximum allowed size of a file that can be uploaded on your server is <strong>%s</strong>. <br>'
  1821. . 'If needing to have the limit increased, please contact your hosting provider.'), $maximumFileUploadSize),
  1822. 'validators' => array(
  1823. 'Digits',
  1824. ),
  1825. 'attributes' => array(
  1826. 'class' => 'form-control input-small',
  1827. ),
  1828. ),
  1829. array(
  1830. 'form_id' => 'digital_downloads',
  1831. 'id' => 'digital_downloads_disclaimer',
  1832. 'element' => 'textarea',
  1833. 'label' => $this->_('Downloads Disclaimer'),
  1834. 'description' => $this->_('Enter a disclaimer paragraph which will be shown to users that will be downloading files from the website before proceeding with the download.'),
  1835. 'validators' => array(
  1836. 'NoHtml',
  1837. ),
  1838. 'attributes' => array(
  1839. 'rows' => '6',
  1840. 'class' => 'form-control',
  1841. ),
  1842. ),
  1843. /**
  1844. * ++++++++++++++
  1845. * SALE TRANSACTION FEE REFUNDS
  1846. * ++++++++++++++
  1847. */
  1848. array(
  1849. 'form_id' => 'sale_fee_refunds',
  1850. 'id' => 'enable_sale_fee_refunds',
  1851. 'element' => 'checkbox',
  1852. 'label' => $this->_('Enable Sale Transaction Fee Refunds'),
  1853. 'multiOptions' => array(
  1854. 1 => null,
  1855. ),
  1856. 'description' => $this->_('Check the above checkbox if you wish to allow your users to request refunds for sale transaction fees.<br>'
  1857. . 'The refunded amounts will be credited to the site account balances of the users.'),
  1858. ),
  1859. array(
  1860. 'form_id' => 'sale_fee_refunds',
  1861. 'id' => 'sale_fee_refunds_range',
  1862. 'element' => '\Ppb\Form\Element\Range',
  1863. 'label' => $this->_('Interval'),
  1864. 'description' => $this->_('Enter the interval when the payer is able to request a refund for a sale transaction fee, or leave both fields empty if you don\'t want to set an interval.'),
  1865. 'suffix' => $this->_('days'),
  1866. 'attributes' => array(
  1867. 'class' => 'form-control input-mini',
  1868. ),
  1869. ),
  1870. /**
  1871. * ++++++++++++++
  1872. * SOCIAL NETWORK LINKS
  1873. * ++++++++++++++
  1874. */
  1875. array(
  1876. 'form_id' => 'social_network_links',
  1877. 'id' => 'enable_social_network_links',
  1878. 'element' => 'checkbox',
  1879. 'label' => $this->_('Enable Social Network Links'),
  1880. 'multiOptions' => array(
  1881. 1 => null,
  1882. ),
  1883. 'description' => $this->_('Check the above checkbox if you wish for social network links to be enabled throughout your website.'),
  1884. ),
  1885. /**
  1886. * ++++++++++++++
  1887. * COOKIE USAGE CONFIRMATION
  1888. * ++++++++++++++
  1889. */
  1890. array(
  1891. 'form_id' => 'cookie_usage',
  1892. 'id' => 'enable_cookie_usage_confirmation',
  1893. 'element' => 'checkbox',
  1894. 'label' => $this->_('Enable Cookie Usage Confirmation'),
  1895. 'multiOptions' => array(
  1896. 1 => null,
  1897. ),
  1898. 'description' => $this->_('Check the above checkbox to enable the cookie usage confirmation option.<br>'
  1899. . 'If this feature is enabled, users will be notified that the site uses cookies and will need to agree in order to hide the message.'),
  1900. ),
  1901. array(
  1902. 'form_id' => 'cookie_usage',
  1903. 'id' => 'cookie_usage_message',
  1904. 'element' => 'textarea',
  1905. 'label' => $this->_('Cookie Usage Confirmation Message'),
  1906. 'description' => $this->_('Enter the cookie confirmation message that will be displayed.'),
  1907. 'required' => ($this->getData('enable_cookie_usage_confirmation')) ? true : false,
  1908. 'attributes' => array(
  1909. 'rows' => '3',
  1910. 'class' => 'form-control',
  1911. ),
  1912. ),
  1913. /**
  1914. * ++++++++++++++
  1915. * GOOGLE RECAPTCHA
  1916. * ++++++++++++++
  1917. */
  1918. array(
  1919. 'form_id' => 'google_recaptcha',
  1920. 'id' => 'enable_recaptcha',
  1921. 'element' => 'checkbox',
  1922. 'label' => $this->_('Enable reCAPTCHA'),
  1923. 'multiOptions' => array(
  1924. 1 => null,
  1925. ),
  1926. 'description' => $this->_('Check the above checkbox to enable the Google reCAPTCHA plugin. <br>'
  1927. . 'To enable the plugin for your site, you will need to create an account '
  1928. . '<a href="https://www.google.com/recaptcha/intro/index.html" target="_blank">here</a>.'),
  1929. ),
  1930. array(
  1931. 'form_id' => 'google_recaptcha',
  1932. 'id' => 'recaptcha_public_key',
  1933. 'element' => 'text',
  1934. 'label' => $this->_('reCAPTCHA Public Key'),
  1935. 'required' => ($this->getData('enable_recaptcha')) ? true : false,
  1936. 'validators' => array(
  1937. 'NoHtml',
  1938. ),
  1939. 'attributes' => array(
  1940. 'class' => 'form-control input-xlarge',
  1941. ),
  1942. ),
  1943. array(
  1944. 'form_id' => 'google_recaptcha',
  1945. 'id' => 'recaptcha_private_key',
  1946. 'element' => 'text',
  1947. 'label' => $this->_('reCAPTCHA Private Key'),
  1948. 'required' => ($this->getData('enable_recaptcha')) ? true : false,
  1949. 'validators' => array(
  1950. 'NoHtml',
  1951. ),
  1952. 'attributes' => array(
  1953. 'class' => 'form-control input-xlarge',
  1954. ),
  1955. ),
  1956. array(
  1957. 'form_id' => 'google_recaptcha',
  1958. 'subtitle' => $this->_('reCAPTCHA Usage'),
  1959. 'id' => 'recaptcha_registration',
  1960. 'element' => 'checkbox',
  1961. 'label' => $this->_('Registration Process'),
  1962. 'multiOptions' => array(
  1963. 1 => null,
  1964. ),
  1965. 'description' => $this->_('Check the above checkbox to enable reCAPTCHA for the registration process.'),
  1966. ),
  1967. array(
  1968. 'form_id' => 'google_recaptcha',
  1969. 'id' => 'recaptcha_contact_us',
  1970. 'element' => 'checkbox',
  1971. 'label' => $this->_('Contact Us Page'),
  1972. 'multiOptions' => array(
  1973. 1 => null,
  1974. ),
  1975. 'description' => $this->_('Check the above checkbox to enable reCAPTCHA for the contact us page.'),
  1976. ),
  1977. array(
  1978. 'form_id' => 'google_recaptcha',
  1979. 'id' => 'recaptcha_email_friend',
  1980. 'element' => 'checkbox',
  1981. 'label' => $this->_('Email Listing to Friend Page'),
  1982. 'multiOptions' => array(
  1983. 1 => null,
  1984. ),
  1985. 'description' => $this->_('Check the above checkbox to enable reCAPTCHA for the email listing to friend page.'),
  1986. ),
  1987. /**
  1988. * ++++++++++++++
  1989. * BCC EMAILS TO ADMIN
  1990. * ++++++++++++++
  1991. */
  1992. array(
  1993. 'form_id' => 'bcc_emails',
  1994. 'id' => 'bcc_emails',
  1995. 'element' => 'checkbox',
  1996. 'label' => $this->_('Enable BCC Emails to Admin'),
  1997. 'multiOptions' => array(
  1998. 1 => null,
  1999. ),
  2000. 'description' => sprintf(
  2001. $this->_('Check the above checkbox in order for emails sent between site users, together with sale notification emails to be sent '
  2002. . 'to the main admin email address as well (%s).'), $settings['admin_email']),
  2003. ),
  2004. /**
  2005. * ++++++++++++++
  2006. * RECENTLY VIEWED LISTINGS BOX
  2007. * ++++++++++++++
  2008. */
  2009. array(
  2010. 'form_id' => 'recently_viewed_listings',
  2011. 'id' => 'enable_recently_viewed_listings',
  2012. 'element' => 'checkbox',
  2013. 'label' => $this->_('Enable Recently Viewed Listings Box'),
  2014. 'multiOptions' => array(
  2015. 1 => null,
  2016. ),
  2017. 'description' => $this->_('Check the above checkbox to enable the recently viewed listings box, which will appear for users '
  2018. . 'by default in the footer of your website.'),
  2019. ),
  2020. array(
  2021. 'form_id' => 'recently_viewed_listings',
  2022. 'id' => 'enable_recently_viewed_listings_expiration',
  2023. 'element' => 'text',
  2024. 'label' => $this->_('Expiration Time'),
  2025. 'suffix' => $this->_('hours'),
  2026. 'description' => $this->_('Enter the number of hours after a listing will be removed from the recently viewed table.'),
  2027. 'required' => $this->getData('enable_recently_viewed_listings') ? true : false,
  2028. 'validators' => array(
  2029. 'Digits',
  2030. ),
  2031. 'attributes' => array(
  2032. 'class' => 'form-control input-mini',
  2033. ),
  2034. ),
  2035. /**
  2036. * ++++++++++++++
  2037. * BULK LISTER
  2038. * ++++++++++++++
  2039. */
  2040. array(
  2041. 'form_id' => 'bulk_lister',
  2042. 'id' => 'enable_bulk_lister',
  2043. 'element' => 'checkbox',
  2044. 'label' => $this->_('Enable Bulk Lister'),
  2045. 'multiOptions' => array(
  2046. 1 => null,
  2047. ),
  2048. 'description' => $this->_('Check the above checkbox to enable the bulk lister tool. The bulk lister will parse CSV files.'),
  2049. ),
  2050. /**
  2051. * ++++++++++++++
  2052. * NEWSLETTER SUBSCRIPTION BOX
  2053. * ++++++++++++++
  2054. */
  2055. array(
  2056. 'form_id' => 'newsletter_subscription_box',
  2057. 'id' => 'newsletter_subscription_box',
  2058. 'element' => 'checkbox',
  2059. 'label' => $this->_('Enable Newsletter Subscription Box'),
  2060. 'multiOptions' => array(
  2061. 1 => null,
  2062. ),
  2063. 'description' => $this->_('Check the above checkbox to enable the newsletter subscription box from the footer.'),
  2064. ),
  2065. /**
  2066. * ++++++++++++++
  2067. * ADULT CATEGORIES
  2068. * ++++++++++++++
  2069. */
  2070. array(
  2071. 'form_id' => 'adult_categories',
  2072. 'id' => 'enable_adult_categories',
  2073. 'element' => 'checkbox',
  2074. 'label' => $this->_('Enable Adult Categories'),
  2075. 'multiOptions' => array(
  2076. 1 => null,
  2077. ),
  2078. 'description' => $this->_('Check the above checkbox to enable the adult categories module.'),
  2079. ),
  2080. array(
  2081. 'form_id' => 'adult_categories',
  2082. 'id' => 'adult_categories_splash_page',
  2083. 'element' => 'checkbox',
  2084. 'label' => $this->_('Splash Page Custom Content'),
  2085. 'multiOptions' => array(
  2086. 1 => null,
  2087. ),
  2088. 'description' => $this->_('Check the above checkbox if you wish to use custom content for the adult categories splash page.'),
  2089. 'attributes' => array(
  2090. 'class' => 'field-changeable',
  2091. ),
  2092. 'bodyCode' => "
  2093. <script type=\"text/javascript\">
  2094. function checkAdultCategoriesFields()
  2095. {
  2096. if ($('input:checkbox[name=\"adult_categories_splash_page\"]').is(':checked')) {
  2097. $('[name=\"adult_categories_splash_page_content\"]').closest('.form-group').show();
  2098. }
  2099. else {
  2100. $('[name=\"adult_categories_splash_page_content\"]').closest('.form-group').hide();
  2101. }
  2102. }
  2103. $(document).ready(function() {
  2104. checkAdultCategoriesFields();
  2105. });
  2106. $(document).on('change', '.field-changeable', function() {
  2107. checkAdultCategoriesFields();
  2108. });
  2109. </script>"
  2110. ),
  2111. array(
  2112. 'form_id' => 'adult_categories',
  2113. 'id' => 'adult_categories_splash_page_content',
  2114. 'element' => '\\Ppb\\Form\\Element\\Wysiwyg',
  2115. 'label' => $this->_('Custom Content'),
  2116. 'description' => $this->_('Enter the custom content that will be displayed on the adult categories splash page.'),
  2117. 'required' => ($this->getData('adult_categories_splash_page')) ? true : false,
  2118. 'attributes' => array(
  2119. 'rows' => '12',
  2120. 'class' => 'form-control',
  2121. ),
  2122. ),
  2123. /**
  2124. * ++++++++++++++
  2125. * AUCTIONS SETTINGS
  2126. * ++++++++++++++
  2127. */
  2128. array(
  2129. 'form_id' => 'auctions_settings',
  2130. 'id' => 'enable_auctions',
  2131. 'element' => 'checkbox',
  2132. 'label' => $this->_('Enable Auctions'),
  2133. 'multiOptions' => array(
  2134. 1 => null,
  2135. ),
  2136. 'description' => $this->_('Check the above checkbox to enable the listing of auctions on your website.'),
  2137. 'required' => (!$settings['enable_products']) ? true : false,
  2138. ),
  2139. array(
  2140. 'form_id' => 'auctions_settings',
  2141. 'subtitle' => $this->_('Auctions Editing Time Limit'),
  2142. 'id' => 'auctions_editing_hours',
  2143. 'element' => 'text',
  2144. 'label' => $this->_('Time Limit'),
  2145. 'suffix' => $this->_('hours'),
  2146. 'description' => $this->_('If the remaining duration of an auction will be less than the above set time limit, the seller will not be allowed to edit it.'),
  2147. 'validators' => array(
  2148. 'Digits',
  2149. ),
  2150. 'attributes' => array(
  2151. 'class' => 'form-control input-mini',
  2152. ),
  2153. ),
  2154. array(
  2155. 'form_id' => 'auctions_settings',
  2156. 'subtitle' => $this->_('Auctions Sniping Feature'),
  2157. 'id' => 'enable_auctions_sniping',
  2158. 'element' => 'checkbox',
  2159. 'label' => $this->_('Enable Feature'),
  2160. 'multiOptions' => array(
  2161. 1 => null,
  2162. ),
  2163. 'description' => $this->_('If this feature is enabled, the duration of an auction will be extended if a bid is placed when the auction is about to close. '),
  2164. ),
  2165. array(
  2166. 'form_id' => 'auctions_settings',
  2167. 'id' => 'auctions_sniping_minutes',
  2168. 'element' => 'text',
  2169. 'label' => $this->_('Sniping Duration'),
  2170. 'suffix' => $this->_('minutes'),
  2171. 'description' => $this->_('If the remaining duration of an auction will be less than the above set duration, the time will be extended to the above setting.'),
  2172. 'required' => $this->getData('enable_auctions_sniping') ? true : false,
  2173. 'validators' => array(
  2174. 'Digits',
  2175. ),
  2176. 'attributes' => array(
  2177. 'class' => 'form-control input-mini',
  2178. ),
  2179. ),
  2180. array(
  2181. 'form_id' => 'auctions_settings',
  2182. 'subtitle' => $this->_('Bid Retraction'),
  2183. 'id' => 'enable_bid_retraction',
  2184. 'element' => 'checkbox',
  2185. 'label' => $this->_('Enable Feature'),
  2186. 'multiOptions' => array(
  2187. 1 => null,
  2188. ),
  2189. 'description' => $this->_('Check the above checkbox in order to allow bidders to retract their bids from auctions.'),
  2190. ),
  2191. array(
  2192. 'form_id' => 'auctions_settings',
  2193. 'id' => 'bid_retraction_hours',
  2194. 'element' => 'text',
  2195. 'label' => $this->_('Bid Retraction Limit'),
  2196. 'suffix' => $this->_('hours'),
  2197. 'description' => $this->_('Enter the minimum required time left on an auction for the bid retraction feature to be allowed.'),
  2198. 'required' => $this->getData('enable_auctions_sniping') ? true : false,
  2199. 'validators' => array(
  2200. 'Digits',
  2201. ),
  2202. 'attributes' => array(
  2203. 'class' => 'form-control input-mini',
  2204. ),
  2205. ),
  2206. array(
  2207. 'form_id' => 'auctions_settings',
  2208. 'subtitle' => $this->_('Change Auction Duration when a Bid is Placed'),
  2209. 'id' => 'enable_change_duration',
  2210. 'element' => 'checkbox',
  2211. 'label' => $this->_('Enable Feature'),
  2212. 'multiOptions' => array(
  2213. 1 => null,
  2214. ),
  2215. 'description' => $this->_('Check the above checkbox if you want for the auction duration to be changed after the first bid has been placed.'),
  2216. ),
  2217. array(
  2218. 'form_id' => 'auctions_settings',
  2219. 'id' => 'change_duration_days',
  2220. 'element' => 'text',
  2221. 'label' => $this->_('New Duration'),
  2222. 'suffix' => $this->_('days'),
  2223. 'description' => $this->_('If the duration left on the auction is over the value above, then it will be automatically reset to the value above.'),
  2224. 'required' => $this->getData('enable_change_duration') ? true : false,
  2225. 'validators' => array(
  2226. 'Digits',
  2227. ),
  2228. 'attributes' => array(
  2229. 'class' => 'form-control input-mini',
  2230. ),
  2231. ),
  2232. // array(
  2233. // 'form_id' => 'auctions_settings',
  2234. // 'subtitle' => $this->_('Second Chance Purchasing'),
  2235. // 'id' => 'second_chance_purchasing',
  2236. // 'element' => 'checkbox',
  2237. // 'label' => $this->_('Enable Feature'),
  2238. // 'multiOptions' => array(
  2239. // 1 => null,
  2240. // ),
  2241. // 'description' => $this->_('With second chance purchasing, sellers will be able to manually select a winner if the '
  2242. // . 'automatically appointed winner didn\'t complete the purchase.<br>'
  2243. // . '<b>Important</b>: This feature will be available for standard auctions not marked as paid only.'),
  2244. // ),
  2245. // array(
  2246. // 'form_id' => 'auctions_settings',
  2247. // 'id' => 'second_chance_purchasing_days',
  2248. // 'element' => 'text',
  2249. // 'label' => $this->_('Enter Interval'),
  2250. // 'suffix' => 'days',
  2251. // 'description' => $this->_('You can set a number of days after which the "Second Chance" feature will become available '
  2252. // . 'for sold items, or enter 0 if you wish for this feature to be available right away.'),
  2253. // 'validators' => array(
  2254. // 'Digits',
  2255. // ),
  2256. // 'attributes' => array(
  2257. // 'class' => 'form-control input-mini',
  2258. // ),
  2259. // ),
  2260. array(
  2261. 'form_id' => 'auctions_settings',
  2262. 'subtitle' => $this->_('Close Auctions Before End Time'),
  2263. 'id' => 'close_auctions_end_time',
  2264. 'element' => 'checkbox',
  2265. 'label' => $this->_('Enable Feature'),
  2266. 'multiOptions' => array(
  2267. 1 => null,
  2268. ),
  2269. 'description' => $this->_('If this setting is enabled, sellers will be able to close their auctions early even if there is a high bid placed. <br>'
  2270. . 'By default, auctions can be closed ahead of the closing date only if there are no bids or if the high bid is '
  2271. . 'lower than the reserve price.'),
  2272. ),
  2273. array(
  2274. 'form_id' => 'auctions_settings',
  2275. 'subtitle' => $this->_('Proxy Bidding'),
  2276. 'id' => 'proxy_bidding',
  2277. 'element' => 'checkbox',
  2278. 'label' => $this->_('Enable Feature'),
  2279. 'multiOptions' => array(
  2280. 1 => null,
  2281. ),
  2282. 'description' => $this->_('If this setting is enabled, bidders will be able to place a maximum bid on an auction, but the active bid set will be the '
  2283. . 'minimum amount required for them to be high bidders.<br>'
  2284. . '<a href="http://en.wikipedia.org/wiki/Proxy_bid" target="_blank">Click here</a> for more information on this feature.'),
  2285. ),
  2286. array(
  2287. 'form_id' => 'auctions_settings',
  2288. 'subtitle' => $this->_('Limit Number of Bids / Offers per User'),
  2289. 'id' => 'enable_limit_bids',
  2290. 'element' => 'checkbox',
  2291. 'label' => $this->_('Enable Feature'),
  2292. 'multiOptions' => array(
  2293. 1 => null,
  2294. ),
  2295. 'description' => $this->_('If you enable this feature, your sellers will be able to limit the number of bids and/or offers a bidder can '
  2296. . 'place on an auction (proxy bids are not taken into consideration).'),
  2297. ),
  2298. /**
  2299. * ++++++++++++++
  2300. * PRODUCTS SETTINGS
  2301. * ++++++++++++++
  2302. */
  2303. array(
  2304. 'form_id' => 'products_settings',
  2305. 'id' => 'enable_products',
  2306. 'element' => 'checkbox',
  2307. 'label' => $this->_('Enable Products'),
  2308. 'multiOptions' => array(
  2309. 1 => null,
  2310. ),
  2311. 'description' => $this->_('Check the above checkbox to enable the listing of products (items with fixed price) on your website.'),
  2312. 'required' => (!$settings['enable_auctions']) ? true : false,
  2313. ),
  2314. array(
  2315. 'form_id' => 'products_settings',
  2316. 'subtitle' => $this->_('Unlimited Duration'),
  2317. 'id' => 'enable_unlimited_duration',
  2318. 'element' => 'checkbox',
  2319. 'label' => $this->_('Enable Unlimited Duration'),
  2320. 'multiOptions' => array(
  2321. 1 => null,
  2322. ),
  2323. 'description' => $this->_('If unlimited duration is enabled, sellers will be able to list products without a closing date.'),
  2324. ),
  2325. array(
  2326. 'form_id' => 'products_settings',
  2327. 'id' => 'force_unlimited_duration',
  2328. 'element' => 'checkbox',
  2329. 'label' => $this->_('Force Unlimited Duration'),
  2330. 'multiOptions' => array(
  2331. 1 => null,
  2332. ),
  2333. 'description' => $this->_('With this option enabled, sellers will only be able to list products with no closing date.'),
  2334. ),
  2335. array(
  2336. 'form_id' => 'products_settings',
  2337. 'subtitle' => $this->_('Shopping Cart'),
  2338. 'id' => 'enable_shopping_cart',
  2339. 'element' => 'checkbox',
  2340. 'label' => $this->_('Enable Shopping Cart'),
  2341. 'multiOptions' => array(
  2342. 1 => null,
  2343. ),
  2344. 'description' => $this->_('Check the above checkbox to enable the shopping cart feature.'),
  2345. ),
  2346. array(
  2347. 'form_id' => 'products_settings',
  2348. 'id' => 'shopping_cart_applies',
  2349. 'element' => 'radio',
  2350. 'label' => $this->_('Shopping Cart Applies'),
  2351. 'multiOptions' => array(
  2352. 'global' => array(
  2353. $translate->_('Globally'),
  2354. $translate->_('The shopping cart will be used for all products listed on the site.'),
  2355. ),
  2356. 'store_owners' => array(
  2357. $translate->_('Store Owners'),
  2358. $translate->_('The shopping cart will be used for products listed by store owners only.')
  2359. ),
  2360. 'store_listings' => array(
  2361. $translate->_('Store Listings'),
  2362. $translate->_('The shopping cart will be used only for products listed in stores.'),
  2363. ),
  2364. ),
  2365. 'description' => $this->_('Select when the shopping cart module will be used.'),
  2366. ),
  2367. array(
  2368. 'form_id' => 'products_settings',
  2369. 'id' => 'pending_sales_listings_expire_hours',
  2370. 'element' => 'text',
  2371. 'label' => $this->_('Reserve Stock'),
  2372. // 'prefix' => $this->_('after'),
  2373. 'suffix' => $this->_('minutes'),
  2374. 'description' => $this->_('Enter the duration for which products added in a shopping cart have their stock reserved, or leave empty to disable this feature.'),
  2375. 'validators' => array(
  2376. 'Digits',
  2377. ),
  2378. 'attributes' => array(
  2379. 'class' => 'form-control input-mini',
  2380. ),
  2381. ),
  2382. array(
  2383. 'form_id' => 'products_settings',
  2384. 'subtitle' => $this->_('Force Payment'),
  2385. 'id' => ($settings['enable_products']) ? 'enable_force_payment' : false,
  2386. 'element' => 'checkbox',
  2387. 'label' => $this->_('Enable Force Payment'),
  2388. 'multiOptions' => array(
  2389. 1 => null,
  2390. ),
  2391. 'description' => $this->_('If enabled, a sale will be completed only when the sale is marked as paid.'),
  2392. ),
  2393. array(
  2394. 'form_id' => 'products_settings',
  2395. 'id' => 'force_payment_limit',
  2396. 'element' => 'text',
  2397. 'label' => $this->_('Force Payment Time Limit'),
  2398. 'suffix' => $this->_('minutes'),
  2399. 'description' => $this->_('Enter the time limit after which unpaid sales are reverted.'),
  2400. 'required' => true,
  2401. 'validators' => array(
  2402. 'Digits',
  2403. ),
  2404. 'attributes' => array(
  2405. 'class' => 'form-control input-mini',
  2406. ),
  2407. ),
  2408. /**
  2409. * ++++++++++++++
  2410. * BUY OUT FEATURE
  2411. * ++++++++++++++
  2412. */
  2413. array(
  2414. 'form_id' => 'buy_out',
  2415. 'id' => 'enable_buyout',
  2416. 'element' => 'checkbox',
  2417. 'label' => $this->_('Enable Buy Out'),
  2418. 'multiOptions' => array(
  2419. 1 => null,
  2420. ),
  2421. 'description' => $this->_('Check the above checkbox to enable buy out feature for auctions.'),
  2422. 'required' => (!$settings['enable_auctions'] && !$settings['enable_make_offer']) ? true : false,
  2423. ),
  2424. array(
  2425. 'form_id' => 'buy_out',
  2426. 'id' => 'always_show_buyout',
  2427. 'element' => 'checkbox',
  2428. 'label' => $this->_('Always Show Buy Out Button'),
  2429. 'multiOptions' => array(
  2430. 1 => null,
  2431. ),
  2432. 'description' => $this->_('If this setting is enabled, when listing an auction with buy out enabled, the option will remain active even if there are bids above the reserve price posted.'),
  2433. ),
  2434. /**
  2435. * ++++++++++++++
  2436. * MAKE OFFER FEATURE
  2437. * ++++++++++++++
  2438. */
  2439. array(
  2440. 'form_id' => 'make_offer',
  2441. 'id' => 'enable_make_offer',
  2442. 'element' => 'checkbox',
  2443. 'label' => $this->_('Enable Make Offer'),
  2444. 'multiOptions' => array(
  2445. 1 => null,
  2446. ),
  2447. 'description' => $this->_('Check the above checkbox to enable the make offer feature for auctions and products.'),
  2448. ),
  2449. array(
  2450. 'form_id' => 'make_offer',
  2451. 'id' => 'show_make_offer_ranges',
  2452. 'element' => 'checkbox',
  2453. 'label' => $this->_('Show Offer Ranges'),
  2454. 'multiOptions' => array(
  2455. 1 => null,
  2456. ),
  2457. 'description' => $this->_('With this option enabled, the allowed offer ranges set by the seller will be displayed on the listing details page.'),
  2458. ),
  2459. /**
  2460. * ++++++++++++++
  2461. * ITEMS SWAPPING FEATURE
  2462. * ++++++++++++++
  2463. */
  2464. array(
  2465. 'form_id' => 'items_swapping',
  2466. 'id' => 'enable_swap',
  2467. 'element' => 'checkbox',
  2468. 'label' => $this->_('Enable Items Swapping Feature'),
  2469. 'multiOptions' => array(
  2470. 1 => null,
  2471. ),
  2472. 'description' => $this->_('Check the above checkbox to enable the items swapping feature for auctions and products.'),
  2473. ),
  2474. /**
  2475. * ++++++++++++++
  2476. * SHIPPING SETTINGS
  2477. * ++++++++++++++
  2478. */
  2479. array(
  2480. 'form_id' => 'shipping_settings',
  2481. 'id' => 'enable_shipping',
  2482. 'element' => 'checkbox',
  2483. 'label' => $this->_('Enable Shipping Module'),
  2484. 'multiOptions' => array(
  2485. 1 => null,
  2486. ),
  2487. 'description' => $this->_('Check the above checkbox to enable the shipping module on the site.'),
  2488. 'attributes' => array(
  2489. 'id' => 'enable_shipping',
  2490. 'onclick' => 'javascript:checkShippingFields();',
  2491. ),
  2492. 'bodyCode' => "
  2493. <script type=\"text/javascript\">
  2494. function checkShippingFields() {
  2495. if ($('#enable_shipping').is(':checked')) {
  2496. $('.shipping-options').closest('.form-group').show();
  2497. }
  2498. else {
  2499. $('.shipping-options').prop('checked', false).closest('.form-group').hide();
  2500. }
  2501. }
  2502. $(document).ready(function() {
  2503. checkShippingFields();
  2504. });
  2505. </script>",
  2506. ),
  2507. array(
  2508. 'form_id' => 'shipping_settings',
  2509. 'id' => 'enable_pickups',
  2510. 'element' => 'checkbox',
  2511. 'label' => $this->_('Enable Pick-ups Option'),
  2512. 'multiOptions' => array(
  2513. 1 => null,
  2514. ),
  2515. 'description' => $this->_('Check the above checkbox to allow sellers to enable the pick-up option for their items.'),
  2516. 'attributes' => array(
  2517. 'class' => 'shipping-options',
  2518. ),
  2519. ),
  2520. array(
  2521. 'form_id' => 'shipping_settings',
  2522. 'id' => 'enable_returns',
  2523. 'element' => 'checkbox',
  2524. 'label' => $this->_('Enable Returns Option'),
  2525. 'multiOptions' => array(
  2526. 1 => null,
  2527. ),
  2528. 'description' => $this->_('Check the above checkbox to allow sellers to specify a returns policy for their items.'),
  2529. 'attributes' => array(
  2530. 'class' => 'shipping-options',
  2531. ),
  2532. ),
  2533. /**
  2534. * ++++++++++++++
  2535. * AUTO RELISTS SETTINGS
  2536. * ++++++++++++++
  2537. */
  2538. array(
  2539. 'form_id' => 'auto_relists',
  2540. 'id' => 'auto_relist',
  2541. 'element' => 'checkbox',
  2542. 'label' => $this->_('Enable Auto Relists'),
  2543. 'multiOptions' => array(
  2544. 1 => null,
  2545. ),
  2546. 'description' => $this->_('Check the above checkbox to enable the auto relists feature.'),
  2547. ),
  2548. array(
  2549. 'form_id' => 'auto_relists',
  2550. 'id' => 'max_auto_relists',
  2551. 'element' => 'text',
  2552. 'label' => $this->_('Maximum Auto Relists Allowed'),
  2553. 'description' => $this->_('Enter the maximum number of auto relists that can be entered when a listing is created.'),
  2554. 'validators' => array(
  2555. 'Digits',
  2556. ),
  2557. 'attributes' => array(
  2558. 'class' => 'form-control input-mini',
  2559. ),
  2560. ),
  2561. array(
  2562. 'form_id' => 'auto_relists',
  2563. 'id' => 'relist_method',
  2564. 'element' => 'select',
  2565. 'label' => $this->_('Relist Method'),
  2566. 'description' => $this->_('Select the method of relisting that will be applied for your listings:<br>'
  2567. . '- New: a new record will be created, and the old listing will be marked deleted<br>'
  2568. . '- Same: the same listing will be re-opened, and any sales, bids etc will be removed'),
  2569. 'multiOptions' => array(
  2570. 'new' => 'New',
  2571. 'same' => 'Same',
  2572. ),
  2573. 'attributes' => array(
  2574. 'class' => 'form-control input-small',
  2575. ),
  2576. ),
  2577. /**
  2578. * ++++++++++++++
  2579. * MARKED DELETED LISTINGS REMOVAL
  2580. * ++++++++++++++
  2581. */
  2582. array(
  2583. 'form_id' => 'marked_deleted',
  2584. 'id' => 'marked_deleted_listings_removal',
  2585. 'element' => 'checkbox',
  2586. 'label' => $this->_('Automatic Marked Deleted Listings Removal'),
  2587. 'multiOptions' => array(
  2588. 1 => null,
  2589. ),
  2590. 'description' => $this->_('Check the above checkbox to enable the automatic removal of marked deleted listings.<br>'
  2591. . '<b>Note</b>: The process will be run using the cron service.'),
  2592. ),
  2593. /**
  2594. * ++++++++++++++
  2595. * CLOSED LISTINGS DELETION
  2596. * ++++++++++++++
  2597. */
  2598. array(
  2599. 'form_id' => 'closed_listings_deletion',
  2600. 'id' => 'closed_listings_deletion_days',
  2601. 'element' => 'text',
  2602. 'label' => $this->_('Closed Listings Deletion'),
  2603. 'suffix' => $this->_('days'),
  2604. 'description' => $this->_('Enter a duration in days after which closed listings should be automatically marked deleted, or leave empty to disable this feature.'),
  2605. 'attributes' => array(
  2606. 'class' => 'form-control input-mini',
  2607. ),
  2608. 'validators' => array(
  2609. 'Digits',
  2610. ),
  2611. ),
  2612. /**
  2613. * ++++++++++++++
  2614. * USERS MESSAGING
  2615. * ++++++++++++++
  2616. */
  2617. array(
  2618. 'form_id' => 'users_messaging',
  2619. 'id' => 'enable_messaging',
  2620. 'element' => 'checkbox',
  2621. 'label' => $this->_('Enable Messaging'),
  2622. 'multiOptions' => array(
  2623. 1 => null,
  2624. ),
  2625. 'description' => $this->_('Check the above checkbox to enable the users messaging module.<br>'
  2626. . '<b>Note</b>: All messages sent through the site can be read/managed by the administrator from the Tools -> Messages page.'),
  2627. ),
  2628. array(
  2629. 'form_id' => 'users_messaging',
  2630. 'id' => 'enable_public_questions',
  2631. 'element' => 'checkbox',
  2632. 'label' => $this->_('Enable Public Questions'),
  2633. 'multiOptions' => array(
  2634. 1 => null,
  2635. ),
  2636. 'description' => $this->_('To enable the posting of public questions on listings, you can check the checkbox above.<br>'
  2637. . 'By default, only private questions on listings will be allowed.'),
  2638. ),
  2639. /**
  2640. * ++++++++++++++
  2641. * ADDITIONAL CATEGORY LISTING
  2642. * ++++++++++++++
  2643. */
  2644. array(
  2645. 'form_id' => 'additional_category_listing',
  2646. 'id' => 'addl_category_listing',
  2647. 'element' => 'checkbox',
  2648. 'label' => $this->_('Enable Feature'),
  2649. 'multiOptions' => array(
  2650. 1 => null,
  2651. ),
  2652. 'description' => $this->_('Check the above checkbox to enable the listing of items in an additional category.'),
  2653. ),
  2654. /**
  2655. * ++++++++++++++
  2656. * LISTINGS COUNTERS
  2657. * ++++++++++++++
  2658. */
  2659. array(
  2660. 'form_id' => 'listings_counters',
  2661. 'id' => 'category_counters',
  2662. 'element' => 'checkbox',
  2663. 'label' => $this->_('Category Counters'),
  2664. 'multiOptions' => array(
  2665. 1 => null,
  2666. ),
  2667. 'description' => $this->_('Check the above checkbox to enable the display of category counters on selected pages. <br>'
  2668. . 'Counters are updated only using the cron job. If they are out of sync, please use the initialization tool below.'),
  2669. ),
  2670. // array(
  2671. // 'form_id' => 'listings_counters',
  2672. // 'id' => 'search_counters',
  2673. // 'element' => 'checkbox',
  2674. // 'label' => $this->_('Search Filter Counters'),
  2675. // 'multiOptions' => array(
  2676. // 1 => null,
  2677. // ),
  2678. // 'description' => $this->_('Check the above checkbox to enable the display of listings counters on the search browse pages. The counters will '
  2679. // . 'display for categories and any custom fields for which this setting can be applied.<br>'
  2680. // . '<b>Important</b>: This functionality may increase your server load on larger sites, VPS or dedicated hosting is highly recommended.'),
  2681. // ),
  2682. array(
  2683. 'form_id' => 'listings_counters',
  2684. 'id' => 'hide_empty_categories',
  2685. 'element' => 'checkbox',
  2686. 'label' => $this->_('Hide Empty Categories/Options'),
  2687. 'multiOptions' => array(
  2688. 1 => null,
  2689. ),
  2690. 'description' => $this->_('Check the above checkbox to hide categories or filtering options that do not contain any listings.'),
  2691. ),
  2692. array(
  2693. 'form_id' => 'listings_counters',
  2694. 'id' => 'init_category_counters',
  2695. 'element' => 'button',
  2696. 'label' => $this->_('Initialize Counters'),
  2697. 'value' => $this->_('Initialize'),
  2698. 'description' => sprintf(
  2699. $translate->_('Click on the button above to initialize your site\'s category counters.'
  2700. . '<div>There are a total of <span id="category-total-listings">%s</span> listings to be counted.</div>'), $totalListings)
  2701. . '<div id="category-counters-progress" class="text-info"></div>',
  2702. 'attributes' => array(
  2703. 'class' => 'btn btn-default',
  2704. ),
  2705. ),
  2706. /**
  2707. * ++++++++++++++
  2708. * LISTINGS TERMS & CONDITIONS BOX
  2709. * ++++++++++++++
  2710. */
  2711. array(
  2712. 'form_id' => 'listing_terms_box',
  2713. 'id' => 'listing_terms_box',
  2714. 'element' => 'checkbox',
  2715. 'label' => $this->_('Show Listing Terms & Conditions Box'),
  2716. 'multiOptions' => array(
  2717. 1 => null,
  2718. ),
  2719. 'description' => $this->_('Check the above checkbox to display the listing terms and conditions box on the listing setup process.'),
  2720. ),
  2721. array(
  2722. 'form_id' => 'listing_terms_box',
  2723. 'id' => 'listing_terms_content',
  2724. 'element' => 'textarea',
  2725. 'label' => $this->_('Content'),
  2726. 'description' => $this->_('Enter the terms and conditions that will be displayed in the box.'),
  2727. 'validators' => array(
  2728. 'NoHtml',
  2729. ),
  2730. 'attributes' => array(
  2731. 'rows' => '12',
  2732. 'class' => 'form-control',
  2733. ),
  2734. ),
  2735. /**
  2736. * ++++++++++++++
  2737. * USERS PHONE NUMBERS ON SUCCESSFUL SALES
  2738. * ++++++++++++++
  2739. */
  2740. array(
  2741. 'form_id' => 'user_phone_numbers',
  2742. 'id' => 'sale_phone_numbers',
  2743. 'element' => 'checkbox',
  2744. 'label' => $this->_('Enable Feature'),
  2745. 'multiOptions' => array(
  2746. 1 => null,
  2747. ),
  2748. 'description' => $this->_('Check the above checkbox to show the phone numbers of users when displaying their full addresses.'),
  2749. ),
  2750. /**
  2751. * ++++++++++++++
  2752. * SELLER'S OTHER ITEMS BOX
  2753. * ++++++++++++++
  2754. */
  2755. array(
  2756. 'form_id' => 'other_items_seller',
  2757. 'id' => 'other_items_seller',
  2758. 'element' => 'checkbox',
  2759. 'label' => $this->_('Enable Feature'),
  2760. 'multiOptions' => array(
  2761. 1 => null,
  2762. ),
  2763. 'description' => $this->_('Check the above checkbox to enable the display of the other items from the seller box on the listing details pages.'),
  2764. ),
  2765. // /**
  2766. // * ++++++++++++++
  2767. // * REVERSE AUCTIONS
  2768. // * ++++++++++++++
  2769. // */
  2770. // array(
  2771. // 'form_id' => 'reverse_auctions_settings',
  2772. // 'id' => 'enable_reverse_auctions',
  2773. // 'element' => 'checkbox',
  2774. // 'label' => 'Enable Reverse Auctions',
  2775. // 'multiOptions' => array(
  2776. // 1 => null,
  2777. // ),
  2778. // 'description' => 'Check the above checkbox to display the listing of reverse auctions on your website.<br>
  2779. // <b>Explanation</b><br>
  2780. // In a reverse auction, the roles of the buyer and seller are inversed. <br>
  2781. // Sellers can make a single bid on a reverse auction, the bid amount however can be edited at any time until the auction closes.<br>
  2782. // After the auction has closed, the buyer will manually award the winning bid.',
  2783. // ),
  2784. // /**
  2785. // * ++++++++++++++
  2786. // * WANTED ADS
  2787. // * ++++++++++++++
  2788. // */
  2789. // array(
  2790. // 'form_id' => 'wanted_ads_settings',
  2791. // 'id' => 'enable_wanted_ads',
  2792. // 'element' => 'checkbox',
  2793. // 'label' => 'Enable Wanted Ads',
  2794. // 'multiOptions' => array(
  2795. // 1 => null,
  2796. // ),
  2797. // 'description' => 'Check the above checkbox to display the listing of wanted ads on your website.',
  2798. // ),
  2799. // /**
  2800. // * ++++++++++++++
  2801. // * FIRST BIDDER AUCTIONS
  2802. // * ++++++++++++++
  2803. // */
  2804. // array(
  2805. // 'form_id' => 'first_bidder_auctions_settings',
  2806. // 'id' => 'enable_first_bidder_auctions',
  2807. // 'element' => 'checkbox',
  2808. // 'label' => 'Enable First Bidder Auctions',
  2809. // 'multiOptions' => array(
  2810. // 1 => null,
  2811. // ),
  2812. // 'description' => 'Check the above checkbox to display the listing of first bidder auctions on your website.<br>
  2813. // <b>Explanation</b><br>
  2814. // In a first bidder auction, the bid decreases automatically periodically, with an amount set by the poster.<br>
  2815. // The first user who bids on the auction will win. Users can only bid the current active bid amount, which is set automatically.',
  2816. // ),
  2817. /**
  2818. * ++++++++++++++
  2819. * STORES SETTINGS
  2820. * ++++++++++++++
  2821. */
  2822. array(
  2823. 'form_id' => 'stores_settings',
  2824. 'id' => 'enable_stores',
  2825. 'element' => 'checkbox',
  2826. 'label' => $this->_('Enable Stores'),
  2827. 'multiOptions' => array(
  2828. 1 => null,
  2829. ),
  2830. 'disabled' => ($settings['enable_products']) ? false : true,
  2831. 'description' => $this->_('Check the above checkbox to enable the stores module on your website.<br>'
  2832. . '<b>Important</b>: Only products can be listed in store. If the listing of products is disabled, stores will be disabled as well.'),
  2833. ),
  2834. array(
  2835. 'form_id' => 'stores_settings',
  2836. 'id' => 'hide_empty_stores',
  2837. 'element' => 'checkbox',
  2838. 'label' => $this->_('Hide Empty Stores'),
  2839. 'multiOptions' => array(
  2840. 1 => null,
  2841. ),
  2842. 'description' => $this->_('Check the above checkbox in order for stores with no items to be hidden when accessing the stores browse page.'),
  2843. ),
  2844. array(
  2845. 'form_id' => 'stores_settings',
  2846. 'id' => 'store_only_mode',
  2847. 'element' => 'checkbox',
  2848. 'label' => $this->_('Enable Store Only Mode'),
  2849. 'multiOptions' => array(
  2850. 1 => null,
  2851. ),
  2852. 'description' => $this->_('Check the above checkbox to enable the store only mode functionality. <br>'
  2853. . 'With this mode enabled, users will need to open a store in order to be able to list items.'),
  2854. ),
  2855. array(
  2856. 'form_id' => 'stores_settings',
  2857. 'id' => 'custom_stores_categories',
  2858. 'element' => 'checkbox',
  2859. 'label' => $this->_('Custom Stores Categories'),
  2860. 'multiOptions' => array(
  2861. 1 => null,
  2862. ),
  2863. 'description' => $this->_('Check the above checkbox to enable allow your users to create their own custom categories.'),
  2864. ),
  2865. array(
  2866. 'form_id' => 'stores_settings',
  2867. 'id' => 'enable_auctions_in_stores',
  2868. 'element' => 'checkbox',
  2869. 'label' => $this->_('Allow Auctions in Stores'),
  2870. 'multiOptions' => array(
  2871. 1 => null,
  2872. ),
  2873. 'description' => $this->_('Check the above checkbox to allow your users to list auctions in their stores. '
  2874. . 'By default, only products can be listed in stores.'),
  2875. ),
  2876. array(
  2877. 'form_id' => 'stores_settings',
  2878. 'id' => 'stores_force_list_in_both',
  2879. 'element' => 'checkbox',
  2880. 'label' => $this->_('Disable List In Select Box'),
  2881. 'multiOptions' => array(
  2882. 1 => null,
  2883. ),
  2884. 'description' => $this->_('Check the above checkbox to disable the "List In" selector. '
  2885. . 'All listings in this case will be listed in both the site and store.'),
  2886. ),
  2887. array(
  2888. 'form_id' => 'stores_settings',
  2889. 'id' => 'force_stores',
  2890. 'element' => 'text',
  2891. 'label' => $this->_('Force Stores'),
  2892. 'suffix' => $this->_('listings'),
  2893. 'description' => $this->_('Enter a number of listings that a seller is allowed to list before being required to open a store, or leave empty to disable this feature.'),
  2894. 'attributes' => array(
  2895. 'class' => 'form-control input-mini',
  2896. ),
  2897. 'validators' => array(
  2898. 'Digits',
  2899. ),
  2900. ),
  2901. /**
  2902. * ++++++++++++++
  2903. * TAX SETTINGS
  2904. * ++++++++++++++
  2905. */
  2906. array(
  2907. 'form_id' => 'tax_settings',
  2908. 'id' => 'enable_tax_fees',
  2909. 'element' => 'checkbox',
  2910. 'label' => $this->_('Enable Tax on Site Fees'),
  2911. 'multiOptions' => array(
  2912. 1 => null,
  2913. ),
  2914. 'description' => $this->_('Check the above checkbox to enable tax for site fees.'),
  2915. ),
  2916. array(
  2917. 'form_id' => 'tax_settings',
  2918. 'id' => 'tax_fees_type',
  2919. 'element' => 'select',
  2920. 'label' => $this->_('Tax Type'),
  2921. 'description' => $this->_('Select the tax that will be applied for site fees.'),
  2922. 'multiOptions' => $this->getTaxTypes()->getMultiOptions(),
  2923. 'attributes' => array(
  2924. 'class' => 'form-control input-large',
  2925. ),
  2926. ),
  2927. array(
  2928. 'form_id' => 'tax_settings',
  2929. 'id' => 'enable_tax_listings',
  2930. 'element' => 'checkbox',
  2931. 'label' => $this->_('Allow Sellers to Apply Tax'),
  2932. 'multiOptions' => array(
  2933. 1 => null,
  2934. ),
  2935. 'description' => $this->_('Check the above checkbox to allow sellers to apply tax on their listings.'),
  2936. ),
  2937. /**
  2938. * --------------
  2939. * SITE FEES MANAGEMENT
  2940. * --------------
  2941. */
  2942. array(
  2943. 'form_id' => 'fees_category',
  2944. 'id' => 'category_id',
  2945. 'element' => 'select',
  2946. 'label' => $this->_('Select Category'),
  2947. 'multiOptions' => $this->getCategories()->getMultiOptions("parent_id IS NULL AND custom_fees='1'", null,
  2948. $translate->_('Default')),
  2949. 'attributes' => array(
  2950. 'class' => 'form-control input-medium',
  2951. 'id' => 'category-selector',
  2952. ),
  2953. 'bodyCode' => "
  2954. <script type=\"text/javascript\">
  2955. $(document).ready(function() {
  2956. $('#category-selector').change(function() {
  2957. var categoryId = $(this).val();
  2958. var action = $(this).closest('form').attr('action');
  2959. var url = action.replace(/(\/category_id)(\/[0-9]+)/g, '');
  2960. $(location).attr('href', url + '/category_id/' + categoryId);
  2961. });
  2962. });
  2963. </script>",
  2964. ),
  2965. /**
  2966. * ++++++++++++++
  2967. * USER SIGN-UP
  2968. * ++++++++++++++
  2969. */
  2970. array(
  2971. 'form_id' => 'signup',
  2972. 'id' => Fees::SIGNUP,
  2973. 'element' => '\\Ppb\\Form\\Element\\LocalizedNumeric',
  2974. 'label' => $this->_('User Signup Fee'),
  2975. 'prefix' => $settings['currency'],
  2976. 'description' => $this->_('Enter an amount in the box above if you wish to charge your users for signing up on the site.'),
  2977. 'attributes' => array(
  2978. 'class' => 'form-control input-mini',
  2979. ),
  2980. 'validators' => array(
  2981. 'Numeric',
  2982. ),
  2983. 'filters' => array(
  2984. '\\Ppb\\Filter\\LocalizedNumeric',
  2985. ),
  2986. ),
  2987. /**
  2988. * ++++++++++++++
  2989. * SALE FEE PAYER RADIO BUTTON
  2990. * ++++++++++++++
  2991. */
  2992. array(
  2993. 'form_id' => 'sale',
  2994. 'id' => 'sale_fee_payer',
  2995. 'element' => 'radio',
  2996. 'label' => $this->_('Paid By'),
  2997. 'multiOptions' => array(
  2998. 'buyer' => array(
  2999. $translate->_('Buyer'),
  3000. ),
  3001. 'seller' => array(
  3002. $translate->_('Seller'),
  3003. ),
  3004. ),
  3005. 'description' => $this->_('Select which party would pay for the sale transaction fee.'),
  3006. ),
  3007. /**
  3008. * ++++++++++++++
  3009. * TIERS FEES TABLES
  3010. * ++++++++++++++
  3011. */
  3012. array(
  3013. 'form_id' => 'tiers',
  3014. 'id' => 'id',
  3015. 'element' => 'hidden',
  3016. 'multiple' => true,
  3017. ),
  3018. array(
  3019. 'form_id' => 'tiers',
  3020. 'id' => 'delete',
  3021. 'element' => 'checkbox',
  3022. 'multiple' => true,
  3023. ),
  3024. array(
  3025. 'form_id' => 'tiers',
  3026. 'id' => 'amount',
  3027. 'element' => '\\Ppb\\Form\\Element\\LocalizedNumeric',
  3028. 'label' => $this->_('Fee Amount'),
  3029. 'multiple' => true,
  3030. 'attributes' => array(
  3031. 'class' => 'form-control input-mini',
  3032. ),
  3033. 'validators' => array(// 'Numeric',
  3034. ),
  3035. 'filters' => array(
  3036. '\\Ppb\\Filter\\LocalizedNumeric',
  3037. ),
  3038. ),
  3039. array(
  3040. 'form_id' => 'tiers',
  3041. 'id' => 'calculation_type',
  3042. 'element' => 'select',
  3043. 'label' => $this->_('Calculation Type'),
  3044. 'multiple' => true,
  3045. 'multiOptions' => array(
  3046. 'flat' => $settings['currency'],
  3047. 'percent' => '%',
  3048. ),
  3049. 'attributes' => array(
  3050. 'class' => 'form-control input-small',
  3051. 'size' => 1,
  3052. ),
  3053. ),
  3054. array(
  3055. 'form_id' => 'tiers',
  3056. 'id' => 'tier_from',
  3057. 'element' => '\\Ppb\\Form\\Element\\LocalizedNumeric',
  3058. 'label' => $this->_('Range From'),
  3059. 'multiple' => true,
  3060. 'prefix' => $settings['currency'],
  3061. 'attributes' => array(
  3062. 'class' => 'form-control input-small',
  3063. ),
  3064. 'validators' => array(// 'Numeric',
  3065. ),
  3066. 'filters' => array(
  3067. '\\Ppb\\Filter\\LocalizedNumeric',
  3068. ),
  3069. ),
  3070. array(
  3071. 'form_id' => 'tiers',
  3072. 'id' => 'tier_to',
  3073. 'element' => '\\Ppb\\Form\\Element\\LocalizedNumeric',
  3074. 'label' => $this->_('Range To'),
  3075. 'multiple' => true,
  3076. 'prefix' => $settings['currency'],
  3077. 'attributes' => array(
  3078. 'class' => 'form-control input-small',
  3079. ),
  3080. 'validators' => array(// 'Numeric',
  3081. ),
  3082. 'filters' => array(
  3083. '\\Ppb\\Filter\\LocalizedNumeric',
  3084. ),
  3085. ),
  3086. /**
  3087. * ++++++++++++++
  3088. * HOME PAGE FEATURED LISTINGS
  3089. * ++++++++++++++
  3090. */
  3091. array(
  3092. 'form_id' => 'hpfeat',
  3093. 'id' => Fees::HPFEAT,
  3094. 'element' => '\\Ppb\\Form\\Element\\LocalizedNumeric',
  3095. 'label' => $this->_('Home Page Featured Fee'),
  3096. 'prefix' => $settings['currency'],
  3097. 'description' => $this->_('Enter a fee that will apply when listing home page featured items.'),
  3098. 'attributes' => array(
  3099. 'class' => 'form-control input-mini',
  3100. ),
  3101. 'validators' => array(
  3102. 'Numeric',
  3103. ),
  3104. 'filters' => array(
  3105. '\\Ppb\\Filter\\LocalizedNumeric',
  3106. ),
  3107. ),
  3108. /**
  3109. * ++++++++++++++
  3110. * CATEGORY PAGES FEATURED LISTINGS
  3111. * ++++++++++++++
  3112. */
  3113. array(
  3114. 'form_id' => 'catfeat',
  3115. 'id' => Fees::CATFEAT,
  3116. 'element' => '\\Ppb\\Form\\Element\\LocalizedNumeric',
  3117. 'label' => $this->_('Category Pages Featured Fee'),
  3118. 'prefix' => $settings['currency'],
  3119. 'description' => $this->_('Enter a fee that will apply when listing category pages featured items.'),
  3120. 'attributes' => array(
  3121. 'class' => 'form-control input-mini',
  3122. ),
  3123. 'validators' => array(
  3124. 'Numeric',
  3125. ),
  3126. 'filters' => array(
  3127. '\\Ppb\\Filter\\LocalizedNumeric',
  3128. ),
  3129. ),
  3130. /**
  3131. * ++++++++++++++
  3132. * HIGHLIGHTED LISTINGS
  3133. * ++++++++++++++
  3134. */
  3135. array(
  3136. 'form_id' => 'highlighted',
  3137. 'id' => Fees::HIGHLIGHTED,
  3138. 'element' => '\\Ppb\\Form\\Element\\LocalizedNumeric',
  3139. 'label' => $this->_('Highlighted Listing Fee'),
  3140. 'prefix' => $settings['currency'],
  3141. 'description' => $this->_('Enter a fee that will apply when enabling the highlighted listing feature.'),
  3142. 'attributes' => array(
  3143. 'class' => 'form-control input-mini',
  3144. ),
  3145. 'validators' => array(
  3146. 'Numeric',
  3147. ),
  3148. 'filters' => array(
  3149. '\\Ppb\\Filter\\LocalizedNumeric',
  3150. ),
  3151. ),
  3152. /**
  3153. * ++++++++++++++
  3154. * LISTING SUBTITLE
  3155. * ++++++++++++++
  3156. */
  3157. array(
  3158. 'form_id' => 'subtitle',
  3159. 'id' => Fees::SUBTITLE,
  3160. 'element' => '\\Ppb\\Form\\Element\\LocalizedNumeric',
  3161. 'label' => $this->_('Listing Subtitle Fee'),
  3162. 'prefix' => $settings['currency'],
  3163. 'description' => $this->_('Enter a fee that will apply when adding a subtitle for a listing.'),
  3164. 'attributes' => array(
  3165. 'class' => 'form-control input-mini',
  3166. ),
  3167. 'validators' => array(
  3168. 'Numeric',
  3169. ),
  3170. 'filters' => array(
  3171. '\\Ppb\\Filter\\LocalizedNumeric',
  3172. ),
  3173. ),
  3174. /**
  3175. * ++++++++++++++
  3176. * LISTING IMAGES
  3177. * ++++++++++++++
  3178. */
  3179. array(
  3180. 'form_id' => 'images',
  3181. 'id' => Fees::IMAGES,
  3182. 'element' => '\\Ppb\\Form\\Element\\LocalizedNumeric',
  3183. 'label' => $this->_('Images Upload Fee'),
  3184. 'prefix' => $settings['currency'],
  3185. 'description' => $this->_('Enter a fee that will be charged for each image uploaded with a listing.'),
  3186. 'attributes' => array(
  3187. 'class' => 'form-control input-mini',
  3188. ),
  3189. 'validators' => array(
  3190. 'Numeric',
  3191. ),
  3192. 'filters' => array(
  3193. '\\Ppb\\Filter\\LocalizedNumeric',
  3194. ),
  3195. ),
  3196. array(
  3197. 'form_id' => 'images',
  3198. 'id' => Fees::NB_FREE_IMAGES,
  3199. 'element' => 'text',
  3200. 'label' => $this->_('Free Images'),
  3201. 'description' => $this->_('Enter the number of free images that can be uploaded with a listing.'),
  3202. 'attributes' => array(
  3203. 'class' => 'form-control input-mini',
  3204. ),
  3205. 'validators' => array(
  3206. 'Digits',
  3207. ),
  3208. 'filters' => array(
  3209. 'Digits',
  3210. ),
  3211. ),
  3212. /**
  3213. * ++++++++++++++
  3214. * MEDIA UPLOAD
  3215. * ++++++++++++++
  3216. */
  3217. array(
  3218. 'form_id' => 'media',
  3219. 'id' => Fees::MEDIA,
  3220. 'element' => '\\Ppb\\Form\\Element\\LocalizedNumeric',
  3221. 'label' => $this->_('Media Upload Fee'),
  3222. 'prefix' => $settings['currency'],
  3223. 'description' => $this->_('Enter a fee that will apply when adding media to a listing.'),
  3224. 'attributes' => array(
  3225. 'class' => 'form-control input-mini',
  3226. ),
  3227. 'validators' => array(
  3228. 'Numeric',
  3229. ),
  3230. 'filters' => array(
  3231. '\\Ppb\\Filter\\LocalizedNumeric',
  3232. ),
  3233. ),
  3234. array(
  3235. 'form_id' => 'media',
  3236. 'id' => Fees::NB_FREE_MEDIA,
  3237. 'element' => 'text',
  3238. 'label' => $this->_('Free Media Items'),
  3239. 'description' => $this->_('Enter the number of free media items that can be uploaded with a listing.'),
  3240. 'attributes' => array(
  3241. 'class' => 'form-control input-mini',
  3242. ),
  3243. 'validators' => array(
  3244. 'Digits',
  3245. ),
  3246. 'filters' => array(
  3247. 'Digits',
  3248. ),
  3249. ),
  3250. /**
  3251. * ++++++++++++++
  3252. * DIGITAL DOWNLOADS
  3253. * ++++++++++++++
  3254. */
  3255. array(
  3256. 'form_id' => 'digital_downloads_fee',
  3257. 'id' => Fees::DIGITAL_DOWNLOADS,
  3258. 'element' => '\\Ppb\\Form\\Element\\LocalizedNumeric',
  3259. 'label' => $this->_('Digital Downloads Fee'),
  3260. 'prefix' => $settings['currency'],
  3261. 'description' => $this->_('Enter a fee that will apply when creating a listing having digital download option enabled.'),
  3262. 'attributes' => array(
  3263. 'class' => 'form-control input-mini',
  3264. ),
  3265. 'validators' => array(
  3266. 'Numeric',
  3267. ),
  3268. 'filters' => array(
  3269. '\\Ppb\\Filter\\LocalizedNumeric',
  3270. ),
  3271. ),
  3272. array(
  3273. 'form_id' => 'digital_downloads_fee',
  3274. 'id' => Fees::NB_FREE_DOWNLOADS,
  3275. 'element' => 'text',
  3276. 'label' => $this->_('Free Digital Downloads'),
  3277. 'description' => $this->_('Enter the number of free digital downloads that can be uploaded with a listing.'),
  3278. 'attributes' => array(
  3279. 'class' => 'form-control input-mini',
  3280. ),
  3281. 'validators' => array(
  3282. 'Digits',
  3283. ),
  3284. 'filters' => array(
  3285. 'Digits',
  3286. ),
  3287. ),
  3288. /**
  3289. * ++++++++++++++
  3290. * ADDITIONAL CATEGORY LISTING
  3291. * ++++++++++++++
  3292. */
  3293. array(
  3294. 'form_id' => 'addl_category',
  3295. 'id' => Fees::ADDL_CATEGORY,
  3296. 'element' => '\\Ppb\\Form\\Element\\LocalizedNumeric',
  3297. 'label' => $this->_('Additional Category Listing Fee'),
  3298. 'prefix' => $settings['currency'],
  3299. 'description' => $this->_('Enter a fee that will apply when listing an item in more than one category.'),
  3300. 'attributes' => array(
  3301. 'class' => 'form-control input-mini',
  3302. ),
  3303. 'validators' => array(
  3304. 'Numeric',
  3305. ),
  3306. 'filters' => array(
  3307. '\\Ppb\\Filter\\LocalizedNumeric',
  3308. ),
  3309. ),
  3310. /**
  3311. * ++++++++++++++
  3312. * BUY OUT FEE
  3313. * ++++++++++++++
  3314. */
  3315. array(
  3316. 'form_id' => 'buyout',
  3317. 'id' => Fees::BUYOUT,
  3318. 'element' => '\\Ppb\\Form\\Element\\LocalizedNumeric',
  3319. 'label' => $this->_('Buy Out Fee'),
  3320. 'prefix' => $settings['currency'],
  3321. 'description' => $this->_('Enter a fee that will apply when listing an item with buy out enabled.'),
  3322. 'attributes' => array(
  3323. 'class' => 'form-control input-mini',
  3324. ),
  3325. 'validators' => array(
  3326. 'Numeric',
  3327. ),
  3328. 'filters' => array(
  3329. '\\Ppb\\Filter\\LocalizedNumeric',
  3330. ),
  3331. ),
  3332. /**
  3333. * ++++++++++++++
  3334. * RESERVE PRICE FEE
  3335. * ++++++++++++++
  3336. */
  3337. array(
  3338. 'form_id' => 'reserve_price',
  3339. 'id' => Fees::RESERVE,
  3340. 'element' => '\\Ppb\\Form\\Element\\LocalizedNumeric',
  3341. 'label' => $this->_('Reserve Price Fee'),
  3342. 'prefix' => $settings['currency'],
  3343. 'description' => $this->_('Enter a fee that will apply when enabling reserve price on an auction.'),
  3344. 'attributes' => array(
  3345. 'class' => 'form-control input-mini',
  3346. ),
  3347. 'validators' => array(
  3348. 'Numeric',
  3349. ),
  3350. 'filters' => array(
  3351. '\\Ppb\\Filter\\LocalizedNumeric',
  3352. ),
  3353. ),
  3354. /**
  3355. * ++++++++++++++
  3356. * MAKE OFFER FEE
  3357. * ++++++++++++++
  3358. */
  3359. array(
  3360. 'form_id' => 'make_offer_fee',
  3361. 'id' => Fees::MAKE_OFFER,
  3362. 'element' => '\\Ppb\\Form\\Element\\LocalizedNumeric',
  3363. 'label' => $this->_('Make Offer Fee'),
  3364. 'prefix' => $settings['currency'],
  3365. 'description' => $this->_('Enter a fee that will apply when listing an item with make offer enabled.'),
  3366. 'attributes' => array(
  3367. 'class' => 'form-control input-mini',
  3368. ),
  3369. 'validators' => array(
  3370. 'Numeric',
  3371. ),
  3372. 'filters' => array(
  3373. '\\Ppb\\Filter\\LocalizedNumeric',
  3374. ),
  3375. ),
  3376. );
  3377. }
  3378. protected function _cachingEngineMultiOptions()
  3379. {
  3380. $translate = $this->getTranslate();
  3381. $result = array(
  3382. '' => array(
  3383. $translate->_('Off'),
  3384. $translate->_('Disables the caching engine. Metadata caching will still be enabled, using the Files adapter.')
  3385. ),
  3386. 'Files' => array(
  3387. $translate->_('Files'),
  3388. $translate->_('Uses static files for caching.')
  3389. ),
  3390. 'Table' => array(
  3391. $translate->_('Table'),
  3392. $translate->_('Uses the database for caching (slower than the Files adapter).'),
  3393. ),
  3394. );
  3395. $result['Memcache'] = array(
  3396. $translate->_('Memcache'),
  3397. );
  3398. if (!CacheAdapter\Memcache::enabled()) {
  3399. $result['Memcache'][] = '<span class="text-danger">' . $translate->_('Memcache is not available on your server. Please contact your server admin for information on how to enable the module.') . '</span>';
  3400. $result['Memcache'][] = array(
  3401. 'disabled' => 'disabled'
  3402. );
  3403. }
  3404. else {
  3405. $result['Memcache'][] = $translate->_('Uses the memcache module for caching (recommended).');
  3406. }
  3407. if (CacheAdapter\Apc::enabled()) {
  3408. $result['Apc'] = array(
  3409. $translate->_('Apc'),
  3410. $translate->_('Uses the Alternative PHP Cache (APC) module for caching.'),
  3411. );
  3412. }
  3413. return $result;
  3414. }
  3415. }