Пример #1
0
    }
    $_result = getRequest($_url);
    $_xml = simplexml_load_string($_result);
    if (substr_count($_result, "<failed>") != 0) {
        $_error = $_xml->failed->message;
        $_form = "login";
    } elseif ($_form == "profile") {
        $_url = sprintf("%s/user.acl.info?sid=%s&realm=%s", apiURL(), $_sid, $_realm);
        $_result = getRequest($_url);
        $_acl = simplexml_load_string($_result);
        if (substr_count($_result, "<failed>") != 0) {
            $_error = $_xml->failed->message;
            $_form = "login";
        } else {
            $_industries = selectList('Industry', '');
            $_countries = selectList('Country', '');
        }
        $ACL = array('public', '1', 'acl', '2', 'private', '3');
    }
}
if ($_form == "login") {
    $_sid = "";
    $_realm = "";
}
$_hostLinks = str_replace('[HOST]', hostURL(), '    <link rel="openid.server" title="OpenID Server" href="[HOST]/openid" />' . '    <link rel="openid2.provider" title="OpenID v2 Server" href="[HOST]/openid" />');
$_userLinks = '';
if ($_userName != "") {
    $_userLinks = '    <link rel="meta" type="application/rdf+xml" title="SIOC" href="[HOST]/dataspace/[USER]/sioc.rdf" />' . '    <link rel="meta" type="application/rdf+xml" title="FOAF" href="[HOST]/dataspace/person/[USER]/foaf.rdf" />' . '    <link rel="meta" type="text/rdf+n3" title="FOAF" href="[HOST]/dataspace/person/[USER]/foaf.n3" />' . '    <link rel="meta" type="application/json" title="FOAF" href="[HOST]/dataspace/person/[USER]/foaf.json" />' . '    <link rel="http://xmlns.com/foaf/0.1/primaryTopic"  title="About" href="[HOST]/dataspace/person/[USER]#this" />' . '    <link rel="schema.dc" href="http://purl.org/dc/elements/1.1/" />' . '    <meta name="dc.language" content="en" scheme="rfc1766" />' . '    <meta name="dc.creator" content="[USER]" />' . '    <meta name="dc.description" content="ODS HTML [USER]\'s page" />' . '    <meta name="dc.title" content="ODS HTML [USER]\'s page" />' . '    <link rev="describedby" title="About" href="[HOST]/dataspace/person/[USER]#this" />' . '    <link rel="schema.geo" href="http://www.w3.org/2003/01/geo/wgs84_pos#" />' . '    <meta http-equiv="X-XRDS-Location" content="[HOST]/dataspace/[USER]/yadis.xrds" />' . '    <meta http-equiv="X-YADIS-Location" content="[HOST]/dataspace/[USER]/yadis.xrds" />' . '    <link rel="meta" type="application/xml+apml" title="APML 0.6" href="[HOST]/dataspace/[USER]/apml.xml" />' . '    <link rel="alternate" type="application/atom+xml" title="OpenSocial Friends" href="[HOST]/feeds/people/[USER]/friends" />';
    $_userLinks = str_replace('[HOST]', hostURL(), $_userLinks);
    $_userLinks = str_replace('[USER]', $_userName, $_userLinks);
}
Пример #2
0
function ShowDropDownCategoryList($cat, $cname, $extras = "", $levellimit = 999)
{
    $app = JFactory::getApplication('site');
    require JPATH_COMPONENT_ADMINISTRATOR . DS . 'config.datsogallery.php';
    $db = JFactory::getDBO();
    $user = JFactory::getUser();
    $task = JRequest::getCmd('task');
    $userGroups = JAccess::getGroupsByUser($user->id, true);
    $is_admin = array(7, 8);
    $db->setQuery('SELECT COUNT(cid)' . ' FROM #__datsogallery_catg' . ' WHERE user_id = ' . $user->id);
    $count = $db->loadResult();
    if ($user_categories && $user->id) {
        $where = ' WHERE user_id = ' . $user->id;
    } else {
        $where = ' WHERE cid IN ( ' . $ad_category . ' )';
    }
    $where1 = !array_intersect($is_admin, $userGroups) ? $where : '';
    $query = 'SELECT cid as id, parent AS parent_id, name AS title' . ' FROM #__datsogallery_catg' . $where1 . ' ORDER BY title';
    $db->setQuery($query);
    $rows = $db->loadObjectList();
    $children = array();
    asort($children);
    if (count($rows)) {
        foreach ($rows as $row) {
            $parent = $row->parent_id;
            $list = @$children[$parent] ? $children[$parent] : array();
            array_push($list, $row);
            $children[$parent] = $list;
        }
    }
    if ($user_categories) {
        $root = $user->id && !array_intersect($is_admin, $userGroups) ? $ad_category : 0;
    } else {
        $root = 0;
    }
    $list = JHTML::_('menu.treerecurse', $root, '', array(), $children);
    $items = array();
    $items[] = JHTML::_('select.option', '', ' - ' . JText::_('COM_DATSOGALLERY_SELECT_CATEGORY'));
    if ($user_categories && $user->id && $task != 'editpic' && $count < $ad_max_categories) {
        $items[] = JHTML::_('select.option', 'usercat', ' + ' . JText::_('COM_DATSOGALLERY_CREATE_NEW_CATEGORY'));
    }
    foreach ($list as $item) {
        $items[] = JHTML::_('select.option', $item->id, $item->treename);
    }
    $parlist = selectList($items, $cname, $extras, 'value', 'text', $cat);
    return $parlist;
}