function run() { $act = @$_REQUEST['act']; $id = addslashes(@$_REQUEST['id']); // echo($id); switch ($act) { default: $savepc = new wra_image(); // $languages=wra_lang::getlist(); // foreach($languages as $l0){ $savepc->id = intval($id); // print_r($savepc); $savepc->delete(); // } echo '{"success":true}'; // echo '{"success":true,"imgid":"'.$savepc->id.'","tmb":"'.$savepc->tmbpic.'"}'; die(); break; } }
function loadimages($lang = "ru") { // WRA::debug("aaaa"); // WRA::debug($this->defaultvalue); $infoid = $this->defaultvalue; $waslist = array(); if ($infoid != -1) { $waslist = wra_image::getlistfull($infoid, 100, 0, $lang); } foreach ($waslist as $value) { $this->items[count($this->items)] = $value; } // WRA::debug($waslist); }
<?php defined('WERUA') or die('<div style="margin:0 0 auto;width:200px">Ошибка запуска. Contact rdx.dnipro@gmail.com</div>'); $curar = array(); $dict = new wra_dictionary(); //$params=array_filter(explode(';',$this->columns[$columni]->description)); //$this->columns[$columni]->description=""; $infoid = $this->columns[$columni]->defaultvalue; //die($this->columns[$columni]->description.'2'); $waslist = array(); if ($infoid != -1) { $c0->defaultvalue = ''; $waslist = wra_image::getlistfull($infoid, 100); } WRA::debug($waslist); WRA::debug($this->lang); ?> <a href="#" id="linkadd<?php WRA::e($curid); ?> ">Добавить фотографию</a><br/><br/> <script type="text/javascript"> var infoimages=new Array(); </script> <table id="table<?php WRA::e($curid); ?> " style="width:100%"> <thead> <tr> <td style="width:120px">Фотография</td><td style="width:120px">Ссылка</td><td>Описание</td><td>Порядок</td><td>Рамочка</td><td></td>
function run() { $act = @$_REQUEST['act']; switch ($act) { case "ui": $savepc = new wra_image(); $savepc->header = ''; $savepc->description = ''; $ismessage = false; $admimessage = ''; $wimage = wra_admintable::getpic($savepc->pic, $savepc->tmbpic, $ismessage, $admimessage, 'gallery/', 340, 'qqfile', false, true); $savepc->keywords = ''; $savepc->galinfoid = 0; $savepc->width = $wimage->imagewidth; $savepc->height = $wimage->imageheight; $languages = wra_lang::getlist(); $savepc->add("_ru"); $ruid = $savepc->id; foreach ($languages as $l0) { if ($l0->alias != 'ru') { $savepc->add('_' . $l0->alias); } } echo '{"success":true,"imgid":"' . $ruid . '","tmb":"' . WRA::base_url() . $savepc->tmbpic . '"}'; break; case 'uploadimage': $savepc = new wra_image(); $savepc->header = ''; $savepc->description = ''; $ismessage = false; $admimessage = ''; require_once WRA_Path . '/modules/admin/admintable.php'; wra_admintable::getpic($savepc->pic, $savepc->tmbpic, $ismessage, $admimessage, 'gallery/', 240, 'qqfile', false, true); $savepc->keywords = ''; $savepc->galinfoid = -1; $savepc->add(); WRA::e(htmlspecialchars(json_encode(array('success' => true, 'picid' => $savepc->id, 'path' => $savepc->tmbpic, 'oldid' => $_REQUEST['id'])), ENT_NOQUOTES)); break; case 'uploadimagepack': if (isset($_FILES['Filedata'])) { $savepc = new wra_image(); $moreinfo = new wra_iteminfo(); $moreinfo->weight = 0; $moreinfo->alt = ''; $moreinfo->keywords = ''; $moreinfo->autoadres = 0; $moreinfo->adres = ''; $moreinfo->commentopt = 2; $moreinfo->mappriority = 0; $moreinfo->authorid = WRA::curuser()->id; $moreinfo->add(); $savepc->header = ''; $savepc->description = ''; //$savepc->pic=$_POST['fieldpic']; $ismessage = false; $admimessage = ''; require_once '../../modules/admin/admintable.php'; wra_admintable::getpic($savepc->pic, $savepc->tmbpic, $ismessage, $admimessage, 'gallery/', 240, 'Filedata', false, true); $savepc->galleryid = WRA::getreq('galid'); $savepc->keywords = ''; $savepc->infoid = $moreinfo->id; $savepc->add(); } WRA::e($savepc->tmbpic . '~@~' . $savepc->id); break; case 'uploadpic': $savepc = new wra_upfile(); if (isset($_FILES['Filedata'])) { if ($_FILES['Filedata']['size'] != 0) { $savepc->original_filename = $_FILES['Filedata']['name']; $wf = new wra_uploadedfile(WRA_Path); $wf->uploaddir .= 'files/'; $wf->addvalidtype('jpg'); $wf->addvalidtype('png'); $wf->addvalidtype('gif'); $wf->addvalidtype('jpeg'); $wf->addvalidtype('jpeg'); $wf->addvalidtype('docx'); $wf->addvalidtype('pdf'); $wf->addvalidtype('doc'); $wf->upload('Filedata', true); WRA::e($wf->error); if ($wf->error == '') { $savepc->path_to_file = 'upload/files/' . $wf->filename; $savepc->description = $_FILES['Filedata']['name'] . ' - загружено загрузчиком редактора'; $savepc->add(); } else { $ismessage = true; switch ($wf->error) { default: $adminmessage = 'Ошибка загрузки файла'; break; } } } } WRA::e(WRA::base_url() . $savepc->path_to_file); break; } }
static function getlist($count = 10, $page = 0, $lang = "ru") { $result = array(); $wd = new wra_db(); $wd->query = 'SELECT `id` FROM `' . WRA_CONF::$db_prefix . "image" . $lang . "` \n LIMIT " . $page * $count . "," . $count . ""; $wd->executereader(); while ($u0 = $wd->read()) { $r0 = new wra_image(); $r0->loadid($u0[0]); $result[count($result)] = $r0; } $wd->close(); return $result; }
function currow($lang = '') { // WRA::debug($lang); // WRA::debug($this->_currow); // if ( (!isset($this->_currow)) ) { $a = $this->getrows($lang, 1, 1); if (count($a) > 0) { $this->_currow = $a[0]; // WRA::debug($a[0]); foreach ($this->columns as $ac) { switch ($ac->editstatus) { case admincolumntype::multiselect: $ilang = $lang; if ($ilang == '') { $ilang = 'ru'; } $ac->items = wra_multiselect::getlist($ac->multiselect->table, $ac->multiselect->kfield, $ac->multiselect->tfield, $this->curid, $sO); break; case admincolumntype::images: $ilang = $lang; if ($ilang == '') { $ilang = 'ru'; } $items = wra_image::getlistadmin($this->curid, $this->table, $ilang); // WRA::debug($ilang); // WRA::debug($items); if (!empty($items)) { $ac->items[str_replace('_', '', $ilang)] = $items; } break; } } return $this->_currow; } $this->_currow = new adminrows(); foreach ($this->columns as $ac) { $this->_currow->values[$ac->field] = ''; } // } return $this->_currow; }