/**
 * Function will return the communities above the specified community_id, as an array.
 *
 * @param int $community_id
 * @return array
 */
function communities_fetch_parent($community_id = 0)
{
    if (!($community_id = (int) $community_id)) {
        return false;
    }
    $fetched = array();
    communities_fetch_parents($community_id, $fetched, 0, false);
    return $fetched;
}
Example #2
0
            break;
        case 2:
            if (isset($PROCESSED["community_shortname"]) && $PROCESSED["community_shortname"]) {
                $ONLOAD[] = "validateShortname('" . html_encode($PROCESSED["community_shortname"]) . "')";
            }
            if (!isset($PROCESSED["community_registration"]) || !(int) $PROCESSED["community_registration"]) {
                $ONLOAD[] = "selectRegistrationOption('0')";
            } else {
                $ONLOAD[] = "selectRegistrationOption('" . (int) $PROCESSED["community_registration"] . "')";
            }
            $HEAD[] = "<script type=\"text/javascript\" src=\"" . ENTRADA_RELATIVE . "/javascript/jquery/chosen.jquery.min.js\"></script>\n";
            $HEAD[] = "<link rel=\"stylesheet\" type=\"text/css\"  href=\"" . ENTRADA_RELATIVE . "/css/jquery/chosen.css\"></script>\n";
            $ONLOAD[] = "jQuery('.chosen-select').chosen({no_results_text: 'No courses found matching'})";
            if ($COMMUNITY_PARENT) {
                $fetched = array();
                communities_fetch_parents($COMMUNITY_PARENT, $fetched);
                if (is_array($fetched) && @count($fetched)) {
                    $community_parents = array_reverse($fetched);
                } else {
                    $community_parents = false;
                }
                unset($fetched);
            }
            ?>
            <h2>Step 2: Community Details</h2>
			<?php 
            if ($ERROR) {
                echo display_error();
            }
            if ($NOTICE) {
                echo display_notice();