<commit_before><?php
/**
 *  ocs-webserver
 *
 *  Copyright 2016 by pling GmbH.
 *
 *    This file is part of ocs-webserver.
 *
 *    This program is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU Affero General Public License as
 *    published by the Free Software Foundation, either version 3 of the
 *    License, or (at your option) any later version.
 *
 *    This program is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU Affero General Public License for more details.
 *
 *    You should have received a copy of the GNU Affero General Public License
 *    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 **/
?>
<!DOCTYPE html>
<html>
<head>
    <title>Download/Install</title>

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
    <link href="tools/spectre/spectre.css" rel="stylesheet" type="text/css"/>
    <link href="tools/spectre/spectre-icons.css" rel="stylesheet" type="text/css"/>
    <link href="tools/spectre/font-awesome.min.css" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" href="/theme/flatui/css/fontawsome/font-awesome.min.css"  crossorigin="anonymous">
    
    <style>
        .btn.btn-lg {
            font-size: 1.6rem;
            height: 4rem;
            padding: .9rem .8rem;
        }
        
        .btn span.icon {
            background: url(/images_sys/external_link_blue.png) no-repeat;
            background-size: cover;
            float: left;
            width: 18px;
            height: 18px;
            margin-right: 5px;
        }
        
        .btn:hover span.icon {
            background: url(/images_sys/external_link_white.png) no-repeat;
            background-size: cover;
            float: left;
            width: 18px;
            height: 18px;
            margin-right: 5px;
        }

        
    </style>
    
</head>
<body style="height: 350px; background-color: #f8f9fa;">
    
    <?php
    
    $fileName = $this->file_name;
    $lastIndex = strripos($fileName, '.');
    $fileExt = "";
    if(!empty($lastIndex)) {
        $fileExt = substr($fileName, $lastIndex+1);
    }
    $fileExt = strtoupper($fileExt);
    $isAppimage = false;
    if($fileExt == 'APPIMAGE') {
        $isAppimage = true;
    }
    
    $isExternal = ($this->is_external == "true");
    
    ?>
    <main id="ads-page">
        
        <div class="columns" style="background-color: #f8f9fa;">
            <div class="col-8 col-md-12 col-xs-12 col-sm-12 column">
                <div class="toast toast-success" style="margin-bottom: 10px;">
                    <?php if($isExternal) { ?>
                    Click button below to follow external link.
                    <?php } else if($this->link_type == 'download') { ?>
                    Download prepared successfully, click the button below to start.
                    <?php } else { ?>
                    Install prepared successfully, click the button below to start.
                    <?php } ?>
                    
                </div>
                <section class="empty">
                    <?php /*
                        if($isExternal == true) {
                    ?>
                    <div class="empty-icon">
                        <i class="fa fa-external-link"></i>
                    </div>
                    <?php
                        }*/
                    ?>
                    
                    <h1 class="empty-title"><?= $this->project_title ?></h1>
                    
                    
                    <div class="empty-action" style="height: 100px;">
                        
                        <?php
                        if ($_SERVER['REQUEST_METHOD'] == 'POST') { 
                            //echo '<a href="'.$this->url.'">Please click here</a>';
                            echo '<script>top.location.href = "'.$this->url.'"; parent.jQuery.fancybox.close();</script>';

                        } else {
                        ?>
                        <form id="Form1" name="Form1" action="" method="POST">    

                         <?php if($isExternal) {?>
                            <button type="submit" value="External Link" class="btn btn-success btn-lg" style="margin: 0 0 10px;"><span class="icon"></span> External Link (<?= $this->file_size_human ?>)</button>   
                         <?php } else if($this->link_type == 'download') { ?>
                         <button type="submit" value="Continue Download" class="btn btn-success btn-lg" style="margin: 0 0 10px;">Download (<?= $this->file_size_human ?>)</button>
                         <?php } else { ?>
                         <button type="submit" value="Continue Installation" class="btn btn-success btn-lg" style="margin: 0 0 10px;">Installation (<?= $this->file_size_human ?>)</button>
                         <p style="margin: 0;">*Needs <a href="https://www.opendesktop.org/p/1136805/" target="_NEW" style="color: #0088d7;text-decoration: underline;">ocs-url</a> or <a href="https://www.opendesktop.org/p/1175480/" target="_NEW" style="color: #0088d7;text-decoration: underline;">ocs-store</a> to install things</p>
                         <?php } ?>
                         
                         <?php
                         if($isAppimage) {
                             echo("<p style='margin: 0;'>For Appimages we recommend <a href='https://www.opendesktop.org/p/1228228' target='_NEW' style='color: #0088d7;text-decoration: underline;'>AppImageLauncher</a> for system integration</p>");
                         }
                         ?>
                         
                         
                         <?php
                        }
                         ?>

                        </form>   
                        
                        
                    </div>
                    
                    
                    <div class="empty-action" style="height: 100px;">
                        <!--
                        <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
                        <input type="hidden" name="cmd" value="_s-xclick">
                        <input type="hidden" name="hosted_button_id" value="MYAVVME9CMX28">
                        <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" name="submit" alt="PayPal - The safer, easier way to pay online!" border="0">
                        <img alt="" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1" border="0">
                        </form>
                        -->
                        <br>
                        
                            <?php 
                                    $identity = Zend_Auth::getInstance()->getIdentity();
                                    if(null == $identity || (null != $identity && !$this->isSupporter($identity->member_id))) {                                                  
                            ?>
                        <p style="font-size: 18px; position: absolute; bottom: 0px; right: 22%;">
                            Become a <a href="/support" target="_TOP" style="color: #0088d7;text-decoration: underline;">Supporter</a> to help the Creators.
                            <?php   } else if((null != $identity && $this->isSupporter($identity->member_id))) { ?>
                        <p style="font-size: 18px; position: absolute; bottom: 0px; right: 32%;">
                            Thank you for your support!
                            <?php   }?>                            
                            
                        </p>
                    </div>
                </section>
            </div>
        </div>
    </main>

