Пример #1
0
<?php

/**
 * @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'];
Пример #2
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;
}
Пример #3
0
<?php

require_once "../kernel/setup_inc.php";
require_once ITAGS_PKG_PATH . "LibertyItag.php";
$gBitSystem->verifyPackage('itags');
$gBitSystem->verifyPermission('p_itags_view');
$itags = new LibertyItag();
$_REQUEST['max_records'] = !empty($_REQUEST['max_records']) ? $_REQUEST['max_records'] : NULL;
$listHash = $_REQUEST;
$tagHash = $_REQUEST;
if (isset($_REQUEST['attachment'])) {
    // display image with tags
} else {
    $listData = $itags->getList($listHash);
    $gBitSmarty->assign('itag_attachments', $listData);
    $gBitSystem->display('bitpackage:itags/attachments.tpl', tra('Itags'), array('display_mode' => 'display'));
}