public function render() { $id = Wi3::date_now(); $val = $this->val(); if (isset($this->attributes->label)) { echo "<label for='" . $this->attributes->name . "'></label>"; } echo "<input type='hidden' name='" . $this->attributes->name . "' id='input_" . $id . "' value='" . $val . "' />"; echo "<div style='padding: 10px;'>"; $this->loadPages(); $pagePositions = $this->pagePositions(); $counter = 0; foreach ($pagePositions as $pagePosition) { $page = $pagePosition->pages[0]; $level = $pagePosition->{$pagePosition->level_column}; $counter++; echo "<div style='padding-left: " . $level * 10 . "px; "; if ($pagePosition->id != $val) { echo "opacity: 0.6; "; } echo "margin: 5px;' id='pagePosition_" . $id . "_" . $counter . "' class='pagePosition_" . $id . "'>"; echo "<a href='javascript:void(0)' style='text-decoration: none;' onClick='\$(\"#input_" . $id . "\").val(\"" . $pagePosition->id . "\").has(\"xyz\").add(\"#pagePosition_" . $id . "_" . $counter . "\").fadeTo(50,1).has(\"xyz\").add(\".image_" . $id . "\").not(\"#pagePosition_" . $id . "_" . $counter . "\").fadeTo(50,0.40);'>"; echo $page->longtitle . "</a>"; echo "</div>"; } echo "</div>"; }
public function render() { $id = Wi3::date_now(); $val = $this->val(); if (isset($this->attributes->label)) { echo "<label for='" . $this->attributes->name . "'></label>"; } echo "<input type='hidden' name='" . $this->attributes->name . "' id='input_" . $id . "' value='" . $val . "' />"; echo "<div style='padding: 10px;'>"; if (isset($this->settings->extensions)) { $files = Wi3::inst()->sitearea->files->find(array("extensions" => $this->settings->extensions)); } else { $files = Wi3::inst()->sitearea->files->find(array()); } $counter = 0; foreach ($files as $file) { $level = $file->{$file->level_column}; $counter++; echo "<div style='padding-left: " . $level * 10 . "px; "; if ($file->id != $val) { echo "opacity: 0.6; "; } echo "margin: 5px;' id='file_" . $id . "_" . $counter . "' class='file_" . $id . "'>"; echo "<a href='javascript:void(0)' style='text-decoration: none;' onClick='\$(\"#input_" . $id . "\").val(\"" . $file->id . "\").has(\"xyz\").add(\"#file_" . $id . "_" . $counter . "\").fadeTo(50,1).has(\"xyz\").add(\".file_" . $id . "\").not(\"#file_" . $id . "_" . $counter . "\").fadeTo(50,0.40);'>"; echo "<div style='margin: 5px;'>"; // Add small thumbnail if file is an image if ($file->isImage()) { echo "<img src='" . Wi3::inst()->urlof->site . "_uploads/30/" . $file->filename . "'/> "; } echo $file->filename; echo "</div>"; echo "</a>"; echo "</div>"; } echo "<div style='font-size: 1px; visibility: hidden; clear:both;'>.</div>"; echo "</div>"; }
public function render() { $id = Wi3::date_now(); if (isset($this->attributes->label)) { echo "<label for='" . $this->attributes->name . "'></label>"; } echo "<input type='hidden' name='" . $this->attributes->name . "' id='input_" . $id . "' />"; echo "<div style='padding: 10px;'>"; $folders = Wi3::inst()->sitearea->files->findfolders(array("fileextensions" => $this->settings->fileextensions)); $counter = 0; foreach ($folders as $folder) { $counter++; echo "<div style='float: left; background: #aaa; "; if (isset($this->settings->selected) and $folder->id != $this->settings->selected) { echo "opacity: 0.4; "; } echo "margin: 5px;' id='image_" . $id . "_" . $counter . "' class='image_" . $id . "'>"; echo "<a href='javascript:void(0)' style='text-decoration: none;' onClick='\$(\"#input_" . $id . "\").val(\"" . $folder->id . "\").has(\"xyz\").add(\"#image_" . $id . "_" . $counter . "\").css(\"background\", \"#1891FF\").fadeTo(50,1).has(\"xyz\").add(\".image_" . $id . "\").not(\"#image_" . $id . "_" . $counter . "\").css(\"background\", \"#eee\").fadeTo(50,0.40);'>"; echo "<div style='float: left; margin: 5px; height: 20px; overflow: hidden;'>" . $folder->filename . "</div></a>"; echo "</div>"; } echo "<div style='font-size: 1px; visibility: hidden; clear:both;'>.</div>"; echo "</div>"; }