Exemple #1
0
 protected function rm($args)
 {
     $result = parent::rm($args);
     foreach ($args['targets'] as $target) {
         // If the image has a corresponding Visual, remove it
         $path = $this->getPath($target);
         $v = Visual::get_by_path($path);
         if ($v) {
             $v->delete();
         }
     }
     return $result;
 }
Exemple #2
0
RecentLink::createOrUpdate('Etichetare Imagini Definiții');
$fileName = util_getRequestParameter('fileName');
$id = util_getRequestParameter('id');
$lexemId = util_getRequestParameter('lexemId');
$revised = util_getBoolean('revised');
$saveButton = util_getRequestParameter('saveButton');
$tagLexemId = util_getRequestParameter('tagLexemId');
$tagLabel = util_getRequestParameter('tagLabel');
$textXCoord = util_getRequestParameter('textXCoord');
$textYCoord = util_getRequestParameter('textYCoord');
$imgXCoord = util_getRequestParameter('imgXCoord');
$imgYCoord = util_getRequestParameter('imgYCoord');
$addTagButton = util_getRequestParameter('addTagButton');
// Tag the image specified by $fileName. Create a Visual object if one doesn't exist, then redirect to it.
if ($fileName) {
    $v = Visual::get_by_path($fileName);
    if (!$v) {
        $v = Visual::createFromFile($fileName);
    }
    util_redirect("?id={$v->id}");
}
$v = Visual::get_by_id($id);
if ($saveButton) {
    $v->lexemeId = $lexemId;
    $v->revised = $revised;
    $v->save();
    util_redirect("?id={$v->id}");
}
if ($addTagButton) {
    $vt = Model::factory('VisualTag')->create();
    $vt->imageId = $v->id;