Hi Brandon,
Actually its a normal Upload type configured as here:
which produces this in the AdminCP for the end user:
It works but the if you have enabled Pixaby, the option to choose a Stock Photo doesn't appear.
So I tried the Other/Manual type, which fills in the PHP code for you to presumably to get you started:
It inserts a Text field form helper so I tried changing it to an Upload field, thinking that as its using the form helpers, and Pixabay is enabled, it would detect and show the Pixabay stock photo option:
<?php
return new \IPS\Helpers\Form\Text( "core_theme_setting_title_{$row['sc_id']}", $value, FALSE, array(), NULL, NULL, NULL, 'theme_setting_' . $row['sc_key'] );
After changing the form helper from text to upload, it saves okay, but when you go to view the Theme Settings I get:
InvalidArgumentException: (0)
#0 C:\xampp\htdocs\dev\ips4\system\Theme\Theme.php(1772) : eval()'d code(1): IPS\Helpers\Form\_Upload->__construct('core_theme_sett...', '', false, Array, NULL, NULL, NULL, 'theme_setting_u...')
#1 C:\xampp\htdocs\dev\ips4\system\Theme\Theme.php(1772): eval()
#2 C:\xampp\htdocs\dev\ips4\system\Theme\Theme.php(1733): IPS\_Theme->getCustomSettingField(Array)
#3 C:\xampp\htdocs\dev\ips4\system\Node\Controller.php(489): IPS\_Theme->form(Object(IPS\Helpers\Form))
#4 C:\xampp\htdocs\dev\ips4\system\Node\Controller.php(388): IPS\Node\_Controller->_addEditForm(Object(IPS\Theme))
#5 C:\xampp\htdocs\dev\ips4\system\Dispatcher\Controller.php(90): IPS\Node\_Controller->form()
#6 C:\xampp\htdocs\dev\ips4\system\Node\Controller.php(62): IPS\Dispatcher\_Controller->execute()
#7 C:\xampp\htdocs\dev\ips4\applications\core\modules\admin\customization\themes.php(59): IPS\Node\_Controller->execute()
#8 C:\xampp\htdocs\dev\ips4\system\Dispatcher\Dispatcher.php(152): IPS\core\modules\admin\customization\_themes->execute()
#9 C:\xampp\htdocs\dev\ips4\admin\index.php(14): IPS\_Dispatcher->run()
#10 {main}
this didn't work either:
<?php
if ( $form === null )
{
$form = new \IPS\Helpers\Form;
}
if ( \IPS\Settings::i()->pixabay_enabled )
{
$options['allowStockPhotos'] = TRUE;
}
return new \IPS\Helpers\Form\Upload( "core_theme_setting_title_{$row['sc_id']}", $value, FALSE, array($options), NULL, NULL, NULL, 'theme_setting_' . $row['sc_key'] );