/trunk/api/pear/Pager/examples/example.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Pager/examples/Pager_Wrapper.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Pager/tests/simple_include.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Pager/tests/pager_sliding_noData_test.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Pager/tests/pager_wrapper_test.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Pager/tests/pager_test.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Pager/tests/pager_sliding_notExpanded_test.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Pager/tests/pager_include.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Pager/tests/pager_wrapper_include.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Pager/tests/pager_post_test.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Pager/tests/pager_sliding_test.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Pager/tests/README |
---|
File deleted |
/trunk/api/pear/Pager/tests/pager_jumping_tests.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Pager/tests/pager_jumping_noData_test.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Pager/tests/pager_tests.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Pager/tests/multibyte_post.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Pager/tests/pager_noData_test.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Pager/tests/pager_post_tests.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Pager/tests/pager_jumping_test.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Pager/tests/pager_sliding_tests.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Pager/tests/pager_test_xss.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Pager/tests/all_tests.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Pager/Common.php |
---|
42,8 → 42,9 |
* when the user doesn't set any other value |
*/ |
if (substr($_SERVER['PHP_SELF'], -1) == '/') { |
$http = !empty($_SERVER['HTTPS']) ? 'https://' : 'http://'; |
define('CURRENT_FILENAME', ''); |
define('CURRENT_PATHNAME', 'http://'.$_SERVER['HTTP_HOST'].str_replace('\\', '/', $_SERVER['PHP_SELF'])); |
define('CURRENT_PATHNAME', $http.$_SERVER['HTTP_HOST'].str_replace('\\', '/', $_SERVER['PHP_SELF'])); |
} else { |
define('CURRENT_FILENAME', preg_replace('/(.*)\?.*/', '\\1', basename($_SERVER['PHP_SELF']))); |
define('CURRENT_PATHNAME', str_replace('\\', '/', dirname($_SERVER['PHP_SELF']))); |
199,6 → 200,12 |
* @access private |
*/ |
var $_attributes = ''; |
/** |
* @var string onclick |
* @access private |
*/ |
var $_onclick = ''; |
/** |
* @var string alt text for "first page" (use "%d" placeholder for page number) |
445,6 → 452,7 |
'expanded', |
'accesskey', |
'attributes', |
'onclick', |
'separator', |
'spacesBeforeSeparator', |
'spacesAfterSeparator', |
475,7 → 483,7 |
// }}} |
// {{{ build() |
/** |
* Generate or refresh the links and paged data after a call to setOptions() |
* |
483,9 → 491,29 |
*/ |
function build() |
{ |
$msg = '<b>PEAR::Pager Error:</b>' |
.' function "build()" not implemented.'; |
return $this->raiseError($msg, ERROR_PAGER_NOT_IMPLEMENTED); |
//reset |
$this->_pageData = array(); |
$this->links = ''; |
$this->_generatePageData(); |
$this->_setFirstLastText(); |
if ($this->_totalPages > (2 * $this->_delta + 1)) { |
$this->links .= $this->_printFirstPage(); |
} |
$this->links .= $this->_getBackLink(); |
$this->links .= $this->_getPageLinks(); |
$this->links .= $this->_getNextLink(); |
$this->linkTags .= $this->_getFirstLinkTag(); |
$this->linkTags .= $this->_getPrevLinkTag(); |
$this->linkTags .= $this->_getNextLinkTag(); |
$this->linkTags .= $this->_getLastLinkTag(); |
if ($this->_totalPages > (2 * $this->_delta + 1)) { |
$this->links .= $this->_printLastPage(); |
} |
} |
// }}} |
752,11 → 780,16 |
} else { |
$href = str_replace('%d', $this->_linkData[$this->_urlVar], $this->_fileName); |
} |
return sprintf('<a href="%s"%s%s%s title="%s">%s</a>', |
$onclick = ''; |
if (array_key_exists($this->_urlVar, $this->_linkData)) { |
$onclick = str_replace('%d', $this->_linkData[$this->_urlVar], $this->_onclick); |
} |
return sprintf('<a href="%s"%s%s%s%s title="%s">%s</a>', |
htmlentities($this->_url . $href), |
empty($this->_classString) ? '' : ' '.$this->_classString, |
empty($this->_attributes) ? '' : ' '.$this->_attributes, |
empty($this->_accesskey) ? '' : ' accesskey="'.$this->_linkData[$this->_urlVar].'"', |
empty($onclick) ? '' : ' onclick="'.$onclick.'"', |
$altText, |
$linkText |
); |
894,15 → 927,15 |
$qs = $_GET; |
} |
} |
if (count($this->_extraVars)){ |
$this->_recursive_urldecode($this->_extraVars); |
} |
$qs = array_merge($qs, $this->_extraVars); |
foreach ($this->_excludeVars as $exclude) { |
if (array_key_exists($exclude, $qs)) { |
unset($qs[$exclude]); |
} |
} |
if (count($this->_extraVars)){ |
$this->_recursive_urldecode($this->_extraVars); |
$qs = array_merge($qs, $this->_extraVars); |
} |
if (count($qs) && get_magic_quotes_gpc()){ |
$this->_recursive_stripslashes($qs); |
} |
1293,6 → 1326,10 |
function __http_build_query($array, $name) |
{ |
$tmp = array (); |
$separator = ini_get('arg_separator.output'); |
if ($separator == '&') { |
$separator = '&'; //the string is escaped by htmlentities anyway... |
} |
foreach ($array as $key => $value) { |
if (is_array($value)) { |
//array_push($tmp, $this->__http_build_query($value, sprintf('%s[%s]', $name, $key))); |
1305,7 → 1342,7 |
array_push($tmp, $this->__http_build_query(get_object_vars($value), $name.'%5B'.$key.'%5D')); |
} |
} |
return implode(ini_get('arg_separator.output'), $tmp); |
return implode($separator, $tmp); |
} |
// }}} |
1386,7 → 1423,7 |
if (strncasecmp($this->_fileName, 'javascript', 10) != 0) { |
$this->_url .= '/'; |
} |
if (!strstr($this->_fileName, '%d')) { |
if (strpos($this->_fileName, '%d') === false) { |
trigger_error($this->errorMessage(ERROR_PAGER_INVALID_USAGE), E_USER_WARNING); |
} |
} |
/trunk/api/pear/Pager/Jumping.php |
---|
75,33 → 75,6 |
} |
// }}} |
// {{{ build() |
/** |
* Generate or refresh the links and paged data after a call to setOptions() |
* |
* @access public |
*/ |
function build() |
{ |
//reset |
$this->_pageData = array(); |
$this->links = ''; |
$this->_generatePageData(); |
$this->_setFirstLastText(); |
$this->links .= $this->_getBackLink(); |
$this->links .= $this->_getPageLinks(); |
$this->links .= $this->_getNextLink(); |
$this->linkTags .= $this->_getFirstLinkTag(); |
$this->linkTags .= $this->_getPrevLinkTag(); |
$this->linkTags .= $this->_getNextLinkTag(); |
$this->linkTags .= $this->_getLastLinkTag(); |
} |
// }}} |
// {{{ getPageIdByOffset() |
/** |
188,13 → 161,14 |
} |
if (!is_null($pageID)) { |
$_sav = $this->_currentPage; |
$this->_currentPage = $pageID; |
$this->links = ''; |
if ($this->_totalPages > $this->_delta) { |
$this->links .= $this->_printFirstPage(); |
} |
$_sav = $this->_currentPage; |
$this->_currentPage = $pageID; |
$this->links .= $this->_getBackLink('', $back_html); |
$this->links .= $this->_getPageLinks(); |
$this->links .= $this->_getNextLink('', $next_html); |
/trunk/api/pear/Pager/Sliding.php |
---|
84,41 → 84,6 |
} |
// }}} |
// {{{ build() |
/** |
* Generate or refresh the links and paged data after a call to setOptions() |
* |
* @access public |
*/ |
function build() |
{ |
//reset |
$this->_pageData = array(); |
$this->links = ''; |
$this->_generatePageData(); |
$this->_setFirstLastText(); |
if ($this->_totalPages > (2 * $this->_delta + 1)) { |
$this->links .= $this->_printFirstPage(); |
} |
$this->links .= $this->_getBackLink(); |
$this->links .= $this->_getPageLinks(); |
$this->links .= $this->_getNextLink(); |
$this->linkTags .= $this->_getFirstLinkTag(); |
$this->linkTags .= $this->_getPrevLinkTag(); |
$this->linkTags .= $this->_getNextLinkTag(); |
$this->linkTags .= $this->_getLastLinkTag(); |
if ($this->_totalPages > (2 * $this->_delta + 1)) { |
$this->links .= $this->_printLastPage(); |
} |
} |
// }}} |
// {{{ getPageIdByOffset() |
/** |
/trunk/api/pear/Pager/HtmlWidgets.php |
---|
71,6 → 71,8 |
* - 'attributes': (html attributes) Tag attributes or |
* HTML attributes (id="foo" pairs), will be inserted in the |
* <select> tag |
* - 'checkMaxLimit': if true, Pager checks if $end is bigger |
* than $totalItems, and doesn't show the extra select options |
* @return string xhtml select box |
* @access public |
*/ |
79,6 → 81,7 |
// FIXME: needs POST support |
$optionText = '%d'; |
$attributes = ''; |
$checkMaxLimit = false; |
if (is_string($extraParams)) { |
//old behavior, BC maintained |
$optionText = $extraParams; |
89,6 → 92,9 |
if (array_key_exists('attributes', $extraParams)) { |
$attributes = $extraParams['attributes']; |
} |
if (array_key_exists('checkMaxLimit', $extraParams)) { |
$checkMaxLimit = $extraParams['checkMaxLimit']; |
} |
} |
if (!strstr($optionText, '%d')) { |
105,6 → 111,10 |
} else { |
$selected = $this->pager->_perPage; |
} |
if ($checkMaxLimit && $this->pager->_totalItems > 0 && $this->pager->_totalItems < $end) { |
$end = $this->pager->_totalItems; |
} |
$tmp = '<select name="'.$this->pager->_sessionVar.'"'; |
if (!empty($attributes)) { |
111,7 → 121,9 |
$tmp .= ' '.$attributes; |
} |
$tmp .= '>'; |
$last = $start; |
for ($i=$start; $i<=$end; $i+=$step) { |
$last = $i; |
$tmp .= '<option value="'.$i.'"'; |
if ($i == $selected) { |
$tmp .= ' selected="selected"'; |
118,7 → 130,7 |
} |
$tmp .= '>'.sprintf($optionText, $i).'</option>'; |
} |
if ($showAllData && $end < $this->pager->_totalItems) { |
if ($showAllData && $last != $this->pager->_totalItems) { |
$tmp .= '<option value="'.$this->pager->_totalItems.'"'; |
if ($this->pager->_totalItems == $selected) { |
$tmp .= ' selected="selected"'; |
/trunk/api/pear/Pager/Pager.php |
---|
165,7 → 165,7 |
* @static |
* @access public |
*/ |
function &factory($options = array()) |
static function &factory($options = array()) |
{ |
$mode = (isset($options['mode']) ? ucfirst($options['mode']) : 'Jumping'); |
$classname = 'Pager_' . $mode; |
/trunk/api/pear/Pager/Pager_savebc.php |
---|
New file |
0,0 → 1,3 |
<?php |
require_once 'Pager.php'; |
?> |