$id = $field;
$nolabel = ($type == "radio") || ($type == "hidden");
- if ($type == 'radio')
+ if ($type == 'radio') {
$id .= $radioCount++;
+ }
if( !$nolabel ) {
echo "<label class='column' for=\"$id\">$text</label>";
$value = intval( $value );
- $n = false;
if ( ( $n = $this->get( $key ) ) !== false ) {
$n += $value;
$this->set( $key, $n ); // exptime?
// Split all copy operations with a source corresponding to the region
// in question.
$newEdits = array();
- foreach ( $this->edits as $i => $edit ) {
+ foreach ( $this->edits as $edit ) {
if ( $edit[0] !== 'copy' ) {
$newEdits[] = $edit;
continue;
* @since 1.17
*/
public function getLatestCoreVersion() {
- global $wgRepositoryPackageStates;
-
- $states = urlencode( implode( '|', $wgRepositoryPackageStates ) );
-
// TODO: use $states
+ //global $wgRepositoryPackageStates;
+ //$states = urlencode( implode( '|', $wgRepositoryPackageStates ) );
$response = Http::get(
"$this->location?format=json&action=mwreleases",
$undoafter = $wgRequest->getVal( 'undoafter' );
$undo = $wgRequest->getVal( 'undo' );
- $text = '';
// For message page not locally set, use the i18n message.
// For other non-existent articles, use preload text if any.
if ( !$this->mTitle->exists() ) {
if( !$this->mFileCache ) {
global $wgCacheDirectory, $wgFileCacheDirectory;
- if ( $wgFileCacheDirectory ) {
- $dir = $wgFileCacheDirectory;
- } elseif ( $wgCacheDirectory ) {
- $dir = "$wgCacheDirectory/html";
- } else {
+ if ( !$wgFileCacheDirectory && !$wgCacheDirectory ) {
throw new MWException( 'Please set $wgCacheDirectory in LocalSettings.php if you wish to use the HTML file cache' );
}
$hash2 = substr( $hash, 0, 2 );
$this->mFileCache = "{$wgFileCacheDirectory}/{$subdir}{$hash1}/{$hash2}/{$key}.html";
- if( $this->useGzip() )
+ if( $this->useGzip() ) {
$this->mFileCache .= '.gz';
+ }
wfDebug( __METHOD__ . ": {$this->mFileCache}\n" );
}
public static function flattenOptions( $options ) {
$flatOpts = array();
- foreach ( $options as $key => $value ) {
+ foreach ( $options as $value ) {
if ( is_array( $value ) ) {
$flatOpts = array_merge( $flatOpts, self::flattenOptions( $value ) );
} else {
$this->loadFile();
$full_url = $this->displayImg->getURL();
- $linkAttribs = false;
$sizeSel = intval( $wgUser->getOption( 'imagesize' ) );
if ( !isset( $wgImageLimits[$sizeSel] ) ) {
$sizeSel = User::getDefaultOption( 'imagesize' );
$width = $width_orig;
$height_orig = $this->displayImg->getHeight( $page );
$height = $height_orig;
- $mime = $this->displayImg->getMimeType();
+
$showLink = false;
$linkAttribs = array( 'href' => $full_url );
$longDesc = $this->displayImg->getLongDesc();
private function processTitle( $text ) {
$workTitle = $text;
$origTitle = Title::newFromText( $workTitle );
- $title = null;
if( !is_null( $this->mTargetNamespace ) && !is_null( $origTitle ) ) {
$title = Title::makeTitle( $this->mTargetNamespace,
global $wgMemc, $wgInterwikiExpiry;
$key = wfMemcKey( 'interwiki', $prefix );
$mc = $wgMemc->get( $key );
- $iw = false;
+
if( $mc && is_array( $mc ) ) { // is_array is hack for old keys
$iw = Interwiki::loadFromArray( $mc );
if( $iw ) {
}
private function logUserLinks( $row ) {
- $userLinks = '';
if( self::isDeleted( $row, LogPage::DELETED_USER ) ) {
$userLinks = '<span class="history-deleted">' .
wfMsgHtml( 'rev-deleted-user' ) . '</span>';
}
private function logAction( $row, $title, $paramArray ) {
- $action = '';
if( self::isDeleted( $row, LogPage::DELETED_ACTION ) ) {
$action = '<span class="history-deleted">' .
wfMsgHtml( 'rev-deleted-event' ) . '</span>';
private function logComment( $row ) {
global $wgContLang;
- $comment = '';
if( self::isDeleted( $row, LogPage::DELETED_COMMENT ) ) {
$comment = '<span class="history-deleted">' .
wfMsgHtml( 'rev-deleted-comment' ) . '</span>';
public static function userCanBitfield( $bitfield, $field ) {
if( $bitfield & $field ) {
global $wgUser;
- $permission = '';
+
if ( $bitfield & LogPage::DELETED_RESTRICTED ) {
$permission = 'suppressrevision';
} else {
$list = array();
- foreach( $data as $date => $messages ) {
+ foreach( $data as $messages ) {
foreach( $messages as $message => $count ) {
$key = $message;
if ( !isset( $list[$key] ) ) $list[$key] = 0;
}
# Check for entry for file extension
- $e = null;
if ( $path ) {
$i = strrpos( $path, '.' );
$e = strtolower( $i ? substr( $path, $i + 1 ) : '' );
$status = $this->poolCounter->acquireForMe();
}
- $result = false;
-
if ( $status->isOK() ) {
switch ( $status->value ) {
case PoolCounter::LOCKED:
$prefix = isset( $info['prefix'] ) ? $info['prefix'] : $name;
$val = array();
- foreach ( $options as $label => $value ) {
+ foreach ( $options as $value ) {
if ( $user->getOption( "$prefix$value" ) ) {
$val[] = $value;
}
return $tz;
default:
$data = explode( ':', $tz, 2 );
- $minDiff = 0;
if ( count( $data ) == 2 ) {
$data[0] = intval( $data[0] );
$data[1] = intval( $data[1] );
// Collect referenced files
$files = array();
- foreach ( $styles as $media => $style ) {
+ foreach ( $styles as $style ) {
// Extract and store the list of referenced files
$files = array_merge( $files, CSSMin::getLocalFileReferences( $style ) );
}
// Sort of nasty way we can get a flat list of files depended on by all styles
$styles = array();
- foreach ( self::organizeFilesByOption( $this->styles, 'media', 'all' ) as $media => $styleFiles ) {
+ foreach ( self::organizeFilesByOption( $this->styles, 'media', 'all' ) as $styleFiles ) {
$styles = array_merge( $styles, $styleFiles );
}
$skinFiles = (array) self::getSkinFiles(
$context->getSkin(), self::organizeFilesByOption( $this->skinStyles, 'media', 'all' )
);
- foreach ( $skinFiles as $media => $styleFiles ) {
+ foreach ( $skinFiles as $styleFiles ) {
$styles = array_merge( $styles, $styleFiles );
}
public static function userCanBitfield( $bitfield, $field ) {
if( $bitfield & $field ) { // aspect is deleted
global $wgUser;
- $permission = '';
if ( $bitfield & self::DELETED_RESTRICTED ) {
$permission = 'suppressrevision';
} elseif ( $field & self::DELETED_TEXT ) {
$lang = $forContent ? $wgContLang : $wgLang;
$msgFunc = $forContent ? "wfMsgForContent" : "wfMsg";
- $s = '';
$changes = self::getChanges( $nbitfield, $obitfield );
array_walk($changes, 'RevisionDeleter::expandMessageArray', $forContent);
$ret = '<li>';
foreach ( $lines as $line ) {
- $m = array();
$display = ltrim( $line );
$ident = strlen( $line ) - strlen( $display );
$diff = $ident - $curIdent;
$errors[] = array( 'cant-move-to-user-page' );
}
} elseif ( !$user->isAllowed( $action ) ) {
- $return = null;
-
// We avoid expensive display logic for quickUserCan's and such
$groups = false;
if ( !$short ) {
return false;
}
- $passwordCorrect = FALSE;
$this->mId = $sId;
if ( !$this->loadFromId() ) {
# Not a valid ID, loadFromId has switched the object to anon for us
wfProfileIn( __METHOD__ );
$found = false;
- $host = '';
// FIXME: IPv6 ??? (http://bugs.php.net/bug.php?id=33170)
if( IP::isIPv4( $ip ) ) {
# Reverse IP, bug 21255
wfProfileIn( __METHOD__ );
global $wgContLang, $wgUser;
$action = $this->getVal( 'Action' );
- $perferred = $wgContLang->getPreferredVariant( false );
// Invalid titles. Bug 21776: The interwikis must redirect even if the page name is empty.
if( is_null($title) || ( ( $title->getDBkey() == '' ) && ( $title->getInterwiki() == '' ) ) ) {
* @return string
*/
public static function listDropDown( $name= '', $list = '', $other = '', $selected = '', $class = '', $tabindex = Null ) {
- $options = '';
$optgroup = false;
$options = self::option( $other, 'other', $selected === 'other' );
}
// remove primary keys
foreach ( $args as $ai => $row ) {
- foreach ( $keys as $ki => $key ) {
+ foreach ( $keys as $key ) {
if ( $row[$key] == null ) {
unset( $row[$key] );
}
}
}
-
// DB2 does not have a proper num_rows() function yet, so we must emulate
// DB2 9.5.4 and the corresponding ibm_db2 driver will introduce
// a working one
}
unset( $res );
- foreach ( $arrToInsert as $blah => $a ) {
+ foreach ( $arrToInsert as $a ) {
// start out with empty identity column, this is so we can return it as a result of the insert logic
$sqlPre = '';
$sqlPost = '';
" INTO $table (" . implode( ',', $keys ) . ") $identityClause VALUES (";
$first = true;
- foreach ( $a as $key => $value ) {
+ foreach ( $a as $value ) {
if ( $first ) {
$first = false;
} else {
}
public function fetch( $mode = SQLSRV_FETCH_BOTH, $object_class = 'stdClass' ) {
- if ( $this->mCursor >= $this->mRowCount || $this->mRowCount == 0 ) return false;
- $ret = false;
+ if ( $this->mCursor >= $this->mRowCount || $this->mRowCount == 0 ) {
+ return false;
+ }
$arrNum = array();
if ( $mode == SQLSRV_FETCH_NUMERIC || $mode == SQLSRV_FETCH_BOTH ) {
- foreach ( $this->mRows[$this->mCursor] as $key => $value ) {
+ foreach ( $this->mRows[$this->mCursor] as $value ) {
$arrNum[] = $value;
}
}
$array_out = array();
$array_hashes = array();
- foreach ( $array_in as $key => $item ) {
+ foreach ( $array_in as $item ) {
$hash = md5( serialize( $item ) );
if ( !isset( $array_hashes[$hash] ) ) {
$array_hashes[$hash] = $hash;
wfRestoreWarnings();
if ( isset( $lob ) ) {
- foreach ( $lob as $lob_i => $lob_v ) {
+ foreach ( $lob as $lob_v ) {
$lob_v->free();
}
}
// count-alias subselect fields to avoid abigious definition errors
$i = 0;
- foreach ( $varMap as $key => &$val ) {
+ foreach ( $varMap as &$val ) {
$val = $val . ' field' . ( $i++ );
}
* @param $field String
*/
private function fieldInfoMulti( $table, $field ) {
- $tableWhere = '';
$field = strtoupper( $field );
if ( is_array( $table ) ) {
$table = array_map( array( &$this, 'tableName' ), $table );
function hasConstraint( $name ) {
global $wgDBmwschema;
- $SQL = "SELECT 1 FROM pg_catalog.pg_constraint c, pg_catalog.pg_namespace n WHERE c.connamespace = n.oid AND conname = '" . pg_escape_string( $this->mConn, $name ) . "' AND n.nspname = '" . pg_escape_string( $this->mConn, $wgDBmwschema ) ."'";
- return $this->numRows( $res = $this->doQuery( $SQL ) );
+ $SQL = "SELECT 1 FROM pg_catalog.pg_constraint c, pg_catalog.pg_namespace n WHERE c.connamespace = n.oid AND conname = '" .
+ pg_escape_string( $this->mConn, $name ) . "' AND n.nspname = '" . pg_escape_string( $this->mConn, $wgDBmwschema ) ."'";
+ $res = $this->doQuery( $SQL );
+ return $this->numRows( $res );
}
- static function newFromParams( $server, $user, $password, $dbName, $failFunction = false, $flags = 0 )
- {
+ static function newFromParams( $server, $user, $password, $dbName, $failFunction = false, $flags = 0 ) {
return new DatabasePostgres( $server, $user, $password, $dbName, $failFunction, $flags );
}
&& preg_match( '/^\w+$/', $wgDBts2schema )
) {
$safeschema = $this->quote_ident( $wgDBmwschema );
- $safeschema2 = $this->quote_ident( $wgDBts2schema );
$this->doQuery( "SET search_path = $safeschema, $wgDBts2schema, public" );
}
// Install plpgsql if needed
$this->setup_plpgsql();
- $superuser = '';
return true; // Reconnect as regular user
} // end superuser
# SQLite can't handle multi-row inserts, so divide up into multiple single-row inserts
if ( isset( $a[0] ) && is_array( $a[0] ) ) {
$ret = true;
- foreach ( $a as $k => $v ) {
+ foreach ( $a as $v ) {
if ( !parent::insert( $table, $v, "$fname/multi-row", $options ) ) {
$ret = false;
}
# SQLite can't handle multi-row replaces, so divide up into multiple single-row queries
if ( isset( $rows[0] ) && is_array( $rows[0] ) ) {
$ret = true;
- foreach ( $rows as $k => $v ) {
+ foreach ( $rows as $v ) {
if ( !parent::replace( $table, $uniqueIndexes, $v, "$fname/multi-row" ) ) {
$ret = false;
}
# Scale the configured load ratios according to the dynamic load (if the load monitor supports it)
$this->getLoadMonitor()->scaleLoads( $nonErrorLoads, $group, $wiki );
- $i = false;
$laggedSlaveMode = false;
# First try quickly looking through the available servers for a server that
* Returns false if there is no connection open
*/
function getAnyOpenConnection( $i ) {
- foreach ( $this->mConns as $type => $conns ) {
+ foreach ( $this->mConns as $conns ) {
if ( !empty( $conns[$i] ) ) {
return reset( $conns[$i] );
}
function commitMasterChanges() {
// Always 0, but who knows.. :)
$masterIndex = $this->getWriterIndex();
- foreach ( $this->mConns as $type => $conns2 ) {
+ foreach ( $this->mConns as $conns2 ) {
if ( empty( $conns2[$masterIndex] ) ) {
continue;
}
function getImageInfo( $data ) {
if( $data && isset( $data['query']['pages'] ) ) {
- foreach( $data['query']['pages'] as $pageid => $info ) {
+ foreach( $data['query']['pages'] as $info ) {
if( isset( $info['imageinfo'][0] ) ) {
return $info['imageinfo'][0];
}
if ( !$this->reposInitialised ) {
$this->initialiseRepos();
}
- foreach ( $this->foreignRepos as $key => $repo ) {
+ foreach ( $this->foreignRepos as $repo ) {
if ( $repo->name == $name)
return $repo;
}
foreach( $this->getInstallSteps() as $stepObj ) {
$step = is_array( $stepObj ) ? $stepObj['name'] : $stepObj;
call_user_func_array( $startCB, array( $step ) );
- $status = null;
# Call our working function
if ( is_array( $stepObj ) ) {
return false;
}
}
- $offset = $row->job_id;
// Try to delete it from the master
$dbw = wfGetDB( DB_MASTER );
return $this->makeFreeExternalLink( $m[0] );
} elseif ( isset( $m[4] ) && $m[4] !== '' ) {
# RFC or PMID
- $CssClass = '';
if ( substr( $m[0], 0, 3 ) === 'RFC' ) {
$keyword = 'RFC';
$urlmsg = 'rfcurl';
$head = array();
$sublevelCount = array();
$levelCount = array();
- $toclevel = 0;
$level = 0;
$prevlevel = 0;
$toclevel = 0;
function setFunctionHook( $id, $callback, $flags = 0 ) {
$this->init();
- foreach ( $this->parsers as $i => $parser ) {
+ foreach ( $this->parsers as $parser ) {
$parser->setFunctionHook( $id, $callback, $flags );
}
}
# check for maximum matching characters (if there are 5 closing
# characters, we will probably need only 3 - depending on the rules)
- $matchingCount = 0;
$rule = $rules[$piece->open];
if ( $count > $rule['max'] ) {
# The specified maximum exists in the callback array, unless the caller
$element = "<$name$attr>";
$element .= "<title>$title</title>";
$argIndex = 1;
- foreach ( $parts as $partIndex => $part ) {
+ foreach ( $parts as $part ) {
if ( isset( $part->eqpos ) ) {
$argName = substr( $part->out, 0, $part->eqpos );
$argValue = substr( $part->out, $part->eqpos + 1 );
# check for maximum matching characters (if there are 5 closing
# characters, we will probably need only 3 - depending on the rules)
- $matchingCount = 0;
$rule = $rules[$piece->open];
if ( $count > $rule['max'] ) {
# The specified maximum exists in the callback array, unless the caller
$titleNode->lastChild = $titleAccum->lastNode;
$element->addChild( $titleNode );
$argIndex = 1;
- foreach ( $parts as $partIndex => $part ) {
+ foreach ( $parts as $part ) {
if ( isset( $part->eqpos ) ) {
// Find equals
$lastNode = false;
return false;
}
-
/**
* Trim ISBN and remove characters which aren't required
*
$page->isRedirect() ? array( 'redirect' => 'no' ) : array()
);
# Mark current revisions
- $difftext = $topmarktext = '';
+ $topmarktext = '';
if( $row->rev_id == $row->page_latest ) {
$topmarktext .= '<span class="mw-uctop">' . $this->messages['uctop'] . '</span>';
# Add rollback link
}
$ip = $block->getRedactedName();
} else {
- $block = new Block();
$ip = trim( $ip );
if ( substr( $ip, 0, 1 ) == "#" ) {
$id = substr( $ip, 1 );
$line = wfMsgReplaceArgs( $msg['blocklistline'], array( $formattedTime, $blocker, $target, $properties ) );
- $unblocklink = '';
$changeblocklink = '';
$toolLinks = '';
if ( $wgUser->isAllowed( 'block' ) ) {
$queries = parent::getPagingQueries();
if ( !is_null( $this->mUserName ) ) {
# Append the username to the query string
- foreach ( $queries as $key => &$query ) {
+ foreach ( $queries as &$query ) {
$query['username'] = $this->mUserName;
}
}
$description_items[] = wfMsg( 'protect-summary-cascade' );
}
- $expiry_description = '';
$stxt = '';
if( $row->pr_expiry != 'infinity' && strlen($row->pr_expiry) ) {
$description_items[] = $protType;
- $expiry_description = ''; $stxt = '';
+ $stxt = '';
if ( $row->pt_expiry != 'infinity' && strlen($row->pt_expiry) ) {
$expiry = Block::decodeExpiry( $row->pt_expiry );
array( 'page_id = ' . $this->mOldTitle->getArticleID() ),
__METHOD__
);
- $deletedOldPage = true;
} else {
# page_latest has to be updated
$currentOldPageRev = Revision::newFromId( $this->mOldTitle->getLatestRevID() );
wfRunHooks( 'SpecialSearchProfiles', array( &$profiles ) );
- foreach( $profiles as $key => &$data ) {
+ foreach( $profiles as &$data ) {
sort($data['namespaces']);
}
$warningHtml = '<h2>' . wfMsgHtml( 'uploadwarning' ) . "</h2>\n"
. '<ul class="warning">';
foreach( $warnings as $warning => $args ) {
- $msg = '';
if( $warning == 'exists' ) {
$msg = "\t<li>" . self::getExistsWarning( $args ) . "</li>\n";
} elseif( $warning == 'duplicate' ) {
# Build a list of IDs for javascript insertion
$this->mSourceIds = array();
- foreach ( $sourceDescriptor as $key => $field ) {
+ foreach ( $sourceDescriptor as $field ) {
if ( !empty( $field['id'] ) ) {
$this->mSourceIds[] = $field['id'];
}
$tagType = 0; // 0-open, 1-close
$bracketState = 0; // 1-tag start, 2-tag name, 0-neither
$entityState = 0; // 0-not entity, 1-entity
- $tag = $ret = $ch = '';
+ $tag = $ret = '';
$openTags = array();
$textLen = strlen( $text );
for ( $pos = 0; $pos < $textLen; ++$pos ) {
*/
protected function getURLVariant() {
global $wgRequest;
- $ret = null;
if ( $this->mURLVariant ) {
return $this->mURLVariant;
*/
protected function getUserVariant() {
global $wgUser;
- $ret = null;
// memoizing this function wreaks havoc on parserTest.php
/* if ( $this->mUserVariant ) { */
return $this->mUserVariant = $this->validateVariant( $ret );
}
-
/**
* Determine the language variant from the Accept-Language header.
*
if ( $pos === false ) {
// No more markup, append final segment
$out .= $this->autoConvert( substr( $text, $startPos ), $variant );
- $startPos = $length;
return $out;
}
global $wgLanguageCode;
$text = parent::translate( $text, $toVariant );
- $letters = '';
switch( $toVariant ) {
case 'kk-cyrl':
case 'kk-kz':
function lastLetter( $word, $allVowels ) {
$lastLetter = array();
- $ar = array();
// Put the word in a form we can play with since we're using UTF-8
$ar = preg_split( '//u', parent::lc( $word ), -1, PREG_SPLIT_NO_EMPTY );
if ( preg_match( '/^\|\s*(.*?)\s*\|\|\s*(.*?)\s*$/', $line, $matches ) ) {
$prefix = $wgContLang->lc( $matches[1] );
$prefix = str_replace( ' ', '_', $prefix );
- $prefix = strtolower( $matches[1] );
+
$url = $matches[2];
if ( preg_match( '/(wikipedia|wiktionary|wikisource|wikiquote|wikibooks|wikimedia)\.org/', $url ) ) {
$local = 1;
$this->makeLanguageLinks ( $site, "_" . $site->suffix );
}
-
foreach ( $dblist as $db ) {
if ( isset( $this->specials[$db] ) ) {
# Special wiki
if (isset($resp['data']['arg']) &&
Net_Gearman_Connection::stringLength($resp['data']['arg'])) {
$arg = json_decode($resp['data']['arg'], true);
- }
+ }
### START MW DIFFERENT BIT
if ( $name != 'mw_job' ) {
$lags = $lb->getLagTimes();
unset( $lags[0] );
echo gmdate( 'H:i:s' ) . ' ';
- foreach ( $lags as $i => $lag ) {
+ foreach ( $lags as $lag ) {
printf( "%-12s " , $lag === false ? 'false' : $lag );
}
echo "\n";
* @return True if there are any results, false if not.
*/
protected function isEmpty() {
- foreach( $this->results as $code => $results ) {
- foreach( $results as $check => $messages ) {
+ foreach( $this->results as $results ) {
+ foreach( $results as $messages ) {
if( !empty( $messages ) ) {
return false;
}
if ( !preg_match( '/Messages([A-Z][a-z_]+)\.php$/', $baseName, $m ) ) {
continue;
}
- $code = str_replace( '_', '-', strtolower( $m[1] ) );
+
$numMessages = $this->getNumMessages( $file );
// print "$code: $numMessages\n";
$total += $numMessages;
$dbsByMaster[$lb->getServerName( 0 )][] = $db;
}
- foreach ( $dbsByMaster as $master => $dbs ) {
+ foreach ( $dbsByMaster as $dbs ) {
$dbConn = wfGetDB( DB_MASTER, array(), $dbs[0] );
$stype = $dbConn->addQuotes( $type );
$res = $dbw->select( 'image', array( 'img_name' ), array( 'img_sha1' => '' ), __METHOD__ );
}
$imageTable = $dbw->tableName( 'image' );
- $oldimageTable = $dbw->tableName( 'oldimage' );
if ( $method == 'pipe' ) {
// @fixme kill this and replace with a second unbuffered DB connection.
// sort of message. Best not to try $row->x stuff...
$fields = get_object_vars( $row );
// Silly for loop over one field...
- foreach ( $fields as $resName => $table ) {
+ foreach ( $fields as $table ) {
// $old should be regexp safe ([a-zA-Z_])
$newTable = preg_replace( '/^' . $old . '/', $new, $table );
$this->output( "Renaming table $table to $newTable\n" );
function runTests( $tests ) {
$ok = true;
- foreach ( $tests as $i => $t ) {
+ foreach ( $tests as $t ) {
$result =
$this->runTest( $t['test'], $t['input'], $t['result'], $t['options'], $t['config'] );
$ok = $ok && $result;
function setup() {
// Get database type and version
$dbType = $this->db->getType();
- $dbVersion = $this->db->getServerVersion();
// will skip unless mysql or sqlite with FTS
$dbSupported =
HAVING n > 1", $fname );
$list = array();
- foreach ( $res as $row ) {
+ foreach ( $result as $row ) {
$list[] = $row->user_name;
}
return $list;
function display( $expand, $indent = 0.0 ) {
usort( $this->children, 'compare_point' );
- $extet = '';
- if ( isset( $expand[$this->name()] ) )
- $ex = true;
- else $ex = false;
+ $ex = isset( $expand[$this->name()] );
+
if ( !$ex ) {
if ( count( $this->children ) ) {
$url = getEscapedProfileUrl( false, false, $expand + array( $this->name() => true ) );
$extet = " <a href=\"$url\">[+]</a>";
- } else $extet = '';
+ } else {
+ $extet = '';
+ }
} else {
$e = array();
- foreach ( $expand as $name => $ep )
- if ( $name != $this->name() )
+ foreach ( $expand as $name => $ep ) {
+ if ( $name != $this->name() ) {
$e += array( $name => $ep );
+ }
+ }
$extet = " <a href=\"" . getEscapedProfileUrl( false, false, $e ) . "\">[–]</a>";
}
<div class='pBody'>
<?php if ( is_array( $cont ) ) { ?>
<ul>
-<?php foreach($cont as $key => $val) { ?>
+<?php foreach($cont as $val) { ?>
<li id="<?php echo Sanitizer::escapeId($val['id']) ?>"<?php
if ( $val['active'] ) { ?> class="active" <?php }
?>><a href="<?php echo htmlspecialchars($val['href']) ?>"<?php echo $this->skin->tooltipAndAccesskey($val['id']) ?>><?php echo htmlspecialchars($val['text']) ?></a></li>
<div class="body">
<?php if ( is_array( $content ) ): ?>
<ul>
- <?php foreach( $content as $key => $val ): ?>
+ <?php foreach( $content as $val ): ?>
<li id="<?php echo Sanitizer::escapeId( $val['id'] ) ?>"<?php if ( $val['active'] ): ?> class="active" <?php endif; ?>><a href="<?php echo htmlspecialchars( $val['href'] ) ?>"<?php echo $this->skin->tooltipAndAccesskey( $val['id'] ) ?>><?php echo htmlspecialchars( $val['text'] ) ?></a></li>
<?php endforeach; ?>
</ul>
<div id="p-views" class="vectorTabs<?php if ( count( $this->data['view_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
<h5><?php $this->msg('views') ?></h5>
<ul<?php $this->html('userlangattributes') ?>>
- <?php foreach ( $this->data['view_urls'] as $key => $link ): ?>
+ <?php foreach ( $this->data['view_urls'] as $link ): ?>
<li<?php echo $link['attributes'] ?>><span><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><?php echo (array_key_exists('img',$link) ? '<img src="'.$link['img'].'" alt="'.$link['text'].'" />' : htmlspecialchars( $link['text'] ) ) ?></a></span></li>
<?php endforeach; ?>
</ul>
<h5><span><?php $this->msg('actions') ?></span><a href="#"></a></h5>
<div class="menu">
<ul<?php $this->html('userlangattributes') ?>>
- <?php foreach ($this->data['action_urls'] as $key => $link ): ?>
+ <?php foreach ($this->data['action_urls'] as $link ): ?>
<li<?php echo $link['attributes'] ?>><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><?php echo htmlspecialchars( $link['text'] ) ?></a></li>
<?php endforeach; ?>
</ul>
<div id="p-personal" class="<?php if ( count( $this->data['personal_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
<h5><?php $this->msg('personaltools') ?></h5>
<ul<?php $this->html('userlangattributes') ?>>
- <?php foreach($this->data['personal_urls'] as $key => $item): ?>
+ <?php foreach($this->data['personal_urls'] as $item): ?>
<li <?php echo $item['attributes'] ?>><a href="<?php echo htmlspecialchars($item['href']) ?>"<?php echo $item['key'] ?><?php if(!empty($item['class'])): ?> class="<?php echo htmlspecialchars($item['class']) ?>"<?php endif; ?>><?php echo htmlspecialchars($item['text']) ?></a></li>
<?php endforeach; ?>
</ul>