1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-02 04:40:44 +02:00

Allow inactive themes to be synced with Git. (when .git is detected)

This commit is contained in:
Cameron
2017-10-15 11:55:46 -07:00
parent 0073de8698
commit 0c10295588
2 changed files with 23 additions and 10 deletions

View File

@@ -1347,6 +1347,12 @@ class e_file
$text = `$cmd2 2>&1`; $text = `$cmd2 2>&1`;
$text .= `$cmd3 2>&1`; $text .= `$cmd3 2>&1`;
if(deftrue('e_DEBUG'))
{
$message = date('r')."\t\tgitPull()\t\t".$text;
file_put_contents(e_LOG."fileClass.log",$message,FILE_APPEND);
}
// $text .= `$cmd4 2>&1`; // $text .= `$cmd4 2>&1`;
// $text .= `$cmd5 2>&1`; // $text .= `$cmd5 2>&1`;

View File

@@ -975,7 +975,8 @@ class themeHandler
if(!empty($_POST['git_pull'])) if(!empty($_POST['git_pull']))
{ {
$return = e107::getFile()->gitPull($this->curTheme, 'theme'); $gitTheme = e107::getParser()->filter($_POST['git_pull'],'w');
$return = e107::getFile()->gitPull($gitTheme, 'theme');
$mes->addSuccess($return); $mes->addSuccess($return);
} }
@@ -1648,8 +1649,8 @@ class themeHandler
$compat = (version_compare(1.9,$theme['compatibility'],'<')) ? "<span class='label label-warning'>".$theme['compatibility']."</span><span class='text-warning'> ".TPVLAN_77."</span>": vartrue($theme['compatibility'],'1.0'); $compat = (version_compare(1.9,$theme['compatibility'],'<')) ? "<span class='label label-warning'>".$theme['compatibility']."</span><span class='text-warning'> ".TPVLAN_77."</span>": vartrue($theme['compatibility'],'1.0');
$price = (!empty($theme['price'])) ? "<span class='label label-primary'><i class='icon-shopping-cart icon-white'></i> ".$theme['price']."</span>" : "<span class='label label-success'>".TPVLAN_76."</span>"; $price = (!empty($theme['price'])) ? "<span class='label label-primary'><i class='icon-shopping-cart icon-white'></i> ".$theme['price']."</span>" : "<span class='label label-success'>".TPVLAN_76."</span>";
$text = e107::getForm()->open('theme-info','post');
$text = "<table class='table table-striped'>"; $text .= "<table class='table table-striped'>";
@@ -1676,7 +1677,11 @@ class themeHandler
$text .= "<tr><td><b>".LAN_CATEGORY."</b></td><td>".$theme['category']."</td></tr>"; $text .= "<tr><td><b>".LAN_CATEGORY."</b></td><td>".$theme['category']."</td></tr>";
} }
if(is_dir(e_THEME.$theme['path']."/.git"))
{
$text .= "<tr><td><b>Developer</b></td>
<td >".$this->frm->admin_button('git_pull', $theme['path'], 'primary', e107::getParser()->toGlyph('fa-refresh'). "Git Sync")."</td></tr>";
}
$itext = ''; $itext = '';
@@ -1742,6 +1747,8 @@ class themeHandler
// $text .= "</td></tr>"; // $text .= "</td></tr>";
$text .= $itext."</table>"; $text .= $itext."</table>";
$text .= e107::getForm()->close();
if(count($theme['preview'])) if(count($theme['preview']))
{ {
@@ -1767,7 +1774,7 @@ class themeHandler
// $text .= "<div class='right'><a href='#themeInfo_".$theme['id']."' class='e-expandit'>Close</a></div>"; // $text .= "<div class='right'><a href='#themeInfo_".$theme['id']."' class='e-expandit'>Close</a></div>";
if(E107_DEBUG_LEVEL > 0) if(E107_DEBUG_LEVEL > 0)
{ {
// $text .= print_a($theme, true); // $text .= print_a($theme, true);
@@ -2143,11 +2150,11 @@ class themeHandler
$text .= "</td></tr>"; $text .= "</td></tr>";
if(is_dir(e_THEME.$this->id."/.git")) if(is_dir(e_THEME.$this->id."/.git"))
{ {
$text .= "<tr><td><b>Developer</b></td> $text .= "<tr><td><b>Developer</b></td>
<td >".$this->frm->admin_button('git_pull', 1, 'primary', $tp->toGlyph('fa-refresh'). "Git Sync")."</td></tr>"; <td >".$this->frm->admin_button('git_pull', $this->id, 'primary', $tp->toGlyph('fa-refresh'). "Git Sync")."</td></tr>";
} }
// site theme.. // site theme..