Exemple #1
0
 public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
 {
     $ajaxResponseObject->setStatus("ok");
     $current_container = \ArtefactModel::getArtefactsContainer();
     $ajaxUploader = new \Widgets\AjaxUploader();
     //$ajaxUploader->setBackend(PATH_URL . "explorer/");
     $ajaxUploader->setEnvId($current_container->get_id());
     $ajaxResponseObject->addWidget($ajaxUploader);
     return $ajaxResponseObject;
 }
Exemple #2
0
 public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
 {
     $ajaxResponseObject->setStatus("ok");
     $ajaxDialog = new \Widgets\Dialog();
     $ajaxDialog->setTitle("Neue Bilder hinzufügen");
     $ajaxUploader = new \Widgets\AjaxUploader();
     $ajaxUploader->setNamespace("explorer");
     $ajaxUploader->setDestId($this->id);
     $ajaxDialog->addWidget($ajaxUploader);
     $ajaxResponseObject->addWidget($ajaxDialog);
     return $ajaxResponseObject;
 }
 public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
 {
     $ajaxResponseObject->setStatus("ok");
     $ajaxUploader = new \Widgets\AjaxUploader();
     $ajaxUploader->setSizeLimit(return_bytes(ini_get('post_max_size')));
     $ajaxUploader->setNamespace("Explorer");
     $ajaxUploader->setDestId($this->id);
     $rawHTML = new \Widgets\RawHtml();
     $rawHTML->setHtml("<div style=\"float:right\"><a class=\"button pill negative\" onclick=\"closeDialog();return false;\" href=\"#\">Schließen</a></div>");
     $ajaxResponseObject->addWidget($ajaxUploader);
     $ajaxResponseObject->addWidget($rawHTML);
     return $ajaxResponseObject;
 }
    public function processData(\IRequestObject $requestObject)
    {
        $params = $requestObject->getParams();
        $objectId = $params["messageObjectId"];
        $object = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $objectId);
        $oldImageId = $object->get_attribute("bid:portlet:msg:picture_id");
        $dialog = new \Widgets\Dialog();
        $dialog->setTitle("Meldungsbild bearbeiten");
        $dialog->setPositionX($this->params["mouseX"]);
        $dialog->setPositionY($this->params["mouseY"]);
        //$dialog->setWidth(450);
        $emptyImageUrl = PATH_URL . "portletMsg/asset/empty.jpg";
        $ajaxUploader = new \Widgets\AjaxUploader();
        if ($oldImageId !== 0) {
            $imgWidget = new \Widgets\RawHtml();
            $imgWidget->setHtml("Um ein Bild hochzuladen ziehen sie eine Datei auf dieses Feld oder doppelklicken sie hier.<br><img id=\"uploaderImage\" src=\"" . PATH_URL . "download/document/{$oldImageId}\"></img>");
            $ajaxUploader->setPreview($imgWidget);
        } else {
            $imgWidget = new \Widgets\RawHtml();
            $imgWidget->setHtml("Um ein Bild hochzuladen ziehen sie eine Datei auf dieses Feld oder doppelklicken sie hier.<br><img id=\"uploaderImage\" src=\"{$emptyImageUrl}\"></img>");
            $ajaxUploader->setPreview($imgWidget);
        }
        $ajaxUploader->setSizeLimit(return_bytes(ini_get('post_max_size')));
        $ajaxUploader->setNamespace("PortletMsg");
        $ajaxUploader->setCommand("UploadImage");
        $ajaxUploader->setDestId($object->get_id());
        $ajaxUploader->setMultiUpload(false);
        $ajaxUploader->setOnComplete("function(id, fileName, responseJSON){document.getElementById('uploaderImage').src = '" . PATH_URL . "download/document/' + responseJSON.oid; jQuery('#uploaderImage').addClass('saved')}");
        $dialog->addWidget($ajaxUploader);
        $raw = new \Widgets\RawHtml();
        $raw->setHtml(<<<END
\t\t<a href="#" class="button pill negative" onclick="sendRequest('DeleteImage', {'id':{$object->get_id()}}, '', 'data', null, function() {document.getElementById('uploaderImage').src = '{$emptyImageUrl}'; jQuery('#uploaderImage').addClass('saved')}, 'PortletMsg');">Bild löschen</a>
END
);
        $dialog->addWidget($raw);
        $dialog->addWidget(new \Widgets\Clearer());
        $radioButton = new \Widgets\RadioButton();
        $radioButton->setLabel("Bildposition");
        $radioButton->setOptions(array(array("name" => "links", "value" => "left"), array("name" => "nicht umfließend", "value" => "none"), array("name" => "rechts", "value" => "right")));
        $radioButton->setData($object);
        $radioButton->setContentProvider(\Widgets\DataProvider::attributeProvider("bid:portlet:msg:picture_alignment"));
        $dialog->addWidget($radioButton);
        $dialog->addWidget(new \Widgets\Clearer());
        $sizeInput = new \Widgets\TextInput();
        $sizeInput->setLabel("Bildbreite");
        $sizeInput->setData($object);
        $sizeInput->setContentProvider(\Widgets\DataProvider::attributeProvider("bid:portlet:msg:picture_width"));
        $dialog->addWidget($sizeInput);
        $this->dialog = $dialog;
    }
 public function processData(\IRequestObject $requestObject)
 {
     $params = $requestObject->getParams();
     //		$objectId = $params["messageObjectId"];
     //		$object = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $objectId);
     //var_dump($params);
     $dialog = new \Widgets\Dialog();
     $dialog->setTitle("Portfolio Importieren");
     $dialog->setPositionX($this->params["mouseX"]);
     $dialog->setPositionY($this->params["mouseY"]);
     $ajaxUploader = new \Widgets\AjaxUploader();
     $imgWidget = new \Widgets\RawHtml();
     $imgWidget->setHtml("Um ein Portfolio zu importieren ziehen sie die Datei auf dieses Feld oder doppelklicken sie hier.<br>");
     //$ajaxUploader->setPreview($imgWidget);
     //		}
     $ajaxUploader->setSizeLimit(return_bytes(ini_get('post_max_size')));
     $ajaxUploader->setNamespace("Portfolio");
     $ajaxUploader->setCommand("UploadImport");
     $ajaxUploader->setDestId($params["id"]);
     $ajaxUploader->setMultiUpload(false);
     //		$ajaxUploader->setOnComplete("function(id, fileName, responseJSON){document.getElementById('uploaderArtefact').src = '" . PATH_URL . "download/document/' + responseJSON.oid; jQuery('#uploaderArtefact').addClass('saved')}");
     $ajaxUploader->setOnComplete("function(id, fileName, responseJSON){location.reload();}");
     $dialog->addWidget($ajaxUploader);
     //		$dialog->addWidget($raw);
     $dialog->addWidget(new \Widgets\Clearer());
     $this->dialog = $dialog;
 }
 public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
 {
     $ajaxResponseObject->setStatus("ok");
     $ajaxUploader = new \Widgets\AjaxUploader();
     $ajaxUploader->setSizeLimit(return_bytes(ini_get('post_max_size')));
     $ajaxUploader->setBackend(PATH_URL . "portfolio/");
     $ajaxUploader->setEnvId($this->id);
     $ajaxUploader->setCommand("UploadImport");
     $ajaxUploader->setNamespace("Portfolio");
     $ajaxResponseObject->addWidget($ajaxUploader);
     return $ajaxResponseObject;
 }