Explorar o código

Use _i() whenever it is possible

Transform FreshRSS_Themes::icon\s? in _i

See https://github.com/marienfressinaud/FreshRSS/issues/655
Marien Fressinaud %!s(int64=11) %!d(string=hai) anos
pai
achega
c8fad68a4f

+ 1 - 1
app/layout/layout.phtml

@@ -56,7 +56,7 @@
 ?>
 <div id="notification" class="notification <?php echo $status; ?>">
 	<span class="msg"><?php echo $msg; ?></span>
-	<a class="close" href=""><?php echo FreshRSS_Themes::icon('close'); ?></a>
+	<a class="close" href=""><?php echo _i('close'); ?></a>
 </div>
 	</body>
 </html>

+ 3 - 3
app/layout/nav_entries.phtml

@@ -1,5 +1,5 @@
 <ul id="nav_entries">
-	<li class="item"><a class="previous_entry" href="#"><?php echo FreshRSS_Themes::icon('prev'); ?></a></li>
-	<li class="item"><a class="up" href="#"><?php echo FreshRSS_Themes::icon('up'); ?></a></li>
-	<li class="item"><a class="next_entry" href="#"><?php echo FreshRSS_Themes::icon('next'); ?></a></li>
+	<li class="item"><a class="previous_entry" href="#"><?php echo _i('prev'); ?></a></li>
+	<li class="item"><a class="up" href="#"><?php echo _i('up'); ?></a></li>
+	<li class="item"><a class="next_entry" href="#"><?php echo _i('next'); ?></a></li>
 </ul>

+ 2 - 2
app/views/configure/archiving.phtml

@@ -5,7 +5,7 @@
 
 	<form method="post" action="<?php echo _url('configure', 'archiving'); ?>">
 		<legend><?php echo _t('archiving_configuration'); ?></legend>
-		<p><?php echo FreshRSS_Themes::icon('help'); ?> <?php echo _t('archiving_configuration_help'); ?></p>
+		<p><?php echo _i('help'); ?> <?php echo _t('archiving_configuration_help'); ?></p>
 
 		<div class="form-group">
 			<label class="group-name" for="old_entries"><?php echo _t('delete_articles_every'); ?></label>
@@ -63,7 +63,7 @@
 				<p><?php echo formatNumber($this->nb_total), ' ', _t('articles'), ', ', formatBytes($this->size_user); ?></p>
 				<input type="hidden" name="optimiseDatabase" value="1" />
 				<button type="submit" class="btn btn-important"><?php echo _t('optimize_bdd'); ?></button>
-				<?php echo FreshRSS_Themes::icon('help'); ?> <?php echo _t('optimize_todo_sometimes'); ?>
+				<?php echo _i('help'); ?> <?php echo _t('optimize_todo_sometimes'); ?>
 			</div>
 		</div>
 

+ 3 - 3
app/views/configure/display.phtml

@@ -62,12 +62,12 @@
 				<thead>
 					<tr>
 						<th> </th>
-						<th title="<?php echo _t('mark_read'); ?>"><?php echo FreshRSS_Themes::icon('read'); ?></th>
-						<th title="<?php echo _t('mark_favorite'); ?>"><?php echo FreshRSS_Themes::icon('bookmark'); ?></th>
+						<th title="<?php echo _t('mark_read'); ?>"><?php echo _i('read'); ?></th>
+						<th title="<?php echo _t('mark_favorite'); ?>"><?php echo _i('bookmark'); ?></th>
 						<th><?php echo _t('sharing'); ?></th>
 						<th><?php echo _t('related_tags'); ?></th>
 						<th><?php echo _t('publication_date'); ?></th>
-						<th><?php echo FreshRSS_Themes::icon('link'); ?></th>
+						<th><?php echo _i('link'); ?></th>
 					</tr>
 				</thead>
 				<tbody>

+ 7 - 7
app/views/configure/sharing.phtml

@@ -4,15 +4,15 @@
 	<a href="<?php echo _url ('index', 'index'); ?>"><?php echo _t('back_to_rss_feeds'); ?></a>
 
 	<form method="post" action="<?php echo _url ('configure', 'sharing'); ?>"
