]> git.mjollnir.org Git - s9y.git/commitdiff
Added hooks to file upload.
authorgarvinhicking <garvinhicking>
Mon, 1 Aug 2005 10:59:53 +0000 (10:59 +0000)
committergarvinhicking <garvinhicking>
Mon, 1 Aug 2005 10:59:53 +0000 (10:59 +0000)
include/admin/images.inc.php

index 3f4a6851e385a22327bc41de7cfe366ae54d832a..3921cab025fb7cc1a48f3c47d2cb5e5adf5e49f4 100644 (file)
@@ -176,6 +176,7 @@ switch ($serendipity['GET']['adminAction']) {
                       
                     $image_id = @serendipity_insertHotlinkedImageInDatabase($tfile, $serendipity['POST']['imageurl'], $authorid, null, $tempfile);
                     printf(HOTLINK_DONE. '<br />', $serendipity['POST']['imageurl'], $tfile);
+                    serendipity_plugin_api::hook_event('backend_image_addHotlink', $tempfile);
                 } else {
                     $fp = fopen($target, 'w');
                     fwrite($fp, $fContent);
@@ -189,6 +190,7 @@ switch ($serendipity['GET']['adminAction']) {
                     }
                     // Insert into database
                     $image_id = serendipity_insertImageInDatabase($tfile, $serendipity['POST']['target_directory'][$tindex], $authorid);
+                    serendipity_plugin_api::hook_event('backend_image_add', $target);
                 }
             }
         }
@@ -236,6 +238,7 @@ switch ($serendipity['GET']['adminAction']) {
                     }
                     // Insert into database
                     $image_id = serendipity_insertImageInDatabase($tfile, $serendipity['POST']['target_directory'][$idx], $authorid);
+                    serendipity_plugin_api::hook_event('backend_image_add', $target);
                 } else {
                     echo ERROR_UNKNOWN_NOUPLOAD . '<br />';
                 }
@@ -614,6 +617,8 @@ switch ($serendipity['GET']['adminAction']) {
                 addField();
            </script>
            
+            <?php serendipity_plugin_api::hook_event('backend_image_addform', $serendipity); ?>
+
             <div style="text-align: center; margin-top: 15px; margin-bottom: 15px">
                 <script type="text/javascript">
                     document.write('<input class="serendipityPrettyButton" type="button" value="<?php echo IMAGE_MORE_INPUT; ?>" onclick="hideForeign(); addField()"' + '/><br' + '/>');