</body>
</html>



<commit_msg>dl popup<commit_after><?php
/**
 *  ocs-webserver
 *
 *  Copyright 2016 by pling GmbH.
 *
 *    This file is part of ocs-webserver.
 *
 *    This program is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU Affero General Public License as
 *    published by the Free Software Foundation, either version 3 of the
 *    License, or (at your option) any later version.
 *
 *    This program is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU Affero General Public License for more details.
 *
 *    You should have received a copy of the GNU Affero General Public License
 *    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 **/
?>
<!DOCTYPE html>
<html>
<head>
    <title>Download/Install</title>

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
    <link href="tools/spectre/spectre.css" rel="stylesheet" type="text/css"/>
    <link href="tools/spectre/spectre-icons.css" rel="stylesheet" type="text/css"/>
    <link href="tools/spectre/font-awesome.min.css" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" href="/theme/flatui/css/fontawsome/font-awesome.min.css"  crossorigin="anonymous">
    
    <style>
        .btn.btn-lg {
            font-size: 1.6rem;
            height: 4rem;
            padding: .9rem .8rem;
        }
        
        .btn span.icon {
            background: url(/images_sys/external_link_blue.png) no-repeat;
            background-size: cover;
            float: left;
            width: 18px;
            height: 18px;
            margin-right: 5px;
        }
        
        .btn:hover span.icon {
            background: url(/images_sys/external_link_white.png) no-repeat;
            background-size: cover;
            float: left;
            width: 18px;
            height: 18px;
            margin-right: 5px;
        }

        
    </style>
    