-		data-simple='<div class="form-group" id="group-share-##key##"><label class="group-name">##label##</label><div class="group-controls"><a href="#" class="remove btn btn-attention" data-remove="group-share-##key##"><?php echo FreshRSS_Themes::icon('close'); ?></a>
+		data-simple='<div class="form-group" id="group-share-##key##"><label class="group-name">##label##</label><div class="group-controls"><a href="#" class="remove btn btn-attention" data-remove="group-share-##key##"><?php echo _i('close'); ?></a>
 			<input type="hidden" id="share_##key##_type" name="share[##key##][type]" value="##type##" /></div></div>'
 		data-advanced='<div class="form-group" id="group-share-##key##"><label class="group-name">##label##</label><div class="group-controls">
 			<input type="hidden" id="share_##key##_type" name="share[##key##][type]" value="##type##" />
 			<div class="stick">
 			<input type="text" id="share_##key##_name" name="share[##key##][name]" class="extend" value="" placeholder="<?php echo _t('share_name'); ?>" size="64" />
 			<input type="url" id="share_##key##_url" name="share[##key##][url]" class="extend" value="" placeholder="<?php echo _t('share_url'); ?>" size="64" />
-			<a href="#" class="remove btn btn-attention" data-remove="group-share-##key##"><?php echo FreshRSS_Themes::icon('close'); ?></a></div>
-			<a target="_blank" class="btn" title="<?php echo _t('more_information'); ?>" href="##help##"><?php echo FreshRSS_Themes::icon('help'); ?></a>
+			<a href="#" class="remove btn btn-attention" data-remove="group-share-##key##"><?php echo _i('close'); ?></a></div>
+			<a target="_blank" class="btn" title="<?php echo _t('more_information'); ?>" href="##help##"><?php echo _i('help'); ?></a>
 			</div></div>'>
 		<legend><?php echo _t('sharing'); ?></legend>
 		<?php foreach ($this->conf->sharing as $key => $sharing): ?>
@@ -27,12 +27,12 @@
 						<div class="stick">
 							<input type="text" id="share_<?php echo $key;?>_name" name="share[<?php echo $key;?>][name]" class="extend" value="<?php echo $sharing['name']?>" placeholder="<?php echo _t('share_name'); ?>" size="64" />
 							<input type="url" id="share_<?php echo $key;?>_url" name="share[<?php echo $key;?>][url]" class="extend" value="<?php echo $sharing['url']?>" placeholder="<?php echo _t('share_url'); ?>" size="64" />
-							<a href='#' class='remove btn btn-attention' data-remove="group-share-<?php echo $key; ?>"><?php echo FreshRSS_Themes::icon('close'); ?></a>
+							<a href='#' class='remove btn btn-attention' data-remove="group-share-<?php echo $key; ?>"><?php echo _i('close'); ?></a>
 						</div>
 
-						<a target="_blank" class="btn" title="<?php echo _t('more_information'); ?>" href="<?php echo $share['help']?>"><?php echo FreshRSS_Themes::icon('help'); ?></a>
+						<a target="_blank" class="btn" title="<?php echo _t('more_information'); ?>" href="<?php echo $share['help']?>"><?php echo _i('help'); ?></a>
 					<?php } else { ?>
-					<a href='#' class='remove btn btn-attention' data-remove="group-share-<?php echo $key; ?>"><?php echo FreshRSS_Themes::icon('close'); ?></a>
+					<a href='#' class='remove btn btn-attention' data-remove="group-share-<?php echo $key; ?>"><?php echo _i('close'); ?></a>
 					<?php } ?>
 				</div>
 			</div>
@@ -45,7 +45,7 @@
 						<option value='<?php echo $key?>' data-form='<?php echo $params['form']?>' data-help='<?php if (!empty($params['help'])) {echo $params['help'];}?>'><?php echo _t($key) ?></option>
 					<?php endforeach; ?>
 				</select>
-				<a href='#' class='share add btn'><?php echo FreshRSS_Themes::icon('add'); ?></a>
+				<a href='#' class='share add btn'><?php echo _i('add'); ?></a>
 			</div>
 		</div>
 

