Skip to content

Commit

Permalink
All of the hard-coded images that are also available as a CSS sprite …
Browse files Browse the repository at this point in the history
…replaced by their sprite counterparts.

Remove unused css styles for iconic view for ul items.
Update the CSS file in the "original" theme.
  • Loading branch information
hisamith committed Mar 5, 2013
1 parent c88420a commit bc47ff4
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 220 deletions.
29 changes: 26 additions & 3 deletions libraries/Message.class.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class PMA_Message
PMA_Message::NOTICE => 'notice', PMA_Message::NOTICE => 'notice',
PMA_Message::ERROR => 'error', PMA_Message::ERROR => 'error',
); );

/** /**
* The message number * The message number
* *
Expand Down Expand Up @@ -638,7 +638,10 @@ public function getMessage()
$message = $string; $message = $string;
} }
} }


if ($this->isDisplayed()) {
$message = $this->getMessageWithIcon($message);
}
if (count($this->getParams()) > 0) { if (count($this->getParams()) > 0) {
$message = PMA_Message::format($message, $this->getParams()); $message = PMA_Message::format($message, $this->getParams());
} }
Expand All @@ -651,7 +654,7 @@ public function getMessage()


return $message; return $message;
} }

/** /**
* returns PMA_Message::$string * returns PMA_Message::$string
* *
Expand Down Expand Up @@ -720,5 +723,25 @@ public function isDisplayed($isDisplayed = false)


return $this->isDisplayed; return $this->isDisplayed;
} }

/**
* Returns the message with corresponding image icon
*
* @param string $message the message(s)
* @return string message with icon
*/
public function getMessageWithIcon($message){
$image = '';
if('error' == $this->getLevel()){
$image = 's_error.png';
} elseif('success' == $this->getLevel()){
$image = 's_success.png';
} else {
$image = 's_notice.png';
}
$message = PMA_Message::notice(PMA_Util::getImage($image))." ".$message;
return $message;

}
} }
?> ?>
112 changes: 3 additions & 109 deletions themes/original/css/common.css.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -487,15 +487,6 @@
h1.success, h1.success,
div.success { div.success {
border-color: #00FF00; border-color: #00FF00;
background-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('s_success.png');?>);
background-repeat: no-repeat;
<?php if ($GLOBALS['text_dir'] === 'ltr') { ?>
background-position: 5px 50%;
padding: 0.2em 0.2em 0.2em 25px;
<?php } else { ?>
background-position: 99% 50%;
padding: 0.2em 35px 0.2em 0.2em;
<?php } ?>
} }
.success h1 { .success h1 {
border-color: #00FF00; border-color: #00FF00;
Expand All @@ -508,15 +499,6 @@
h1.notice, h1.notice,
div.notice { div.notice {
border-color: #FFD700; border-color: #FFD700;
background-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('s_notice.png');?>);
background-repeat: no-repeat;
<?php if ($GLOBALS['text_dir'] === 'ltr') { ?>
background-position: 5px 50%;
padding: 0.2em 0.2em 0.2em 25px;
<?php } else { ?>
background-position: 99% 50%;
padding: 0.2em 35px 0.2em 0.2em;
<?php } ?>
} }
.notice h1 { .notice h1 {
border-color: #FFD700; border-color: #FFD700;
Expand All @@ -530,15 +512,6 @@
h1.error, h1.error,
div.error { div.error {
border-color: #ff0000; border-color: #ff0000;
background-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('s_error.png');?>);
background-repeat: no-repeat;
<?php if ($GLOBALS['text_dir'] === 'ltr') { ?>
background-position: 5px 50%;
padding: 0.2em 0.2em 0.2em 25px;
<?php } else { ?>
background-position: 99% 50%;
padding: 0.2em 35px 0.2em 0.2em;
<?php } ?>
} }
div.error h1 { div.error h1 {
border-color: #ff0000; border-color: #ff0000;
Expand Down Expand Up @@ -1279,90 +1252,15 @@
} }
/* END main page */ /* END main page */



/* iconic view for ul items */ /* iconic view for ul items */
li#li_create_database {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('b_newdb.png');?>);
}

li#li_select_lang {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('s_lang.png');?>);
}

li#li_select_mysql_collation {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('s_asci.png');?>);
}

li#li_select_theme {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('s_theme.png');?>);
}

li#li_user_info {
/* list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('s_rights.png');?>); */
}


li#li_mysql_status { li.no_bullets {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('s_status.png');?>); list-style-type:none !important;
margin-left: -25px !important; //align with other list items which have bullets
} }


li#li_mysql_variables {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('s_vars.png');?>);
}

li#li_mysql_processes {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('s_process.png');?>);
}

li#li_mysql_collations {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('s_asci.png');?>);
}

li#li_mysql_engines {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('b_engine.png');?>);
}

li#li_mysql_binlogs {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('s_tbl.png');?>);
}

li#li_mysql_databases {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('s_db.png');?>);
}

li#li_export {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('b_export.png');?>);
}

li#li_import {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('b_import.png');?>);
}

li#li_change_password {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('s_passwd.png');?>);
}

li#li_log_out {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('s_loggoff.png');?>);
}

