Пример #1
0
function itags_content_store(&$pObject, &$pParamHash)
{
    global $gBitSystem;
    $errors = NULL;
    // If a content access system is active and we have geo in our store hash, let's call it
    if ($gBitSystem->isPackageActive('itags') && !empty($pParamHash['itags'])) {
        $itags = new LibertyItag($pObject->mAttachmentId);
        // if both lat and lng fields are empty then the user is trying to clear geo data
        if (empty($pParamHash['itags']['top']) && empty($pParamHash['itags']['left'])) {
            $geo->expunge();
            // store the geo data
        } elseif (!$itags->store($pParamHash)) {
            $errors = $itags->mErrors;
        }
    }
    return $errors;
}
Пример #2
0
/**
 * @version $Header$
 * @package itags
 * @subpackage functions
 */
/**
 * required setup
 */
require_once '../kernel/setup_inc.php';
global $gBitSystem, $gDebug;
include_once ITAGS_PKG_PATH . 'image_lookup_inc.php';
$tag = new LibertyItag($gContent->mInfo['image_file']['attachment_id']);
if (!empty($_REQUEST['mode'])) {
    if (!empty($_REQUEST['save']) and $_REQUEST['save'] == 'yes') {
        // save itag record
        $tag->store($_REQUEST);
    }
    $gBitSmarty->assign('mode', $_REQUEST['mode']);
}
if (!empty($_REQUEST['delete'])) {
    $tag->expunge_tag($_REQUEST['delete']);
}
$tag->load();
$gBitThemes->loadAjax('jquery');
$gBitThemes->loadJavascript(UTIL_PKG_PATH . 'javascript/libs/jquery/full/ui/jquery.ui.all.js', FALSE, 500, FALSE);
$gBitThemes->loadJavascript(ITAGS_PKG_PATH . 'scripts/imagetag.js', FALSE, 500, FALSE);
// this will let LibertyMime know that we want to display the original image
$gContent->mInfo['image_file']['original'] = TRUE;
$gContent->mInfo['itags'] = $tag->mInfo['itags'];
if (!$gContent->isValid()) {
    $gBitSystem->setHttpStatus(404);