+ 4 - 4
app/views/configure/users.phtml

@@ -22,7 +22,7 @@
 			<div class="group-controls">
 				<div class="stick">
 					<input type="password" id="passwordPlain" name="passwordPlain" autocomplete="off" pattern=".{7,}" <?php echo cryptAvailable() ? '' : 'disabled="disabled" '; ?>/>
-					<a class="btn toggle-password"><?php echo FreshRSS_Themes::icon('key'); ?></a>
+					<a class="btn toggle-password"><?php echo _i('key'); ?></a>
 				</div>
 				<noscript><b><?php echo _t('javascript_should_be_activated'); ?></b></noscript>
 			</div>
@@ -34,7 +34,7 @@
 			<div class="group-controls">
 				<div class="stick">
 					<input type="password" id="apiPasswordPlain" name="apiPasswordPlain" autocomplete="off" pattern=".{7,}" <?php echo cryptAvailable() ? '' : 'disabled="disabled" '; ?>/>
-					<a class="btn toggle-password"><?php echo FreshRSS_Themes::icon('key'); ?></a>
+					<a class="btn toggle-password"><?php echo _i('key'); ?></a>
 				</div>
 			</div>
 		</div>
@@ -113,7 +113,7 @@
 			<div class="group-controls">
 				<input type="text" id="token" name="token" value="<?php echo $token; ?>" placeholder="<?php echo _t('blank_to_disable'); ?>"<?php
 					echo Minz_Configuration::canLogIn() ? '' : ' disabled="disabled"'; ?> />
-				<?php echo FreshRSS_Themes::icon('help'); ?> <?php echo _t('explain_token', Minz_Url::display(null, 'html', true), $token); ?>
+				<?php echo _i('help'); ?> <?php echo _t('explain_token', Minz_Url::display(null, 'html', true), $token); ?>
 			</div>
 		</div>
 		<?php } ?>
@@ -184,7 +184,7 @@
 			<div class="group-controls">
 				<div class="stick">
 					<input type="password" id="new_user_passwordPlain" name="new_user_passwordPlain" autocomplete="off" pattern=".{7,}" />
-					<a class="btn toggle-password"><?php echo FreshRSS_Themes::icon('key'); ?></a>
+					<a class="btn toggle-password"><?php echo _i('key'); ?></a>
 				</div>
 				<noscript><b><?php echo _t('javascript_should_be_activated'); ?></b></noscript>
 			</div>

+ 1 - 1
app/views/entry/bookmark.phtml

@@ -13,4 +13,4 @@ $url = Minz_Url::display (array (
 	'params' => Minz_Request::params (),
 ));
 
-echo json_encode (array ('url' => str_ireplace ('&amp;', '&', $url), 'icon' => FreshRSS_Themes::icon(Minz_Request::param ('is_favorite') ? 'non-starred' : 'starred')));
+echo json_encode (array ('url' => str_ireplace ('&amp;', '&', $url), 'icon' => _i(Minz_Request::param ('is_favorite') ? 'non-starred' : 'starred')));

+ 1 - 1
app/views/entry/read.phtml

@@ -13,4 +13,4 @@ $url = Minz_Url::display (array (
 	'params' => Minz_Request::params (),
 ));
 
-echo json_encode (array ('url' => str_ireplace ('&amp;', '&', $url), 'icon' => FreshRSS_Themes::icon(Minz_Request::param ('is_read') ? 'unread' : 'read')));
+echo json_encode (array ('url' => str_ireplace ('&amp;', '&', $url), 'icon' => _i(Minz_Request::param ('is_read') ? 'unread' : 'read')));

+ 3 - 3
app/views/feed/add.phtml

@@ -29,7 +29,7 @@
 			<label class="group-name"><?php echo _t('website_url'); ?></label>
 			<div class="group-controls">
 				<?php echo $this->feed->website(); ?>
