示例#1
0
 /**
  * Test function associated with Stylesheet
  *
  * @return void
  * @test
  */
 public function testStylesheetViewFunctions()
 {
     $this->assertInstanceOf(Zbase\Models\View\Javascript::class, zbase_view_javascript_add('script', 'script.js', 'lte IE 8', []));
     $links = ['scriptOne' => ['src' => 'scriptOne.js'], 'scriptTwo' => ['src' => 'scriptTwo.js'], 'scriptThree' => ['src' => 'scriptThree.js'], 'scriptFour' => ['src' => 'scriptFour.js']];
     $this->assertEquals(5, count(zbase_view_javascripts_set($links)));
     $this->assertInstanceOf(Zbase\Models\View\Javascript::class, zbase_view_javascript('scriptThree'));
     $this->assertNotInstanceOf(Zbase\Models\View\Javascript::class, zbase_view_javascript('scriptFive'));
     $this->assertTrue(zbase_view_javascript_has('scriptThree'));
     $this->assertFalse(zbase_view_javascript_has('scriptFive'));
     $this->assertEquals(5, count(zbase_view_javascripts($links)));
 }
示例#2
0
/**
 * Recaptcha
 *
 * @return recaptcha
 */
function zbase_captcha_render()
{
    $enable = zbase_config_get('recaptcha.enable', false);
    $siteKey = zbase_config_get('recaptcha.sitekey', false);
    if (!empty($siteKey) && !empty($enable)) {
        zbase_view_javascript_add('catcha', 'https://www.google.com/recaptcha/api.js');
        return '<div class="g-recaptcha" data-sitekey="' . $siteKey . '"></div>';
    }
}