public function getSocImgPath($imgName) { $template = frameCsp::_()->getModule('options')->get('template'); if (!empty($template) && frameCsp::_()->getModule($template)) { if (utilsCsp::fileExists(frameCsp::_()->getModule($template)->getModDir() . 'img' . DS . $imgName)) { return frameCsp::_()->getModule($template)->getModPath() . 'img/' . $imgName; } } return uriCsp::_(CSP_IMG_PATH . $imgName); }
public function setLogoDefault($d = array()) { $code = isset($d['code']) ? $d['code'] : ''; if (!empty($code)) { $plTemplate = $this->get('template'); // Current plugin template if ($plTemplate && frameCsp::_()->getModule($plTemplate)) { $newValue = frameCsp::_()->getModule($plTemplate)->getDefOptions($code); if ($newValue !== NULL && file_exists(frameCsp::_()->getModule($plTemplate)->getModDir() . $newValue)) { // Remove prev. image if (utilsCsp::fileExists(frameCsp::_()->getModule('options')->getLogoImgFullDir())) { utilsCsp::deleteFile(frameCsp::_()->getModule('options')->getLogoImgFullDir()); } // Copy new image from tpl module directory to uploads dirctory copy(frameCsp::_()->getModule($plTemplate)->getModDir() . $newValue, utilsCsp::getUploadsDir() . DS . $this->getModule()->getLogoImgDir() . DS . $newValue); if ($this->save(array('opt_values' => array($code => $newValue), 'code' => $code))) { return $this->getModule()->getLogoImgFullPath(); } } else { $this->pushError(langCsp::_('There is no default for this option and current template')); } } else { $this->pushError(langCsp::_('There is no default for this option and current template')); } } else { $this->pushError(langCsp::_('Empty option code')); } return false; }