-				<a class="btn" target="_blank" href="<?php echo $this->feed->website(); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a>
+				<a class="btn" target="_blank" href="<?php echo $this->feed->website(); ?>"><?php echo _i('link'); ?></a>
 			</div>
 		</div>
 		<?php } ?>
@@ -39,7 +39,7 @@
 			<div class="group-controls">
 				<div class="stick">
 					<input type="text" name="url_rss" id="url" class="extend" value="<?php echo $this->feed->url(); ?>" />
-					<a class="btn" target="_blank" href="<?php echo $this->feed->url(); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a>
+					<a class="btn" target="_blank" href="<?php echo $this->feed->url(); ?>"><?php echo _i('link'); ?></a>
 				</div>
 				<a class="btn" target="_blank" href="http://validator.w3.org/feed/check.cgi?url=<?php echo $this->feed->url(); ?>"><?php echo _t('feed_validator'); ?></a>
 			</div>
@@ -76,7 +76,7 @@
 			</div>
 
 			<div class="group-controls">
-				<?php echo FreshRSS_Themes::icon('help'); ?> <?php echo _t('access_protected_feeds'); ?>
+				<?php echo _i('help'); ?> <?php echo _t('access_protected_feeds'); ?>
 			</div>
 		</div>
 

+ 4 - 4
app/views/helpers/feed/update.phtml

@@ -36,7 +36,7 @@
 			<div class="group-controls">
 				<div class="stick">
 					<input type="text" name="website" id="website" class="extend" value="<?php echo $this->feed->website (); ?>" />
-					<a class="btn" target="_blank" href="<?php echo $this->feed->website (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a>
+					<a class="btn" target="_blank" href="<?php echo $this->feed->website (); ?>"><?php echo _i('link'); ?></a>
 				</div>
 			</div>
 		</div>
@@ -45,7 +45,7 @@
 			<div class="group-controls">
 				<div class="stick">
 					<input type="text" name="url" id="url" class="extend" value="<?php echo $this->feed->url (); ?>" />
-					<a class="btn" target="_blank" href="<?php echo $this->feed->url (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a>
+					<a class="btn" target="_blank" href="<?php echo $this->feed->url (); ?>"><?php echo _i('link'); ?></a>
 				</div>
 
 				<a class="btn" target="_blank" href="http://validator.w3.org/feed/check.cgi?url=<?php echo $this->feed->url (); ?>"><?php echo _t('feed_validator'); ?></a>
@@ -139,7 +139,7 @@
 			<label class="group-name" for="http_user"><?php echo _t('http_username'); ?></label>
 			<div class="group-controls">
 				<input type="text" name="http_user" id="http_user" class="extend" value="<?php echo $auth['username']; ?>" autocomplete="off" />
-				<?php echo FreshRSS_Themes::icon('help'); ?> <?php echo _t('access_protected_feeds'); ?>
+				<?php echo _i('help'); ?> <?php echo _t('access_protected_feeds'); ?>
 			</div>
 
 			<label class="group-name" for="http_pass"><?php echo _t('http_password'); ?></label>
@@ -160,7 +160,7 @@
 			<label class="group-name" for="path_entries"><?php echo _t('css_path_on_website'); ?></label>
 			<div class="group-controls">
 				<input type="text" name="path_entries" id="path_entries" class="extend" value="<?php echo $this->feed->pathEntries (); ?>" placeholder="<?php echo _t('blank_to_disable'); ?>" />
-				<?php echo FreshRSS_Themes::icon('help'); ?> <?php echo _t('retrieve_truncated_feeds'); ?>
+				<?php echo _i('help'); ?> <?php echo _t('retrieve_truncated_feeds'); ?>
 			</div>
 		</div>
 

+ 1 - 1
app/views/helpers/javascript_vars.phtml

@@ -33,7 +33,7 @@ echo ',shortcuts={',
 "},\n";
 
 if (Minz_Request::param ('output') === 'global') {
-	echo "iconClose='", FreshRSS_Themes::icon('close'), "',\n";
+	echo "iconClose='", _i('close'), "',\n";
 }
 
 $authType = Minz_Configuration::authType();

+ 1 - 1
app/views/helpers/view/global_view.phtml

