Tidy up PHP code

Signed-off-by: Justin Georgi <justin.georgi@gmail.com>
This commit is contained in:
2024-10-29 16:14:29 -07:00
parent 5d4863f9be
commit 4f1ff35194
3 changed files with 332 additions and 327 deletions

View File

@@ -95,9 +95,11 @@ class GlModelHooks {
'class' => 'AddHotspot', 'class' => 'AddHotspot',
'onclick' => 'readyAddHotspot()' 'onclick' => 'readyAddHotspot()'
); );
$addHsButton = Html::rawElement('button',$addButtonAttr,'Add a new hotspot'); $addHsButton = array(
Html::rawElement('button',$addButtonAttr,'Add a new hotspot')
);
$previewHTML = Html::rawElement('div',NULL,$previewViewer.$addHsButton); $previewHTML = Html::rawElement('div',NULL,$previewViewer.implode($addHsButton));
return false; return false;
} }

View File

@@ -45,13 +45,15 @@ class GlModelTransformOutput extends MediaTransformOutput {
if ($this->thumb) { if ($this->thumb) {
return Html::rawElement('span',['class' => 'fake-thumbnail'],'Gltf model thumbnail'); return Html::rawElement('span',['class' => 'fake-thumbnail'],'Gltf model thumbnail');
} }
//return Html::rawElement( 'div',[ 'class' => 'my-model-class'], $this->url . ' is a ' . $this->parameters['type'] . ' 3D model!' );
if (isset($options['img-class'])) { if (isset($options['img-class'])) {
$this->parameters['class'] = $options['img-class']; $this->parameters['class'] = $options['img-class'];
} }
if (isset($options['preview']) && $options['preview']) { if (isset($options['preview']) && $options['preview']) {
$this->parameters['preview'] = $options['preview']; $this->parameters['preview'] = $options['preview'];
} }
return self::buildViewer($this->file->getDescriptionText(),$this->url,$this->parameters); return self::buildViewer($this->file->getDescriptionText(),$this->url,$this->parameters);
} }
@@ -127,6 +129,7 @@ class GlModelTransformOutput extends MediaTransformOutput {
'onmousedown' => 'clearAnnotations()', 'onmousedown' => 'clearAnnotations()',
'ontouchstart' => 'clearAnnotations()' 'ontouchstart' => 'clearAnnotations()'
); );
return Html::rawElement('div', $attrContainer, $elModel . $elMenu); return Html::rawElement('div', $attrContainer, $elModel . $elMenu);
} }
@@ -139,7 +142,7 @@ class GlModelTransformOutput extends MediaTransformOutput {
* *
* @param string $paramType the type of parameter to be extracted 'view'|'hsset' * @param string $paramType the type of parameter to be extracted 'view'|'hsset'
* @param string $classList a string of class names * @param string $classList a string of class names
* @return string parameter name or 'default' * @return string parameter value or 'default'
*/ */
private static function extractClassParams(string $paramType, ? string $classList) { private static function extractClassParams(string $paramType, ? string $classList) {
if (!in_array($paramType, ['view', 'hsset'])) { if (!in_array($paramType, ['view', 'hsset'])) {