li#li_mysql_privilegs {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('s_rights.png');?>);
}

li#li_switch_dbstats {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('b_dbstatistics.png');?>);
}

li#li_flush_privileges {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('s_reload.png');?>);
}

li#li_user_preferences {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('b_tblops.png');?>);
}
/* END iconic view for ul items */ /* END iconic view for ul items */



#body_browse_foreigners { #body_browse_foreigners {
background: <?php echo $GLOBALS['cfg']['NaviBackground']; ?>; background: <?php echo $GLOBALS['cfg']['NaviBackground']; ?>;
margin: .5em .5em 0 .5em; margin: .5em .5em 0 .5em;
Expand Down Expand Up @@ -1490,10 +1388,6 @@
display: none; display: none;
} }


#li_select_server {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('s_host.png');?>);
}

#list_server { #list_server {
list-style-image: none; list-style-image: none;
} }
Expand Down
111 changes: 3 additions & 108 deletions themes/pmahomme/css/common.css.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@
background-repeat: no-repeat; background-repeat: no-repeat;
<?php if ($GLOBALS['text_dir'] === 'ltr') { ?> <?php if ($GLOBALS['text_dir'] === 'ltr') { ?>
background-position: 10px 50%; background-position: 10px 50%;
padding: 10px 10px 10px 25px; padding: 10px 10px 10px 10px;
<?php } else { ?> <?php } else { ?>
background-position: 99% 50%; background-position: 99% 50%;
padding: 10px 35px 10px 10px; padding: 10px 35px 10px 10px;
Expand Down Expand Up @@ -729,14 +729,7 @@


h1.success, h1.success,
div.success { div.success {
border-color: #a2d246; border-color: #a2d246;
background-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('s_success.png');?>);
background-repeat: no-repeat;
<?php if ($GLOBALS['text_dir'] === 'ltr') { ?>
background-position: 5px 50%;
<?php } else { ?>
background-position: 99% 50%;
<?php } ?>
} }
.success h1 { .success h1 {
border-color: #00FF00; border-color: #00FF00;
Expand All @@ -750,13 +743,6 @@
h1.notice, h1.notice,
div.notice { div.notice {
border-color: #3a6c7e; border-color: #3a6c7e;
background-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('s_notice.png');?>);
background-repeat: no-repeat;
<?php if ($GLOBALS['text_dir'] === 'ltr') { ?>
background-position: 5px 50%;
<?php } else { ?>
background-position: 99% 50%;
<?php } ?>
} }


.notice h1 { .notice h1 {
Expand All @@ -771,14 +757,7 @@


h1.error, h1.error,
div.error { div.error {
border-color: #333; border-color: #333;
background-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('s_error.png');?>);
background-repeat: no-repeat;
<?php if ($GLOBALS['text_dir'] === 'ltr') { ?>
background-position: 5px 50%;
<?php } else { ?>
background-position: 99% 50%;
<?php } ?>
} }


div.error h1 { div.error h1 {
Expand Down Expand Up @@ -1657,88 +1636,8 @@
margin-left: -25px !important; //align with other list items which have bullets margin-left: -25px !important; //align with other list items which have bullets
} }


li#li_create_database {
//list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('b_newdb.png');?>);
}

li#li_select_lang {
//list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('s_lang.png');?>);
}

li#li_select_mysql_collation {
//list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('s_asci.png');?>);
}

li#li_select_theme {
//list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('s_theme.png');?>);
}

li#li_user_info {
/* list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('s_rights.png');?>); */
}

li#li_mysql_status {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('s_status.png');?>);
}

li#li_mysql_variables {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('s_vars.png');?>);
}

li#li_mysql_processes {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('s_process.png');?>);
}

li#li_mysql_collations {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('s_asci.png');?>);
}

li#li_mysql_engines {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('b_engine.png');?>);
}

li#li_mysql_binlogs {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('s_tbl.png');?>);
}

li#li_mysql_databases {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('s_db.png');?>);
}

li#li_export {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('b_export.png');?>);
}

li#li_import {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('b_import.png');?>);
}

li#li_change_password {
//list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('s_passwd.png');?>);
}

li#li_log_out {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('s_loggoff.png');?>);
}

li#li_mysql_privilegs {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('s_rights.png');?>);
}

li#li_switch_dbstats {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('b_dbstatistics.png');?>);
}

li#li_flush_privileges {
list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('s_reload.png');?>);
}

li#li_user_preferences {
//list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('b_tblops.png');?>);
}
/* END iconic view for ul items */ /* END iconic view for ul items */



#body_browse_foreigners { #body_browse_foreigners {
background: <?php echo $GLOBALS['cfg']['NaviBackground']; ?>; background: <?php echo $GLOBALS['cfg']['NaviBackground']; ?>;
margin: .5em .5em 0 .5em; margin: .5em .5em 0 .5em;
Expand Down Expand Up @@ -1880,10 +1779,6 @@
display: none; display: none;
} }


#li_select_server {
//list-style-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('s_host.png');?>);
}

#list_server { #list_server {
list-style-image: none; list-style-image: none;
} }
Expand Down

0 comments on commit bc47ff4

Please sign in to comment.