예제 #1
0
 public function testBuildStringFromArray()
 {
     $array = array(1, 2, 42);
     $this->assertEquals('1+2+42', \Elabftw\Elabftw\Tools::buildStringFromArray($array));
     $this->assertEquals('1-2-42', \Elabftw\Elabftw\Tools::buildStringFromArray($array, '-'));
     $this->assertFalse(\Elabftw\Elabftw\Tools::buildStringFromArray('pwet'));
 }
예제 #2
0
파일: search.php 프로젝트: corcre/elabftw
                <p class='inline'><?php 
            echo _('Export this result:');
            ?>
 </p>
                <a href='make.php?what=zip&id=<?php 
            echo Tools::buildStringFromArray($results_arr);
            ?>
&type=<?php 
            echo $search_type;
            ?>
'>
                    <img src='img/zip.png' title='make a zip archive' alt='zip' />
                </a>

                <a href='make.php?what=csv&id=<?php 
            echo Tools::buildStringFromArray($results_arr);
            ?>
&type=<?php 
            echo $search_type;
            ?>
'>
                    <img src='img/spreadsheet.png' title='Export in spreadsheet file' alt='Export CSV' />
                </a>
            </div>
            <?php 
            echo "<p class='smallgray'>" . count($results_arr) . " " . ngettext("result found", "results found", count($results_arr)) . " (" . $total_time['time'] . " " . $total_time['unit'] . ")</p>";
            // Display results
            echo "<hr>";
            foreach ($results_arr as $id) {
                if ($search_type === 'experiments') {
                    showXP($id, $_SESSION['prefs']['display']);