Example #1
0
 *
 * @category  Provisioning
 * @author    S. Hamblett <*****@*****.**>
 * @copyright 2010 S. Hamblett
 * @license   GPLv3 http://www.gnu.org/licenses/gpl.html
 * @link      none
 *
 * @package provisioner
 *
 *
 */
$metatagArray = array();
/* Protection */
if (REVO_GATEWAY_OPEN != "true") {
    die("Revo Gateway API error - Invalid access");
}
/* Get the resources from the database */
$db = connectToDb();
logImportEvent("Getting all metatags", $db);
$sql = "SELECT * FROM " . $table_prefix . "site_metatags ";
$result = mysql_query($sql, $db);
if (!$result) {
    die("Revo Gateway API error - Invalid Resource query");
}
while ($metatag = mysql_fetch_assoc($result)) {
    $metatagArray[] = $metatag;
}
$response = errorSuccess('', $metatagArray);
logImportEvent("Got all metatags", $db);
mysql_close($db);
echo toJSON($response);
Example #2
0
 * @package provisioner
 *
 *
 */
$keywordArray = array();
$outputArray = array();
/* Protection */
if (REVO_GATEWAY_OPEN != "true") {
    die("Revo Gateway API error - Invalid access");
}
/* Get the keywords from the database */
$db = connectToDb();
/* Get the keywords */
logImportEvent("Getting all keywords", $db);
$sql = "SELECT keyword, content_id FROM " . $table_prefix . "site_keywords";
$sql .= " LEFT JOIN " . $table_prefix . "keyword_xref on id = keyword_id";
$result = mysql_query($sql, $db);
if (!$result) {
    die("Revo Gateway API error - Invalid Keyword query");
}
while ($keyword = mysql_fetch_assoc($result)) {
    $keywordArray[] = $keyword;
}
/* Assemble the output array, list of mapped resources indexed by keyword */
foreach ($keywordArray as $keyword) {
    $outputArray[$keyword['keyword']][] = $keyword['content_id'];
}
$response = errorSuccess('', $outputArray);
logImportEvent("Got all keywords", $db);
mysql_close($db);
echo toJSON($response);
Example #3
0
    die("Revo Gateway API error - Invalid access");
}
/* Get the TV access data  from the database */
$db = connectToDb();
/* Get the plugin event data names */
logImportEvent("Getting all plugin events", $db);
$sql = "SELECT id, name FROM " . $table_prefix . "system_eventnames";
$result = mysql_query($sql, $db);
if (!$result) {
    die("Revo Gateway API error - Invalid TV access query");
}
while ($eventname = mysql_fetch_assoc($result)) {
    $eventNameArray[] = $eventname;
}
/* Get the plugin event map data*/
$sql = "SELECT pluginid, evtid, priority FROM " . $table_prefix . "site_plugin_events, " . $table_prefix . "site_plugins ";
$sql .= " WHERE id = pluginid";
$result = mysql_query($sql, $db);
if (!$result) {
    die("Revo Gateway API error - Invalid plugin event query");
}
while ($eventmap = mysql_fetch_assoc($result)) {
    $eventMapArray[] = $eventmap;
}
/* Assemble the output array */
$outputArray[0] = $eventNameArray;
$outputArray[1] = $eventMapArray;
$response = errorSuccess('', $outputArray);
logImportEvent("Got all plugin events", $db);
mysql_close($db);
echo toJSON($response);
Example #4
0
    die("Revo Gateway API error - Invalid TV access query");
}
while ($tvaccess = mysql_fetch_assoc($result)) {
    $accessArray[] = $tvaccess;
}
/* Get the template data */
$sql = "SELECT * FROM " . $table_prefix . "site_tmplvar_templates";
$result = mysql_query($sql, $db);
if (!$result) {
    die("Revo Gateway API error - Invalid TV template query");
}
while ($tvtemplate = mysql_fetch_assoc($result)) {
    $templateArray[] = $tvtemplate;
}
/* Get the content value data */
$sql = "SELECT * FROM " . $table_prefix . "site_tmplvar_contentvalues";
$result = mysql_query($sql, $db);
if (!$result) {
    die("Revo Gateway API error - Invalid TV content value query");
}
while ($tvcontent = mysql_fetch_assoc($result)) {
    $contentArray[] = $tvcontent;
}
/* Assemble the output array */
$outputArray[0] = $accessArray;
$outputArray[1] = $templateArray;
$outputArray[2] = $contentArray;
$response = errorSuccess('', $outputArray);
logImportEvent("Got all tv data", $db);
mysql_close($db);
echo toJSON($response);
Example #5
0
 *
 * @package provisioner
 *
 *
 */
