1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-18 04:22:10 +02:00

A few minor phpdoc/code comments

This commit is contained in:
Ryan Cramer
2019-02-22 17:45:20 -05:00
parent c6410c6478
commit c80ae0acd8
3 changed files with 37 additions and 5 deletions

View File

@@ -138,11 +138,10 @@ class WireHooks {
* *
* @param Wire $object * @param Wire $object
* @param string $method Optional method that hooks will be limited to. Or specify '*' to return all hooks everywhere. * @param string $method Optional method that hooks will be limited to. Or specify '*' to return all hooks everywhere.
* @param int $type Type of hooks to return: 0=all, 1=local only, 2=static only
* @param int $type Type of hooks to return, specify one of the following constants: * @param int $type Type of hooks to return, specify one of the following constants:
* - WireHooks::getHooksAll returns all hooks (default) * - WireHooks::getHooksAll returns all hooks [0] (default)
* - WireHooks::getHooksLocal returns local hooks only * - WireHooks::getHooksLocal returns local hooks [1] only
* - WireHooks::getHooksStatic returns static hooks only * - WireHooks::getHooksStatic returns static hooks [2] only
* @return array * @return array
* *
*/ */

View File

@@ -20,6 +20,7 @@
* @property bool|int $noCollapseItem Set to true to disable collapsed items (like for LanguageTranslator tool or other things that add tools to files) * @property bool|int $noCollapseItem Set to true to disable collapsed items (like for LanguageTranslator tool or other things that add tools to files)
* @property bool|int $noShortName Set to true to disable shortened filenames in output * @property bool|int $noShortName Set to true to disable shortened filenames in output
* @property bool|int $noCustomButton Set to true to disable use of the styled <input type='file'> * @property bool|int $noCustomButton Set to true to disable use of the styled <input type='file'>
* @property Pagefiles|Pagefile|null $value
* *
* @method string renderItem($pagefile, $id, $n) * @method string renderItem($pagefile, $id, $n)
* @method string renderList($value) * @method string renderList($value)
@@ -490,6 +491,13 @@ class InputfieldFile extends Inputfield implements InputfieldItemList, Inputfiel
return $out; return $out;
} }
/**
* Wrap output of files list item
*
* @param string $out
* @return string
*
*/
protected function renderItemWrap($out) { protected function renderItemWrap($out) {
// note: using currentItem rather than a new argument since there are now a few modules extending // note: using currentItem rather than a new argument since there are now a few modules extending
// this one and if they implement their own calls to this method or version of this method then // this one and if they implement their own calls to this method or version of this method then
@@ -498,7 +506,15 @@ class InputfieldFile extends Inputfield implements InputfieldItemList, Inputfiel
$id = $item && !$this->renderValueMode ? " id='file_$item->hash'" : ""; $id = $item && !$this->renderValueMode ? " id='file_$item->hash'" : "";
return "<li$id class='{$this->itemClass}'>$out</li>"; return "<li$id class='{$this->itemClass}'>$out</li>";
} }
/**
* Render files list ready
*
* @param Pagefiles|null $value
* @throws WireException
* @throws WirePermissionException
*
*/
protected function renderListReady($value) { protected function renderListReady($value) {
if(!$this->renderValueMode) { if(!$this->renderValueMode) {
// if just rendering the files list (as opposed to saving it), delete any temp files that may have accumulated // if just rendering the files list (as opposed to saving it), delete any temp files that may have accumulated
@@ -511,6 +527,13 @@ class InputfieldFile extends Inputfield implements InputfieldItemList, Inputfiel
} }
} }
/**
* Render files list
*
* @param Pagefiles|null $value
* @return string
*
*/
protected function ___renderList($value) { protected function ___renderList($value) {
if(!$value) return ''; if(!$value) return '';
@@ -534,6 +557,13 @@ class InputfieldFile extends Inputfield implements InputfieldItemList, Inputfiel
return $out; return $out;
} }
/**
* Render upload area
*
* @param Pagefiles|null $value
* @return string
*
*/
protected function ___renderUpload($value) { protected function ___renderUpload($value) {
if($value) {} if($value) {}
if($this->noUpload || $this->renderValueMode) return ''; if($this->noUpload || $this->renderValueMode) return '';

View File

@@ -277,6 +277,9 @@ class LanguageSupportPageNames extends WireData implements Module, ConfigurableM
} else { } else {
// inactive status only applies to the page itself // inactive status only applies to the page itself
$active = $page->get("status$setLanguage") > 0; $active = $page->get("status$setLanguage") > 0;
// https://github.com/processwire/processwire-issues/issues/463
// $active = $page->get("status$setLanguage") > 0 || $page->template->noLang;
} }
// if page is inactive for a language, and it's not editable, send a 404 // if page is inactive for a language, and it's not editable, send a 404
if(!$active && !$page->editable() && $page->id != $config->http404PageID) { if(!$active && !$page->editable() && $page->id != $config->http404PageID) {