</head>
<body style="height: 350px; background-color: #f8f9fa;">
    
    <?php
    
    $fileName = $this->file_name;
    $lastIndex = strripos($fileName, '.');
    $fileExt = "";
    if(!empty($lastIndex)) {
        $fileExt = substr($fileName, $lastIndex+1);
    }
    $fileExt = strtoupper($fileExt);
    $isAppimage = false;
    if($fileExt == 'APPIMAGE') {
        $isAppimage = true;
    }
    
    $isExternal = ($this->is_external == "true");
    
    ?>
    <main id="ads-page">
        
        <div class="columns" style="background-color: #f8f9fa;">
            <div class="col-8 col-md-12 col-xs-12 col-sm-12 column">
                <div class="toast toast-success" style="margin-bottom: 10px;">
                    <?php if($isExternal) { ?>
                    Click button below to follow external link.
                    <?php } else if($this->link_type == 'download') { ?>
                    Download prepared successfully, click the button below to start.
                    <?php } else { ?>
                    Installation prepared successfully, click the button below to start.
                    <?php } ?>
                    
                </div>
                <section class="empty">
                    <?php /*
                        if($isExternal == true) {
                    ?>
                    <div class="empty-icon">
                        <i class="fa fa-external-link"></i>
                    </div>
                    <?php
                        }*/
                    ?>
                    
                    <h1 class="empty-title"><?= $this->project_title ?></h1>
                    
                    
                    <div class="empty-action" style="height: 100px;">
                        
                        <?php
                        if ($_SERVER['REQUEST_METHOD'] == 'POST') { 
                            //echo '<a href="'.$this->url.'">Please click here</a>';
                            echo '<script>top.location.href = "'.$this->url.'"; parent.jQuery.fancybox.close();</script>';

                        } else {
                        ?>
                        <form id="Form1" name="Form1" action="" method="POST">    

                         <?php if($isExternal) {?>
                            <button type="submit" value="External Link" class="btn btn-success btn-lg" style="margin: 0 0 10px;"><span class="icon"></span> External Link (<?= $this->file_size_human ?>)</button>   
                         <?php } else if($this->link_type == 'download') { ?>
                         <button type="submit" value="Continue Download" class="btn btn-success btn-lg" style="margin: 0 0 10px;">Download (<?= $this->file_size_human ?>)</button>
                         <?php } else { ?>
                         <button type="submit" value="Continue Installation" class="btn btn-success btn-lg" style="margin: 0 0 10px;">Install (<?= $this->file_size_human ?>)</button>
                         <p style="margin: 0;">*Needs <a href="https://www.opendesktop.org/p/1136805/" target="_NEW" style="color: #0088d7;text-decoration: underline;">ocs-url</a> or <a href="https://www.opendesktop.org/p/1175480/" target="_NEW" style="color: #0088d7;text-decoration: underline;">ocs-store</a> to install things</p>
                         <?php } ?>
                         
                         <?php
                         if($isAppimage) {
                             echo("<p style='margin: 0;'>For Appimages we recommend <a href='https://www.opendesktop.org/p/1228228' target='_NEW' style='color: #0088d7;text-decoration: underline;'>AppImageLauncher</a> for system integration</p>");
                         }
                         ?>
                         
                         
                         <?php
                        }
                         ?>

                        </form>   
                        
                        
                    </div>
                    
                    
                    <div class="empty-action" style="height: 100px;">
                        <!--
                        <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
                        <input type="hidden" name="cmd" value="_s-xclick">
                        <input type="hidden" name="hosted_button_id" value="MYAVVME9CMX28">
                        <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" name="submit" alt="PayPal - The safer, easier way to pay online!" border="0">
                        <img alt="" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1" border="0">
                        </form>
                        -->
                        <br>
                        
                            <?php 
                                    $identity = Zend_Auth::getInstance()->getIdentity();
                                    if(null == $identity || (null != $identity && !$this->isSupporter($identity->member_id))) {                                                  
                            ?>
                        <p style="font-size: 18px; position: absolute; bottom: 0px; right: 22%;">
                            Become a <a href="/support" target="_TOP" style="color: #0088d7;text-decoration: underline;">Supporter</a> to help the Creators.
                            <?php   } else if((null != $identity && $this->isSupporter($identity->member_id))) { ?>
                        <p style="font-size: 18px; position: absolute; bottom: 0px; right: 32%;">
                            Thank you for your support!
                            <?php   }?>                            
                            
                        </p>
                    </div>
                </section>
            </div>
        </div>
    </main>

</body>
</html>




{'fraction_non_alphanumeric': 0.1358325523273977, 'fraction_numerical': 0.015245235863792565, 'mean_word_length': 1.3733689205219455, 'pattern_counts': {'":': 0, '<': 197, '<?xml version=': 0, '>': 227, 'https://': 14, 'lorem ipsum': 0, 'www.': 14, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 20, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2365642', 'n_tokens_mistral': 4499, 'n_tokens_neox': 4132, 'n_words': 961}