Iframe Button

This commit is contained in:
Martin Müller 2015-02-27 14:59:50 +01:00
parent 104152d159
commit 4b79bf45e4
6 changed files with 90 additions and 11 deletions

View File

@ -32,26 +32,26 @@
Router::connect('/contact', array('controller' => 'extra', 'action' => 'contact'));
Router::connect('/cooperators', array('controller' => 'extra', 'action' => 'cooperators'));
Router::connect('/team', array('controller' => 'extra', 'action' => 'team'));
Router::connect('/premium', array('controller' => 'extra', 'action' => 'premium'));
Router::connect('/advertise', array('controller' => 'extra', 'action' => 'advertise'));
Router::connect('/adv/company', array('controller' => 'extra', 'action' => 'company'));
Router::connect('/adv/worker', array('controller' => 'extra', 'action' => 'worker'));
Router::connect('/team', array('controller' => 'extra', 'action' => 'team'));
Router::connect('/premium', array('controller' => 'extra', 'action' => 'premium'));
Router::connect('/advertise', array('controller' => 'extra', 'action' => 'advertise'));
Router::connect('/adv/company', array('controller' => 'extra', 'action' => 'company'));
Router::connect('/adv/worker', array('controller' => 'extra', 'action' => 'worker'));
Router::connect('/plus', array('controller' => 'service', 'action' => 'index'));
Router::connect('/plus/:list', array('controller' => 'service','action'=>'index'),array("list"=>"[a-z0-9]+"));
Router::connect('/plus/show/:item', array('controller' => 'service','action'=>'show'),array("item"=>"[a-z0-9]+"));
Router::connect('/plus/:list/:item', array('controller' => 'service','action'=>'show'),array("list"=>"[a-z0-9]+","item"=>"[a-z0-9]+"));
Router::connect('/plus/:list', array('controller' => 'service','action'=>'index'),array("list"=>"[a-z0-9]+"));
Router::connect('/plus/show/:item', array('controller' => 'service','action'=>'show'),array("item"=>"[a-z0-9]+"));
Router::connect('/plus/:list/:item', array('controller' => 'service','action'=>'show'),array("list"=>"[a-z0-9]+","item"=>"[a-z0-9]+"));
Router::connect('/company', array('controller' => 'home', 'action' => 'company'));
Router::connect('/company/registration', array('controller' => 'registration', 'action' => 'company'));
Router::connect('/company/registration', array('controller' => 'registration', 'action' => 'company'));
Router::connect('/registration', array('controller' => 'registration', 'action' => 'worker'));
Router::connect('/registration/active/:code', array('controller' => 'registration', 'action' => 'active'),array("code" => ".+"));
Router::connect('/password/reset', array('controller' => 'registration', 'action' => 'password_reset'));
Router::connect('/password/replace/:code', array('controller' => 'registration', 'action' => 'password_replace'),array("code" => ".+"));
Router::connect('/password/reset', array('controller' => 'registration', 'action' => 'password_reset'));
Router::connect('/password/replace/:code', array('controller' => 'registration', 'action' => 'password_replace'),array("code" => ".+"));
Router::connect('/profil', array('controller' => 'user', 'action' => 'profil'));
Router::connect('/profil/page/:page', array('controller' => 'user', 'action' => 'profil'),array("page" => "[0-9]+"));
@ -98,6 +98,14 @@
Router::connect('/search/academy', array('controller' => 'search', 'action' => 'academy'));
Router::connect('/search/internship', array('controller' => 'search', 'action' => 'internship'));
/*****
* Extern
*
*/
Router::connect('/extern/button/company/:id', array('controller' => 'extern', 'action' => 'button_company'),array("id" => "[0-9]+"));
Router::connect('/extern/button/opening/extern', array('controller' => 'extern', 'action' => 'button_opening_extern'),array("id" => "[0-9]+"));
Router::connect('/extern/button/opening/:id', array('controller' => 'extern', 'action' => 'button_opening'),array("id" => "[0-9]+"));
Router::parseExtensions('pdf');
Router::connect('/application/:id.pdf', array('controller' => 'pdf', 'action' => 'applicationGetPdf'),array("id" => "[0-9]+"));

View File

@ -0,0 +1,42 @@
<?php
App::uses('AppController', 'Controller');
class ExternController extends AppController {
public $uses = array('DreamjobJobOpening','DreamjobCompany');
public $components = array('MiconwareSession');
public function button_company() {
$this->MiconwareSession->init($this);
$this->MiconwareSession->initWeb($this);
if(!empty($this->request->params['id'])){
$this->set("company",$this->DreamjobCompany->find('first',array('conditions' => array('AppUser.id' => $this->request->params['id']))));
}
$this->layout = 'extern_mini';
$this->render('/Extern/button_company');
}
public function button_opening() {
$this->MiconwareSession->init($this);
$this->MiconwareSession->initWeb($this);
if(!empty($this->request->params['id'])){
$con = $this->MiconwareSession->getOpeningCondition();
$con['DreamjobJobOpening.id'] = $this->request->params['id'];
$this->set("opening",$this->DreamjobJobOpening->find('first', array('conditions' => $con)));
}
$this->layout = 'extern_mini';
$this->render('/Extern/button_opening');
}
public function button_opening_extern() {
$this->MiconwareSession->init($this);
$this->MiconwareSession->initWeb($this);/*
$this->request->data['DreamjobUser']['mail'] = $this->request->query('mail');
$this->request->data['AppUser']['nickname'] = $this->request->query('company');
$this->request->data['DreamjobUser']['street'] = $this->request->query('street');
$this->request->data['DreamjobUser']['postcode'] = $this->request->query('postcode');
$this->request->data['DreamjobListCity']['name'] = $this->request->query('city');*/
$this->set("content",array());
$this->layout = 'extern_mini';
$this->render('/Extern/button_opening_extern');
}
}

1
app/View/Extern/button_company.ctp vendored Normal file
View File

@ -0,0 +1 @@
<?=$this->Html->link($company['AppUser']['nickname'],array('controller'=>'user', 'action'=>'profil', 'id'=> $company['AppUser']['id']),array("class" => "btn btn-primary","target"=>"_blank",'rel'=>'external'));?>

1
app/View/Extern/button_opening.ctp vendored Normal file
View File

@ -0,0 +1 @@
<?=$this->Html->link($opening['DreamjobJobOpening']['title'],array('controller'=>'job', 'action'=>'openingGet', 'id'=> $opening['DreamjobJobOpening']['id']),array("class" => "btn btn-primary","target"=>"_blank",'rel'=>'external'));?>

View File

@ -0,0 +1 @@
<?=$this->Html->link(__('dreamjob.application.extern'),array('controller'=>'job', 'action'=>'applicationSendExt', '?'=> $content),array("class" => "btn btn-primary","target"=>"_blank",'rel'=>'external'));?>

View File

@ -0,0 +1,26 @@
<?php
/*
* Default-Template
*/
?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
<head>
<title><?=((isset($title))?$title:$title_for_layout);?> - <?=__('dreamjob');?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="stylesheet" type="text/css" href="/css/dreamjob.css" type="text/css" media="screen" />
<?php
echo $this->Html->charset();
echo $this->Html->css(array('bootstrap.min','bootstrap-wysihtml5','wysiwyg-color','select2','select2-bootstrap'));
echo $this->Html->meta('icon', $this->Html->url('/favicon.ico'));
?>
</head>
<body>
<!-- alert -->
<?=$this->Session->flash(); ?>
<!-- /alert -->
<!-- container -->
<?=$this->fetch('content'); ?>
<!-- /container -->
</body>
</html>