1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-14 10:45:54 +02:00

Various minor adjustments, but nothing interesting

This commit is contained in:
Ryan Cramer
2019-03-22 17:02:44 -04:00
parent a2e7c35f95
commit 2cad3ed11b
5 changed files with 63 additions and 16 deletions

View File

@@ -43,6 +43,7 @@
*
* @property bool $pagefileSecure When used, files in /site/assets/files/ will be protected with the same access as the page. Routines files through a passthrough script. #pw-group-files
* @property string $pagefileSecurePathPrefix One or more characters prefixed to the pathname of protected file dirs. This should be some prefix that the .htaccess file knows to block requests for. #pw-group-files
* @property string $pagefileUrlPrefix Deprecated property that was a string that prefixes filenames in PW URLs, becoming a shortcut to a pages files URL (do not use, here for backwards compatibility only). #pw-internal
*
* @property array $contentTypes Array of extensions and the associated MIME type for each (for template file output). #pw-group-template-files
* @property array $fileContentTypes Array of extensions and the associated MIME type for each (for file output). See /wire/config.php for details and defaults. #pw-group-files
@@ -69,7 +70,7 @@
* @property string $appendTemplateFile PHP file in /site/templates/ that will be loaded after each page's template file (default=none) #pw-group-template-files
* @property bool $templateCompile Allow use of compiled templates? #pw-group-template-files
*
* @property string $uploadUnzipCommand Shell command to unzip archives, used by WireUpload class. #pw-group-deprecated
* @property string $uploadUnzipCommand Shell command to unzip archives, used by WireUpload class (deprecated, no longer in use). #pw-internal
* @property string $uploadTmpDir Optionally override PHP's upload_tmp_dir with your own. Should include a trailing slash. #pw-group-files
* @property string $uploadBadExtensions Space separated list of file extensions that are always disallowed from uploads. #pw-group-files
*

View File

@@ -68,21 +68,22 @@ function fuel($name = '') {
}
/**
* Indent the given string with $numTabs tab characters
*
* Newlines are assumed to be \n
*
* Watch out when using this function with strings that have a <textarea>, you may want to have it use \r newlines, at least temporarily.
*
* #pw-internal
*
* @param string $str String that needs the tabs
* @param int $numTabs Number of tabs to insert per line (note any existing tabs are left as-is, so indentation is retained)
* @param string $str The provided string but with tabs inserted
*
*/
if(!function_exists("tabIndent")):
if(!function_exists("tabIndent")):
/**
* Indent the given string with $numTabs tab characters
*
* Newlines are assumed to be \n
*
* Watch out when using this function with strings that have a <textarea>, you may want to have it use \r newlines, at least temporarily.
*
* #pw-internal
*
* @param string $str String that needs the tabs
* @param int $numTabs Number of tabs to insert per line (note any existing tabs are left as-is, so indentation is retained)
* @param string $str The provided string but with tabs inserted
* @deprecated
*
*/
function tabIndent($str, $numTabs) {
$tabs = str_repeat("\t", $numTabs);
$str = str_replace("\n", "\n$tabs", $str);

View File

@@ -245,10 +245,12 @@ class AdminThemeUikitConfigHelper extends Wire {
$fieldset->set('themeOffset', true);
$inputfields->add($fieldset);
/** @var InputfieldMarkup $e1 */
$e1 = $modules->get('InputfieldMarkup');
$e1->label = $this->_('Input size examples');
$e1->columnWidth = 25;
/** @var InputfieldMarkup $e2 */
$e2 = $modules->get('InputfieldMarkup');
$e2->label = $this->_('Select size examples');
$e2->columnWidth = 25;

View File

@@ -22,6 +22,7 @@
*
* @property string $value [selector string] Value that user can change.
* @property string $initValue [selector string] Initial value that user can't change.
* @property Template|null $initTemplate [null] Optional context template, used only just 1 allowed (pulled from $initValue automatically).
* @property string $addIcon [plus-circle] Icon used for the "Add Field" link.
* @property string $addLabel [Add Field] Text used for the "Add Field" link
* @property string $dateFormat [Y-m-d] Default PHP date() format for date fields.
@@ -1728,6 +1729,42 @@ class InputfieldSelector extends Inputfield implements ConfigurableModule {
return parent::setAttribute($key, $value);
}
/**
* Set property
*
* @param string $key
* @param mixed $value
* @return $this|Inputfield|WireData
* @throws WireException
*
*/
public function set($key, $value) {
if($key === 'initTemplate') {
if($value && !$value instanceof Template) {
$value = $this->wire('templates')->get($value);
}
if($value === null || $value instanceof Template) {
$this->initTemplate = $value;
return $this;
} else {
throw new WireException('initTemplate must be a Template or null');
}
}
return parent::set($key, $value);
}
/**
* Get property
*
* @param string $key
* @return mixed
*
*/
public function get($key) {
if($key === 'initTemplate') return $this->initTemplate;
return parent::get($key);
}
/**
* Makes sure that existing fields present in selector are added to limitFields
*

View File

@@ -1017,6 +1017,10 @@ class ProcessPageLister extends Process implements ConfigurableModule {
}
}
if($templateSelector) {
// not currently used
}
if($includeSelector) {
$includeMode = $includeSelector->value;
@@ -1200,6 +1204,7 @@ class ProcessPageLister extends Process implements ConfigurableModule {
*
*/
protected function buildListerTableCol(Page $p, array $fields, $name, $value = null) {
if($value) {} // ignore, used by ListerPro only
/** @var Sanitizer $sanitizer */
$sanitizer = $this->wire('sanitizer');
@@ -1644,6 +1649,7 @@ class ProcessPageLister extends Process implements ConfigurableModule {
if(isset($actions['edit']) && $this->editURL && strpos($actions['edit']['url'], '/page/edit/') !== false) {
list($path, $queryString) = explode('?', $actions['edit']['url']);
if($path) {} // ignore, descriptive only
$actions['edit']['url'] = $this->editURL . '?' . $queryString;
}