示例#1
0
 public function actionQuickImages()
 {
     $this->validateToken();
     $this->validatePermission('smartslider_edit');
     $sliderId = N2Request::getInt('sliderid');
     $this->validateVariable($sliderId > 0, 'Slider');
     $images = json_decode(base64_decode(N2Request::getVar('images')), true);
     $this->validateVariable(count($images), 'Images');
     $sliderObj = new N2SmartSlider($sliderId, array());
     $slidesModel = new N2SmartsliderSlidesModel();
     foreach ($images as $image) {
         $newSlideId = $slidesModel->createQuickImage($image, $sliderId);
         $slide = $slidesModel->get($newSlideId);
         $slideObj = new N2SmartSliderSlide($sliderObj, $slide);
         $slideObj->initGenerator();
         $slideObj->fillSample();
         $this->addView('slidebox', array('slider' => $sliderObj, 'slide' => $slideObj));
     }
     ob_start();
     $this->render();
     $box = ob_get_clean();
     N2Message::success(n2_n('Slide created.', 'Slides created.', count($images)));
     $this->response->respond($box);
 }
示例#2
0
function n2_en($single, $plural, $number, $domain = 'nextend')
{
    echo n2_n($single, $plural, $number, $domain);
}