$resourceArray = array();
/* Protection */
if (REVO_GATEWAY_OPEN != "true") {
    die("Revo Gateway API error - Invalid access");
}
/* Get the resources from the database */
$db = connectToDb();
logImportEvent("Getting all resources", $db);
$sql = "SELECT * FROM " . $table_prefix . "site_content ";
$result = mysql_query($sql, $db);
if (!$result) {
    die("Revo Gateway API error - Invalid Resource query");
}
while ($resource = mysql_fetch_assoc($result)) {
    /* Set the class key for correct creation in Revolution */
    if ($resource['type'] == 'reference') {
        $resource['class_key'] = 'modWebLink';
    } else {
        $resource['class_key'] = 'modDocument';
    }
    $resourceArray[] = $resource;
}
$response = errorSuccess('', $resourceArray);
logImportEvent("Got all resources", $db);
mysql_close($db);
echo toJSON($response);
Example #6
0
        break;
    case 'tv':
        logImportEvent("Getting all TVs", $db);
        $sql = "SELECT * FROM " . $table_prefix . "site_tmplvars";
        $result = mysql_query($sql, $db);
        while ($element = mysql_fetch_assoc($result)) {
            $elementArray[] = $element;
        }
        $response = errorSuccess('', $elementArray);
        logImportEvent("Got all TVs", $db);
        mysql_close($db);
        echo toJSON($response);
        break;
    case 'category':
        logImportEvent("Getting all categories", $db);
        $sql = "SELECT * FROM " . $table_prefix . "categories";
        $result = mysql_query($sql, $db);
        while ($category = mysql_fetch_assoc($result)) {
            $category['parent'] = 0;
            $elementArray[] = $category;
        }
        $response = errorSuccess('', $elementArray);
        logImportEvent("Got all categories", $db);
        mysql_close($db);
        echo toJSON($response);
        break;
    default:
        $response = errorFailure("No such element type", array('type' => $type));
        mysql_close($db);
        echo toJSON($response);
}
Example #7
0
 */
$docgroupArray = array();
$outputMapArray = array();
$outputArray = array();
/* Protection */
if (REVO_GATEWAY_OPEN != "true") {
    die("Revo Gateway API error - Invalid access");
}
/* Get the docgroups from the database */
$db = connectToDb();
/* Get the keywords */
logImportEvent("Getting all docgroups", $db);
$sql = "SELECT a.id, name, private_memgroup, private_webgroup, document FROM " . $table_prefix . "documentgroup_names as a";
$sql .= " LEFT JOIN " . $table_prefix . "document_groups on a.id = document_group";
$result = mysql_query($sql, $db);
if (!$result) {
    die("Revo Gateway API error - Invalid Docgroup query");
}
while ($docgroup = mysql_fetch_assoc($result)) {
    $docgroupArray[] = $docgroup;
}
/* Assemble the output array, list of mapped resources indexed by docgroup name */
foreach ($docgroupArray as $docgroup) {
    $outputMapArray[$docgroup['name']][] = $docgroup['document'];
}
$outputArray[] = $docgroupArray;
$outputArray[] = $outputMapArray;
$response = errorSuccess('', $outputArray);
logImportEvent("Got all docgroups", $db);
mysql_close($db);
echo toJSON($response);