is_album()) { $albumCustom = ORM::factory("custom_album")->where("album_id", "=", $item->id)->find(); $thumbdata = $form->edit_item->group("custom_album")->label("Custom Album"); if ($albumCustom->loaded()) { $thumbdata->input("thumbsize")->label(t("Thumbnail size (in pixels)"))->value($albumCustom->thumb_size); } else { $thumbdata->input("thumbsize")->label(t("Thumbnail size (in pixels)")); } } } static function item_edit_form_completed($item, $form) { if ($item->is_album()) { $thumbChanged = false; if ($form->edit_item->custom_album->thumbsize->value == "") { db::build() ->delete("custom_album") ->where("album_id", "=", $item->id) ->execute(); } else { $albumCustom = ORM::factory("custom_album")->where("album_id", "=", $item->id)->find(); if (!$albumCustom->loaded()) { $albumCustom->album_id = $item->id; } $albumCustom->thumb_size = $form->edit_item->custom_album->thumbsize->value; $albumCustom->save(); $thumbChanged = true; } if ($thumbChanged) { db::build() ->update("items") ->set("thumb_dirty", 1) ->where("parent_id", "=", $item->id) ->execute(); } } } static function theme_edit_form_completed($form) { // Update our resize rules, in case the thumbnail or resize size has changed custom_albums_installer::update_rules(); } }