Exemple #1
0
        $results[$key]['url'] .= '?highlight=' . $enc;
    }
}
loader_import('saf.GUI.Pager');
$pg = new Pager($cgi->offset, appconf('limit'));
if ($parameters['multiple'] == 'yes') {
    $t = '';
    if (is_array($parameters['ctype'])) {
        foreach ($parameters['ctype'] as $ct) {
            $t .= '&ctype[]=' . urlencode($ct);
        }
    }
    $d = '';
    if (is_array($parameters['domains'])) {
        foreach ($parameters['domains'] as $ds) {
            $d .= '&domains[]=' . $ds;
        }
    }
} else {
    $t = '&ctype=' . urlencode($parameters['ctype']);
    $d = '&domains=' . urlencode($parameters['domains']);
}
$pg->setUrl(site_current() . '?query=%s' . $t . $d . '&show_types=%s&multiple=%s&show_domains=%s', $enc, $parameters['show_types'], $parameters['multiple'], $parameters['show_domains']);
$pg->total = $total;
$pg->setData($results);
$pg->update();
page_id('search');
page_title('SiteSearch - Results For "' . $cgi->query . '"');
template_simple_register('cgi', $cgi);
template_simple_register('pager', $pg);
echo template_simple('stats_search.spt', array('show_types' => $show_types, 'show_domains' => $show_domains, 'types' => $types, 'domains' => $domains, 'multiple' => $multiple, 'syntax' => $res['metadata']['syntax']));
Exemple #2
0
	//this box is to be listed
	} else {
		//check for an access file, if there isnt on, dont list 
		$access_file = parse_ini_file($path . '/' . $file . '/boxes/index/access.php');
		
		//if there is an access file make sure it states this box should be listed
		if($access_file['sitellite_inline'])//this box is to be listed
		{	
			//see if a) there is a config.ini.php and b) if there is a preferred name in there
			if(file_exists($path . '/' . $file . '/conf/config.ini.php'))
			{	$config_file = parse_ini_file($path . '/' . $file . '/conf/config.ini.php');
				if($config_file['app_name'])
				{	//add data to the boxes array
					$data['boxes'][] = array($file, $config_file['app_name']);
				}
			//there is no app_name to specify, use folder name
			} else {
				//add data to the boxes array
				$data['boxes'][] = array($file, $file);
			}
		}
	}
}*/
//info($data['boxes']);
//$data['friendly_path'] = substr($data['location'], strlen($root)+1);
//$data['url_prefix'] = $data['url_prefix'] . $data['friendly_path'];
// show me the money
//info($data);
template_simple_register('cgi', $cgi);
echo template_simple('index.spt', $data);
exit;
Exemple #3
0
<?php

if (session_admin()) {
    $acl = session_allowed_sql();
} else {
    $acl = session_approved_sql();
}
$res = db_fetch_array('select name, display_title, extension, description from sitellite_filesystem where path = ? and ' . $acl . ' order by name asc', $parameters['path']);
$valid = appconf('valid');
foreach (array_keys($res) as $k) {
    if (!in_array(strtolower($res[$k]->extension), $valid)) {
        unset($res[$k]);
    }
}
if ($parameters['title']) {
    if ($box['context'] == 'action') {
        page_title($parameters['title']);
    } else {
        echo '<h2>' . $parameters['title'] . '</h2>';
    }
}
page_add_script(site_prefix() . '/js/rollover.js');
template_simple_register('results', $res);
template_simple_register('first', array_shift($res));
echo template_simple('slideshow.spt', array('path' => $parameters['path'], 'total' => count($res) + 1, 'desc' => $parameters['descriptions'], 'delay' => $parameters['delay']));
Exemple #4
0
    if (strstr($cgi->lang, '-')) {
        list($code, $locale) = split('-', $cgi->lang);
    } else {
        $code = $cgi->lang;
        $locale = '';
    }
    // rewrite file
    global $intl;
    if (!$intl->writeLanguage($file_lang, $this->lang_hash[$cgi->lang], $code, $locale)) {
        page_title(intl_get('An Error Occurred'));
        echo $intl->error;
        return;
    }
}
if ($parameters['home'] == 'yes') {
    header('Location: ' . site_prefix() . '/index/multilingual-translation-action?appname=' . $cgi->appname);
    exit;
}
$parameters['screen_total'] = ceil(count($index) / $limit);
$parameters['screen_num'] = $cgi->offset / $limit + 1;
$parameters['more'] = $cgi->offset + $limit < count($index) ? true : false;
$show = array_slice($index, $cgi->offset, $limit);
foreach ($show as $k => $v) {
    $show[$k]['current'] = $this->lang_hash[$cgi->lang][stripslashes($k)];
}
header('Content-Type: text/html; charset=' . $cgi->charset);
$langs = ini_parse($file_langs);
page_title(intl_get('Editing Language') . ': ' . $langs[$cgi->lang]['name']);
template_simple_register('show', $show);
echo template_simple('translation_strings.spt', $parameters);
//info ($show, true);
Exemple #5
0
<?php