@@ -42,7 +42,7 @@
 
 <div id="overlay"></div>
 <div id="panel"<?php echo $this->conf->display_posts ? '' : ' class="hide_posts"'; ?>>
-	<a class="close" href="#"><?php echo FreshRSS_Themes::icon('close'); ?></a>
+	<a class="close" href="#"><?php echo _i('close'); ?></a>
 </div>
 
 <?php } else { ?>

+ 7 - 7
app/views/helpers/view/normal_view.phtml

@@ -66,7 +66,7 @@ if (!empty($this->entries)) {
 							$arUrl['params']['is_read'] = 0;
 						}
 						?><a class="read" href="<?php echo Minz_Url::display($arUrl); ?>"><?php
-							echo FreshRSS_Themes::icon($item->isRead () ? 'read' : 'unread'); ?></a><?php
+							echo _i($item->isRead () ? 'read' : 'unread'); ?></a><?php
 					?></li><?php
 				}
 				if ($topline_favorite) {
@@ -76,7 +76,7 @@ if (!empty($this->entries)) {
 							$arUrl['params']['is_favorite'] = 0;
 						}
 						?><a class="bookmark" href="<?php echo Minz_Url::display($arUrl); ?>"><?php
-							echo FreshRSS_Themes::icon($item->isFavorite () ? 'starred' : 'non-starred'); ?></a><?php
+							echo _i($item->isFavorite () ? 'starred' : 'non-starred'); ?></a><?php
 					?></li><?php
 				}
 			}
@@ -90,7 +90,7 @@ if (!empty($this->entries)) {
 			?><li class="item website"><a href="<?php echo _url ('index', 'index', 'get', 'f_' . $feed->id ()); ?>"><img class="favicon" src="<?php echo $feed->favicon (); ?>" alt="✇" /> <span><?php echo $feed->name(); ?></span></a></li>
 			<li class="item title"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo $item->title (); ?></a></li>
 			<?php if ($topline_date) { ?><li class="item date"><?php echo $item->date (); ?> </li><?php } ?>
-			<?php if ($topline_link) { ?><li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a></li><?php } ?>
+			<?php if ($topline_link) { ?><li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo _i('link'); ?></a></li><?php } ?>
 		</ul>
 
 		<div class="flux_content">
@@ -111,7 +111,7 @@ if (!empty($this->entries)) {
 								$arUrl['params']['is_read'] = 0;
 							}
 							?><a class="read" href="<?php echo Minz_Url::display($arUrl); ?>"><?php
-								echo FreshRSS_Themes::icon($item->isRead () ? 'read' : 'unread'); ?></a><?php
+								echo _i($item->isRead () ? 'read' : 'unread'); ?></a><?php
 						?></li><?php
 					}
 					if ($bottomline_favorite) {
@@ -121,7 +121,7 @@ if (!empty($this->entries)) {
 								$arUrl['params']['is_favorite'] = 0;
 							}
 							?><a class="bookmark" href="<?php echo Minz_Url::display($arUrl); ?>"><?php
-								echo FreshRSS_Themes::icon($item->isFavorite () ? 'starred' : 'non-starred'); ?></a><?php
+								echo _i($item->isFavorite () ? 'starred' : 'non-starred'); ?></a><?php
 						?></li><?php
 					}
 				} ?>
@@ -132,7 +132,7 @@ if (!empty($this->entries)) {
 					?><div class="dropdown">
 						<div id="dropdown-share-<?php echo $item->id ();?>" class="dropdown-target"></div>
 						<a class="dropdown-toggle" href="#dropdown-share-<?php echo $item->id ();?>">
-							<?php echo FreshRSS_Themes::icon('share'); ?>
+							<?php echo _i('share'); ?>
 							<?php echo _t('share'); ?>
 						</a>
 
@@ -171,7 +171,7 @@ if (!empty($this->entries)) {
 					?><li class="item date"><?php echo $item->date (); ?></li><?php
 				}
 				if ($bottomline_link) {
-					?><li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a></li><?php
+					?><li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo _i('link'); ?></a></li><?php
 				} ?>
 			</ul>
 		</div>