loader_import('sitegallery.Functions');
if (session_admin()) {
    $acl = session_allowed_sql();
} else {
    $acl = session_approved_sql();
}
$res = db_fetch_array('select name, display_title, extension, description from sitellite_filesystem where path = ? and ' . $acl . ' order by name asc', $parameters['path']);
if ($parameters['title']) {
    if ($box['context'] == 'action') {
        page_title($parameters['title']);
    } else {
        echo '<h2>' . $parameters['title'] . '</h2>';
    }
}
$valid = appconf('valid');
foreach (array_keys($res) as $k) {
    if (!in_array(strtolower($res[$k]->extension), $valid)) {
        unset($res[$k]);
        continue;
    }
    $res[$k]->src = sitegallery_get_thumbnail($parameters['path'] . '/' . $res[$k]->name . '.' . $res[$k]->extension, true);
    //list ($res[$k]->width, $res[$k]->height) = getimagesize ('inc/data/' . $parameters['path'] . '/' . $res[$k]->name . '.' . $res[$k]->extension);
}
template_simple_register('results', $res);
page_add_script(site_prefix() . '/inc/app/sitegallery/js/prototype.js');
page_add_script(site_prefix() . '/inc/app/sitegallery/js/scriptaculous.js?load=effects');
page_add_script(site_prefix() . '/inc/app/sitegallery/js/lightbox.js');
page_add_style(site_prefix() . '/inc/app/sitegallery/html/lightbox.css');
echo template_simple('gallery.spt', array('path' => $parameters['path'], 'total' => count($res) + 1, 'desc' => $parameters['descriptions']));
Exemple #6
0
    $multiple = false;
}
global $cgi;
if (isset($cgi->ctype)) {
    $parameters['ctype'] = $cgi->ctype;
}
loader_import('sitesearch.Logger');
$logger = new SiteSearchLogger();
if ($parameters['show_types'] == 'yes') {
    $show_types = true;
    $data = $logger->getCurrentIndex();
    if (!$data) {
        $types = array();
    } else {
        $counts = unserialize($data->counts);
        if (!is_array($counts)) {
            $types = array();
        } else {
            loader_import('sitesearch.Filters');
            $types = array();
            foreach ($counts as $k => $c) {
                $types[$k] = sitesearch_filter_ctype($k);
            }
            asort($types);
        }
    }
} else {
    $show_types = false;
}
template_simple_register('parameters', $parameters);
echo template_simple('sidebar.spt', array('show_types' => $show_types, 'types' => $types, 'multiple' => $multiple));
Exemple #7
0
        $perms = $vals['requires'];
        switch ($perms) {
            case 'r':
            case 'w':
            case 'rw':
                if (session_is_resource($cgi->collection) && !session_allowed($cgi->collection, $perms, 'resource')) {
                    continue;
                }
                break;
        }
        if (isset($vals['requires resource'])) {
            if (session_is_resource($vals['requires resource']) && !session_allowed($vals['requires resource'], 'rw', 'resource')) {
                continue;
            }
        }
        $vals['text'] = intl_get($vals['text']);
        if (strpos($vals['url'], '/index/') === 0) {
            $vals['url'] = site_prefix() . $vals['url'];
        }
        $data['links'][] = $vals;
    }
}
echo template_simple(CMS_JS_ALERT_MESSAGE, $GLOBALS['cgi']);
echo loader_box('cms/nav');
template_simple_register('pager', $pg);
template_simple_register('locks', $locks);
template_simple_register('editable', $editable);
template_simple_register('align', $align);
template_simple_register('width', $width);
echo template_simple('browse.spt', $data);
//info ($pg);
Exemple #8
0
 function draw()
 {
     global $cgi;
     if (!isset($cgi->orderBy)) {
         $cgi->orderBy = array_shift(array_keys($this->fields));
     }
     if (!isset($cgi->sort)) {
         $cgi->sort = 'asc';
     }
     if (!isset($cgi->offset)) {
         $cgi->offset = 0;
     }
     $list = $this->getList();
     if (!$list) {
         return false;
     }
     if (!$this->primary_key) {
         $this->primary_key = array_shift(array_keys($this->fields));
     }
     $this->list = array();
     foreach ($list as $row) {
         if (!is_object($row)) {
             $row = (object) $row;
         }
         $this->list[$row->{$this->primary_key}] = $row;
     }
     $pg = new Pager($cgi->offset, $this->limit, $this->total);
     $pg->setUrl(site_current() . '?orderBy=%s&sort=%s' . $this->rememberParams(), $cgi->orderBy, $cgi->sort);
     $pg->getInfo();
     $headers = array();
     foreach ($this->fields as $name => $display) {
         $headers[$name] = new TableHeader($name, $display);
     }
     $this->headers =& $headers;
     $this->first_field = array_shift(array_keys($this->fields));
     template_simple_register('pager', $pg);
     return template_simple($this->template, $this);
 }
Exemple #9
0
<?php

// BEGIN KEEPOUT CHECKING
// Add these lines to the very top of any file you don't want people to
// be able to access directly.
if (!defined('SAF_VERSION')) {
    header('HTTP/1.1 404 Not Found');
    echo "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n" . "<html><head>\n<title>404 Not Found</title>\n</head><body>\n<h1>Not Found</h1>\n" . "The requested URL " . $PHP_SELF . " was not found on this server.<p>\n<hr>\n" . $_SERVER['SERVER_SIGNATURE'] . "</body></html>";
    exit;
}
// END KEEPOUT CHECKING
loader_box('sitellite/nav/init');
// import the global $menu and $page objects
global $menu, $page;
template_simple_register('page', $page);
// the template to display a single menu link.
$template = "<a href=\"{site/prefix}/index/{id}\"{if obj.id eq page.id} class=\"current\"{end if}{if obj.id ne page.id and sitellite_nav_list_in_trail (obj.id)} class=\"parent\"{end if}>{title}</a>\n";
// retrieve the breadcrumb trail to the currently active page.
if ($page->below_page) {
    if (!is_object($menu->{'items_' . $page->id})) {
        $menu->addItem($page->id, $page->title, $page->below_page);
    }
    $trail_as_objects = $menu->{'items_' . $page->id}->trail();
    $trail = array();
    foreach ($trail_as_objects as $obj) {
        $trail[] = $obj->id;
    }
} else {
    $trail = array($page->id);
}
// here we define a few helper functions that will render the menu for us.
Exemple #10
0
        if (!Docs::isClass($parameters['class'], $data['classes'])) {
            die('Invalid class!');
        }
        $data['class'] = $parameters['class'];
        if ($parameters['class'] == '_functions_') {
            $functions = docs_cache('func_data', $parameters['package']);
            if (!is_array($functions)) {
                $functions = docs_cache_store(Docs::getFunctions($parameters['package']), 'func_data', $parameters['package']);
            }
            template_simple_register('functions', $functions);
        } else {
            $class = docs_cache('class_data', $parameters['package'], $parameters['class']);
            if (!is_array($class)) {
                $class = docs_cache_store(Docs::getClass($parameters['package'], $parameters['class']), 'class_data', $parameters['package'], $parameters['class']);
            }
            template_simple_register('class', $class);
        }
    }
} else {
    $data['package'] = false;
    $data['class'] = false;
}
$data['apps'] = Docs::apps();
$data['current'] = $parameters['current'];
$data['current_name'] = $data['apps'][$data['current']];
if (empty($data['current_name'])) {
    $data['current_name'] = appconf('title');
}
page_add_style(site_prefix() . '/inc/app/docs/html/docs.css');
page_add_script(site_prefix() . '/js/jquery-1.2.3.min.js');
page_add_script(site_prefix() . '/js/jquery.cookie.js');